nvvidconv sigsegv with nvjpegenc

I’m trying to use nvvidconv to implement a digital pan/zoom. It works just fine when the sink is omxh264enc or nvoverlaysink but crashes with a SIGSEGV when nvjpegenc is the sink. Any ideas? Running on a TX1 with 28.1.

This pipeline works without nvvidconv:

gst-launch-1.0 -v nvcamerasrc name=cam sensor-id=0 '!' capsfilter name=cam_caps 'caps=video/x-raw(memory:NVMM),width=(int)1280,height=(int)720,format=(string)I420,framerate=(fraction)10/1' '!' nvjpegenc name=enc '!' multifilesink name=mfs location=/Images/temp-0-%d.jpg thumbnail=/Images/1.jpg
Setting pipeline to PAUSED ...

Available Sensor modes : 
3864 x 2174 FR=60.000000 CF=0x1009208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1932 x 1094 FR=120.000000 CF=0x1009208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1288 x 734 FR=120.000000 CF=0x1009208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1288 x 546 FR=240.000000 CF=0x1009208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...

NvCameraSrc: Trying To Set Default Camera Resolution. Selected sensorModeIndex = 0 WxH = 3864x2174 FrameRate = 60.000000 ...

New clock: GstSystemClock
/GstPipeline:pipeline0/GstNvCameraSrc:cam.GstPad:src: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)10/1"
/GstPipeline:pipeline0/GstCapsFilter:cam_caps.GstPad:src: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)10/1"
/GstPipeline:pipeline0/GstNvJpegEnc:enc.GstPad:sink: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)10/1"
/GstPipeline:pipeline0/GstCapsFilter:cam_caps.GstPad:sink: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)10/1"
/GstPipeline:pipeline0/GstNvJpegEnc:enc.GstPad:src: caps = "image/jpeg\,\ sof-marker\=\(int\)4\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)10/1"
/GstPipeline:pipeline0/GstMultiFileSink:mfs.GstPad:sink: caps = "image/jpeg\,\ sof-marker\=\(int\)4\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)10/1"

But crashes when nvvidconv is inserted:

gst-launch-1.0 -v nvcamerasrc name=cam sensor-id=0 '!' capsfilter name=cam_caps 'caps=video/x-raw(memory:NVMM),width=(int)1280,height=(int)720,format=(string)I420,framerate=(fraction)10/1' '!' nvvidconv name=conv '!' 'video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)I420, framerate=(fraction)10/1' '!' nvjpegenc name=enc '!' multifilesink name=mfs location=/Images/temp-0-%d.jpg thumbnail=/Images/1.jpg
Setting pipeline to PAUSED ...

Available Sensor modes : 
3864 x 2174 FR=60.000000 CF=0x1009208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1932 x 1094 FR=120.000000 CF=0x1009208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1288 x 734 FR=120.000000 CF=0x1009208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1288 x 546 FR=240.000000 CF=0x1009208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
Pipeline is live and does not need PREROLL ...

NvCameraSrc: Trying To Set Default Camera Resolution. Selected sensorModeIndex = 0 WxH = 3864x2174 FrameRate = 60.000000 ...

Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstNvCameraSrc:cam.GstPad:src: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)10/1"
/GstPipeline:pipeline0/GstCapsFilter:cam_caps.GstPad:src: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)10/1"
/GstPipeline:pipeline0/Gstnvvconv:conv.GstPad:src: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)10/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)10/1"
/GstPipeline:pipeline0/GstNvJpegEnc:enc.GstPad:sink: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)10/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)10/1"
/GstPipeline:pipeline0/Gstnvvconv:conv.GstPad:sink: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)10/1"
/GstPipeline:pipeline0/GstCapsFilter:cam_caps.GstPad:sink: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)I420\,\ framerate\=\(fraction\)10/1"
/GstPipeline:pipeline0/GstNvJpegEnc:enc.GstPad:src: caps = "image/jpeg\,\ sof-marker\=\(int\)4\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)10/1"
/GstPipeline:pipeline0/GstMultiFileSink:mfs.GstPad:sink: caps = "image/jpeg\,\ sof-marker\=\(int\)4\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)10/1"
Caught SIGSEGV
#0  0x0000007f7ff5a030 in __GI___poll (fds=0x6692a0, nfds=2, 
#1  0x0000007f8005b3ac in ?? () from /lib/aarch64-linux-gnu/libglib-2.0.so.0
#2  0x00000000004e62f0 in ?? ()

the same pipeline with nvoverlasink works perfectly

Hi sperok,
nvcamerasrc can link to nvjpegenc directly. Could you share the reason to insert nvvidconv?

I am using nvvidconv to implement digital pan/zoom. The pipeline shown is for test purposes only as the simplest way to reproduce the error. In actual use this pipeline is built inside of RidgeRun’s gstd/gstd-client and the parameters for nvvidconv get changed dynamically. The caps for nvcamerasrc height and width are set to 3840x2160 and remain constant, the caps for nvvidconv height and width are set to 1280x720 and remain constant. The nvvidconv parameters left/right/top/bottom get modified dynamically to implement 3x pan/zoom. This pipeline works very nicely with nvoverlaysink and omxh264[5]enc. It fails with nvjpegenc.

Hi sperok,
Please try below pipeline:

nvcamerasrc ! nvvidconv ! 'video/x-raw(memory:NVMM),wodth=1280,height=720,format=I420' ! nvvidconv ! 'video/x-raw,wodth=1280,height=720,format=I420' ! nvjpegenc ! multifilesink

That pipeline calls nvvidconv twice and the second invocation gets rid of NVMM so it is a performance hit. But it made me experiment and I got to this which is now working:

nvcamerasrc name=cam sensor-id=2  auto-exposure=1 exposure-time=0.001 !  'video/x-raw(memory:NVMM),width=3840,height=2160,format=I420,framerate=(fraction)10/1'  ! nvvidconv name=conv left=1280 top=720 right=2559 bottom=1439 ! 'video/x-raw(memory:NVMM),width=1280,height=720,format=I420,framerate=(fraction)10/1' ! nvjpegenc name=enc quality=100 ! multifilesink name=mfs location=/Images/temp-2-%d.jpg thumbnail=/Images/3.jpg