[FFmpeg-devel] [RFC] libavdevice, audio output devices

Luca Abeni lucabe72
Mon Nov 23 09:12:35 CET 2009

Hi all,

Ivo wrote:
> Basically, alsa blocks on input and output if AVFMT_FLAG_NONBLOCK is not set 
> and does not block on input and output if it is set. On the other hand, oss 
> always blocks on output, and never blocks on input. If you look at the 
> description in avformat.h, both are not functioning as is described.
> My proposal would be to extend AVFMT_FLAG_NONBLOCK to non-blocking behaviour 
> for output too and fix oss_audio. This leads to the greatest flexibility 
> for third-party applications using libavdevice.

I have no particular preference about how to solve this issue, but I'd like
to add that this problem affects libavformat too... For example, the "file"
protocol seems to always block, regardless of the AVFMT_FLAG_NONBLOCK flag.

	ffmpeg -i <mpeg file> test.nut
encodes as fast as possible (about 600fps here), but running
	mkfifo pipe.nut
	ffmpeg -y -i <mpeg file> pipe.nut < /dev/zero & ffmpeg -y -re -i pipe.nut test.nut
both the first and the second instance of ffmpeg encode at 25fps (hence,
the output of the first instance is blocking even if ffmpeg.c sets


More information about the ffmpeg-devel mailing list