Skip to content

rav1e

rav1e is a command line application for encoding AV1 written in Rust & Assembly co-developed by Xiph.org and Mozilla.

rav1e is available in FFmpeg via librav1e. You can check if you have it by running ffmpeg -h encoder=librav1e. You can input non-FFmpeg standard rav1e parameters via -rav1e-params. Please keep in mind that unless you build FFmpeg yourself, you are using the most vanilla version of rav1e.

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.

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.

Terminal window
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:

Terminal window
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.

AV1

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

Basic usage:

Terminal window
rav1e -i input.y4m -o output.ivf --quantizer 60 --photon-noise 8

Basic usage with FFmpeg piping, 10bit input:

Terminal window
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:

Terminal window
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
  1. Use 2x1 tiles or tile-columns 2 and tile-rows 1 for 4K (2160p) encoding, this will help with both encoding and decoding.