Running the standard example qmlsink in Qt6

Hello, I am trying to launch the standard demo program example with qml6glsink, but I encounter the following error during compilation:

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.7.2\msvc2019_64\include\QtCore/qlist.h, line 631

I am using GStreamer version 1.24.5 with the plugin for Qt6 (compiling in Qt 6.7.2 MSVS 2019 64b). I checked the existence of the plugin using gst-inspect-1.0 and in the framework folder - it exists. When enabling GST_DEBUG=3, no errors are reported.

Could you please advise on what to do in this case?

There appears to be an issue loading the Qt6GLVIdeoItem contained within the qm6glsink element on a windows environment in some circumstances. I do not have a Windows environment to be able to check and fix the issue there so it requires somebody to delve into why the Qt6GLVIdeoItem is not loaded correctly.

Previously, I tried running the example with GStreamer version 1.22.4 on Qt 6.4, and everything worked correctly (I also tried running GStreamer 1.24.5 with Qt 6.4 but unsuccessfully). I hope this information helps in identifying the problem.

is qml6glsink compiled? Run
gst-inspect-1.0 qml6glsink
to see if it is available. Or check if gstqml6.dll exists under path/gstreamer/lib/gstreamer-1.0.
Normally you need to rebuild gstreamer to get it.

gst-inspect-1.0 says that the plugin exists. I couldn’t find the file you mentioned, but I found the file gstqml6.dll.
I rebuilt GStreamer with the plugin twice, the result is the same.

Sorry it is gstqml6.dll. It is available. Then check if plugin path GST_PLUGIN_PATH is set to the dir of gstqml6.dll.

I checked, the variable was missing, after adding it nothing changed.
Скриншот 11-07-2024 213126

Library path has to be set as well because plugins need gstreamer libs.

The paths to the framework folder are already specified in my PATH variable.
Скриншот 12-07-2024 140413

https://discourse.gstreamer.org/t/gstreamer-and-qt6/1004

Try the link from ystreet00. I just tested it on Linux and the example runs with Qt 6.7.2. I think it may be the same case. No issues on Ubuntu 22.04 with gstreamer 1.24.5.

I checked, the result is the same :frowning:

When GST_DEBUG=4 is enabled, GStreamer outputs the following information:

0:00:00.000091900   292 00000181B0577060 INFO                GST_INIT gst.c:574:init_pre: Initializing GStreamer Core Library version 1.24.5.1
0:00:00.000176600   292 00000181B0577060 INFO                GST_INIT gst.c:575:init_pre: Using library installed in E:\gstreamer\1.0\msvc_x86_64\lib
0:00:00.000445100   292 00000181B0577060 INFO                GST_INIT gstmessage.c:129:_priv_gst_message_initialize: init messages
0:00:00.000874700   292 00000181B0577060 INFO                GST_INIT gstcontext.c:86:_priv_gst_context_initialize: init contexts
0:00:00.001083000   292 00000181B0577060 INFO      GST_PLUGIN_LOADING gstplugin.c:328:_priv_gst_plugin_initialize: registering 0 static plugins
0:00:00.001180700   292 00000181B0577060 INFO      GST_PLUGIN_LOADING gstplugin.c:236:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.001217500   292 00000181B0577060 INFO      GST_PLUGIN_LOADING gstplugin.c:238:gst_plugin_register_static: added static plugin "staticelements", result: 1
0:00:00.003680000   292 00000181B0577060 INFO            GST_REGISTRY gstregistry.c:1918:ensure_current_registry: reading registry cache: C:\Users\mobut\AppData\Local\Microsoft\Windows\INetCache\gstreamer-1.0\registry.x86_64-msvc.bin
0:00:00.016213600   292 00000181B0577060 INFO            GST_REGISTRY gstregistrybinary.c:683:priv_gst_registry_binary_read_cache: loaded C:\Users\mobut\AppData\Local\Microsoft\Windows\INetCache\gstreamer-1.0\registry.x86_64-msvc.bin in 0.012463 seconds
0:00:00.016366200   292 00000181B0577060 INFO            GST_REGISTRY gstregistry.c:1785:scan_and_update_registry: Validating plugins from registry cache: C:\Users\mobut\AppData\Local\Microsoft\Windows\INetCache\gstreamer-1.0\registry.x86_64-msvc.bin
0:00:00.195092400   292 00000181B0577060 INFO            GST_REGISTRY gstregistry.c:1877:scan_and_update_registry: Registry cache has not changed
0:00:00.195135200   292 00000181B0577060 INFO            GST_REGISTRY gstregistry.c:1953:ensure_current_registry: registry reading and updating done
0:00:00.195157700   292 00000181B0577060 INFO                GST_INIT gst.c:808:init_post: GLib runtime version: 2.74.4
0:00:00.195204300   292 00000181B0577060 INFO                GST_INIT gst.c:810:init_post: GLib headers version: 2.74.4
0:00:00.195225600   292 00000181B0577060 INFO                GST_INIT gst.c:811:init_post: initialized GStreamer successfully
0:00:00.218424800   292 00000181B0577060 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:489:gst_element_factory_create_with_properties: creating element "pipeline"
0:00:00.220522400   292 00000181B0577060 INFO      GST_PLUGIN_LOADING gstplugin.c:995:_priv_gst_plugin_load_file_for_registry: plugin "E:\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0\gstvideotestsrc.dll" loaded
0:00:00.220559200   292 00000181B0577060 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:489:gst_element_factory_create_with_properties: creating element "videotestsrc"
0:00:00.220743300   292 00000181B0577060 INFO        GST_ELEMENT_PADS gstelement.c:759:gst_element_add_pad:<GstBaseSrc@00000181B299CE60> adding pad 'src'
0:00:00.221274100   292 00000181B0577060 INFO      GST_PLUGIN_LOADING gstplugin.c:995:_priv_gst_plugin_load_file_for_registry: plugin "E:\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0\gstcoreelements.dll" loaded
0:00:00.221307000   292 00000181B0577060 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:489:gst_element_factory_create_with_properties: creating element "capsfilter"
0:00:00.221363700   292 00000181B0577060 INFO        GST_ELEMENT_PADS gstelement.c:759:gst_element_add_pad:<GstBaseTransform@00000181B2994A40> adding pad 'sink'
0:00:00.221393500   292 00000181B0577060 INFO        GST_ELEMENT_PADS gstelement.c:759:gst_element_add_pad:<GstBaseTransform@00000181B2994A40> adding pad 'src'
0:00:00.221429500   292 00000181B0577060 INFO               GST_EVENT gstevent.c:1687:gst_event_new_reconfigure: creating reconfigure event
0:00:00.224507000   292 00000181B0577060 INFO      GST_PLUGIN_LOADING gstplugin.c:995:_priv_gst_plugin_load_file_for_registry: plugin "E:\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0\gstopengl.dll" loaded
0:00:00.224543200   292 00000181B0577060 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:489:gst_element_factory_create_with_properties: creating element "glupload"
0:00:00.224736200   292 00000181B0577060 INFO        GST_ELEMENT_PADS gstelement.c:759:gst_element_add_pad:<GstBaseTransform@00000181B29EA280> adding pad 'sink'
0:00:00.224769000   292 00000181B0577060 INFO        GST_ELEMENT_PADS gstelement.c:759:gst_element_add_pad:<GstBaseTransform@00000181B29EA280> adding pad 'src'
0:00:00.228604500   292 00000181B0577060 INFO      GST_PLUGIN_LOADING gstplugin.c:995:_priv_gst_plugin_load_file_for_registry: plugin "E:\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0\gstqml6.dll" loaded
0:00:00.228648700   292 00000181B0577060 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:489:gst_element_factory_create_with_properties: creating element "qml6glsink"
0:00:00.228747900   292 00000181B0577060 INFO        GST_ELEMENT_PADS gstelement.c:759:gst_element_add_pad:<GstBaseSink@00000181B2A07510> adding pad 'sink'
0:00:00.228820900   292 00000181B0577060 INFO        GST_ELEMENT_PADS gstutils.c:1821:gst_element_link_pads_full: trying to link element videotestsrc0:(any) to element capsfilter0:(any)
0:00:00.228851800   292 00000181B0577060 INFO                GST_PADS gstutils.c:1081:gst_pad_check_link: trying to link videotestsrc0:src and capsfilter0:sink
0:00:00.228914500   292 00000181B0577060 INFO                GST_PADS gstpad.c:4398:gst_pad_peer_query:<capsfilter0:src> pad has no peer
0:00:00.228953800   292 00000181B0577060 INFO                GST_PADS gstutils.c:1635:prepare_link_maybe_ghosting: videotestsrc0 and capsfilter0 in same bin, no need for ghost pads
0:00:00.228985200   292 00000181B0577060 INFO                GST_PADS gstpad.c:2441:gst_pad_link_prepare: trying to link videotestsrc0:src and capsfilter0:sink
0:00:00.229010700   292 00000181B0577060 INFO                GST_PADS gstpad.c:4398:gst_pad_peer_query:<capsfilter0:src> pad has no peer
0:00:00.229038800   292 00000181B0577060 INFO                GST_PADS gstpad.c:2622:gst_pad_link_full: linked videotestsrc0:src and capsfilter0:sink, successful
0:00:00.229060400   292 00000181B0577060 INFO               GST_EVENT gstevent.c:1687:gst_event_new_reconfigure: creating reconfigure event
0:00:00.229081700   292 00000181B0577060 INFO               GST_EVENT gstpad.c:6018:gst_pad_send_event_unchecked:<videotestsrc0:src> Received event on flushing pad. Discarding
0:00:00.229106400   292 00000181B0577060 INFO        GST_ELEMENT_PADS gstutils.c:1821:gst_element_link_pads_full: trying to link element capsfilter0:(any) to element gluploadelement0:(any)
0:00:00.229131000   292 00000181B0577060 INFO                GST_PADS gstutils.c:1081:gst_pad_check_link: trying to link capsfilter0:src and gluploadelement0:sink
0:00:00.229161400   292 00000181B0577060 INFO                GST_PADS gstpad.c:4398:gst_pad_peer_query:<gluploadelement0:src> pad has no peer
0:00:00.229357000   292 00000181B0577060 INFO                GST_PADS gstutils.c:1635:prepare_link_maybe_ghosting: capsfilter0 and gluploadelement0 in same bin, no need for ghost pads
0:00:00.229399600   292 00000181B0577060 INFO                GST_PADS gstpad.c:2441:gst_pad_link_prepare: trying to link capsfilter0:src and gluploadelement0:sink
0:00:00.229445100   292 00000181B0577060 INFO                GST_PADS gstpad.c:4398:gst_pad_peer_query:<gluploadelement0:src> pad has no peer
0:00:00.229611600   292 00000181B0577060 INFO                GST_PADS gstpad.c:2622:gst_pad_link_full: linked capsfilter0:src and gluploadelement0:sink, successful
0:00:00.229647200   292 00000181B0577060 INFO               GST_EVENT gstevent.c:1687:gst_event_new_reconfigure: creating reconfigure event
0:00:00.229688600   292 00000181B0577060 INFO               GST_EVENT gstpad.c:6018:gst_pad_send_event_unchecked:<capsfilter0:src> Received event on flushing pad. Discarding
0:00:00.229726800   292 00000181B0577060 INFO        GST_ELEMENT_PADS gstutils.c:1821:gst_element_link_pads_full: trying to link element gluploadelement0:(any) to element qml6glsink0:(any)
0:00:00.229753300   292 00000181B0577060 INFO                GST_PADS gstutils.c:1081:gst_pad_check_link: trying to link gluploadelement0:src and qml6glsink0:sink
0:00:00.229832500   292 00000181B0577060 INFO                GST_PADS gstutils.c:1635:prepare_link_maybe_ghosting: gluploadelement0 and qml6glsink0 in same bin, no need for ghost pads
0:00:00.229859700   292 00000181B0577060 INFO                GST_PADS gstpad.c:2441:gst_pad_link_prepare: trying to link gluploadelement0:src and qml6glsink0:sink
0:00:00.229928700   292 00000181B0577060 INFO                GST_PADS gstpad.c:2622:gst_pad_link_full: linked gluploadelement0:src and qml6glsink0:sink, successful
0:00:00.229953000   292 00000181B0577060 INFO               GST_EVENT gstevent.c:1687:gst_event_new_reconfigure: creating reconfigure event
0:00:00.229973900   292 00000181B0577060 INFO               GST_EVENT gstpad.c:6018:gst_pad_send_event_unchecked:<gluploadelement0:src> Received event on flushing pad. Discarding

I reinstalled GStreamer 1.22.4 (which used to work for me before), but the error remains. It seems the problem is not entirely on the framework side.

It seems I have partially identified the problem. For some reason, the framework works correctly with Qt only in release build mode, and since the .pro file specifies running in debug mode, the program example does not work. After I changed the mode to release, everything worked, but now it is unclear how to make the framework work in debug mode.

I built my version of GStreamer using Cerbero with the command ./cerbero-uninstalled -c config/win64.cbc -v qt6 package gstreamer-1.0

Ah, interesting. I think in order to work in debug mode, the cerbero command also has to build against debug QT binaries which I am not sure if that is supported or possible at the moment. This might require pointing to a diffferent qmake binary or Qt installation.

Tried both on Ubuntu without issues.

I do not think it is necessary to use Qt debug libs unless it is needed to debug into Qt libs.

There is a strange situation on Windows, however :frowning:
I dug up information that such a situation with the debug mode has been happening on windows since the time of qt 5.