[gst-devel] Timeout in rtspsrc

Marco Ballesio gibrovacco at gmail.com
Tue Feb 8 09:26:42 CET 2011


Hi,

On Tue, Feb 8, 2011 at 9:37 AM, Thierry Panthier
<thierry.devel at gmail.com> wrote:
> Hi,
> I'm using rtspsrc to request video from an IP camera.
> Everything works fine in normal conditions however if I unplug the network
> cable from the camera my pipeline takes several minutes to timeout.
> This is the error message I get minutes later:
>    code = 7
> domain = gst-resource-error-quark
>     error = Could not open resource for reading and writing.
>   debug = gstrtspsrc.c(3839): gst_rtspsrc_loop_udp ():
> /GstPipeline:RTSPPlayer/GstRTSPSrc:rtspsrc9:
> Could not connect to server. (System error: Connection refused)
> I've gone through the documentation of rtspsrc but there's no way to specify
> a timeout for RTP packets.

as you're likely using UDP as transport layer, RTP packets cannot be
timed out (yes, it's an unreliable protocol). RTCP can help you here,
as you'd just need to enable it and listen for (missing) Sender
Reports, translated in "on-ssrc-active" signals from the session
element in the GstRtspSrc (which is usually a GstRtpBin).

Could someone tell me the best way to detect the
> absence of data in the pipeline? It doesn't necessarily have to be on
> rtspsrc. I just need a way to quickly detect that the pipeline is not
> handling any data.

RTCP packets are (usually) sent with intervals of 5s. If you want
something faster, you can install a data probe somewhere in the pipe
resetting a timeout each time a buffer transits through the pad. When
the timer triggers, then a timeout occurred and you can unilaterally
terminate the communication.

Regards

> Regards,
> Thierry
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>




More information about the gstreamer-devel mailing list