FFmpeg libaom-av1 Encoder Configurations

This article provides a comprehensive guide to the standard configurations for the libaom-av1 encoder in FFmpeg. You will learn the essential parameters for controlling quality, encoding speed, bitrate, and hardware utilization to optimize your AV1 video compression workflow.

Constant Quality (CRF) Encoding

Constant Rate Factor (CRF) is the recommended encoding mode for general file storage and playback when you want to maintain a consistent visual quality throughout the video.

To use CRF mode with libaom-av1, you must set the video bitrate to 0 (-b:v 0) and specify a CRF value using the -crf flag.

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

Speed vs. Quality Presets (-cpu-used)

The -cpu-used parameter controls the trade-off between encoding speed and compression efficiency.

The default value is usually 1 if not specified, which is highly impractical for most users due to slow speeds. It is highly recommended to explicitly set -cpu-used 4 or -cpu-used 6.

Bitrate-Targeted Encoding (Two-Pass)

If you need your output video to fit a specific file size, you should use two-pass encoding with a target bitrate instead of CRF.

ffmpeg -i input.mp4 -c:v libaom-av1 -b:v 2M -cpu-used 4 -pass 1 -f null /dev/null
ffmpeg -i input.mp4 -c:v libaom-av1 -b:v 2M -cpu-used 4 -pass 2 output.mp4

(On Windows, replace /dev/null with NUL)

Color Depth and Pixel Formats

AV1 strongly benefits from 10-bit color depth, even when the input source is only 8-bit. Encoding in 10-bit reduces color banding in gradients and improves overall compression efficiency.

To force 10-bit encoding, append the pixel format flag to your command:

ffmpeg -i input.mp4 -c:v libaom-av1 -crf 26 -b:v 0 -pix_fmt yuv420p10le -cpu-used 4 output.mkv

Multi-Threading and Performance Options

To ensure libaom-av1 utilizes modern multi-core processors effectively, use the following parameters:

ffmpeg -i input.mp4 -c:v libaom-av1 -crf 28 -b:v 0 -pix_fmt yuv420p10le -cpu-used 4 -row-mt 1 -tiles 2x2 output.mkv