[Libav-user] questions about indefinite waiting for incoming rtmp stream

Chen Fisher chen.fisher at gmail.com
Mon Aug 22 13:30:43 EEST 2016


Yes, you should use *interrupt_callback*:
https://www.ffmpeg.org/doxygen/3.0/structAVFormatContext.html#a5b37acfe4024d92ee510064e80920b40
https://www.ffmpeg.org/doxygen/3.0/structAVIOInterruptCB.html

This callback function is called repeatedly when there's a blocking
operation like av_read_frame
Just return 1 if you want to abort any blocking operation

On Sun, Jul 31, 2016 at 1:25 PM, qw <applemax82 at 163.com> wrote:

> Hi,
>
> I use avformat_open_input(), and avformat_find_stream_info() to open rtmp
> stream, and use av_read_frame() to read av packet. If there is no incoming
> rtmp stream, avformat_open_input() and avformat_find_stream_info() will
> wait indefinitely. If incoming rtmp stream is terminated in the middle,
> av_read_frame() will wait indefinitely.
>
> Is there some method for ffmpeg lib to effective handle this sort of
> indefinite waiting in case of network issue?
>
> Thanks!
>
> Regards
>
> Andrew
>
>
>
>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160822/67fcca05/attachment.html>


More information about the Libav-user mailing list