Rate Control
Introduction
In this section, we outline the various rate control methods available in the Aurora1 AV1 encoder. Rate control is critical for maintaining optimal video quality while balancing the constraints of file size and bandwidth.
Aurora1 supports several modes including Constant Rate Factor (CRF), Variable Bitrate (VBR), and their combinations with Video Buffering Verifier (VBV). Each of these options offers flexibility depending on your specific encoding requirements—whether you're aiming for consistent quality, maintaining a target bitrate, or adhering to strict bitrate caps.
The table below details the parameters associated with each rate control mode, their respective settings, and the expected behavior during the encoding process.
Rate Control Modes Explained
| Rate-Control | Description | cq-level (range [0, 63], default 10) | min-q (range [0, max-q], default 0) | max-q (range [1, 63], default 63) | target-bitrate (default 256) | undershoot-pct (range [0, 100], default 25) | overshoot-pct (range [0, 100], default 25) | buf-sz (default 6000) | enable-vbv (0/1) |
|---|---|---|---|---|---|---|---|---|---|
| CRF (--end-usage=q) | CRF aims to maintain a consistent visual quality regardless of bitrate. The actual bitrate will fluctuate depending on the video content. Complex scenes naturally require more bits to maintain the target quality. | Specify desired quality level. Mandatory | Specify the minimum (best) quantizer | Specify the maximum (worst) quantizer | N/A | N/A | N/A | N/A | 0 |
| CRF+VBV (--end-usage=q --enable-vbv=1) | Builds upon CRF by introducing a maximum bitrate limit. The encoder first determines the QP like CRF mode, then checks the instant bitrate. If the instant bitrate exceeds the VBV limitation, then the encoder adjusts the QP upwards while scarfing the quality. | Specify desired quality level; Mandatory | Specify the minimum (best) quantizer | Specify the maximum (worst) quantizer | Specify the maximum bitrate in kbps. Mandatory | N/A | N/A | Specify VBV buffer size in ms. Mandatory | 1, Mandatory |
| VBR (--end-usage=vbr) | VBR tries to encode the video at the target bitrate regardless of the content. The encoder analyzes the complexity of each scene and allocates bits accordingly. It allocates more bits to complex scenes and fewer bits to simpler ones. VBR can result in similar file size regardless of the content. You need to choose an appropriate average bitrate for your desired quality and file size goals. | N/A | Specify the minimum (best) quantizer | Specify the maximum (worst) quantizer | Specify target bitrate in kbps. Mandatory | Controls the tolerance of the VBR algorithm to undershoot and is used as a trigger threshold for more aggressive adaptation of Q | Controls the tolerance of the VBR algorithm to overshoot and is used as a trigger threshold for more aggressive adaptation of Q | N/A | 0 |
| VBR+VBV (--end-usage=vbr --enable-vbv=1) | Builds upon VBR by introducing a maximum bitrate limit. The actual bitrate is close to the target bitrate, and the maximum bitrate is also constrained. The encoder analyzes the complexity of each scene and allocates bits accordingly. It allocates more bits to complex scenes and fewer bits to simpler ones while not breaking the VBV limitation. The encoder tracks both the current average bitrate and instant bitrate, and adjusts the QP accordingly. | N/A | Specify the minimum (best) quantizer | Specify the maximum (worst) quantizer | Specify target average bitrate. Mandatory | Controls the tolerance of the VBR algorithm to undershoot and is used as a trigger threshold for more aggressive adaptation of Q | Controls the tolerance of the VBR algorithm to overshoot and is used as a trigger threshold for more aggressive adaptation of Q | Specify VBV buffer size in ms. Mandatory | 1, Mandatory |
Rate Control Examples
CRF Example
To specify Quality=25 (--end-usage=q --cq-level=25)
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib bin/aurora_av1enc input.y4m --end-usage=q --cq-level=25 --cpu-used=5 --limit=60 --threads=8 -o output.ivf
CRF + VBV (Capped CRF) Example
Specify maximum bitrate 3 Mbps, VBV buffer size 1.5s, quality 25 (--end-usage=q --cq-level=25 --target-bitrate=3000 --enable-vbv=1 --buf-sz=1500)
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib bin/aurora_av1enc input.y4m --end-usage=q --cq-level=25 --target-bitrate=3000 --enable-vbv=1 --buf-sz=1500 --cpu-used=5 --limit=60 --threads=8 -o output.ivf
VBR Example
Specify target bitrate 3 Mbps (--end-usage=vbr --target-bitrate=3000)
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib bin/aurora_av1enc input.y4m --end-usage=vbr --target-bitrate=3000 --cpu-used=5 --limit=60 --threads=8 -o output.ivf
VBR + VBV Example
Specify target bitrate 3 Mbps, VBV buffer size 1.5s (--end-usage=vbr --target-bitrate=3000 --enable-vbv=1 --buf-sz=1500)
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib bin/aurora_av1enc input.y4m --end-usage=vbr --target-bitrate=3000 --enable-vbv=1 --buf-sz=1500 --cpu-used=5 --limit=60 --threads=8 -o output.ivf