Import Error when Integrating Qt and GStreamer.
-
I’m new to Linux, Qt, GStreamer, qmake, cmake… My goal to learn all of the above while creating something that is personally useful and challenging for myself.
I have installed both Qt 5.15.2 and GStreamer 1.18.0 on an Ubuntu 20.10 PC. Both Qt and GStreamer are working as expected. I have been able to build and run any desired Qt Example without issue. I have also been able to create and run all of the GStreamer tutorials as well as my own custom pipelines using gst-launch-1.0.
I'm attempting to use the example from:
https://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/qt/qmlsink
To get a test video to display in a QML application.The qmlsink example compiles and runs BUT I have one problem that I have not been able to resolve. Within the main.qml file is an import that is not found.
import org.freedesktop.gstreamer.GLVideoItem 1.0
Err = QML module not found (org.freedesktop.gstreamer.GLVideoItem 1.0)If I comment out the import line then GstGLVideoItem errors with Unknown component and the app will not run.
This problem spawns several noob questions regarding how to troubleshoot Qt import issues.
- Is there a way to find which file that this import is in?
- Is there a way to search the system for this import?
- How can the app compile and run with this error?
- What needs to be installed or settings changed to satisfy the error.
Below is a list of everything “GStreamer related” installed on the system.
$ pkg-config --list-all | grep gstreamer
gstreamer-1.0 GStreamer - Streaming media framework
gstreamer-allocators-1.0 GStreamer Allocators Library - Allocators implementation
gstreamer-app-1.0 GStreamer Application Library - Helper functions and base classes for application integration
gstreamer-audio-1.0 GStreamer Audio library - Audio helper functions and base classes
gstreamer-base-1.0 GStreamer base classes - Base classes for GStreamer elements
gstreamer-check-1.0 GStreamer check unit testing - Unit testing helper library for GStreamer modules
gstreamer-controller-1.0 GStreamer controller - Dynamic parameter control for GStreamer elements
gstreamer-fft-1.0 GStreamer FFT Library - FFT implementation
gstreamer-gl-1.0 GStreamer OpenGL Plugins Libraries - Streaming media framework, OpenGL plugins libraries
gstreamer-gl-egl-1.0 GStreamer OpenGL Plugins Libraries (Wayland specifics) - Streaming media framework, OpenGL plugins libraries (EGL specifics)
gstreamer-gl-prototypes-1.0 GStreamer OpenGL Plugins Libraries (OpenGL Prototypes) - Streaming media framework, OpenGL plugins libraries (OpenGL Prototypes)
gstreamer-gl-wayland-1.0 GStreamer OpenGL Plugins Libraries (Wayland specifics) - Streaming media framework, OpenGL plugins libraries (Wayland specifics)
gstreamer-gl-x11-1.0 GStreamer OpenGL Plugins Libraries (X11 specifics) - Streaming media framework, OpenGL plugins libraries (X11 specifics)
gstreamer-net-1.0 GStreamer networking library - Network-enabled GStreamer plug-ins and clocking
gstreamer-pbutils-1.0 GStreamer Base Utils Library - General utility functions
gstreamer-plugins-base-1.0 GStreamer Base Plugins Libraries - Streaming media framework, base plugins libraries
gstreamer-riff-1.0 GStreamer RIFF Library - RIFF helper functions
gstreamer-rtp-1.0 GStreamer RTP Library - RTP base classes and helper functions
gstreamer-rtsp-1.0 GStreamer RTSP Library - RTSP base classes and helper functions
gstreamer-sdp-1.0 GStreamer SDP Library - SDP helper functions
gstreamer-tag-1.0 GStreamer Tag Library - Tag base classes and helper functions
gstreamer-video-1.0 GStreamer Video Library - Video base classes and helper functionsThanks in advance for any assistance.
-
@ijststd
Update: I have totally rebuilt my system trying to resolve this. Reinstalled Qt 5.15.2 using the online installer and GStreamer 1.18.0 following the instructions on the GStreamer website into an Ubuntu 20.10 PC. Both Qt and GStreamer are working as expected. I have been able to build and run any desired Qt Example without issue. I have also been able to compile and run any of the GStreamer tutorials as well as my own custom pipelines using C and gst-launch-1.0.The Error persists. I have no idea as to how to fix this. I don’t know what kind of files QML imports look for. Are there tools or utilities available that would help debug this? Does someone have this working and could offer some suggestions.
-
Matthew Waters on the GStreamer forum has answered this question.
I quote him below.
Ah, so your problem is use with the Qt designer not showing finding the
relevant qml code. That use case is currently not supported by qmlglsink.The issue is that the necessary QML item is contained within the
qmlglsink element itself and is registered dynamically when the element
itself is instantiated. Qt designer doesn't know anything about
GStreamer so cannot perform this initialisation for you. There are no
qmldir or qmltype files for qmlglsink.The 'fix' involves are rather complicated restructure of the qmlglsink
element to support placing the qml part/plugin in a separate .so that is
findable with Qt tools (using qmldir or whatever).