Libvpx Undershoot and Overshoot Settings Explained

This article explores the impact of the undershoot and overshoot percentage settings in the libvpx encoder, which is widely used for compressing VP8 and VP9 video formats. These parameters dictate how strictly the encoder adheres to a target bitrate during variable bitrate (VBR) and constant bitrate (CBR) encoding. Understanding how to configure these settings allows you to strike the ideal balance between consistent video quality, efficient file sizing, and stable network streaming.

Understanding the Parameters

In libvpx, rate control is managed using two key percentage parameters: --undershoot-pct and --overshoot-pct. These settings tell the encoder how much it is allowed to deviate from the target bitrate on a frame-by-frame or scene-by-scene basis.

Impact on Video Quality and Compression Efficiency

The range you set for these parameters determines how “flexible” the encoder is, directly affecting both visual quality and storage efficiency.

High Flexibility (Loose Settings)

When you allow high undershoot and overshoot percentages (e.g., 100% undershoot and 50% overshoot), the encoder behaves like a true Variable Bitrate (VBR) system. * Pros: Outstanding overall visual quality and highly efficient file sizes. The encoder saves bits during static talking-head scenes and spends those saved bits generously on fast-action sequences. * Cons: Highly unpredictable file sizes and bitrates, making the output stream unsuitable for strict bandwidth-limited environments.

Low Flexibility (Strict Settings)

When you restrict these percentages to low values (e.g., 0% to 10%), you force the encoder into a Constant Bitrate (CBR) or “constrained VBR” mode. * Pros: Highly predictable file sizes and stable data transmission rates. * Cons: Decreased visual quality. Complex scenes will suffer from compression artifacts because the encoder is not allowed to use extra bits, while simple scenes will waste bandwidth by using more bits than necessary to meet the minimum bitrate threshold.

Best Practices for Common Use Cases

To get the best results from libvpx, tailor these settings to your specific delivery platform: