Hi,

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:

  -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)

I add timeout of 10 seconds to rtmp option set, and call avformat_open_input().

    AVDictionary *format_opts = NULL;
    av_dict_set(&format_opts, "timeout", "10", 0);
    avformat_open_input(fmt-ctx, rtmp-url, NULL, &format_opts);

But avformat_open_input() will return immediately with error messages as 
follows:

[rtmp @ 0x8ff9a0] Cannot open connection 
tcp://localhost:1935?listen&listen_timeout=10000
Cannot open input rtmp url:
    rtmp://localhost:1935/live1/abc!
Fail to call openInputLiveStream()!

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?

Thanks!

Regards

Andrew


_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to