[Libav-user] avformat_find_stream_info blocking/hanging?

Chung, Ian (UK) ian.chung at baesystems.com
Wed Oct 14 15:35:06 CEST 2015

Processing MPEG Transport Stream over network containing single H264 stream.

Simplified code (without error checks) uses
avformat_open_input(formatCtx, <URL>, NULL, NULL) to open network stream
avformat_find_stream_info(formatCtx, NULL) to get stream information.

When input stream is "good" quality, functions behave as expected and I can determine details, extract video and process. All works fine.

However when input stream is poor, i.e. corruption, the avformat_open_input() can still return as success but avformat_find_stream_info() hangs indefinitely.

Setting the format context (probesize and max_analyze_duration) does not have any effect.

Is there a mechanism to timeout the avformat_find_stream_info()?

The input Transport Stream format is controlled and known. Is it possible to populate the format context and thus avoid calling avformat_find_stream_info()?

Any help appreciated.

Ian Chung
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20151014/6453bf11/attachment.html>

More information about the Libav-user mailing list