What Is the Libaom Undershoot-pct Parameter?
The undershoot-pct parameter in the libaom AV1 encoder
plays a critical role in rate control by defining the maximum allowed
bitrate undershoot as a percentage of the target data rate. Adjusting
this value directly alters how aggressively the encoder drops the
bitrate during simple, low-complexity scenes. This article explores how
undershoot-pct balances file size savings against visual
quality, its interaction with its counterpart
overshoot-pct, and best practices for configuring it in
your video encoding workflows.
Understanding Rate Control and Undershoot
In variable bitrate (VBR) or constrained quality encoding, the encoder continuously adjusts quantization to hit a specific target bitrate. However, video complexity varies wildly from scene to scene.
- High-complexity scenes: Action sequences or heavy noise require more data.
- Low-complexity scenes: Static talking heads or flat backgrounds require very little data.
The undershoot-pct parameter (set via
--undershoot-pct in the CLI) dictates the lower bound of
this variance. For example, if you set a target bitrate of 2000 kbps and
an undershoot-pct of 50, you are telling the encoder that
it is allowed to drop the bitrate down to 1000 kbps for highly
compressible scenes if it deems higher data rates unnecessary for visual
fidelity.
The Impact on Video Quality and File Size
Modifying this parameter forces a trade-off between strict adherence to your target bitrate and encoding efficiency.
- Higher Undershoot Percentages (e.g., 50% to 100%): This grants the encoder maximum flexibility. During simple scenes, it will aggressively drop the bitrate, leading to a smaller overall file size. The risk, however, is that if the encoder miscalculates scene complexity, it might introduce subtle blocking artifacts or blurriness by starving the scene of data.
- Lower Undershoot Percentages (e.g., 0% to 10%): This forces the encoder to stay as close to the target bitrate as possible, even during static scenes. While this guarantees high quality across the board, it results in wasted bits and larger file sizes, as padding a static image with data yields no perceptual visual improvement.
Comparing Undershoot-pct and Overshoot-pct
To effectively manage rate control, undershoot-pct must
be used in tandem with overshoot-pct. They act as the floor
and ceiling for the encoder’s bitrate fluctuations.
| Parameter | Function | Typical Use Case |
|---|---|---|
undershoot-pct |
Caps how much the bitrate can drop below the target. | Maximizes storage savings during simple scenes. |
overshoot-pct |
Caps how much the bitrate can spike above the target. | Prevents buffer exhaustion and streaming stalls during complex scenes. |
Recommended Configurations
For standard 2-pass VBR streaming workflows where file size optimization is crucial, allowing a generous undershoot is generally recommended. A setting between 25% and 50% gives libaom enough room to save bits on easy scenes without causing severe quality degradation. Conversely, if you are encoding for a strict CBR-like environment or low-latency streaming where bit distribution must remain completely predictable, keeping the parameter closer to 0% to 10% is ideal.