RTSP - Video (h264) is not being played in GStreamer

Narayan Sultania narayansultania at gmail.com
Mon Nov 7 05:59:47 UTC 2022


Hi All,

I am facing the issue that the video (h264) is not being played in
GStreamer.

Here's the details of the workflow,

1. I have RTSP server running on a Windows machine. It streams video
frames/packets (h264).

2. Tested the server using VLC and the video plays fine.

3. Tested the server using GStreamer. First I used the following command,
gst-launch-1.0 playbin uri=rtsp://127.0.0.1:8554/live

And then also tried with,
gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/live ! rtph264depay !
h264parse ! avdec_h264 ! videoconvert ! autovideosink

4. In both the cases I was getting warning as follows,
WARNING: from element
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstRtpH264Depay:rtph264depay0:
Could not decode stream.
Additional debug info:
../gst/rtp/gstrtph264depay.c(1443): gst_rtp_h264_depay_process ():
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstRtpH264Depay:rtph264depay0:
Undefined packet type

5. I analyzed the warning and investigated further. My finding was that the
h264 header has start codes (00 00 00 01) zeros followed by one. And maybe
GStreamer expects h264 without start codes. So I removed the start codes in
the RTSP server before streaming.

6. Tested with VLC to ensure that the video plays fine after removing start
codes. Yes the video plays fine.

7. Tested again with GStreamer and I don't get the warning for "Undefined
packet type". Now I get some logs as follows,
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Redistribute latency...
Progress: (request) Sending PLAY request
Redistribute latency...
Progress: (request) Sent PLAY request
Redistribute latency...
Redistribute latency...

And nothing happens after this. The video is not being played.

I also output logs using gst-debug but couldn't find the root cause of the
issue.

Please advise what is missing here and how I can look into this further.

Regards,
Narayan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20221107/461afe74/attachment.htm>


More information about the gstreamer-devel mailing list