FFmpeg AV1 Encoding: libaom, SVT-AV1, and rav1e

FFmpeg delivers versatile AV1 video compression by acting as a unified wrapper around three external open-source libraries: libaom-av1, libsvtav1, and librav1e. Through its libavcodec subsystem, FFmpeg abstracts the unique APIs, memory models, and parameter formats of each encoder into standardized command-line flags while maintaining access to library-specific tuning options. This guide details how FFmpeg interfaces with each library, compares their technical designs, and explains how to configure them for general-purpose encoding workflows.

The libavcodec Abstraction Layer

FFmpeg does not implement native AV1 encoding logic directly. Instead, it relies on external C and Rust libraries enabled at compile time using flags such as --enable-libaom, --enable-libsvtav1, and --enable-librav1e.

The libavcodec architecture provides generic translation mappings for cross-codec parameters:

  • Target bitrate (-b:v) and rate control modes (CRF via -crf, CQP via -qp).
  • GOP structure and keyframe intervals (-g, -keyint_min).
  • Pixel format handling via the swscale filter, typically converting inputs to high-efficiency formats like yuv420p10le (10-bit).

Because AV1 encoders differ significantly in how they handle speed presets, threading, and frame analysis, FFmpeg supplements standard options with encoder-specific options (-cpu-used, -preset, -speed) and raw parameter strings (-aom-params, -svtav1-params, -rav1e-params).


libaom-av1: The Reference Standard

Developed by the Alliance for Open Media (AOMedia), libaom serves as the reference implementation for the AV1 format. Within FFmpeg, it is invoked using -c:v libaom-av1.

  • Architecture: Focuses on pure compression efficiency, algorithmic completeness, and standards compliance. It features comprehensive research tools and advanced rate control models.
  • Performance Profile: Computationally expensive and historically slow, though recent updates have improved multi-threading (-row-mt 1).
  • Key FFmpeg Parameters:
    • -crf: Sets Constant Rate Factor (recommended range: 18–32).
    • -b:v 0: Enables pure CRF mode when paired with a target CRF.
    • -cpu-used: Controls the speed-versus-efficiency trade-off (values from 0 to 8, where higher values encode faster).
  • Use Case: Best suited for high-fidelity archival, reference quality comparisons, and non-time-critical encoding.

SVT-AV1: Production and Multi-Core Scaling

Initially created by Intel and now maintained under the AOMedia umbrella, SVT-AV1 (Scalable Video Technology for AV1) is designed specifically for real-world production environments and multi-threaded CPU architectures. It is invoked via -c:v libsvtav1.

  • Architecture: Uses a parallel processing pipeline optimized for modern multi-core x86 and ARM processors, dividing analysis across processes, tiles, and segments with high thread utilization.
  • Performance Profile: Delivers the fastest encoding speeds among the three libraries while maintaining high compression ratios, making it the practical choice for most general-purpose applications.
  • Key FFmpeg Parameters:
    • -crf: Sets rate control (standard range: 20–35).
    • -preset: Determines encoding speed and quality on a scale from 0 to 13 (lower values yield higher quality at lower speeds; presets 4 through 7 are commonly used for general-purpose tasks).
    • -svtav1-params: Passes custom options, such as tune=0 (visual quality) or specific GOP settings.
  • Use Case: Video-on-Demand (VOD) services, desktop transcode queues, and production pipelines requiring efficient CPU utilization.

rav1e: Memory-Safe and Low-Latency Encoding

Developed by the Xiph.Org Foundation and Mozilla, rav1e is written primarily in Rust with optimized Assembly kernels (x86 SIMD and ARM NEON). FFmpeg interacts with it through C Foreign Function Interface (FFI) bindings using the -c:v librav1e codec flag.

  • Architecture: Emphasizes memory safety, predictable resource management, and clean modular code design.
  • Performance Profile: Offers clean parallelization and consistent real-time delivery modes, though generally exhibits higher complexity overhead than SVT-AV1 at equivalent quality levels.
  • Key FFmpeg Parameters:
    • -speed: Controls the operational speed profile (range from 0 to 10, with 10 optimized for fast/real-time processing).
    • -qp: Direct quantization control for constant-quality configurations.
    • -rav1e-params: Forwards native flags, such as tuning for psychovisual metrics or tile configurations.
  • Use Case: Live-streaming prototypes, security-critical infrastructure requiring memory guarantees, and software stacks integrated with Rust-based processing components.

Command Comparison for General-Purpose Transcoding

To convert a source file to an 10-bit AV1 output using each encoder at balanced quality settings, FFmpeg applies the following structures:

Using SVT-AV1:

ffmpeg -i input.mp4 -c:v libsvtav1 -crf 28 -preset 6 -pix_fmt yuv420p10le -c:a copy output_svt.mp4

Using libaom-av1:

ffmpeg -i input.mp4 -c:v libaom-av1 -crf 28 -b:v 0 -cpu-used 4 -row-mt 1 -pix_fmt yuv420p10le -c:a copy output_aom.mp4

Using rav1e:

ffmpeg -i input.mp4 -c:v librav1e -qp 80 -speed 6 -pix_fmt yuv420p10le -c:a copy output_rav1e.mp4

Through this modular architecture, FFmpeg gives users the flexibility to choose between libaom for maximum compression, SVT-AV1 for balanced throughput and high performance, and rav1e for memory safety and predictable execution.