I have setup a virtual camera at /dev/video4 and /dev/video5. I have done it so that I two applications (one opencv application and other to record video using gstreamer) can access the camera. when I ran the following command just to access camera
gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg, width=1280, height=720, framerate=30/1, format=MJPG ! nvv4l2decoder mjpeg=1 ! nvvidconv ! video/x-raw ! xvimagesink sync=False
I am able to see the video captured by the webcam at 720p 30fps. In order to stream the video to the virtual camera, I ran the following command
gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg, width=1280, height=720, framerate=30/1, format=MJPG ! nvv4l2decoder mjpeg=1 ! nvvidconv ! v4l2sink device=/dev/video4
But I got the following output
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
ArgusV4L2_Open failed: Invalid argument
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
NvMMLiteOpen : Block : BlockType = 277
NvMMLiteBlockCreate : Block : BlockType = 277
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.410236821
Setting pipeline to NULL ...
Freeing pipeline ...
I believe I need to convert the stream to a specific format or I might have configured something incorrectly. Could any let me know on how to fix this issue.