Basically the VBV enables you to make sure the encoded stream doesn't overflow or underflow the decoder's buffer. If too much data comes in fast the buffer will overflow and you'll be forced to drop some of it. If data is coming in too slow the buffer will run out and the playback will stall.
It's a bit counter-intuitive but a VBV underflow signals an encoder rate buffer overflow (video bitrate larger than the input rate) while a VBV overflow signals an encoder rate buffer underflow (video bitrate lower than input the rate).
For ffmpeg
the bufsize
is the size of the buffer. minrate
and maxrate
are used in conjunction with bufsize
to set the max and min bitrate change tolerance for VBR (variable bitrate).
minrate
is typically used along with maxrate
to achieve near-CBR (constant bitrate).
maxrate
is not the peak bitrate, it's rather the maximum bitrate that can enter the buffer. If you have a large buffer, like in your second example, you can tolerate a higher bitrate for a greater amount of time until the buffer overflows. VBV makes sure your bitrate is lowered before that happens. That's why your stream can reach 800-900 kbps.
You can read more here: The relationship between --vbv-bufsize and --vbv-maxrate