https://github.com/alexheretic/ab-av1
AV1 re-encoding using ffmpeg, svt-av1 & vmaf.
https://github.com/alexheretic/ab-av1
Last synced: 7 days ago
JSON representation
AV1 re-encoding using ffmpeg, svt-av1 & vmaf.
- Host: GitHub
- URL: https://github.com/alexheretic/ab-av1
- Owner: alexheretic
- License: mit
- Created: 2022-01-27T00:12:12.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-28T02:47:07.000Z (18 days ago)
- Last Synced: 2025-03-31T19:03:14.045Z (14 days ago)
- Language: Rust
- Size: 543 KB
- Stars: 560
- Watchers: 18
- Forks: 32
- Open Issues: 51
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- stars - alexheretic/ab-av1 - AV1 re-encoding using ffmpeg, svt-av1 & vmaf. (Rust)
README
# ab-av1
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.
### Command: auto-encode
Automatically determine the best crf to deliver the `--min-vmaf` and use it to encode a video or image.Two phases:
* [crf-search](#command-crf-search) to determine the best --crf value
* ffmpeg to encode using the settings```
ab-av1 auto-encode [OPTIONS] -i --preset --min-vmaf
```### Command: crf-search
Interpolated binary search using [sample-encode](#command-sample-encode) to find the best
crf value delivering `--min-vmaf` & `--max-encoded-percent`.Outputs:
* Best crf value
* Mean sample VMAF score
* Predicted full encode size
* Predicted full encode time```
ab-av1 crf-search [OPTIONS] -i --preset --min-vmaf
```#### Notable options
* `--min-xpsnr ` may be used as an alternative to VMAF.### Command: sample-encode
Encode short video samples of an input using provided **crf** & **preset**.
This is much quicker than full encode/vmaf run.Outputs:
* Mean sample VMAF score
* Predicted full encode size
* Predicted full encode time```
ab-av1 sample-encode [OPTIONS] -i --crf --preset
```#### Notable options
* `--xpsnr` specifies calculation of XPSNR score instead of VMAF.### Command: encode
Invoke ffmpeg to encode a video or image.```
ab-av1 encode [OPTIONS] -i --crf --preset
```### Command: vmaf
Full VMAF score calculation, distorted file vs reference file.
Works with videos and images.* Auto sets model version (4k or 1k) according to resolution.
* Auto sets _n_threads_ to system threads.
* Auto upscales lower resolution videos to the model.```
ab-av1 vmaf --reference --distorted
```### Command: xpsnr
Full XPSNR score calculation, distorted file vs reference file.
Works with videos and images.```
ab-av1 xpsnr --reference --distorted
```## Install
### Arch Linux
Available in the [AUR](https://aur.archlinux.org/packages/ab-av1).### Linux
Pre-built statically linked x86_64-unknown-linux-musl binary included in the [latest release](https://github.com/alexheretic/ab-av1/releases/latest).### Windows
Pre-built **ab-av1.exe** included in the [latest release](https://github.com/alexheretic/ab-av1/releases/latest).### Using cargo
Latest release
```sh
cargo install ab-av1
```Latest code direct from git
```sh
cargo install --git https://github.com/alexheretic/ab-av1
```### Requirements
**ffmpeg** newer than git-2022-02-24 with libsvtav1, libvmaf, libopus enabled.`ffmpeg` should be in `$PATH`.
## Debug
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
```## Minimum supported rust compiler
Maintained with [latest stable rust](https://gist.github.com/alexheretic/d1e98d8433b602e57f5d0a9637927e0c).