How to Configure libaom cpu-used in FFmpeg

This article provides a straightforward guide on how to configure the cpu-used parameter when encoding AV1 video using the libaom encoder in FFmpeg. You will learn what this parameter does, the range of values you can use, and how to apply it in your FFmpeg command-line workflows to balance encoding speed and compression efficiency.

What is the cpu-used Parameter?

In the libaom-av1 encoder, the -cpu-used parameter controls the trade-off between encoding speed and visual quality (compression efficiency).

Valid Value Range

The -cpu-used parameter accepts integer values ranging from 0 to 9 (and up to 11 in newer experimental versions of libaom):

How to Use cpu-used in an FFmpeg Command

To set this parameter, append -cpu-used followed by your desired value in your FFmpeg command.

Here is a standard example using Constant Rate Factor (CRF) mode:

ffmpeg -i input.mp4 -c:v libaom-av1 -crf 30 -b:v 0 -cpu-used 4 -c:a libopus output.mkv

In this command: * -c:v libaom-av1 specifies the libaom AV1 video encoder. * -crf 30 sets the quality target (lower is better quality, standard range is 20-35). * -b:v 0 is required when using CRF mode with libaom to enable constant quality. * -cpu-used 4 sets the speed/quality preset to a balanced level of 4. * -c:a libopus transcodes the audio to Opus, which pairs well with AV1.

Depending on your hardware and time constraints, use these configurations: