我必须使用 NVIDIA Jetson-AGX 设备上的 gst-play-1.0 / gst-launch-1.0 命令显示 RTSP 流。
这些是我尝试过的命令:
1. gst-play-1.0
$ gst-play-1.0 rtsp://192.168.1.xxx:8554/main.264
在这种情况下,终端仍然停留在:
Press 'k' to see a list of keyboard shortcuts.
Now playing rtsp://username:[email protected]:554
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-启动-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
在这种情况下,终端仍然停留在:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://admin:[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
按下 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 ...
URL 的格式如下:
rtsp://192.168.1.xxx:8554/main.264
rtsp://username:[email protected]:554
这些命令适用于装有 Ubuntu 20.04 和 Gstreamer 1.16.3 的 x86 PC。因此,RTSP 源本身没有问题。
但是,这些命令在 Jetson 设备上不起作用。
NVIDIA Jetson-AGX 设备信息:
L4T 32.6.1 [ JetPack 4.6 ]
Ubuntu 18.04.6 LTS
内核版本:4.9.253-tegra
GStreamer 1.14.5
CUDA 10.2.300
CUDA 架构:无
OpenCV版本:4.1.1
OpenCV Cuda:否
CUDNN:8.2.1.32
TensorRT:8.0.1.6
视觉作品:1.6.0.501
版本号:1.1.12
火神:1.2.70
感谢您的耐心和帮助。
问候。 :)
编辑:
输出自gst-discoverer-1.0 rtsp://username:[email protected]:554
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)
答案1
我也在NVIDIA的官方论坛上发布了这个问题(回答),也咨询了一些其他人的意见。
看来这两个命令应该起作用:
$ 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
基本上,建议在 Jetson 设备上使用 NVIDIA 特定的 GStreamer 插件(以 nv 为前缀)。
问候。