Gstreamer mjpeg decoder error in 32.5.1

Hi I am trying the below pipeline which worked fine in previous jetson nano firmware version 32.4.4 with the libnvtvmr.so file patched. NowI get an error when running the pipeleine. I also tried before replacing the file now get the error after replacing the file also.

gst-launch-1.0 -e v4l2src device=/dev/video0 ! tee name=t1 t1. ! queue ! video/x-raw, width=1920, height=1080, framerate=30/1 ! nvvidconv ! queue ! nvv4l2h264enc maxperf-enable=1 bitrate=4000000 profile=4 ! queue ! h264parse ! queue ! mux. pulsesrc device=“alsa_input.usb-VXIS_Inc_ezcap_U3_capture-02.analog-stereo” ! queue ! audio/x-raw,width=16,depth=16,rate=44100,channel=1 ! audioconvert ! voaacenc ! aacparse ! mpegtsmux name=mux ! filesink location=feed1mp1080HW1TS.ts t1. ! queue ! video/x-raw, width=1920, height=1080, framerate=30/1 ! nvvidconv ! queue ! “video/x-raw(memory:NVMM),width=959,height=540,framerate=30/1,format=NV12” ! queue ! nvoverlaysink overlay-x=0 overlay-y=270 overlay-w=959 overlay-h=540 overlay=1 v4l2src device=/dev/video2 io-mode=2 do-timestamp=true ! tee name=t2 t2. ! queue ! image/jpeg,width=1920,height=1080,framerate=30/1 ! videorate ! image/jpeg,width=1920,height=1080,framerate=30/1 ! nvv4l2decoder mjpeg=1 ! nvvidconv ! video/x-raw,width=1920,height=1080,framerate=30/1 ! nvvidconv ! queue ! “video/x-raw(memory:NVMM),framerate=30/1,format=NV12” ! nvv4l2h264enc maxperf-enable=1 bitrate=4000000 profile=4 ! queue ! h264parse ! queue ! mpegtsmux ! filesink location=feed2mp1080HW1TS.ts t2. ! queue ! image/jpeg,width=1920,height=1080,framerate=30/1 ! nvv4l2decoder mjpeg=1 ! nvvidconv ! video/x-raw,framerate=30/1 ! nvvidconv ! queue ! “video/x-raw(memory:NVMM),framerate=30/1,format=NV12” ! queue ! nvoverlaysink overlay-x=960 overlay-y=270 overlay-w=960 overlay-h=540 overlay=2

Setting pipeline to PAUSED …
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Caught SIGSEGV
#0 0x0000007f81933d5c in __waitpid (pid=, stat_loc=0x7ffee6ce04, options=) at …/sysdeps/unix/sysv/linux/waitpid.c:30
#1 0x0000007f8196f2e0 in g_on_error_stack_trace ()
#2 0x000000557a4e7c3c in ()
#3 0x0000000000008600 in ()
Spinning. Please run ‘gdb gst-launch-1.0 11893’ to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

Hi,
The prebuilt lib is not required for r32.5.1. In the pipeline, the buffer are copy to CPU buffers and then copy back to NVMM buffers:

... ! nvv4l2decoder mjpeg=1 ! nvvidconv ! video/x-raw,width=1920,height=1080,framerate=30/1 ! nvvidconv ! queue ! 'video/x-raw(memory:NVMM),framerate=30/1,format=NV12' ! ...

Could you try not to copy to CPU buffers:

... ! nvv4l2decoder mjpeg=1 ! nvvidconv ! 'video/x-raw(memory:NVMM),framerate=30/1,format=NV12' ! ...

It looks not required and please eliminate it for a try.

1 Like

I will try this method

Thank you

You may try something like (here simulating your sources from videotestsrc):

gst-launch-1.0 -e \
videotestsrc ! video/x-raw, width=1920, height=1080, framerate=30/1 ! tee name=t1 \
t1. ! queue ! video/x-raw, width=1920, height=1080, framerate=30/1 ! nvvidconv ! nvv4l2h264enc maxperf-enable=1 bitrate=4000000 profile=4 ! h264parse ! queue ! mux.  \
pulsesrc ! audio/x-raw,width=16,depth=16,rate=44100,channel=1 ! audioconvert ! voaacenc ! aacparse ! queue ! mpegtsmux name=mux ! filesink location=feed1mp1080HW1.ts \
t1. ! queue ! nvvidconv ! "video/x-raw(memory:NVMM),width=959,height=540,framerate=30/1,format=NV12" ! nvoverlaysink overlay-x=0 overlay-y=270 overlay-w=959 overlay-h=540 overlay=1 \
videotestsrc ! nvvidconv ! "video/x-raw(memory:NVMM),format=I420,width=1920,height=1080,framerate=30/1" ! nvjpegenc ! image/jpeg,width=1920,height=1080,framerate=30/1 ! jpegparse ! tee name=t2 \
t2. ! queue ! nvv4l2decoder mjpeg=1 ! nvvidconv ! "video/x-raw(memory:NVMM,format=I420" ! nvv4l2h264enc maxperf-enable=1 bitrate=4000000 profile=4 ! h264parse ! mpegtsmux ! filesink location=feed2mp1080HW1.mp4 \
t2. ! queue ! nvv4l2decoder mjpeg=1 ! nvvidconv ! "video/x-raw(memory:NVMM),framerate=30/1,format=NV12,width=960,height=540" ! nvoverlaysink overlay-x=960 overlay-y=270 overlay-w=960 overlay-h=540 overlay=2

[EDIT: Without I420 conversion between MJPEG decoder and H264 encoder, it generates repeated kernel message:

host1x 13e10000.host1x: nvhost_syncpt_wait_timeout: invalid syncpoint id 0

]

1 Like