Configure libaom Undershoot and Overshoot PCT in FFmpeg

This guide explains how to configure the target bitrate undershoot and overshoot percentage parameters (undershoot-pct and overshoot-pct) using the libaom-av1 encoder in FFmpeg. Adjusting these parameters allows you to control bitrate fluctuations, ensuring the encoder adheres strictly to your target bitrate or allows flexibility for high-complexity scenes.

Understanding Undershoot and Overshoot PCT

When encoding AV1 video using Variable Bitrate (VBR) or Constrained Quality (CQ) modes, the encoder dynamically adjusts the bitrate based on scene complexity. The undershoot and overshoot parameters define the boundaries of these adjustments:

The values for both parameters range from 0 to 100 percent.

FFmpeg Command Syntax

In FFmpeg, you can pass these parameters directly as private encoder flags.

Basic Syntax

ffmpeg -i input.mp4 -c:v libaom-av1 -b:v 2M -undershoot-pct 50 -overshoot-pct 50 output.mkv

Alternative Syntax using AOM Params

You can also pass these settings inside the -aom-params option, separating the arguments with a colon:

ffmpeg -i input.mp4 -c:v libaom-av1 -b:v 2M -aom-params "undershoot-pct=50:overshoot-pct=50" output.mkv

Depending on your distribution network and playback requirements, you should configure these settings to balance quality and bandwidth stability.

1. Strict Bitrate Control (Low Delay / Streaming)

If you are streaming video and have limited bandwidth, you need to prevent large bitrate spikes. Setting low percentages forces the encoder to stay very close to the target bitrate. * Undershoot: 0 to 10 * Overshoot: 0 to 15

ffmpeg -i input.mp4 -c:v libaom-av1 -b:v 3M -undershoot-pct 10 -overshoot-pct 15 output.mkv

2. High-Quality Archiving (Flexible VBR)

For offline viewing or archiving where file size predictability is less important than visual consistency, allow the encoder maximum freedom to allocate bits where they are needed. * Undershoot: 100 (allows maximum compression in static scenes) * Overshoot: 100 (allows double the target bitrate for intense motion)

ffmpeg -i input.mp4 -c:v libaom-av1 -b:v 3M -undershoot-pct 100 -overshoot-pct 100 output.mkv