I am using ffmpeg to convert a set of images (bmps) with an audio track into Web ready video. Target formats are h.264 mp4, webm and flv.
This is on a Windows Azure extra-large instance (8 proc) using the prebuilt zeranoe static builds ( http://ffmpeg.zeranoe.com/builds/).
Suppose I’m willing to sacrifice quality and size for raw speed. What options for each format will yield the quickest result?
My “baseline” command looks like this (swap the extension for the other formats):
ffmpeg -y -i frames%5d.bmp -i audio.mp3 -r 23.97 out.mp4
I can change the inputs to other formats if needed (jpg images, aac audio, etc).
The major “knob” you change the quality/encoding speed balance for any format is the bitrate. In testing just now, a video that takes 97 seconds to encode with default settings, bitrate ~900k, took less than half that with the bitrate dialed down to 100k. The output video was much smaller, and the quality was noticeably worse.
In your case, coming from images, you can probably get a major speedup from turning off motion estimation as mentioned in FFmpeg’s encoding tips:
In testing, the 97-second encode finished in 20 seconds with
-g 0. There was much less compression, 63% the original size versus 25% with default settings, but the quality remains good unlike low-bitrate encodings.Here are the complete results from my quick testing, time is real time used for encoding:
Baseline, 27M MOV to mp4, bitrate ~900k: 97s
with
-me_method zero: 84swith
-flags2 fast: 84swith
-b 500k: 75swith
-b 100k: 43swith
-g 0: 20swith
-flags2 fastand-b 100kand-g 0: 12s (the output looks terrible)There might be other format-specific tweaks, but I wouldn’t expect significant speedups from those compared to the methods listed above..