gst-play-1.0, gst-launch-1.0 unable to display RTSP stream

326 views Asked by At

I need to display an RTSP stream using the gst-play-1.0 and/ or gst-launch-1.0 commands on an NVIDIA Jetson-AGX device.

These are the commands I have tried so far:

1. gst-play-1.0

$ gst-play-1.0 rtsp://192.168.1.xxx:8554/main.264

in which case the terminal remains stuck at:

Press 'k' to see a list of keyboard shortcuts.
Now playing rtsp://192.168.1.xxx:8554/main.264
Pipeline is live.
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 
Prerolled.

2. gst-launch-1.0

$ gst-launch-1.0 rtspsrc location=rtsp://192.168.1.xxx:8554/main.264 latency=0 buffer-mode=auto ! queue ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! videoscale ! video/x-raw,width=1920,height=1080 ! autovideosink

in which case the terminal remains stuck at:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.1.xxx:8554/main.264
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Progress: (request) Sending PLAY request
Progress: (request) Sent PLAY request

After pressing Ctrl+C:

^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:02.188911578
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

The URLs are typically of the following formats:

rtsp://192.168.1.xxx:8554/main.264
rtsp://username:[email protected]:554

I am able to use the commands on a x86 PC with Ubuntu 20.04 and Gstreamer 1.16.3. So, the camera feeds themselves are fine.

But, the commands don't work on the Jetson device.

NVIDIA Jetson-AGX device info:

L4T 32.6.1 [ JetPack 4.6 ]

Ubuntu 18.04.6 LTS

Kernel Version: 4.9.253-tegra

GStreamer 1.14.5

CUDA 10.2.300

CUDA Architecture: NONE

OpenCV version: 4.1.1

OpenCV Cuda: NO

CUDNN: 8.2.1.32

TensorRT: 8.0.1.6

Vision Works: 1.6.0.501

VPI: 1.1.12

Vulcan: 1.2.70

Thanks for going through the post. Any hint(s) or guidance would be most appreciated.

Thank you. :)

Edit: I tried the following command, as suggested by @SeB:

gst-launch-1.0 rtspsrc location=rtsp://username:[email protected]:554 latency=500 ! queue ! rtph264depay ! h264parse ! nvv4l2decoder ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1920,height=1080' ! nvvidconv ! autovideosink

and the terminal displayed the following:

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://username:[email protected]:554
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Progress: (request) Sending PLAY request
Progress: (request) Sent PLAY request
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 

(gst-launch-1.0:14920): GStreamer-CRITICAL **: 21:59:35.771: gst_mini_object_unref: assertion 'mini_object != NULL' failed
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 

Edit# 2:

Output from gst-discoverer-1.0 rtsp://username:[email protected]:554 as suggested by @SeB

Analyzing rtsp://username:[email protected]:554
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 
Done discovering rtsp://username:[email protected]:554

Topology:
  unknown: application/x-rtp
    video: H.264 (Main Profile)

Properties:
  Duration: 99:99:99.999999999
  Seekable: no
  Live: yes
  Tags: 
      video codec: H.264 (Main Profile)

Thanks for taking an interest in my query.

1

There are 1 answers

0
9friday On BEST ANSWER

I also posted the query on NVIDIA's official forum(answer) as well as consulted some other people.

It seems that these two commands should work:

$ gst-launch-1.0 rtspsrc location=rtsp://username:[email protected]:554 latency=500 ! queue ! rtph264depay ! h264parse ! nvv4l2decoder ! nvvidconv ! 'video/x-raw(memory:NVMM)' ! nv3dsink sync=0

$ gst-launch-1.0 -v uridecodebin uri=rtsp://username:[email protected]:554 ! nvvidconv ! nvegltransform ! nveglglessink

Basically, it is recommended to use NVIDIA specific GStreamer plugins(prefixed by nv) on Jetson devices.