JetPack 4.5 - nvv4l2h264enc no more one instance with opencv 4.5.2 (Segmentation fault)

Hello

Today I decided to update my Xavier NX to the jetpack 4.5 from the 4.4.1 , unfortunately, my code don’t run anymore, I have an issue with nvv4l2h264enc that raises a dump if I open my second webcam trough videocapture (python -opencv).

My setup :
Jetpack 4.5
Python 2.7.17 & Python 3.6.9
Opencv 4.5.2


#the pipelines

 streamf='v4l2src device=/dev/video0  extra-controls="s,exposure_auto=3,exposure_absolute=300" io-mode=2 ! image/jpeg, width=%d, height=%d, framerate=%d/1, format=MJPG ! queue ! nvv4l2decoder mjpeg=true enable-max-performance=1 capture-io-mode=2  output-io-mode=2 ! nvvidconv ! video/x-raw, format=NV12 ! appsink sync=false' %(camf_w,camf_h,camf_rate)
  streamb='v4l2src device=/dev/video1  extra-controls="s,exposure_auto=3,exposure_absolute=300" io-mode=2 ! image/jpeg, width=%d, height=%d, framerate=%d/1, format=MJPG ! queue ! nvv4l2decoder mjpeg=true enable-max-performance=1 capture-io-mode=2  output-io-mode=2 ! nvvidconv ! video/x-raw, format=NV12 ! appsink sync=false' %(camb_w,camb_h,camb_rate)


cap=cv2.VideoCapture(streamf, cv2.CAP_GSTREAMER)      
cap2=cv2.VideoCapture(streamb, cv2.CAP_GSTREAMER)  # this instance raises the segmentation (jetpack 4.5 only)

The error :

Opening in BLOCKING MODE
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 277 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 277 
[ WARN:0] global /tmp/build_opencv/opencv/modules/videoio/src/cap_gstreamer.cpp (1081) open OpenCV | GStreamer warning: Cannot query video position: status=1, value=13, duration=-1
Opening in BLOCKING MODE
Opening in BLOCKING MODE 
Opening in BLOCKING MODE
Segmentation fault (core dumped)

------------------
(program exited with code: 139)
Press return to continue

Does someone has the same behavior , and maybe a fix ?

I changed my pipelines to use nvjepdec or jpegdec , its works, but the performance is not great

Thank you in advance for your support

Regards
Ludovic

If opencv-4.5.2 was a custom build from a previous JetPack version, I’d suggest to rebuild opencv with new L4T version.

Thank you for your feedback

Already done, even with the 4.5.1, same issue

Do these pipelines (using fakesink instead of appsink) work in a single gst-launch command ?

gst-launch-1.0 -v v4l2src device=/dev/video0  io-mode=2 ! image/jpeg, width=640, height=480, framerate=30/1, format=MJPG ! queue ! nvv4l2decoder mjpeg=true enable-max-performance=1 capture-io-mode=2  output-io-mode=2 ! nvvidconv ! video/x-raw, format=NV12 ! fakesink        v4l2src device=/dev/video1  io-mode=2 ! image/jpeg, width=640, height=480, framerate=30/1, format=MJPG ! queue ! nvv4l2decoder mjpeg=true enable-max-performance=1 capture-io-mode=2  output-io-mode=2 ! nvvidconv ! video/x-raw, format=NV12 ! fakesink

If this works, try adding queues before appsinks. You may also try other io-modes of nvv4l2decoder.
If this doesn’t work, check the camera modes (I used 640X480p30):

v4l2-ctl -d0 --list-formats-ext
v4l2-ctl -d1 --list-formats-ext

If still not working with a supported mode of the camera, you may post the output of the gst-launch command.

Thank you for your support ;-)

unfortunately It does not work (I tried with all resolutions supported) , here is the output

ludovic@ludovic-desktop:~$ gst-launch-1.0 -v v4l2src device=/dev/video0  io-mode=2 ! image/jpeg, width=640, height=480, framerate=30/1, format=MJPG ! queue ! nvv4l2decoder mjpeg=true enable-max-performance=1 capture-io-mode=2  output-io-mode=2 ! nvvidconv ! video/x-raw, format=NV12 ! fakesink        v4l2src device=/dev/video1  io-mode=2 ! image/jpeg, width=640, height=480, framerate=30/1, format=MJPG ! queue ! nvv4l2decoder mjpeg=true enable-max-performance=1 capture-io-mode=2  output-io-mode=2 ! nvvidconv ! video/x-raw, format=NV12 ! fakesink
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
Opening in BLOCKING MODE 
Opening in BLOCKING MODE
Opening in BLOCKING MODE 
Opening in BLOCKING MODE
Caught SIGSEGV
#0  0x0000007fa77fbd5c in __waitpid (pid=<optimized out>, stat_loc=0x7fff2e3834, options=<optimized out>) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x0000007fa78372e0 in g_on_error_stack_trace ()
#2  0x000000556b344c3c in  ()
#3  0x0000000000008600 in  ()
Spinning.  Please run 'gdb gst-launch-1.0 17360' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.


---------------------

gdb gst-launch-1.0 17570
GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gst-launch-1.0...(no debugging symbols found)...done.
Attaching to program: /usr/bin/gst-launch-1.0, process 17570
[New LWP 17572]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
0x0000007f8412e5fc in __GI___nanosleep (requested_time=0x7fe154d5c8, 
    remaining=0x7fe154d5d8) at ../sysdeps/unix/sysv/linux/nanosleep.c:28
28	../sysdeps/unix/sysv/linux/nanosleep.c: No such file or directory.
(gdb) 

You may issue a backtrace command:

bt

into gdb when the fault happens in order to get (maybe) some additional information.

Also please post the v4l2-ctl command above’s output.

Did you try removing the nvv4l2decoder io options ?

Yes, I removed the io options, same issue

Here is the output for the formats supported, same output d0 or d1:

 v4l2-ctl -d0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'MJPG' (compressed)
	Name        : Motion-JPEG
		Size: Discrete 3840x2160
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.040s (25.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.040s (25.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 2592x1944
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.040s (25.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 2048x1536
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.040s (25.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1600x1200
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.040s (25.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1280x960
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.040s (25.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.040s (25.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1024x768
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.040s (25.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 800x600
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.040s (25.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.040s (25.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 320x240
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.040s (25.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)

	Index       : 1
	Type        : Video Capture
	Pixel Format: 'YUYV'
	Name        : YUYV 4:2:2
		Size: Discrete 3840x2160
			Interval: Discrete 1.000s (1.000 fps)
		Size: Discrete 1920x1080
			Interval: Discrete 0.333s (3.000 fps)
		Size: Discrete 2592x1944
			Interval: Discrete 1.000s (1.000 fps)
		Size: Discrete 2048x1536
			Interval: Discrete 0.333s (3.000 fps)
		Size: Discrete 1600x1200
			Interval: Discrete 0.333s (3.000 fps)
		Size: Discrete 1280x960
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1024x768
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 800x600
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.040s (25.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 320x240
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.040s (25.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)

So far, I don’t think opencv is really involved, so let’s just try on gstreamer side.
Can you get decoded stream from one camera (using first a low mode, you would increase when working) ?

gst-launch-1.0 -v v4l2src device=/dev/video0 ! image/jpeg, width=320, height=240, framerate=15/1, format=MJPG ! nvv4l2decoder mjpeg=1 ! nvvidconv ! xvimagesink

If working, does the second camera work or give fault from another terminal:

gst-launch-1.0 -v v4l2src device=/dev/video1 ! image/jpeg, width=320, height=240, framerate=15/1, format=MJPG ! nvv4l2decoder mjpeg=1 ! nvvidconv ! xvimagesink

The both instances work, even at 25fps 1080p

Do they fail when launched in the same gst-launch command ?

gst-launch-1.0 -v v4l2src device=/dev/video0 ! image/jpeg, width=320, height=240, framerate=15/1, format=MJPG ! nvv4l2decoder mjpeg=1 ! nvvidconv ! xvimagesink      v4l2src device=/dev/video1 ! image/jpeg, width=320, height=240, framerate=15/1, format=MJPG ! nvv4l2decoder mjpeg=1 ! nvvidconv ! xvimagesink

Unfortunately yes, it failed in the same command

Then, I’m afraid I cannot help further. Anyway, the above info may help someone more skilled to understand your case and better advise.

You may monitor kernel messages from another terminal with:

dmesg --follow

and check if you see USB or else errors when it fails.

You may also run:

export GST-DEBUG=*:3
gst-launch-1.0 -v ...your pipelines

in order to get more messages from gstreamer.

Last, just for checking if it is rather nvv4l2decoder or USB cam issue, can your run both cameras with nvjpegdec (this wouldn’t be a solution for opencv, though):

gst-launch-1.0 -v v4l2src device=/dev/video0 ! image/jpeg, width=320, height=240, framerate=15/1, format=MJPG ! nvjpegdec ! 'video/x-raw(memory:NVMM), format=I420' ! nvvidconv ! xvimagesink      v4l2src device=/dev/video1 ! image/jpeg, width=320, height=240, framerate=15/1, format=MJPG ! nvjpegdec ! 'video/x-raw(memory:NVMM), format=I420' ! nvvidconv ! xvimagesink

Your last pipeline has failed :

gst-launch-1.0 -v v4l2src device=/dev/video0 ! image/jpeg, width=320, height=240, framerate=15/1, format=MJPG ! nvjpegdec ! 'video/x-raw(memory:NVMM), format=I420' ! nvvidconv ! xvimagesink      v4l2src device=/dev/video1 ! image/jpeg, width=320, height=240, framerate=15/1, format=MJPG ! nvjpegdec ! 'video/x-raw(memory:NVMM), format=I420' ! nvvidconv ! xvimagesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = image/jpeg, width=(int)320, height=(int)240, framerate=(fraction)15/1, format=(string)MJPG, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = image/jpeg, width=(int)320, height=(int)240, framerate=(fraction)15/1, format=(string)MJPG, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstV4l2Src:v4l2src1.GstPad:src: caps = image/jpeg, width=(int)320, height=(int)240, framerate=(fraction)15/1, format=(string)MJPG, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstNvJpegDec:nvjpegdec0.GstPad:sink: caps = image/jpeg, width=(int)320, height=(int)240, framerate=(fraction)15/1, format=(string)MJPG, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = image/jpeg, width=(int)320, height=(int)240, framerate=(fraction)15/1, format=(string)MJPG, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter2.GstPad:src: caps = image/jpeg, width=(int)320, height=(int)240, framerate=(fraction)15/1, format=(string)MJPG, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstNvJpegDec:nvjpegdec1.GstPad:sink: caps = image/jpeg, width=(int)320, height=(int)240, framerate=(fraction)15/1, format=(string)MJPG, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter2.GstPad:sink: caps = image/jpeg, width=(int)320, height=(int)240, framerate=(fraction)15/1, format=(string)MJPG, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstNvJpegDec:nvjpegdec0.GstPad:src: caps = video/x-raw(memory:NVMM), format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0, framerate=(fraction)15/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = video/x-raw(memory:NVMM), format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0, framerate=(fraction)15/1
/GstPipeline:pipeline0/GstNvJpegDec:nvjpegdec1.GstPad:src: caps = video/x-raw(memory:NVMM), format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0, framerate=(fraction)15/1
/GstPipeline:pipeline0/GstNvJpegDec:nvjpegdec1.GstPad:src: caps = video/x-raw(memory:NVMM), format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0, framerate=(fraction)15/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter3.GstPad:src: caps = video/x-raw(memory:NVMM), format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0, framerate=(fraction)15/1
/GstPipeline:pipeline0/Gstnvvconv:nvvconv1.GstPad:src: caps = video/x-raw, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)15/1, format=(string)YUY2
/GstPipeline:pipeline0/GstXvImageSink:xvimagesink0.GstPad:sink: caps = video/x-raw, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)15/1, format=(string)YUY2
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:sink: caps = video/x-raw(memory:NVMM), format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0, framerate=(fraction)15/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = video/x-raw(memory:NVMM), format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0, framerate=(fraction)15/1
/GstPipeline:pipeline0/GstXvImageSink:xvimagesink1.GstPad:sink: caps = video/x-raw, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)15/1, format=(string)YUY2
/GstPipeline:pipeline0/Gstnvvconv:nvvconv1.GstPad:sink: caps = video/x-raw(memory:NVMM), format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0, framerate=(fraction)15/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter3.GstPad:sink: caps = video/x-raw(memory:NVMM), format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0, framerate=(fraction)15/1
nvbuf_utils: nvbuffer Payload Type not supported
nvbuf_utils: nvbuffer Payload Type not supported
gst_nvvconv_transform: NvBufferGetParams Failed 
gst_nvvconv_transform: NvBufferGetParams Failed 
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src1: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src1:
streaming stopped, reason error (-5)
Execution ended after 0:00:00.715183504
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

But mine works with nvjpegdec

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=2 ! 'image/jpeg,width=320,height=240, framerate=30/1' ! nvjpegdec ! xvimagesink  v4l2src device=/dev/video1 io-mode=2 ! 'image/jpeg,width=320,height=240, framerate=30/1' ! nvjpegdec ! xvimagesink

So probably io-mode=2 is required for your case in v4l2src.
Or is the I420 format in NVMM output making the difference with your pipeline outputing video into CPU memory ?
What is the working format in CPU memory ?

I removed the io-mode 2 in my pipeline, it works too

I think you’r right, the issue is probably linked to the memory management when I tried to launch 2 instances with this pipeline, it works

[code]
gst-launch-1.0 v4l2src device=/dev/video0 ! ‘image/jpeg,width=320,height=240, framerate=30/1’ ! nvjpegdec ! ‘video/x-raw, format=I420’ ! xvimagesink v4l2src device=/dev/video1 ! ‘image/jpeg,width=320,height=240, framerate=30/1’ ! nvjpegdec ! ‘video/x-raw, format=I420’ ! xvimagesink
[/code)

the difference with your pipeline is (memory:NVMM) and not the I420 alone

I’ve always seen that I420 in NVMM memory for the video end of nvjpegdec/nvjpegenc was the safest way, so your case is a bit surprizing to me, but I have never tried 2 MJPG cameras with R32.5.

As I don’t have your cameras, I cannot say much more. Simulating with:

gst-launch-1.0 videotestsrc ! video/x-raw, width=320, height=240,framrerate=15/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! nvjpegenc ! image/jpeg,format=MJPG ! tee name =t    t. ! queue ! nvv4l2decoder mjpeg=1 ! nvvidconv ! xvimagesink     t. ! queue ! nvv4l2decoder mjpeg=1 ! nvvidconv ! xvimagesink

shows no problem, so it may be more complex.

Just as last (low hope) suggestion, you may try adding queues and identity with various options such drop-allocation=1 and sync=1 or else, but not sure at all it might really help.

Someone with similar HW may further help.

Your simulation works fine on my device too ;-)

Thank you so much for you time “Honey_Patouceul”, I don’t know what are the changes between the 4.4 and the 4.5, according to me, I need a patch to fix the issue. On the 4.4, I have no issue !!!

Glad if I’ve been helpful. For a fix, probably NVIDIA folks would need to reproduce your issue.
You may tell your camera model for a quicker fix.

If someone can fix/reproduce my issue, I use ELP cameras

I don’t know if my troubles are linked to my cameras, but I can reproduce my problem with my IMX415 too or with my AR0331

Hi,
Please apply the prebuilt lib and check if it helps:
Jetson/L4T/r32.5.x patches - eLinux.org
[camera] 3rdparty application fails to open with USB camera