ffmpeg bufsize
is simply the amount of data processed (number of bits) before ffmpeg re-calculates the current bitrate, based on the content being transcoded.
You may think of bufsize as similar to key frames. The difference is bufsize triggers a re-evaluation of ffmpeg's current algorithm usage after X bits of data have been processed. While commands related to key frame evaluation (e.g. -g
parameter) operate based on how many frames have been processed since the last time the key frame evaluation took place.
For example, let's say you setup ffmpeg in Constant Bit Rate (CBR) mode and set -bufsize to 2x your bit rate. The formula will be simple. Every 2 frames, ffmpeg will adjust. On the other hand, if you are using VBR and set -bufsize at 2x the target bit rate, exactly how often ffmpeg adjusts its encoding formula (and the actual bitrate) will vary depending on what the bitrate is at any given moment (since it is variable). So, the frequency - in terms of frames and/or bits processed - will vary throughout the encode.
Thinking strictly of bit rate constrained encoding modes only (i.e. non-CQ/CRF), a good ballpark concept of a -bufsize target is to use between 1x - 2x your -maxsize bit rate (or target bit rate, depending on the codec and encoding mode).
EDIT: Clarifying a bit further.... -bufsize
is used in conjunction with -maxsize
to determine exactly when the maximum number of bits should be re-calculated (bufsize will dictate when that happens).