Relative Content

Tag Archive for qtqmlgstreamer

GStreamer & Qt GUI (QML, qmake) in same process (NVIDIA Jetson, L4T)

I have written an application for recording and viewing video data with a Jetson Xavier NX. It is a single-process, multi-threading application. The video is available via a V4L2 camera device (/dev/video0) and I am using a GStreamer pipeline to record and provide the video to the GUI. The GUI is written in QML (Qt 5.15) and is used to control the application in addition to viewing the video.
In the main thread (main() function) the Qt QML and the GStreamer frameworks are initialized.
Thread “A” creates the GStreamer pipeline for recording and providing the video to the GUI. The NVIDIA Accelerated GStreamer element ‘nvv4l2camerasrc’ is used to capture the video of the V4L2 camera device (/dev/video0). A V4L2 loopback camera device is created (/dev/video2) using the ‘v4l2loopback-utils’ CLI API. This loopback camera device is used as a sink in the GStreamer pipeline. The GUI uses the Qt QML ‘Camera’ component to get the video from the loopback camera device.
I am using Linux Real-Time signals for signalling state changes from one thread to another.
There are several other threads for monitoring I/Os, handle control commands (VCP) and controlling peripheral components. These threads do not use any Qt QML or GStreamer component.
The problem is that the ‘Camera’ QML component throws an error about every 5 to 10 seconds: