Configure rav1e Quantizer in FFmpeg
This article provides a quick guide on how to configure the quantizer
parameter in the rav1e AV1 encoder using FFmpeg. You will
learn the correct command-line syntax, the range of quantizer values,
and how to balance video quality against file size.
Understanding the rav1e Quantizer
The rav1e encoder uses a quantizer parameter (QP) to
control the compression level and overall quality of the output video.
Unlike some encoders that use a 0–51 scale, rav1e uses a
scale of 0 to 255.
- 0: Lossless (maximum quality, extremely large file size).
- 255: Maximum compression (lowest quality, smallest file size).
- Default: If not specified, the encoder typically defaults to a balanced mid-range value (often around 100).
A lower quantizer value results in higher visual fidelity but a larger file size, while a higher value reduces file size at the cost of visual clarity.
How to Set the Quantizer in FFmpeg
In FFmpeg, you can configure the rav1e quantizer using
either the -qp option or the -crf option. The
librav1e wrapper in FFmpeg treats both of these options
similarly for constant quality encoding.
Standard Command Syntax
To set the quantizer, use the following command structure:
ffmpeg -i input.mp4 -c:v librav1e -qp 100 output.mp4Alternatively, you can use -crf:
ffmpeg -i input.mp4 -c:v librav1e -crf 100 output.mp4Recommended Quantizer Values
Because the scale ranges up to 255, the values differ significantly
from encoders like libx264 or libsvtav1. Use
these ranges as a starting point:
- High Quality (Archival):
50–80 - Standard/Medium Quality (Recommended):
80–120 - Low Quality (High Compression):
150–200
Combining Quantizer with Speed Presets
The speed of the rav1e encoder can be adjusted using the
-preset option, which ranges from 0 (slowest,
best compression efficiency) to 10 (fastest). For best
results, pair your quantizer setting with an appropriate preset:
ffmpeg -i input.mp4 -c:v librav1e -qp 90 -preset 5 output.mp4