FFmpeg AV1 Encoding: Standard Command Guide

This guide details the standard command-line parameters required to encode video using the modern AV1 codec in FFmpeg. It focuses on using the recommended SVT-AV1 encoder (libsvtav1), breaking down the essential flags for rate control, encoding presets, pixel formats, and audio handling to help you achieve an optimal balance between file size, visual quality, and encoding speed.

Standard Encoding Command

The default and most widely supported production encoder for AV1 in modern FFmpeg builds is SVT-AV1. The standard command for a typical Constant Rate Factor (CRF) encode is:

ffmpeg -i input.mp4 -c:v libsvtav1 -crf 30 -preset 5 -pix_fmt yuv420p10le -c:a libopus -b:a 128k output.mkv

Essential Parameter Breakdown

Alternative: Two-Pass Target Bitrate

If you need a specific target file size rather than variable quality, use a two-pass approach with a specified average bitrate:

Pass 1:

ffmpeg -i input.mp4 -c:v libsvtav1 -b:v 2500k -preset 5 -pass 1 -an -f null /dev/null

Pass 2:

ffmpeg -i input.mp4 -c:v libsvtav1 -b:v 2500k -preset 5 -pass 2 -c:a libopus -b:a 128k output.mp4

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

Reference Encoder Alternative: libaom-av1

If your FFmpeg installation lacks libsvtav1 and relies on the reference libaom-av1 encoder, use the following syntax:

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