Correct way to reconnect to a network stream

strider4102 strider4102 at gmail.com
Wed Dec 14 13:37:47 PST 2011


I'm currently using a uridecodebin to connect to a multitude of video stream
types. 
I'm trying to get my application to automatically reconnect to a stream
should an error occur or the end of the stream be reached. One way I found
while searching the mailing list was to set the pipeline state to ready,
then back to playing when either of those events occur. This works great for
local files, but network streams don't seem to like it. I'm using an Axis
241QA as the video server, both the MJPEG and the RTSP/MPEG4 streams cause
problems when reconnecting.
The MJPEG stream's only problem is it seems to take a while for it to
realize the connection has been lost (about 2 minutes), but once it does
detect the disconnect, it reconnects almost immediately, so I'm sure the fix
for this is probably as simple as changing a timeout property somewhere.
The RTSP/MPEG4 stream however is being a little more problematic. It takes
anywhere from 5 to 10 minutes to reconnect, during which it gets alternating
"Could not read from resource." and "Could not write to resource." errors.
Also, it takes a long time (duration varies, the first attempt is usually 15
seconds, but subsequent attempts take about 110 seconds) to go from the
playing state to the ready state.

Current testing method is: 
1) Connect my application to the Axis server's video stream, confirm it's
working
2) Unplug the power cable from the axis server, wait 5 seconds
3) Plug the power cable back in
4) Keep an eye on the log to see what is happening

With VLC, I can reconnect to the Axis server within 30 seconds of reapplying
power to it.

I'm using the OSSBuild version of GStreamer, checked out of their SVN and
compiled yesterday (12/14/2011) OSSBuild is on GStreamer 0.10.35 as of the
SVN checkout I used.

My pipeline looks like this:
uridecodebin ! tee ! queue2 ! ffmpegcolorspace ! appsink

--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Correct-way-to-reconnect-to-a-network-stream-tp4197164p4197164.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list