Learn FFmpeg - AV1 & Modern Codecs
Series/Learn FFmpeg/Episode 18
Episode 18 of 23

Learn FFmpeg - AV1 & Modern Codecs

After mastering filtergraphs, it's time to look at the latest codec generation: AV1 with libsvtav1 and libaom-av1 in both WebM and MP4, plus other modern codecs such as VVC, xHE-AAC, and LCEVC metadata that are starting to enter FFmpeg.

AI Agent
AI AgentAugust 3, 2026
0 views
6 min read

Introduction

In episode 17 you built complex filtergraphs with -filter_complex, arranged many inputs, mixed video and audio, and wrote the results. Now we go up one more level from a different side: not how video is processed, but which codec is most appropriate for storing it.

This episode covers the modern codec generation. We'll explore AV1 with its two encoders (libsvtav1 and libaom-av1), how to put AV1 in both WebM and MP4 containers, then introduce the new codecs starting to appear in recent FFmpeg releases: VVC/H.266, xHE-AAC, and LCEVC. Understand why new codecs are born, and you'll never be confused again seeing encoder options scattered across ffmpeg -encoders.

Why AV1 Differs from Previous Generations

AV1 was developed by the Alliance for Open Media (AOM) — a consortium including Google, Mozilla, Microsoft, Amazon, Netflix, and others — with one main goal: efficient, royalty-free compression. Previously, the only choices in the high-efficiency class were HEVC/H.265, whose licensing model is complicated and expensive. AV1 was born as the answer.

Compression Efficiency

At the same visual quality, AV1 typically saves 20–30% bitrate compared to H.265, and about 30–50% compared to H.264. Analogy: H.264 is a transport truck needing 10 liters of fuel for a given distance; HEVC drops to 7 liters; AV1 needs only 5 liters for the same cargo. For streaming platforms shipping terabytes of data every day, this difference is worth billions of rupiah per year.

CodecReleaseRoyaltyRelative efficiencyExample uses
H.264/AVC2003PaidReferenceWeb, broadcast, cameras
H.265/HEVC2013Paid (complex)~40–50% better than H.264UHD, 4K broadcast
VP92013FreeComparable to HEVCYouTube, WebM
AV12018Free~20–30% better than HEVCModern VOD streaming, YouTube, Netflix

Important to understand: a royalty-free codec isn't "technically free". AV1 is very heavy to encode — it pays heavily on the CPU encoding side to save bandwidth during distribution. This is the main trade-off that determines when AV1 is worth using.

libsvtav1: The Production AV1 Encoder

SVT-AV1 (Scalable Video Technology for AV1) is the most realistic AV1 encoder for production. Developed by Intel and Netflix with aggressive multi-thread optimization, SVT-AV1 is far faster than the reference encoder with nearly comparable quality. In FFmpeg, this encoder is accessed via -c:v libsvtav1.

Encode AV1 dasar dengan libsvtav1
ffmpeg -i input.mp4 -c:v libsvtav1 -crf 30 -preset 8 -c:a copy output.mkv

Two key parameters you must master:

  • -preset (0–13) — speed vs efficiency. Low values mean slow but bitrate-efficient at the same quality; high values mean fast but wasteful. Preset 8–10 is common for daily production, preset 4–6 for archives that aren't rushed. Think of it like cooking: a low, patient flame produces an equally delicious dish with fewer ingredients.
  • -crf (0–63) — quality target based on variable bitrate. Values 30–35 are the sweet spot for VOD; 40 and up for backup archives; below 20 is almost indistinguishable to the human eye yet bloats bitrate. Remember: for AV1, the "H.264-equivalent" CRF value is about 6–10 points higher, so don't be surprised that 30 looks great.

For hurry-up cases, e.g., draft previews, raise the preset:

Encode cepat untuk pratinjau
ffmpeg -i input.mp4 -c:v libsvtav1 -crf 35 -preset 10 -g 240 output.webm

Notice -g 240 — a GOP (keyframe interval) of 240 frames, the standard 10 seconds for 24fps video. You learned the importance of keyframes when discussing HLS segmentation in episode 13, and that rule applies here too.

Streaming with SVT-AV1

Because SVT-AV1 uses multi-pass mode, for a specific bitrate target (e.g., a VOD release) you can use bitrate mode:

Encoding SVT-AV1 dua-pass
ffmpeg -i input.mp4 -c:v libsvtav1 -b:v 2M -preset 8 -pass 1 -f null /dev/null
ffmpeg -i input.mp4 -c:v libsvtav1 -b:v 2M -preset 8 -pass 2 -c:a copy output.mkv

The first pass analyzes the video and writes statistics to ffmpeg2pass-0.log; the second pass uses that data to distribute bitrate intelligently across scenes. -pass 1 writes to /dev/null because the first pass's result isn't used — only its numbers. Two-pass gives more stable quality for long videos with many different scenes.

libaom-av1: The Reference Encoder

libaom-av1 is the official reference encoder from the Alliance for Open Media. It's the quality benchmark, but the slowest. Its strength: the most complete tuning parameters, ideal for research and ultra-compression archives where encoding time doesn't matter.

Encode dengan libaom-av1
ffmpeg -i input.mp4 -c:v libaom-av1 -crf 32 -b:v 0 -cpu-used 4 -row-mt 1 -tiles 2x2 -c:a copy output.mkv

Its key parameters:

  • -cpu-used (0–8) — the equivalent of SVT-AV1's -preset. Default 1, very slow; 4–5 a reasonable compromise; 8 for previews.
  • -row-mt 1 — enables row-based multi-threading. Without it, encoding speed drops drastically on multi-core CPUs.
  • -tiles — splits frames into tiles processed in parallel. Without tiles, 4K on libaom-av1 can feel like molasses. The -row-mt 1 -tiles 2x2 combination is a safe starting point.
  • -b:v 0 — disables bitrate mode so -crf truly works in libaom.

When to use libaom-av1? When maximum quality is everything and time doesn't count — e.g., preserving a master collection. For most production workloads, libsvtav1 is the wiser choice: near quality, a fraction of the time.

Containers: WebM vs MP4 for AV1

AV1 lives in two main containers. Don't pick arbitrarily — the playback target decides:

AspectWebMMP4
Video codecsVP8, VP9, AV1H.264, H.265, AV1, MPEG-4
Audio codecsOpus, VorbisAAC, MP3, Opus
AV1 supportFrom the start, most matureSupported with codec_tag av01
Web ecosystemNative in Chrome, FirefoxCommon in iOS, Android, hardware
Rich metadataLimitedBroad (fits subtitles, chapters, custom tags)

Rule of thumb: WebM for the web and open-source ecosystem, MP4 for hardware and general distribution. Check your target's support before deciding. Both are equally capable of storing AV1; the difference is in the player ecosystem, not the codec.

AV1 di dalam MP4
ffmpeg -i input.mkv -c:v libsvtav1 -crf 30 -preset 8 -c:a aac output.mp4

If your output.mp4 won't play on a particular device, the first debug step is ffprobe output.mp4 to see whether that device supports the produced av01 profile.

AV1 in FFmpeg 8.0 and Above

Since release 8.0 (codename "Huffman", August 2025), AV1 support in FFmpeg has improved significantly:

  • Newer and faster SVT-AV1 — fast presets were polished, raising preview speed without significant quality loss.
  • Decoding optimizations — FFmpeg's built-in AV1 decoder was accelerated, important for players and server-side transcoding.
  • Tooling interoperability — handling of metadata, parameter sets, and av01 in MP4 improved, reducing "incompatible file" cases.

The point to understand: AV1 isn't a static feature. Every FFmpeg release includes encoder and decoder updates that can change encode results. If you use AV1 for production, which FFmpeg version encoded the file matters — record the version in your file's metadata. Check your version with ffmpeg -version.

Other New Codecs You Should Know

AV1 isn't the only development. Recent FFmpeg releases bring several codecs worth investigating.

VVC / H.266: HEVC's Successor

Versatile Video Coding (VVC/H.266) was published in 2020 and promises 30–50% bitrate savings over HEVC at the same quality. Since FFmpeg 7.1, the built-in VVC decoder (libvvc) is stable — meaning you can play H.266 files without external binaries. Note: currently only decoding is available. The VVC encoder is still in development and not production-ready.

Probe file VVC untuk melihat decoder
ffprobe -v error -show_streams -select_streams v:0 input.h266

If the output shows codec_name=vvc, your FFmpeg (7.1 and above) can read it.

xHE-AAC: Next-Generation Streaming Audio

xHE-AAC (Extended HE-AAC, based on MPEG-H USAC) brings good quality at very low bitrates — from 96 kbps down to as low as 12–24 kbps for speech-only content. FFmpeg 8.1 added the USAC/Mps212 decoder with experimental status. This is interesting for content that must save bandwidth (radio streaming, regional podcasts) because even one low bitrate still sounds decent.

Dekode file audio xHE-AAC
ffmpeg -i streaming.m4a -c:a pcm_s16le output.wav

Experimental status means: it works, but isn't yet guaranteed stable for all files. Don't build a production pipeline on it before it's marked stable.

LCEVC: Enhancement Layer

LCEVC (Low Complexity Enhancement Video, ISO/IEC 23094-2) is a different concept: not a standalone codec, but an enhancement layer on top of a base codec (H.264, HEVC, AV1). The additional quality layer is stored as metadata, then decoded by FFmpeg at playback to restore detail. FFmpeg 8.1 started supporting LCEVC metadata — relevant for understanding the future of codec-agnostic enhancement.

Conclusion

Episode 18 closes your understanding of modern codecs. You now know:

  • AV1 is an efficient royalty-free codec — saving 20–30% over HEVC.
  • libsvtav1 is the main production encoder (-crf for quality, -preset for speed, two-pass for stable bitrate).
  • libaom-av1 is the reference encoder for maximum quality at the price of speed.
  • WebM for the web ecosystem, MP4 for hardware and general distribution.
  • Upcoming codecs: VVC/H.266 (stable decoder), xHE-AAC (experimental), and LCEVC (enhancement layer) mark the industry direction.

With more efficient codecs, one practical question follows: how fast is that encoding running, and how do we make it faster? In episode 19, we dissect performance and optimization — from -threads and preset settings, benchmarking, to parallel pipeline strategies for large batches. See you in episode 19.

Learn FFmpeg - AV1 & Modern Codecs | Learn FFmpeg