MCPcopy Index your code
hub / github.com/alexheretic/ab-av1

github.com/alexheretic/ab-av1 @v0.11.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.11.4 ↗ · + Follow
231 symbols 431 edges 25 files 48 documented · 21%
What it actually does AI analysis from the code graph — generated when you open this
loading…
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 to determine the best --crf value * ffmpeg to encode using the settings

ab-av1 auto-encode [OPTIONS] -i <INPUT> --preset <PRESET> --min-vmaf <MIN_VMAF>

Command: crf-search

Interpolated binary search using 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 <INPUT> --preset <PRESET> --min-vmaf <MIN_VMAF>

Notable options

  • --min-xpsnr <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 <INPUT> --crf <CRF> --preset <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 <INPUT> --crf <CRF> --preset <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 <REFERENCE> --distorted <DISTORTED>

Command: xpsnr

Full XPSNR score calculation, distorted file vs reference file. Works with videos and images.

ab-av1 xpsnr --reference <REFERENCE> --distorted <DISTORTED>

JSON output

See --stdout-format json docs.

Install

Arch Linux

Available in the AUR.

Linux

Pre-built statically linked x86_64-unknown-linux-musl binary included in the latest release.

Windows

Pre-built ab-av1.exe included in the latest release.

Using cargo

Latest release

cargo install ab-av1

Latest code direct from git

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.

Extension points exported contracts — how you extend this code

SmallDuration (Interface)
Helper trait for durations under 584942 years or so. [1 implementers]
src/command.rs
CommandExt (Interface)
(no doc) [1 implementers]
src/process.rs
VCodecSpecific (Interface)
(no doc) [1 implementers]
src/ffmpeg.rs
EncodeResults (Interface)
(no doc) [1 implementers]
src/command/sample_encode.rs
Exited (Interface)
(no doc) [1 implementers]
src/process/child.rs
ArgString (Interface)
(no doc) [1 implementers]
src/process.rs

Core symbols most depended-on inside this repo

arg2
called by 31
src/process.rs
push
called by 24
src/process.rs
as_str
called by 19
src/command/args/encode.rs
arg2_opt
called by 10
src/process.rs
probe
called by 8
src/ffprobe.rs
hash
called by 8
src/command/args.rs
single_score
called by 7
src/command/sample_encode.rs
print_attempt
called by 5
src/command/crf_search.rs

Shape

Method 92
Function 89
Class 28
Enum 16
Interface 6

Languages

Rust100%

Modules by API surface

src/process.rs31 symbols
src/command/args/encode.rs29 symbols
src/command/sample_encode.rs26 symbols
src/command/args/vmaf.rs23 symbols
src/command/crf_search.rs18 symbols
src/process/child.rs11 symbols
src/ffprobe.rs11 symbols
src/ffmpeg.rs10 symbols
src/command/args.rs9 symbols
src/command/xpsnr.rs8 symbols
src/command/sample_encode/cache.rs8 symbols
src/xpsnr.rs7 symbols

For agents

$ claude mcp add ab-av1 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page