Configure AV1 Bitrate with libsvtav1 in FFmpeg

This article explains how to configure target-level bitrates and rate control modes for AV1 video encoding using the SVT-AV1 (libsvtav1) encoder in FFmpeg. You will learn the specific commands and parameters required to set Constant Rate Factor (CRF), Variable Bitrate (VBR), and Constant Bitrate (CBR) targets to optimize your video quality and file size.

1. Constant Quality Mode (CRF)

For most encoding tasks, Constant Rate Factor (CRF) is the recommended rate control method. It focuses on maintaining a consistent visual quality throughout the video, letting the bitrate fluctuate as needed.

In FFmpeg, you set this using the -crf flag. The scale for SVT-AV1 typically ranges from 0 to 63, where lower values yield higher quality and larger file sizes. A CRF value between 20 and 32 is standard for high-definition video.

ffmpeg -i input.mp4 -c:v libsvtav1 -crf 26 -preset 4 output.mkv

2. Target Variable Bitrate (VBR)

If you need to target a specific average file size or average bitrate while allowing the encoder to allocate bits dynamically to complex scenes, use Variable Bitrate (VBR) mode.

You can set the target bitrate using FFmpeg’s standard -b:v flag.

ffmpeg -i input.mp4 -c:v libsvtav1 -b:v 2M -preset 5 output.mkv

To configure this more precisely using SVT-AV1’s internal parameters, use the -svtav1-params option to define the rate control mode (rc) and the target bitrate (tbr in kilobits per second). Setting rc=1 enables VBR.

ffmpeg -i input.mp4 -c:v libsvtav1 -svtav1-params rc=1:tbr=2000 output.mkv

3. Constrained Variable Bitrate (CVBR)

Constrained VBR is useful for streaming environments where you want to target an average bitrate but must cap maximum spikes to prevent buffering.

Enable this by setting rc=2 (CVBR) in the SVT-AV1 parameters, and define your target bitrate (tbr). You should also pass the maximum bitrate using the standard -maxrate flag.

ffmpeg -i input.mp4 -c:v libsvtav1 -b:v 2M -maxrate 3M -svtav1-params rc=2:tbr=2000 output.mkv

4. Constant Bitrate (CBR)

Constant Bitrate forces the encoder to maintain a strict, unvarying bitrate throughout the duration of the video. This is ideal for live streaming over bandwidth-constrained connections but is highly inefficient for local storage.

To enforce CBR, use -svtav1-params to set the rate control to CBR (rc=2 or specific CBR passes depending on your SVT-AV1 version) and match the target bitrate with the maximum rate and buffer size.

ffmpeg -i input.mp4 -c:v libsvtav1 -b:v 2M -maxrate 2M -bufsize 4M -svtav1-params rc=2:tbr=2000 output.mkv