Uridecodebin does not work with certain RTSP video streams
Hello, I am dealing with two RTSP video streams that cannot be decoded using uridecodebin
.
Disclaimer:I am working with Nvidia Deepstream which is based on Gstreamer. However the issue seems to be related to uridecodebin
.
The following pipelines kinda work on only one of the streams (it saved a video that cannot be played... while the fakesink
pipeline does not seem to print anything):
gst-launch-1.0 uridecodebin uri=$RTSP_STREAM ! filesink location='test.mp4'
gst-launch-1.0 uridecodebin uri=$RTSP_STREAM ! nvvideoconvert ! fakesink
The RTSP video streams can be played correctly using VLC and ffplay.
One of the two streams (not both) can be decoded using the following pipeline, which uses Nvidia hardware acceleration to decode the video:
gst-launch-1.0 --gst-debug=v4l2videodec:5 rtspsrc location=$RTSP_STREAM protocols=tcp latency=1000 drop-on-latency=1 timeout=5000000 ! rtph264depay ! h264parse ! nvv4l2decoder cudadec-memtype=2 num-extra-surfaces=1 ! queue leaky=2 max-size-buffers=1 ! nvvideoconvert nvbuf-memory-type=3 output-buffers=1 ! capsfilter caps=video/x-raw,format=RGBA ! fakesink
Both the video can be decoded with the same pipeline using the software decoder (however I need to use the hardware decoder)
gst-launch-1.0 --gst-debug=v4l2videodec:5 rtspsrc location=$RTSP_STREAM protocols=tcp latency=1000 drop-on-latency=1 timeout=5000000 ! rtph264depay ! h264parse ! avdec_h264 ! queue leaky=2 max-size-buffers=1 ! nvvideoconvert nvbuf-memory-type=3 output-buffers=1 ! capsfilter caps=video/x-raw,format=RGBA ! filesink location='test-nvv4l2decoder.mp4'
The RTSP video streams are private but I am happy to privately share them with anyone who can help me debug the issue.
I am also trying to get more help from Nvidia on their forum, but the issue seems to be caused by Gstreamer components. More here: https://forums.developer.nvidia.com/t/uridecodebin-cannot-decode-an-rtsp-video-stream/217422
Thank you!