<div dir="ltr"><div><div>Hi <br><br></div> i follow below step to set UDP socket timeout of 5 seconds. <br><br>AVDictionary *stream_opts = 0;<br>av_dict_set(&stream_opts, "timeout", 3000000) // in microseconds.<br>
avformat_open_input ( &myContext, "<myIPAddr", NULL, &stream_opts);<br><br><br><br></div><div>by default, av_read_frame () takes 20 Seconds for timeout, in case RTSP goes out of network. [ socket.h:#define SO_RCVTIMEO 20 ] <br>
<br></div><div>which is very clearly indicates, the value which is set has no impact.<br><br></div><div>I am not sure if there are any quirk which i need to be aware of ?<br><br></div><div>is it the right way ?<br><br></div>
<div>Also from udp.c<br><br>{"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 }<br><br>596 if (!is_output && av_find_info_tag(buf, sizeof(buf), "timeout", p))<br>
597 s->timeout = strtol(buf, NULL, 10);<br><br><br>606 h->rw_timeout = s->timeout;<br><br><br></div><div><b>I am unable to locate the interesting part of where UDP socket is configured with h->rw_timeout ?<br>
</b><br><br><br></div><div><br><br></div><div><br></div><div><br><br></div><div><div><br><br></div></div></div>