# GStreamer and Qt6

**URL:** <https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004>\
**Category:** Application Development\
**Created:** [February 16, 2024, 9:08pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004 "2024-02-16T21:08:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dsmith](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Dsmith](https://discourse.gstreamer.org/u/Dsmith)\
**Post date:** [February 16, 2024, 9:08pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/1 "2024-02-16T21:08:21Z")

</div>

Hi everyone, I have recently started using GStreamer for playing an RTSP feed in Qt. I have the video playing fine however not in my Qml window. I am having a bit of an issue using the Qt6 Qml sink. I have the latest version of Gtreamer installed both the dev and runtime kits.

However, when I go to compile my code or even the Qt6 example using Qml I am faced with the following error:

qrc:/main.qml:6:1: module “org.freedesktop.gstreamer.Qt6GLVideoItem” is not installed

On GitHub I can download the qt plugins folder and I can see the Qt6 files but I am unable to link them to my program.

Could any one give me any tips? I think there are a few other people online facing the same issue.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Dsmith](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Dsmith](https://discourse.gstreamer.org/u/Dsmith)\
**Post date:** [February 17, 2024, 11:42am UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/2 "2024-02-17T11:42:06Z")

</div>

Okay, so I have figured out that the plugin doesn’t appear to be compiled with the released version. So I have tried to build gstreamer with Cerbero, I have pointed it to Qmake however I am still receiving this error:

## Called: `C:\\Qt\\6.6.1\\msvc2019_64\\bin\\qmake6.exe -query` → 0 stdout: QT\_SYSROOT: QT\_INSTALL\_PREFIX:C:/Qt/6.6.1/msvc2019\_64 QT\_INSTALL\_ARCHDATA:C:/Qt/6.6.1/msvc2019\_64 QT\_INSTALL\_DATA:C:/Qt/6.6.1/msvc2019\_64 QT\_INSTALL\_DOCS:C:/Qt/Docs/Qt-6.6.1 QT\_INSTALL\_HEADERS:C:/Qt/6.6.1/msvc2019\_64/include QT\_INSTALL\_LIBS:C:/Qt/6.6.1/msvc2019\_64/lib QT\_INSTALL\_LIBEXECS:C:/Qt/6.6.1/msvc2019\_64/bin QT\_INSTALL\_BINS:C:/Qt/6.6.1/msvc2019\_64/bin QT\_INSTALL\_TESTS:C:/Qt/6.6.1/msvc2019\_64/tests QT\_INSTALL\_PLUGINS:C:/Qt/6.6.1/msvc2019\_64/plugins QT\_INSTALL\_QML:C:/Qt/6.6.1/msvc2019\_64/qml QT\_INSTALL\_TRANSLATIONS:C:/Qt/6.6.1/msvc2019\_64/translations QT\_INSTALL\_CONFIGURATION: QT\_INSTALL\_EXAMPLES:C:/Qt/Examples/Qt-6.6.1 QT\_INSTALL\_DEMOS:C:/Qt/Examples/Qt-6.6.1 QT\_HOST\_PREFIX:C:/Qt/6.6.1/msvc2019\_64 QT\_HOST\_DATA:C:/Qt/6.6.1/msvc2019\_64 QT\_HOST\_BINS:C:/Qt/6.6.1/msvc2019\_64/bin QT\_HOST\_LIBEXECS:C:/Qt/6.6.1/msvc2019\_64/bin QT\_HOST\_LIBS:C:/Qt/6.6.1/msvc2019\_64/lib QMAKE\_SPEC:win32-msvc QMAKE\_XSPEC:win32-msvc QMAKE\_VERSION:3.1 QT\_VERSION:6.6.1

Run-time dependency qt6 (modules: Core, Gui, Qml, Quick) found: YES 6.6.1 (qmake)  
Program qsb-qt6 qsb found: NO

..\ext\qt6\meson.build:63:6: ERROR: Program ‘qsb-qt6 qsb’ not found or not executable

Any help would be appreciated, Thanks.

---

<div class="post-metadata">

**Author:** ![Dsmith](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Dsmith](https://discourse.gstreamer.org/u/Dsmith)\
**Post date:** [February 18, 2024, 9:04am UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/4 "2024-02-18T09:04:32Z")

</div>

Well I have managed to compile it, the path to the Qt bin folder had to be listed as a user variable and not a system variable. Now to try and make the plugin work.

---

<div class="post-metadata">

**Author:** ![Dsmith](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Dsmith](https://discourse.gstreamer.org/u/Dsmith)\
**Post date:** [February 18, 2024, 11:06am UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/5 "2024-02-18T11:06:57Z")

</div>

Okay so I have ran the installer, set the GST\_PLUGIN\_PATH to the /lib/gstreamer-1.0 folder and I have also ran gst-inspect-1.0 which is showing the Qt6 QML plugin as installed. However when I run my program in Qt I am faced with:

QQmlApplicationEngine failed to load component  
qrc:/main.qml:6:1: module “org.freedesktop.gstreamer.Qt6GLVideoItem” is not installed  
ASSERT: “!isEmpty()” in file C:\Qt\6.6.1\msvc2019\_64\include\QtCore/qlist.h, line 628

Again any ideas would be much appreciated. Thanks

---

<div class="post-metadata">

**Author:** ![ystreet00](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/y/3d9bf3/32.png) [@ystreet00](https://discourse.gstreamer.org/u/ystreet00)\
**Post date:** [February 18, 2024, 11:35pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/6 "2024-02-18T23:35:39Z")

</div>

Make sure that you are loading the `qml6glsink` element before the `QQmlApplicationEngine`. See the example [subprojects/gst-plugins-good/tests/examples/qt6/qmlsink · main · GStreamer / gstreamer · GitLab](https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/main/subprojects/gst-plugins-good/tests/examples/qt6/qmlsink?ref_type=heads) for more information.

---

<div class="post-metadata">

**Author:** ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)\
**Post date:** [February 21, 2024, 6:12pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/7 "2024-02-21T18:12:05Z")

</div>

first to check if qml6 gl sink is compiled. show the output of  
gst-inspect-1.0 | grep qml

---

<div class="post-metadata">

**Author:** ![Dsmith](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Dsmith](https://discourse.gstreamer.org/u/Dsmith)\
**Post date:** [February 21, 2024, 10:13pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/8 "2024-02-21T22:13:40Z")

</div>

Hi, thanks for the replies. I have tried loading the example itself and I am still getting the same error. Running gst-inspect-1.0 I get:

 ![image](https://discourse.gstreamer.org/uploads/default/original/1X/4c7aa0d30250c043925d6c3745e6e5ff0d6f7fb7.png)

and running gst-inspect-1.0 grep qml6 I get:

 ![image](https://discourse.gstreamer.org/uploads/default/original/1X/c187bcc0a1f5a2ec5771b9af84c8bb6adcca10a3.png)

running gst-inspect-1.0 grep qml returns no such element or plugin.

Thanks again

---

<div class="post-metadata">

**Author:** ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)\
**Post date:** [February 22, 2024, 7:25pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/9 "2024-02-22T19:25:21Z")

</div>

> [@Dsmith](#):
>
> Qt6GLVideoItem

qml6glsink is available. I guess your problem is a Qt issue and not gstreamer problem. I will try a small case for you.

---

<div class="post-metadata">

**Author:** ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)\
**Post date:** [February 22, 2024, 11:14pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/10 "2024-02-22T23:14:00Z")

</div>

I managed to successfully run the test case ystreet00 posted with Qt 6.6.2 + Qt Creator 12.  
What I did is on Ubuntu 22.04 and use pkg config settings of gstreamer and qt in the build.  
And Qt6 lib path has to be added to LIB\_LIBRARY\_PATH in order to let qml6glsink be loaded properly because it depends on qt libs.

---

<div class="post-metadata">

**Author:** ![Dsmith](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Dsmith](https://discourse.gstreamer.org/u/Dsmith)\
**Post date:** [June 16, 2024, 9:21pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/11 "2024-06-16T21:21:32Z")

</div>

Hi, I am still having this same issue, when I run pkg-config itself I can see:

gstqt6d3d11 and gstqml6 which I have included in PKGCONFIG in the build however the Qt6GLVideoItem is still not found.

What I have done so far is build GStreamer using Cerbero with the qt option selected. This is showing with gst-inspect, I have set the LIB\_LIBRARY\_PATH to the Qt6 lib folder. When it builds with cerbero it finds qmake and qsb etc.

Any help is appreciated. Thanks

---

<div class="post-metadata">

**Author:** ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)\
**Post date:** [June 20, 2024, 2:11pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/12 "2024-06-20T14:11:56Z")

</div>

On Linux, you need to set plugin path.  
export GST\_PLUGIN\_PATH=path/gstreamer/lib/gstreamer-1.0  
I guess you need it as well on Windows.

---

<div class="post-metadata">

**Author:** ![Dsmith](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Dsmith](https://discourse.gstreamer.org/u/Dsmith)\
**Post date:** [June 24, 2024, 2:47pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/13 "2024-06-24T14:47:40Z")

</div>

I have the GST\_PLUGIN\_PATH set on windows as well and I am still having this issue.

Thanks

---

<div class="post-metadata">

**Author:** ![Dsmith](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Dsmith](https://discourse.gstreamer.org/u/Dsmith)\
**Post date:** [June 25, 2024, 7:36am UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/14 "2024-06-25T07:36:03Z")

</div>

I just in the process of trying it with ubuntu as this is what my application will eventually run on.

From the Cerbero build guide I see this:

**NOTE:** The package outputted will not contain a copy of the Qt5 libraries in it. You must link to them while building your app yourself.

I have done everything until this step, Qt sees gstreamer as I can use everything but the plugin and gst-inspect-1.0 sees the qml6 plugin. I just can’t seem to get it to load it.

---

<div class="post-metadata">

**Author:** ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)\
**Post date:** [June 25, 2024, 3:44pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/15 "2024-06-25T15:44:54Z")

</div>

> [@Dsmith](#):
>
> LIB\_LIBRARY\_PATH

you need to add gstreamer lib path to LIB\_LIBRARY\_PATH as well.

If still not working, show all steps you did.

---

<div class="post-metadata">

**Author:** ![Dsmith](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Dsmith](https://discourse.gstreamer.org/u/Dsmith)\
**Post date:** [June 25, 2024, 4:40pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/16 "2024-06-25T16:40:21Z")

</div>

I have LIB\_LIBRARY\_PATH set to:

C:\gstreamer\1.0\msvc\_x86\_64\lib\gstreamer-1.0  
C:\Qt\6.6.3\msvc2019\_64\lib\

The steps I took were,

Install QT 6.6.3 from offline installer

Downloaded the Cerbero version of gstreamer to build

Set the path variable so that it could find qmake

Built gstreamer with qt6 option using cerbero

Installed both the development and release versions of Gstreamer

---

<div class="post-metadata">

**Author:** ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)\
**Post date:** [June 25, 2024, 4:51pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/17 "2024-06-25T16:51:19Z")

</div>

> [@Dsmith](#):
>
> C:\gstreamer\1.0\msvc\_x86\_64\lib\gstreamer-1.0

C:\gstreamer\1.0\msvc\_x86\_64\lib\gstreamer-1.0 \<= plugin path

show your qt code and build file

---

<div class="post-metadata">

**Author:** ![Dsmith](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Dsmith](https://discourse.gstreamer.org/u/Dsmith)\
**Post date:** [June 25, 2024, 6:06pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/18 "2024-06-25T18:06:04Z")

</div>

I am simply running the QT6 qml sink example.

I really appreciate all of your help so far. Gstreamer is working great for me, it’s just this last part to show it on a QML window.

---

<div class="post-metadata">

**Author:** ![Dsmith](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Dsmith](https://discourse.gstreamer.org/u/Dsmith)\
**Post date:** [June 25, 2024, 6:07pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/19 "2024-06-25T18:07:13Z")

</div>

my .pro file looks like this

```auto
TEMPLATE = app

QT += qml quick widgets

QT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig debug
PKGCONFIG = \
    gstreamer-1.0 \
    gstreamer-video-1.0 \
    gstqml6 \
    gstreamer-plugins-base-1.0

DEFINES += GST_USE_UNSTABLE_API

INCLUDEPATH += ../lib

SOURCES += main.cpp

RESOURCES += qmlsink.qrc

# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH = C:\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0\

```

And I built gstreamer with this command:

./cerbero-uninstalled -v qt6 -c config/win64.cbc package gstreamer-1.0

---

<div class="post-metadata">

**Author:** ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)\
**Post date:** [June 26, 2024, 1:40pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/20 "2024-06-26T13:40:51Z")

</div>

I did it on Linux and have not tried on Windows. Will try it later.

```auto
PKGCONFIG = \
    gstreamer-1.0 \
    gstreamer-video-1.0 \
    gstqml6 \ <=== a plugin, not a pkg package in gstreamer and therefore not needed.
    gstreamer-plugins-base-1.0

```

you are messing gstreamer lib up with plugin lib. All plugin libs(in path/gstreamer/lib/gstreamer-1.0) are looked for in the app with GST\_PLUGIN\_PATH. However, plugin libs loading needs libs in path/gstreamer/lib and Qt libs. LIB\_LIBRARY\_PATH is used for path/gstreamer/lib and Qt libs.

Another thing: prefix path in all pkg files of gstreamer may not be right. Better to replace all of them if so(open any pc file to check it). In my build, I set flag --pkgconfig.relocatable (relative prefix, not sure if this works on Windows) in order to be able to copy the build to anywhere needed. Same issue with prefix path in all default qt pkg files.

---

<div class="post-metadata">

**Author:** ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)\
**Post date:** [June 27, 2024, 1:42pm UTC](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004/21 "2024-06-27T13:42:34Z")

</div>

If you try it on Linux, run your test code with  
strace yourapp  
and you will be able to see where it fails.

[Next page](https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004.md?page=2)
