Bug in nvarguscamerasrc with GstRTSPServer

I am playing with the https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-launch.c example shown here. The command I’m executing on my Jetson TX2 (running L4T 32.1 / GStreamer 1.14.1 / nvarguscamerasrc 1.0.0) with a Omnivision OV5693 camera which came with the devkit is:

./test-launch "nvarguscamerasrc ! video/x-raw(memory:NVMM),width=(int)320,height=(int)240,format=(string)NV12,framerate=(fraction)15/1 ! omxh264enc name=omxh264enc control-rate=1 ! video/x-h264,profile=baseline,stream-format=(string)byte-stream ! h264parse ! rtph264pay name=pay0"

And I’m viewing the RTSP stream by running:

gst-launch-1.0 playbin uri=rtsp:// latency=100

On the first time I run this, the video feed is displayed perfectly and I am able to see the output from the camera.

However, if I close the stream by exiting playbin and then run

gst-launch-1.0 playbin uri=rtsp:// latency=100

again, I get no output on the receiver and the GstRTSPServer launch script crashes with a segmentation fault. On closer examination using valgrind, it looks like the crash is due to nvarguscamerasrc. This crash does not happen with v4l2src / uvch264src and did not happen with the older nvcamerasrc element either

The output of running valgrind on the GstRTSPServer launch script can be found here: https://pastebin.com/raw/db9YAfn9. The crash occurs the second time I open the client by using playbin after closing the first one. Maybe nvarguscamerasrc hasn’t completely cleaned up the resources or still holds the file descriptor of the camera?

Thanks for helping out :-)

1 Like

Hi, we will check and update.

Will it work if you run:

./test-launch "( nvcamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=1920, height=1080, framerate=30/1, format=I420 ! nvvidconv flip-method=4 ! video/x-raw, width=720, height=480, framerate=30/1, format=I420 ! timeoverlay ! omxh265enc ! rtph265pay name=pay0 pt=96 )"
gst-launch-1.0 rtspsrc location=rtsp://  ! 'application/x-rtp, media=video' ! decodebin ! videoconvert ! ximagesink

Hi, nvcamerasrc in your test-launch pipeline is no longer available in L4T 32.1 and has been replaced by nvarguscamerasrc. Even after replacing nvcamerasrc with nvarguscamerasrc in your test-launch command above, I am not able to get any output on the receiver.

may be the following will work?

CSI camera streaming:

sudo apt-get install libgstrtspserver-1.0 libgstreamer1.0-dev
wget https://gstreamer.freedesktop.org/src/gst-rtsp/gst-rtsp-server-1.14.1.tar.xz
tar -xvf gst-rtsp-server-1.14.1.tar.xz
cd  gst-rtsp-server-1.14.1
cd examples
gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)
./test-launch "nvarguscamerasrc ! video/x-raw(memory:NVMM), format=NV12, width=1920, height=1080, framerate=30/1 ! nvvidconv ! video/x-raw, width=640, height=480, format=NV12, framerate=30/1 ! omxh265enc ! rtph265pay name=pay0 pt=96 config-interval=1"
Another computer in the network:

gst-launch-1.0 rtspsrc location=rtsp:// ! queue ! decodebin ! videoconvert ! xvimagesink

I just tried this out.

On the first time I open the RTSP stream using rtspsrc, the stream opens correctly and I am able to see the camera output. However, it exhibits the same problem as I wrote in the OP - that on closing the xvimagesink window and opening it again, the RTSP Server program encounters a segfault in nvarguscamerasrc.

Hi, is there anything else that I can try to resolve this issue?

We shall have it fixed in next r32 release.

Today we realized we have the same issue. Any workaround until next version? When should be released?

The modification of fixing the issue is significant. For stability, please wait for next release.

If you are going to mass production based on r32.1, please contact us to get further support.

Hi @DaneLLL has this issue been fixed in the most current release, r32.2 / Jetpack 4.2.1 (for TX2)?


Yes, it i fixed in r32.2. Please give it a try.

1 Like


Thanks for the good question and answer.
By the way

Has it been resolved?
I tried testing and it failed.
Has anyone else tested it?

Thank you.

Hi @forumuser
Please share the error test-launch command. Are you on JP4.5 or JP4.4.1?

1 Like