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:
CameraBin error: "Failed to allocate a buffer"
I can’t explain this error to myself except that there could be an issue due to running the Qt QML-based GUI and the GStreamer pipeline in the same process.
I checked that the issue is the ‘Camera’ QML component by creating a new project without the GUI. Only GStreamer and standard C++ code. Before I start re-writing the application using a multi-process approach where the GStreamer pipeline and the Qt QML GUI run in separate processes I would like to get feedback from the experts out there:
- Is it a bad approach to run the GStreamer pipeline and the Qt QML GUI in the same process?
- Could this lead to the error of the ‘Camera’ QML component as described above?
Best regards
B0bbyR4y