[FFmpeg-cvslog] Do not use AVFMT_FLAG_NONBLOCK for the output file.

Luca Abeni lucabe72
Wed Mar 9 21:52:58 CET 2011

On 09/03/11 21:45, Nicolas George wrote:
> Le nonidi 19 vent?se, an CCXIX, Luca Abeni a ?crit :
>> However, the fact that ffmpeg selects AVFMT_FLAG_NONBLOCK basically
>> means that the application wants to take care of the timing by
>> itself.
> That is the theory. In practice, setting AVFMT_FLAG_NONBLOCK means that you
> have to handle EAGAIN condition. ffmpeg does it on input files but not on
> output files.
Well, if ffmpeg writes output packets at the correct rate, then EAGAIN 
does not happen, so no need for handling it ;-)

>> 	And "-re" just asks ffmpeg to read (and write) the stream at
>> the correct rate - according to the timestamps (this is what we use
>> for network streaming, too).
> Unfortunately, the clock of a soundcard can be slightly different from the
> central clock of the computer, leading to a slow drift and ultimately
> possibly a buffer overrun and short blocking. Or EAGAIN.
I fully on this; I have seen this happening after 30 or 40 minutes of 
playing... A more correct application should handle EAGAIN, or 
compensate for the drift between the two clocks.


More information about the ffmpeg-cvslog mailing list