Skip to content
rust-avPublic

About

Cross-platform command-line AV1 / VP9 / HEVC / H264 encoding framework with per scene quality encoding

Topics

Resources

Security policy

Stars

2.0k stars

Watchers

35 watching

Forks

Repository files navigation

Av1an

Demonstration of the California Condor TUI

Discord server CI tests

Buy Me A Coffee

Av1an is a video encoding Rust library and command-line tool designed to be as fast as possible, easy to use, and extremely extensible. It supports a wide variety of encoders and tools to produce high quality videos.

Branch changes and legacy Av1an

The default branch is main. main now includes the Condor rewrite of Av1an, whose executable is av1an. The v0 branch contains the latest stable release of legacy Av1an.

Features

  • Support for Windows, Linux, and MacOS
  • Docker builds (published legacy Av1an images may not contain Condor)
  • Hyper-scalable video encoding
  • Cancel and resume at any time without losing progress
  • Real-time progress feedback
  • Terminal User Interface (TUI)
  • Modular architecture for custom workflows

Video Filtering

Av1an is built with FFMS2 for simple decoding but also supports VapourSynth for advanced filtering and analysis.

  • Decode the input video with either the FFMS2, BestSource, L-SMASH-Works, or DGDecNV VapourSynth plugin
  • Pass a VapourSynth Python script (.vpy or .py) as the input
  • Apply custom variables to the VapourSynth script
  • Output a specific track/index from the VapourSynth script
  • Apply additional VapourSynth filters such as Trim, Crop, Resize, and Splice

Video Encoding

Av1an supports the following encoder executables:

  • aomenc - Alliance for Open Media reference AV1 encoder
  • SvtAv1EncApp - Scalable Video Technology for AV1 AV1 encoder
  • rav1e - Rust AV1 encoder
  • avmenc - Alliance for Open Media AOM Video Model reference AV2 encoder
  • vpxenc - WebM VP8/VP9 encoder
  • x264 - x264 H.264 encoder
  • x265 - x265 H.265 encoder
  • vvenc - Fraunhofer Versatile Video Encoder H.266 encoder
  • FFmpeg - FFmpeg

Video Analysis

Av1an can analyze video properties and qualities to improve encoded video quality by:

  • Splitting the video into contiguous scenes
  • Scaling Photon Noise ISO based on the level of noise/grain in each scene
  • Finding the most efficient quantizer for each scene for a given quality target
  • Choosing the appropriate encoding speed for each scene

Getting Started

Installation

The CLI's Cargo package is california-condor; its executable is av1an. As of 2026-11-13, this package is unpublished on crates.io, and the checked upstream releases do not provide Condor ZIPs. Use a checkout of main containing this workspace; v0 contains legacy Av1an. After installing the build prerequisites, run from the repository root:

cargo install --locked --path california-condor --bin av1an

Windows: this copies only av1an.exe, not its required DLLs. Follow the Windows runtime/build instructions instead of using this command alone.

See Installation for package availability, future release bundles and runtime dependencies, and Docker for upstream image policy and local Condor builds.

Usage

California Condor CLI

The Av1an CLI, California Condor, uses a single JSON configuration file to manage the entire encoding process. Each step can also be executed individually with its own command. You can use --help on each command for details on how to use them (e.g. av1an --help, av1an detect-scenes --help, av1an target-quality --help). For a complete guide on using California Condor, see the California Condor README and guide. For a quick start, see the example below.

Encode a 1080p 10-bit AV1 video with Film Grain Synthesis using rav1e. Use FFMS2 to decode the input. Downscale the scene detection input to 540p to detect scenes faster. Target a SSIMULACRA 2 quality score of 85 quickly. Use mkvmerge to concatenate the output video.

av1an \
    --temp "./deletemelater" \
    --logs "./deletemelater/condor.log" \
    --config-file "./deletemelater/config.json" \
    --input "bird takeoff.mp4" \
    --output "bird takeoff.mkv" \
    --decoder "vs-ffms2" \
    --filters "resize:scaler=bilinear;width=1920;height=1080;format=yuv420p10le" \
    --scd-filters "resize:scaler=bilinear;width=540;height=960;" \
    --encoder "rav1e" \
    --params "--speed 4" \
    --photon-noise 800 \
    --target-metric "ssimulacra2" \
    --target 85 \
    --target-profile "fast" \
    --concat "mkvmerge"

Andean Condor Library

The Av1an library, Andean Condor, consists of the following components: Input, Output, Encoder, Scene, and Sequence. These components are managed with a single Condor instance. See the library example and local dependency setup; andean-condor is not yet published on crates.io.

Library cancellation

Keep one andean_condor::utils::cancellation::Cancellation and pass it through Input::ensure_indexed_cancel, AndeanCondor::process_all_cancel (or process_one_cancel), and Sequence::execute_cancel. Clone the token for the application's cancellation controls; do not create a token per pass.

use andean_condor::utils::cancellation::Cancellation;

let cancellation = Cancellation::default();
let controls = cancellation.clone();
controls.request()?; // Graceful: finish admitted scenes, including both passes.
controls.request()?; // Forced: stop feeds, kill owned trees, join workers, reap.

Direct encoder, filter, zone/probe, indexing, and concat APIs also have _cancel entry points. Fresh jobs do not admit work after cancellation. Errors retain a typed Cancelled::Forced cause through anyhow context. Existing Arc<AtomicBool> entry points remain available but cannot request force. Custom Sequence implementations must override execute_cancel to support forced child teardown; the default bridge exposes only the legacy flag. For manual scene pipelines, call root.admit()? once and pass that view through all passes/filter setup; keep the root for admitting the next scene. Custom AndeanCondor implementations must supply the new process_one_cancel/process_all_cancel methods.

Native decoder/plugin calls already in progress must finish; arbitrary hung foreign calls cannot be interrupted safely. Unix children use private process groups; Windows uses suspended creation and kill-on-close Job Objects (native Windows acceptance remains pending). Deliberately escaping a managed group/job is not supported. These library APIs do not register signals or change the CLI's keyboard, terminal-exit, or exit-code behavior.

Unix hosts must not externally reap managed children or enable SIGCHLD=SIG_IGN / SA_NOCLDWAIT while their guards are active. Auto-reap dispositions are rejected before spawn; detected lost ownership is reported without signaling stale IDs. This check cannot protect against concurrent external waiters. Use piped or null stdin for managed children: inherited terminal input may stop a background group.

Developing

See Developing and Contributing for a guide on developing Av1an and preparing for a Pull Request.

About

Cross-platform command-line AV1 / VP9 / HEVC / H264 encoding framework with per scene quality encoding

Topics

Resources

Security policy

Stars

2.0k stars

Watchers

35 watching

Forks

Releases

Packages

Used by

Contributors

Languages