Skip to main content

rav1e

rav1e is an open source command line application for encoding AV1 written in Assembly & Rust, co-developed by Xiph.org and Mozilla and licensed under BSD-2 Clause.

FFmpeg​

rav1e is available in FFmpeg via librav1e, to check if you have it, run ffmpeg -h encoder=librav1e. You can input non-FFmpeg standard rav1e parameters via -rav1e-params.

Supported Color Space​

rav1e supports the following color spaces:

FormatChroma SubsamplingSupported Bit Depth(s)
YUV420P4:2:08-bit
YUVJ420P4:2:08-bit (Full range)
YUV422P4:2:28-bit
YUVJ422P4:2:28-bit (Full range)
YUV444P4:4:48-bit
YUVJ444P4:4:48-bit (Full range)
YUV420P10LE4:2:010-bit
YUV422P10LE4:2:210-bit
YUV444P10LE4:4:410-bit
YUV420P12LE4:2:012-bit
YUV422P12LE4:2:212-bit
YUV444P12LE4:4:412-bit

Installation​

Official pre-built rav1e binaries can be found on the releases page in rav1e's Github repository. Unofficially, the rAV1ator CLI command line tool can automatically download and install rav1e to /usr/local/bin. rav1e can also be installed with Cargo by running cargo install rav1e.

Stable Release

For stability & a proper version number, please reset the source to the correct release commit. In the releases page, click the icon to the right of the release tag & copy the commit in the url bar. Then, in the cloned rav1e directory, git reset --hard [commit hash]

Here are instructions for resetting to release 0.7.1 (latest as of 19 Feb 2024) and building. Omit the git reset command to use the latest git, if you have a specific reason to use the latest git instead of an official tagged release.

git clone https://github.com/xiph/rav1e.git
cd rav1e
git reset --hard a8d05d0c43826a465b60dbadd0ab7f1327d75371
RUSTFLAGS="-C target-cpu=native" cargo build --release

When done, the binary can be found in /target/release. You can then copy the binary wherever you desire it to go, like by doing cp /target/release/rav1e /usr/local/bin .

Patched Installation with HDR10+ support​

rav1e currently has an unmerged pull request by quietvoid, the person behind hdr10plus_tool and dovi_tool. The PR adds a new parameter called --hdr10plus-json for HDR10+ JSON dynamic metadata input. To merge it locally, do the following:

git clone https://github.com/xiph/rav1e.git
cd rav1e
git reset --hard [release commit]
git fetch origin pull/3000/head:HDR10+

Now the patch should be applied, and you may build as usual.

Usage​

For AV1 encoding, rav1e has very sane defaults. It is very hard to go wrong with parameters if you modify as few as possible.

tip

To convert cq-level in aomenc and crf in SVT-AV1 to rav1e's quantizer values, multiply by 4. For example, --cq-level 20 equals to --quantizer 80.

Basic usage
rav1e -i input.y4m -o output.ivf --quantizer 60 --photon-noise 8
Basic usage with FFmpeg piping, 10bit input
ffmpeg -i input.mkv -pix_fmt yuv420p10le -strict -2 -f yuv4mpegpipe - | rav1e - -o output.ivf --quantizer 80 --photon-noise 8
Basic usage with FFmpeg piping, 10bit input and assuming 4K
ffmpeg -i input.mkv -pix_fmt yuv420p10le -strict -2 -f yuv4mpegpipe - | rav1e - -o output.ivf --quantizer 68 --tile-columns 2 --tile-rows 1 --photon-noise 8

Tips & Tricks​

  1. Use 2x1 tiles or tile-columns 2 and tile-rows 1 for 4K (2160p) encoding, this will help with both encoding and decoding speeds.