Hi,
I am trying to get v4l2loopback kernel module working on Jetson Xavier NX in order to be able to use single camera input for multiple processes.
As you might know, most of the tensorrt examples use gstreamer pipes for input. This applies for jetson-inference and tensorrt_demos repositories. (An example: https://github.com/jkjung-avt/tensorrt_demos/blob/master/utils/camera.py)
In the conventional way, I am able to view camera input using:
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! nvoverlaysink -e
However, nvarguscamerasrc plugin does not let us specify which /dev/videoX device to take into account. Therefore, I want to use v4l2src such as:
gst-launch-1.0 v4l2src device=/dev/video1 ! nvoverlaysink
This causes following error:
root@jetson-xavier-nx-devkit:~# gst-launch-1.0 v4l2src device=/dev/video1 ! nvoverlaysink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../gstreamer-1.18.1/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
ERROR: pipeline doesn't want to preroll.
Execution ended after 0:00:00.000517895
Setting pipeline to NULL ...
Freeing pipeline ...
Of all my experimentation with v4l2src plugin, I couldn’t manage to make it work.
Welcome — Jetson Linux<br/>Developer Guide 34.1 documentation documentation notes that I should be able to use following command:
gst-launch-1.0 v4l2src device="/dev/video0" ! \
"video/x-raw, width=640, height=480, format=(string)YUY2" ! \
xvimagesink -e
or by extension something like:
XDG_RUNTIME_DIR=/run/user/0 gst-launch-1.0 v4l2src device="/dev/video0" ! "video/x-raw, width=640, height=480, format=(string)YUY2" ! waylandsink -e
However, same error happens for this command as well.
Simply put, I want to access the imx219 camera using v4l2src plugin, not nvarguscamerasrc.
I am using a custom distro with wayland, Linux4Tegra R32.4.4 and JetPack 4.4.1 support. Being able to do this in Ubuntu distro that comes with the board is sufficient for me, I can integrate it to my custom distro.
Taking a look at imx219.c driver, I can see that NVIDIA introduced a couple of changes to the Jetson / Raspberry Pi IMX219 camera driver, I am thinking that might be the reason why I am not able to use v4l2src plugin.
If there is a workaround I can apply, or a simple gstreamer plugin to which I can specify /dev/videoX device, please let me know.
Any help is appreciated. Thanks in advance.