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:
- Undershoot PCT (
-undershoot-pct): Sets the maximum allowed bitrate undershoot as a percentage of the target bitrate. For example, if your target is 2000 kbps and you set-undershoot-pct 50, the encoder can drop the bitrate down to 1000 kbps during simple scenes to save space. - Overshoot PCT (
-overshoot-pct): Sets the maximum allowed bitrate overshoot as a percentage of the target bitrate. For example, with a target of 2000 kbps and-overshoot-pct 50, the encoder can spike up to 3000 kbps during complex, fast-moving scenes to maintain visual quality.
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.mkvAlternative 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.mkvRecommended Configurations
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.mkv2. 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