RTSP over UDP fails
Nicolas Dufresne
nicolas at ndufresne.ca
Wed Jun 1 16:02:10 UTC 2022
Le mercredi 01 juin 2022 à 03:46 +1000, John McDermott via gstreamer-devel a
écrit :
> Hi all
>
> I have a camera that possibly has an unstable connection. FFMPEG can read the
> stream fine over UDP but not TCP. It takes a few second to setup, but it works
> fine over UDP nonetheless. The camera probably supports only UDP. However, the
> standard command:
>
> gst-launch-1.0 rtspsrc location=rtsp://ip/stream ! queue ! rtph264depay !
> h264parse ! fakesink
>
> fails with the following:
>
> Progress: (open) Retrieving media info
> Progress: (request) SETUP stream 0
> Progress: (request) SETUP stream 1
> Progress: (open) Opened Stream
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> Progress: (request) Sending PLAY request
> Redistribute latency...
> Redistribute latency...
> Progress: (request) Sending PLAY request
> Redistribute latency...
> Redistribute latency...
> Progress: (request) Sent PLAY request
> ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not read
> from resource.
> Additional debug info:
> ../subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c(6554):
> gst_rtsp_src_receive_response (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
> Could not receive message. (Parse error)
> ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not read
> from resource.
>
> Is there a way to allow make Gstreamer to be as “resilient” as FFMPEG? My
> guess is that if GST could spend a few more seconds establishing the
> connection and/or reading the stream, it should work.
Try with a little more logs to understand what is going on, e.g. set the env
GST_DEBUG="2" . What may happen is that it takes over 5s for UDP packets to
arrive and gstreamer fallbacks to TCP and fails. You can disable the the timeout
, rtspsrc timeout=0, this will prevent the fallback from happening.
Nicolas
More information about the gstreamer-devel
mailing list