[FFmpeg-user] ffmpeg stdout write performance on windows (buffering request)

Jason Anders jgo at kataf.nl
Thu Aug 16 20:34:04 CEST 2012

Dear ffmpeg developers,

For a video analysis application, we use ffmpeg to stream video to stdout as
raw rgb values:
    ffmpeg -i ... -f rawvideo -pix_fmt rgb24 -

This works perfectly fine on Linux, but on Windows we run into performance
problems on 1280x544 and higher resolution videos.

I did some benchmarking, and it seems that Windows has a significant
overhead per write call for stdout / piping. These are my results of two
processes communicating with stdout --> stdin:
    writing batches of 16 bytes: 4MB/sec
    writing batches of 1024 bytes: 170MB/sec
    writing batches of 4096 bytes: 260MB/sec
    writing batches of 65536 bytes: 980MB/sec

At 1280x544 @ 24fps, using RGB8 as output means we're moving around
48MB/sec. I suspect that ffmpeg is writing relatively small batches of data
to stdout. As said, it works perfectly fine on Linux, but unfortunately
we're not as lucky on Windows.

If my calculations are correct, then 1920x1080 @ 30fps would mean we'd need
a throughput of 177MB/sec, for which 4K writes seem enough, although a
higher margin could be desirable, as CPU-usage on I/O climes significantly
with a higher write call rate.

I hope buffering stdout write calls could be integrated into ffmpeg, as it
would allow us to deploy on Windows too. Thanks for your time!

With kind regards,
    Jason Anders

More information about the ffmpeg-user mailing list