Hello,
I faced with a nvjpegenc issue while developing a Gstreamer jpeg encoding pipeline, here is a major part of my pipeline:
nvarguscamerasrc sensor-id=0 !
video/x-raw(memory:NVMM),width=1920,height=1200,framerate=30/1,format=NV12 !
comp.sink_0
nvarguscamerasrc sensor-id=1 !
video/x-raw(memory:NVMM),width=1920,height=1200,framerate=30/1,format=NV12 !
comp.sink_1 nvcompositor name=comp background=0
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=1920 sink_0::height=1200 sink_0::sizing-policy=1
sink_1::xpos=1920 sink_1::ypos=0 sink_1::width=1920 sink_1::height=1200 sink_1::sizing-policy=1 !
video/x-raw(memory:NVMM),width=3840,height=1200 !
queue !
nvvidconv !
video/x-raw(memory:NVMM),width=3840,height=1200,format=NV12 ! tee name=timg0 !
# something is going on here but it is not related to the issue
timg0. !
nvvidconv ! video/x-raw(memory:NVMM),format=NV12,width=$IMAGEW,height=$IMAGEH,framerate=(fraction)15/1 ! videorate max-rate=15/1 !
queue ! nvjpegenc ! fakesink
My setup is: Jetson Orin AGX, Jetpack 6.2, Jeston Linux 36.4.3
Let me describe the issue:
Image size on the jpeg encoder’s input is configurable and can be 3840x1200 or resized down
When it is resized to the any ratio less than 3840x1200 (1920x600, 3456x1080, whatever else) everything works fine.
However, when the $IMAGEW and $IMAGEH params are set to the same resolution as the input one (3840x1200) I get a segfault:
video_head-1 | [gst_pipeline_video_node-1] Segmentation fault detected! Generating stack trace...
video_head-1 | [gst_pipeline_video_node-1] Stack trace:
video_head-1 | [gst_pipeline_video_node-1] /root/ws/install/lib/libgst_pipeline.so(_ZN12gst_pipeline16segfault_handlerEi+0x6c) [0xffff8fa16344]
video_head-1 | [gst_pipeline_video_node-1] linux-vdso.so.1(__kernel_rt_sigreturn+0) [0xffff94d0d79c]
video_head-1 | [gst_pipeline_video_node-1] /usr/lib/aarch64-linux-gnu/nvidia/libnvjpeg.so(jpegTegraEncoderAccelerationCheck+0x10c) [0xffff5484f380]
video_head-1 | [gst_pipeline_video_node-1] /usr/lib/aarch64-linux-gnu/nvidia/libnvjpeg.so(jpeg_start_compress+0xfc) [0xffff548158fc]
video_head-1 | [gst_pipeline_video_node-1] /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvjpeg.so(+0x51cc) [0xffff405951cc]
video_head-1 | [gst_pipeline_video_node-1] /lib/aarch64-linux-gnu/libgstvideo-1.0.so.0(+0x44abc) [0xffff74244abc]
video_head-1 | [gst_pipeline_video_node-1] /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0(+0x94a78) [0xffff8f374a78]
video_head-1 | [gst_pipeline_video_node-1] /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0(+0x97cb8) [0xffff8f377cb8]
video_head-1 | [gst_pipeline_video_node-1] /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0(gst_pad_push+0x124) [0xffff8f3780e8]
video_head-1 | [gst_pipeline_video_node-1] /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstcoreelements.so(+0x436fc) [0xffff414236fc]
video_head-1 | [gst_pipeline_video_node-1] /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0(+0xc180c) [0xffff8f3a180c]
video_head-1 | [gst_pipeline_video_node-1] /lib/aarch64-linux-gnu/libglib-2.0.so.0(+0x87668) [0xffff8f4d7668]
video_head-1 | [gst_pipeline_video_node-1] /lib/aarch64-linux-gnu/libglib-2.0.so.0(+0x84990) [0xffff8f4d4990]
video_head-1 | [gst_pipeline_video_node-1] /lib/aarch64-linux-gnu/libc.so.6(+0x80398) [0xffff93810398]
video_head-1 | [gst_pipeline_video_node-1] /lib/aarch64-linux-gnu/libc.so.6(+0xe9e9c) [0xffff93879e9c]
So as you can see, in this case I literally take 3840x1200 frames from one nvvidconv and put them to another nvvidconv which is set up to the same input resolution, seems like in this case it somehow changes surfaceList[0].dataPtr to NULL and the downstream nvjpegenc fails to compute it. (it is just my rough assumption).
Note, that if I just remove the second nvvidconv from the pipeline it works with no issues, and it also works if I put a 1920x1200 input to the second nvvidconv and convert it to 1920x1200 (no changes). It starts emitting segfaults only when I try to convert 3840x1200 → 3840x1200
Could you please take a look and try to fix this bug please