(Re)starting rtspsrc when the source is offline
Federico Zamperini
fzamperini at tiscali.it
Fri Jan 18 04:14:53 PST 2013
rtspsrc is just a source, so when it fails it doesn't try to reconnect
(AFAIK).
If the RTSP server is not responding at start time, an error is posted
on the message bus.
If no (UDP) packets are received for an amount of time greater than
about 25 sec (that is 5 times the RTCP interval - many thanks to Wim for
pointing it out) rtspsrc sends an EOS message on the bus.
I'd like to have time to try a more responsive and fine grained approach
(<<25 sec), maybe using a probe (or a queue) as you did.
I developed a rtsp client (using playbin2, but the source is a rtpsrc)
and whenever I receive an error or EOS (on the message bus) due to
connection problems, whether they are at start time or during the app
lifetime, I start a thread that simply stops the pipeline and restarts
it (sleeping for a configurable short time between the tries). I found
there's no need to destroy/recreate elements.
About your AV sync problems I cannot be of much help, but if you look at
the rtpbin docs you find this:
RTP bin combines the functions of GstRtpSession, GstRtpSsrcDemux,
GstRtpJitterBuffer and GstRtpPtDemux in one element. It allows for
multiple RTP sessions that will be synchronized together using RTCP SR
packets
It talks about different RTP sessions, not differente RTSP servers, though.
Federico
P.S: I add these links for reference, maybe you can find something useful:
http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/gst/rtsp/README
http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/gst/rtp/README
More information about the gstreamer-devel
mailing list