Configure libaom end-usage Parameter in FFmpeg
This article provides a straightforward guide on how to configure the
end-usage rate control parameter for the
libaom AV1 encoder in FFmpeg. You will learn the definition
of the four primary rate control modes—VBR, CBR, CQ, and Q—and how to
apply them directly using FFmpeg command-line arguments.
Understanding the end-usage Parameter
The end-usage parameter in the libaom
encoder determines the rate control mode used during the AV1 compression
process. This setting dictates how the encoder allocates bitrate across
the video timeline to balance quality and file size.
There are four modes available for end-usage:
q(Constant Quality / Pure Q): Focuses strictly on maintaining a specific quality level (set by-crf) without regard to the final file size or bitrate.cq(Constrained Quality): A compromise between quality and bitrate. It aims for a specific quality level but caps the bitrate to prevent massive spikes.vbr(Variable Bitrate): Targets a specific average bitrate, allowing the bitrate to rise and fall depending on the complexity of the scene.cbr(Constant Bitrate): Forces the encoder to maintain a strict, steady bitrate, which is ideal for live streaming environments.
How to Configure end-usage in FFmpeg
To set the end-usage parameter in FFmpeg, use the
-aom-params private option flag. The syntax is formatted as
-aom-params end-usage=<mode>.
1. Constant Quality Mode (q)
To use pure Constant Quality, pair end-usage=q with a
Constant Rate Factor (CRF) value. Lower CRF values yield higher
quality.
ffmpeg -i input.mp4 -c:v libaom-av1 -crf 30 -aom-params end-usage=q output.mkv2. Constrained Quality Mode (cq)
For Constrained Quality, you must define both a target quality level
using -crf and a target bitrate limit using
-b:v.
ffmpeg -i input.mp4 -c:v libaom-av1 -crf 30 -b:v 2M -aom-params end-usage=cq output.mkv3. Variable Bitrate Mode (vbr)
To target a specific average bitrate while letting the encoder adjust
dynamically based on motion and complexity, use vbr along
with the -b:v flag.
ffmpeg -i input.mp4 -c:v libaom-av1 -b:v 2M -aom-params end-usage=vbr output.mkv4. Constant Bitrate Mode (cbr)
For strict streaming requirements where the bitrate must remain
completely stable, set end-usage=cbr. You should also
define the target, minimum, and maximum bitrates to match.
ffmpeg -i input.mp4 -c:v libaom-av1 -b:v 2M -minrate 2M -maxrate 2M -aom-params end-usage=cbr output.mkv