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.
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:
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.
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
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.
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.
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.
I did it on Linux and have not tried on Windows. Will try it later.
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.