<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hi,<br><br>I use native rtmp in ffmpeg 3.1.1 to demuxer rtmp stream from nginx server. avformat_open_input() is used to open input rtmp stream. Native rtmp plugin supports 'timeout' option as shown below:<br><br>  -timeout           <int>        .D...... Maximum timeout (in seconds) to wait for incoming connections. -1 is infinite. Implies -rtmp_listen 1 (from INT_MIN to INT_MAX) (default -1)<br><br>I add timeout of 10 seconds to rtmp option set, and call avformat_open_input().<br><br>    AVDictionary *format_opts = NULL;<br>    av_dict_set(&format_opts, "timeout", "10", 0);<br>    avformat_open_input(fmt-ctx, rtmp-url, NULL, &format_opts);<br><br>But avformat_open_input() will return immediately with error messages as follows:<br><br>[rtmp @ 0x8ff9a0] Cannot open connection tcp://localhost:1935?listen&listen_timeout=10000<br>Cannot open input rtmp url:<br>    rtmp://localhost:1935/live1/abc!<br>Fail to call openInputLiveStream()!<br><br>nginx server didn't provide live streaming service. It was expected that avformat_open_input() would return in 10 seconds with error mesage. But why did the function return immediately?<br><br>Thanks!<br><br>Regards<br><br>Andrew<br><br><br></div></div><br><br><span title="neteasefooter"><p> </p></span>