RTSP Could not open resource for reading

Orin Jetpack 5.0.2
Setting up RTSP server with:

$ ./test-launch “v4l2src device=/dev/video0 ! video/x-raw, width=640,height=480,format=(string)YUY2,framerate=30/1 ! queue ! nvvidconv ! video/x-raw(memory:NVMM),width=640,height=480,format=(string)NV12 ! nvv4l2h264enc bitrate=912000 ! video/x-h264, stream-format=(string)byte-stream ! rtph264pay name=pay0 pt=96”
stream ready at rtsp://127.0.0.1:8554/test

Note: I’m not seeing the blue lights on the camera that I normally see. However, when I run
the jetson-inference video-viewer, camera works as I expected:
$ video-viewer /dev/video0 rtsp://127.0.0.1:8554 --input-codec=mjpeg --output-codec=mjpeg --bitrate=1000000

Check network to ensure test-launch process is running:

$sudo ss -ltnp
State        Recv-Q   Send-Q      Local Address:Port    Peer Address:Port    Process  
LISTEN       0        5           127.0.0.1:8554        0.0.0.0:*            users:(("test-launch",pid=8748,fd=4))    

Reading from port:

steven@development-orin:~$ gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/test latency=0 ! rtph264depay ! h264parse ! nvv4l2decoder ! nvvidconv ! xvimagesink sync=0
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE 
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://127.0.0.1:8554/test
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not open resource for reading and writing.
Additional debug info:
gstrtspsrc.c(7893): gst_rtspsrc_retrieve_sdp (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Failed to connect. (Generic error)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...


Any ideas? Thanks!!!
1 Like

May be because you’re streaming RTPH264 but you’re trying to read as if it was RTPH265.
Try on receivert side:

st-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/test latency=0 ! rtph264depay ! h264parse ! nvv4l2decoder ! nvvidconv ! xvimagesink sync=0

If this doesn’t work out, post the formats of your camera with:

# v4l2-ctl is provided by apt package v4l-utils
v4l2-ctl --list-formats-ext
1 Like
[1]: 'H264' (H.264, compressed)
		Size: Discrete 640x480
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 160x90
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 160x120
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 176x144
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 320x180
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 320x240
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 352x288
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 432x240
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 640x360
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 800x448
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 800x600
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 864x480
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 960x720
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1024x576
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1600x896
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.042s (24.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
			Interval: Discrete 0.200s (5.000 fps)

Modified previous entry with code change to 264, still has issue. Thanks for the help.

With H264 format, you may try:
./test-launch “v4l2src device=/dev/video0 ! video/x-h264, width=640, height=480, framerate=30/1 ! queue ! h264parse ! rtph264pay name=pay0 pt=96”

Response:

steven@development-orin:~/Projects/test-gstreamer-video/build/bin$ ./test-launch v4l2src device=/dev/video0 ! video/x-h264, width=640, height=480, framerate=30/1 ! queue ! h264parse ! rtph264pay name=pay0 pt=96
stream ready at rtsp://127.0.0.1:8554/test

steven@development-orin:~$ gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/test latency=0 ! rtph264depay ! h264parse ! nvv4l2decoder ! nvvidconv ! xvimagesink sync=0
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE 
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://127.0.0.1:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not open resource for reading.
Additional debug info:
gstrtspsrc.c(6232): gst_rtspsrc_setup_auth (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
No supported authentication protocol was found
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

Note that you omitted the double quotes for test-launch.

First try to read camera feed and display (assuming you have a local monitor and GUI running on Jetson).
Try the following command and post the output of the first failing one if any.

gst-launch-1.0 -v v4l2src device=/dev/video0 ! fakesink

gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-h264, width=640, height=480, framerate=30/1 ! fakesink

gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-h264, width=640, height=480, framerate=30/1 ! h264parse ! nvv4l2decoder ! nvvidconv ! autovideosink

Re-ran test-launch with double quotes. Result seems the same. But I will include for now on.

Ran the 3 tests. All functioned correctly. The last one displayed video on my screen.

That’s good news. Now try:

gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-h264, width=640, height=480, framerate=30/1 ! h264parse ! rtph264pay name=pay0 pt=96 ! fakesink

If this runs, you may have the server running in one terminal:

./test-launch "v4l2src device=/dev/video0 ! video/x-h264, width=640, height=480, framerate=30/1 ! h264parse ! rtph264pay name=pay0 pt=96"

and in second terminal run the client:

gst-play-1.0 rtsp://127.0.0.1:8554/test

When client connects, post errors if any from the first terminal (server) and from second terminal (client).

1 Like

The first test was successful
When I ran the 2nd test I received the standard “stream ready at rtsp://127.0.0.1:8554/test”
The 3rd test had issues:

steven@development-orin:~$ gst-play-1.0 rtsp://127.0.0.1:8554/test
Press 'k' to see a list of keyboard shortcuts.
Now playing rtsp://127.0.0.1:8554/test
Pipeline is live.
ERROR Could not open resource for reading. for rtsp://127.0.0.1:8554/test
ERROR debug information: gstrtspsrc.c(6232): gst_rtspsrc_setup_auth (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
No supported authentication protocol was found
Reached end of play list.


@DaneLLL Are you aware of a bug preventing ORIN RTSP?
Any suggestions?

Thanks!

I set
$ export GST_DEBUG=“*:6” then
re-ran
$ ./test.launch “pipeline” 2>err.text

Reviewed the output, nothing eventful shows. I didn’t mention this before, the camera lights show during the gst-launch-1.0 test but not when using ./test.launch.

I submitted a question at freedesktop.org forum 1016 and submitted the error output. I was initially asked to upgrade gstreamer.
I investigated on the Nvidia forums on the process, but seems going past Gstreamer 1.16.3 is not supported.

Works now.

I had changed the receiving object name in test-launch from “test” to “my_stream”. Once I changed back and re-compiled, then ran both, a window with video appeared.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.