[gst-devel] Timeout in rtspsrc

Wim Taymans wim.taymans at gmail.com
Tue Feb 15 11:34:52 CET 2011


On 02/15/2011 02:55 AM, Thierry Panthier wrote:
> Hi Marco,
>
> After a few hours debugging the application and analyzing packets with
> Wireshark I finally found the source of the problem.
>
> The RTCP timeout (5s) works as expected and an EOS message is posted
> on the bus to notify that the source has timed out.
>
> However 'rtspsrc' has two other parameters - "tcp-timeout" and "retry"
> - which are set to a very high value by default.
>
> tcp-timeout : Fail after timeout microseconds on TCP connections (0 = disabled)
>                     flags: readable, writable
>                     Unsigned Integer64. Range: 0 -
> 18446744073709551615 Default: 20000000 Current: 20000000
>
> retry           : Max number of retries when allocating RTP ports.
>                     flags: readable, writable
>                     Unsigned Integer. Range: 0 - 65535 Default: 20 Current: 20
>
> So even though the absence of the sender is detected by 'rtpbin'
> within 5s, 'rtspsrc' enters this retry cycle with a long TCP timeout
> and consequently my application takes minutes to respond.
There are many ways the sender can 'disappear':

1) it is not sending RTP packets anymore. This is detected by rtpbin 
using the
regular RTP timeout mechanisms (which is 5 times the deterministic RTCP
reporting interval or about 25 seconds).

2) the server closes the RTSP TCP connection. If there is still RTP 
traffic going on,
this is allowed by the RTSP spec and the client will try to reconnect 
when it needs
to.

The 'retry' property on rtspsrc has nothing to do with this, it's just 
the amount of
attempts it does to allocate two udp ports.

Wim

> The best way to simulate all different scenarios was by using
> 'iptables' to block RTP, RTCP and then finally RTSP packets (simple
> port based filtering).
>
> Thanks for your help!
>
> Thierry
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list