dusty-nv / jetson-inference

Hello AI World guide to deploying deep-learning inference networks and deep vision primitives with TensorRT and NVIDIA Jetson.
https://developer.nvidia.com/embedded/twodaystoademo
MIT License
7.76k stars 2.97k forks source link

Jetson Orin Error with RTSP URI #1742

Open 5aled01 opened 1 year ago

5aled01 commented 1 year ago

Hi all, I’m trying to set up a webrtc stream using the following command video-viewer "rtsp://login:pass/172.21.40.10:554/cam/realmonitor?channel=1&subtype=0" --input-codec=h264 webrtc://@:8555/output --output-codec=h264

i got the error [gstreamer] gstDecoder::Capture() -- a timeout occurred waiting for the next image buffer. I initially suspected an issue with the RTSP link structure due to a previous problem related to having gstreamer1.0-plugins-ugly installed, but after removing gstreamer1.0-plugins-ugly, I’m now facing a different error in videoOutput :

$ video-viewer "rtsp://login:pass@172.21.40.10/profile" --input-codec=h265 webrtc://@:8555/output --output-codec=h265
URI -- missing/invalid IP port from rtsp://login:pass@172.21.40.10/profile, default to port 554
[gstreamer] initialized gstreamer, version 1.16.3.0
[gstreamer] gstDecoder -- creating decoder for login
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 
[gstreamer] gstDecoder -- failed to discover stream info
[gstreamer] gstDecoder -- resource discovery and auto-negotiation failed
[gstreamer] gstDecoder -- pipeline string:
[gstreamer] rtspsrc location=rtsp://login:pass@172.21.40.10/profile latency=10 ! queue ! rtph265depay ! nvv4l2decoder name=decoder enable-max-performance=1 ! video/x-raw(memory:NVMM) ! nvvidconv name=vidconv ! video/x-raw ! appsink name=mysink sync=false
[video]  created gstDecoder from rtsp://login:pass-2021@172.21.40.10/profile
------------------------------------------------
gstDecoder video options:
------------------------------------------------
  -- URI: rtsp://login:pass@172.21.40.10/profile
     - protocol:  rtsp
     - location:  login
     - port:      554
  -- deviceType: ip
  -- ioType:     input
  -- codec:      H265
  -- codecType:  v4l2
  -- frameRate:  0
  -- numBuffers: 4
  -- zeroCopy:   true
  -- flipMethod: none
  -- loop:       0
  -- latency     10
------------------------------------------------
[gstreamer] gstEncoder -- detected board 'NVIDIA Orin Nano Developer Kit'
[gstreamer] gstEncoder -- hardware encoder not detected, reverting to CPU encoder
[gstreamer] gstEncoder -- pipeline launch string:
[gstreamer] appsrc name=mysource is-live=true do-timestamp=true format=3 ! x265enc name=encoder bitrate=4000 speed-preset=ultrafast tune=zerolatency key-int-max=30 insert-vui=1 ! video/x-h265 ! rtph265pay config-interval=1 ! application/x-rtp,media=video,encoding-name=H265,clock-rate=90000,payload=96 ! tee name=videotee ! queue ! fakesink
[gstreamer] gstEncoder -- failed to create pipeline
[gstreamer]    (no property "insert-vui" in element "encoder")
[gstreamer] failed to create encoder pipeline
[gstreamer] gstEncoder -- failed to create encoder engine
video-viewer:  failed to create output stream
jetson@linux:~/jetson-inference/utils/python/examples$ video-viewer "rtsp://login:pass@172.21.40.10/profile" --input-codec=h264 webrtc://@:8555/output --output-codec=h264
URI -- missing/invalid IP port from rtsp://login:pass@172.21.40.10/profile, default to port 554
[gstreamer] initialized gstreamer, version 1.16.3.0
[gstreamer] gstDecoder -- creating decoder for admin
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 
[gstreamer] gstDecoder -- failed to discover stream info
[gstreamer] gstDecoder -- resource discovery and auto-negotiation failed
[gstreamer] gstDecoder -- pipeline string:
[gstreamer] rtspsrc location=rtsp://login:pass@172.21.40.10/profile latency=10 ! queue ! rtph264depay ! nvv4l2decoder name=decoder enable-max-performance=1 ! video/x-raw(memory:NVMM) ! nvvidconv name=vidconv ! video/x-raw ! appsink name=mysink sync=false
[video]  created gstDecoder from rtsp://login:pass@172.21.40.10/profile
------------------------------------------------
gstDecoder video options:
------------------------------------------------
  -- URI: rtsp://login:pass@172.21.40.10/profile
     - protocol:  rtsp
     - location:  login
     - port:      554
  -- deviceType: ip
  -- ioType:     input
  -- codec:      H264
  -- codecType:  v4l2
  -- frameRate:  0
  -- numBuffers: 4
  -- zeroCopy:   true
  -- flipMethod: none
  -- loop:       0
  -- latency     10
------------------------------------------------
[gstreamer] gstEncoder -- detected board 'NVIDIA Orin Nano Developer Kit'
[gstreamer] gstEncoder -- hardware encoder not detected, reverting to CPU encoder
[gstreamer] gstEncoder -- pipeline launch string:
[gstreamer] appsrc name=mysource is-live=true do-timestamp=true format=3 ! x264enc name=encoder bitrate=4000 speed-preset=ultrafast tune=zerolatency key-int-max=30 insert-vui=1 ! video/x-h264 ! rtph264pay config-interval=1 ! application/x-rtp,media=video,encoding-name=H264,clock-rate=90000,payload=96 ! tee name=videotee ! queue ! fakesink
[gstreamer] gstEncoder -- failed to create pipeline
[gstreamer]    (no element "x264enc")
[gstreamer] failed to create encoder pipeline
[gstreamer] gstEncoder -- failed to create encoder engine
video-viewer:  failed to create output stream 

I’ve also tried using a different valid RTSP URI rtsp://login:pass@172.21.40.10/profile without the & character, and it works fine . I’ve validated the URI using various tools like ffmpeg and vlc to ensure its correctness. However, when I execute the gst-launch-1.0 command, I still encounter the same error message.

Any insights into what might be causing this timeout error and how to resolve it would be greatly appreciated. Thank you!

dusty-nv commented 1 year ago

@5aled01 it looks like uninstalling the bad/ugly plugins also removed x264enc - if you are on Orin Nano, you'll need that.

If you're unable to get the standalone RTSP pipeline working with gst-launch-1.0, then unfortunately not much I can personally do from a GStreamer standpoint, and I would recommend debugging it with gst-launch or posting or searching your question to the Jetson forums as general GStreamer usage. Good luck!