Nvidia Gstreamer modules don't cooperate with appsink

Hello

I’m have difficulties with translating x86 architecture pipeline to Jetson Xavier architecture (JetPack 4.3).

Xavier (NV codecs) pipeline works fine when it is used with gst-launch-1.0 but it crash c++ application.

C++ application works fine on Xavier device with “x86” pipeline ( this pipeline is tested on x86 platform: Ubuntu 18.04) but then it is using too much cpu resources so I want to try hardware accelerated approach.

This application crashes while using accelerated pipeline with “segmentation fault (core dumped)” error.

Standard debug tools and Gstreamer debug tools shows nothing.

C++ application is using Gstreamer callbacks.

Those are the pipelines:

x86 pipeline:

udpsrc multicast-group=232.0.0.0 auto-multicast=true port=5000 multicast-iface=eth0 caps=“application/x-rtp, encoding-name=JPEG,payload=26” ! rtpjpegdepay ! jpegdec ! videoconvert ! video/x-raw, format=RGBA ! appsink name=sink emit-signals=true sync=false max-buffers=1 drop=true

Xavier (accelerated) pipeline:

udpsrc multicast-group=232.0.0.0 auto-multicast=true port=5000 multicast-iface=eth0 caps=“application/x-rtp, encoding-name=JPEG,payload=26” ! rtpjpegdepay ! nvjpegdec ! video/x-raw(memory:NVMM) ! nvvidconv ! video/x-raw, format=RGBA ! appsink name=sink emit-signals=true sync=false max-buffers=1 drop=true

Try to specify I420 format in NVMM memory after nvjpegdec:

udpsrc multicast-group=232.0.0.0 auto-multicast=true port=5000 multicast-iface=eth0 caps=“application/x-rtp, encoding-name=JPEG,payload=26” ! rtpjpegdepay ! nvjpegdec ! video/x-raw(memory:NVMM),format=I420 ! nvvidconv ! video/x-raw, format=RGBA ! appsink name=sink emit-signals=true sync=false max-buffers=1 drop=true

Also note if you’re using high pixel rate that default kernel socket max buffer size may be low, so in such case use buffer-size property of udpsrc for setting a bigger buffer max size.