[Libav-user] av_read_frame() hangup (no timeout)
ggarra13 at gmail.com
Sat Nov 16 23:36:50 EET 2019
El 16/11/19 a las 17:51, bsenftner at earthlink.net escribió:
>> I am implementing rtmp reading into my viewer and have run into the
>> unfortunate event that av_read_frame() hangs when reaching the end of
>> the video being sent over the protocol. I was hoping it would return
>> AVERROR_EOF or a timeout error, but none of the sort seems to happen.
>> Thus, my viewer just hangs at the end of the video.
>> I tested with ffplay and the same seems to happen there, where the
>> window close button becomes ineffective.
> Please take a look at this:
> It is a 5 line addition to libavformat/utils.c that adds an av_read_frame() I/O callback.
> I added this a few years ago to my local ffmpeg compile, tried to get it adopted by the official ffmpeg dev maintainers, but they felt it was (incorrectly, IMHO) too specific to streaming playback.
> My company uses this av_read_frame()callback to identify when a network stream unexpectedly terminates, often caused by someone turning off or tripping over a security camera cable.
Your solution works like a charm and it is extremely simple. It is a
pity that it was not adopted by the ffmpeg maintainers.
More information about the Libav-user