AV1 video encoding tool with fast VMAF sampling & automatic encoder crf calculation. Uses ffmpeg, svt-av1 & vmaf.

Also supports other ffmpeg compatible encoders like libx265 & libx264.
Automatically determine the best crf to deliver the --min-vmaf and use it to encode a video or image.
Two phases:
ab-av1 auto-encode [OPTIONS] -i <INPUT> --preset <PRESET> --min-vmaf <MIN_VMAF>
Interpolated binary search using sample-encode to find the best
crf value delivering --min-vmaf & --max-encoded-percent.
Outputs:
ab-av1 crf-search [OPTIONS] -i <INPUT> --preset <PRESET> --min-vmaf <MIN_VMAF>
--min-xpsnr <MIN_XPSNR> may be used as an alternative to VMAF.Encode short video samples of an input using provided crf & preset. This is much quicker than full encode/vmaf run.
Outputs:
ab-av1 sample-encode [OPTIONS] -i <INPUT> --crf <CRF> --preset <PRESET>
--xpsnr specifies calculation of XPSNR score instead of VMAF.Invoke ffmpeg to encode a video or image.
ab-av1 encode [OPTIONS] -i <INPUT> --crf <CRF> --preset <PRESET>
These also apply to auto-encode.
--verify checks the finished encode before it is moved into place: decodes it in full
failing on decode errors (--verify-decode) & fails if its duration does not match the
input within 2s (--verify-duration). Either check can be enabled on its own.
The encoder can otherwise exit successfully having written a damaged or cut short result,
e.g. from a truncated input.--fail-fast stops the encode at the first ffmpeg reported error instead of writing a
damaged result.Full VMAF score calculation, distorted file vs reference file. Works with videos and images.
ab-av1 vmaf --reference <REFERENCE> --distorted <DISTORTED>
Full XPSNR score calculation, distorted file vs reference file. Works with videos and images.
ab-av1 xpsnr --reference <REFERENCE> --distorted <DISTORTED>
See --stdout-format json docs.
Available in the AUR.
Pre-built statically linked x86_64-unknown-linux-musl binary included in the latest release.
Pre-built ab-av1.exe included in the latest release.
Latest release
cargo install ab-av1
Latest code direct from git
cargo install --git https://github.com/alexheretic/ab-av1
ffmpeg newer than git-2022-02-24 with libsvtav1, libvmaf, libopus enabled.
ffmpeg should be in $PATH.
Enable debug logs by setting env var RUST_LOG=ab_av1=debug. This includes all ffmpeg calls.
$ RUST_LOG=ab_av1=debug ab-av1 auto-encode -i vid.mkv
Maintained with latest stable rust.
Rust
99.3%
AV1 video encoding tool with fast VMAF sampling & automatic encoder crf calculation. Uses ffmpeg, svt-av1 & vmaf.

Also supports other ffmpeg compatible encoders like libx265 & libx264.
Automatically determine the best crf to deliver the --min-vmaf and use it to encode a video or image.
Two phases:
ab-av1 auto-encode [OPTIONS] -i <INPUT> --preset <PRESET> --min-vmaf <MIN_VMAF>
Interpolated binary search using sample-encode to find the best
crf value delivering --min-vmaf & --max-encoded-percent.
Outputs:
ab-av1 crf-search [OPTIONS] -i <INPUT> --preset <PRESET> --min-vmaf <MIN_VMAF>
--min-xpsnr <MIN_XPSNR> may be used as an alternative to VMAF.Encode short video samples of an input using provided crf & preset. This is much quicker than full encode/vmaf run.
Outputs:
ab-av1 sample-encode [OPTIONS] -i <INPUT> --crf <CRF> --preset <PRESET>
--xpsnr specifies calculation of XPSNR score instead of VMAF.Invoke ffmpeg to encode a video or image.
ab-av1 encode [OPTIONS] -i <INPUT> --crf <CRF> --preset <PRESET>
These also apply to auto-encode.
--verify checks the finished encode before it is moved into place: decodes it in full
failing on decode errors (--verify-decode) & fails if its duration does not match the
input within 2s (--verify-duration). Either check can be enabled on its own.
The encoder can otherwise exit successfully having written a damaged or cut short result,
e.g. from a truncated input.--fail-fast stops the encode at the first ffmpeg reported error instead of writing a
damaged result.Full VMAF score calculation, distorted file vs reference file. Works with videos and images.
ab-av1 vmaf --reference <REFERENCE> --distorted <DISTORTED>
Full XPSNR score calculation, distorted file vs reference file. Works with videos and images.
ab-av1 xpsnr --reference <REFERENCE> --distorted <DISTORTED>
See --stdout-format json docs.
Available in the AUR.
Pre-built statically linked x86_64-unknown-linux-musl binary included in the latest release.
Pre-built ab-av1.exe included in the latest release.
Latest release
cargo install ab-av1
Latest code direct from git
cargo install --git https://github.com/alexheretic/ab-av1
ffmpeg newer than git-2022-02-24 with libsvtav1, libvmaf, libopus enabled.
ffmpeg should be in $PATH.
Enable debug logs by setting env var RUST_LOG=ab_av1=debug. This includes all ffmpeg calls.
$ RUST_LOG=ab_av1=debug ab-av1 auto-encode -i vid.mkv
Maintained with latest stable rust.
Rust
99.3%