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.

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.

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.

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.