[Libav-user] Unable to set UDP timeout for av_read_frame () . It goes with default value of 20 seconds.

whoami Jils get2jils at gmail.com
Mon Mar 17 17:50:19 CET 2014


Hi

 i follow below step to set UDP socket timeout of 5 seconds.

AVDictionary *stream_opts = 0;
av_dict_set(&stream_opts, "timeout", 3000000) // in microseconds.
avformat_open_input ( &myContext, "<myIPAddr", NULL, &stream_opts);



by default, av_read_frame ()  takes 20 Seconds for timeout, in case RTSP
goes out of network. [ socket.h:#define SO_RCVTIMEO 20 ]

which is very clearly indicates, the value which is set has no impact.

I am not sure if there are any quirk which i need to be aware of ?

is it the right way ?

Also from udp.c

{"timeout", "In read mode: if no data arrived in more than this time
interval, raise error", OFFSET(timeout), AV_OPT_TYPE_INT, {.i64 = 0}, 0,
INT_MAX, D }

596         if (!is_output && av_find_info_tag(buf, sizeof(buf), "timeout",
p))
597             s->timeout = strtol(buf, NULL, 10);


606     h->rw_timeout = s->timeout;



*I am unable to locate the interesting part of where UDP socket is
configured with   h->rw_timeout ?*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20140317/8930114f/attachment.html>


More information about the Libav-user mailing list