The video buffering verifier
A decoder receives bits at the speed of its connection and uses them a frame at a time. Between the two sits a buffer. The video buffering verifier (VBV) is the encoder's model of that buffer: bits flow in at a fixed maximum rate, each frame takes its own size out at once, and the level must never go below zero. An encoder that respects it has kept enough data in the model for every frame's removal. Whether a player has each frame in time also depends on how the data is delivered and how fast it is decoded. This page's version is idealized: a buffer filled at a configured rate and capped at its size.
Two numbers
The model has a fill rate and a size. A stream may use more than the fill rate for a while, by drawing the buffer down, and must then use less while it refills. A large frame, such as an intra frame, is paid for out of the buffer. Over any stretch of T seconds the stream can use at most what arrives in that time plus what the buffer held at the start:
bits in T seconds ≤ rate × T + size
So its average over that stretch is at most the rate plus size ÷ T, an allowance that shrinks as the stretch grows. There is no fixed length past which the average must be at or under the rate.
Constrain a stream
The sequence of the previous page is coded at a constant rate factor of 26, which on its own averages 638 kbit/s and peaks at 901 kbit in its busiest second. Set the buffer's fill rate and its size in seconds of that rate: at 600 kbit/s a one-second buffer holds 600 kilobits. In the upper plot the dashed line is the quantization parameter (QP) without the limit and the solid line with it. The lower plot is the buffer level once each frame is taken out and before the next refill, where it is lowest. The buffer starts 90% full, as x264's does by default.
For this sequence:
- At 600 kbit/s with a one-second buffer, 196 of the 300 frames had their QP raised. The busy section went from an average QP of 28.4 to 29.9, the stream from 638 to 566 kbit/s, and the buffer's lowest level was 17.1% of its size.
- The first adjustment came at frame 98, three frames before the busy section, and adjustments recurred through the last section. Frames 194 to 200 were left alone. In the medium section QP averaged 26.8 against 26.0: the rule was still working the buffer back toward half full.
- The busiest second still took 807 kbit, more than the fill rate. The burst drew on bits that had arrived earlier and were waiting in the buffer. With half a second of buffer it took 734; with three seconds, 901, the same as with no limit.
- A limit at or above the stream's own peak does almost nothing. At 900 kbit/s one frame was touched.
The settings in x264
--vbv-maxrate is the fill rate, in kbit/s, and --vbv-bufsize the size, in kilobits. Neither is set by default, so no buffer is modeled. --vbv-init is the starting level, 0.9 of the size by default.
Minimum rate, filler and the rule with no lookahead
- The two buffer options work with
--crfor--bitrate. - In one-pass average bitrate with the maximum rate no higher than
--bitrate, x264 also keeps the buffer from overfilling, by lowering QP. Filler is separate: x264 adds it only under--filleror--nal-hrd cbr, and otherwise drops the credit a full buffer cannot hold. A maximum rate below the average bitrate target lowers the target to match. - With
--rc-lookaheadat 0, x264 falls back to a rule that uses the current buffer level and a prediction of the current frame's size, without planning ahead. The demo does not model it.
Trade-offs
- The cost lands mostly around the hardest content. Busy scenes get coarser quantization than the rate factor asked for. Here the rule also raised QP just before the busy section and in the easier section after it, while the buffer recovered.
- A larger buffer permits longer bursts and can add delay. With the same starting fraction and arrival rate it stands for more data buffered before the first frame: filling an empty one-second buffer to 0.9 takes 0.9 seconds at the fill rate. That is not a measurement of a player's startup or total latency.
- The limits usually come from outside. Levels in a coding standard, a delivery channel or a device set them, and the encoder's job is to do the least harm inside them.
Sources
Read 2026-11-15, at the commit linked.
- x264 at commit c24e06c (GitHub mirror): in
encoder/ratecontrol.c, the lookahead rule with the walk over planned frames, the lower target, the 1% step and the upper target, the fallback with no lookahead, the buffer drained by a frame and refilled, the underflow warning, the fill per frame and the starting level, the test for the minimum-rate behavior, the update after a frame (the frame taken out, the underflow test, then the refill) and filler, or the level capped without it; inencoder/encoder.c, a maximum rate under the bitrate lowering the bitrate and filler turned on by the constant bitrate signaling mode; the default starting level; the options in the command-line list and their units. - Not checked: the hypothetical reference decoder as a standard defines it, and how levels limit rate and size; x264's size predictors, its corrections within a frame and how filler is written; how the buffer interacts with B frames and with two-pass encoding;
--crf-max, and what--nal-hrdsignals; buffer models in x265, libaom and SVT-AV1.