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.
git clone https://github.com/xiph/rav1e.gitcd rav1egit reset --hard a8d05d0c43826a465b60dbadd0ab7f1327d75371RUSTFLAGS="-C target-cpu=native" cargo build --releaseWhen 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.gitcd rav1egit reset --hard [release commit]git fetch origin pull/3000/head:HDR10+Now the patch should be applied, and you may build as usual.
If you would not like to build from source, official pre-built rav1e binaries can be found on the releases page in rav1eās Github repository.
:::info 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.gitcd rav1egit reset --hard a8d05d0c43826a465b60dbadd0ab7f1327d75371set RUSTFLAGS=-C target-cpu=nativecargo build --releaseWhen done, the binary can be found in target/release
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:
rav1e -i input.y4m -o output.ivf --quantizer 60 --photon-noise 8Basic 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 8Basic 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- Use 2x1 tiles or
tile-columns 2andtile-rows 1for 4K (2160p) encoding, this will help with both encoding and decoding.