What You’ll Learn
- What AV1 is and how it compares to H.264 and H.265
- When to use libsvtav1 (fast) vs libaom-av1 (high compression)
- CRF mode and bitrate-controlled encoding
- 2-pass encoding for precise bitrate targets
- Container and audio codec choices
- Browser compatibility and web delivery settings
Tested with: FFmpeg 7.0
Platform: Windows / macOS / Linux
What is AV1?
AV1 (AOMedia Video 1) is an open, royalty-free video codec developed by the Alliance for Open Media.
| Codec | Relative File Size | Encoding Speed | Browser Support |
|---|---|---|---|
| H.264 (libx264) | 100% (baseline) | Fast | Nearly universal |
| H.265 (libx265) | ~50% | Medium | Safari, Edge |
| AV1 (libsvtav1) | ~35–45% | Medium | Chrome, Firefox, Edge |
| AV1 (libaom-av1) | ~30–40% | Slow | Chrome, Firefox, Edge |
AV1 achieves half the file size of H.264 at equivalent quality. Major platforms like YouTube, Netflix, and Twitch are actively deploying AV1.
Check Available Encoders
ffmpeg -encoders 2>/dev/null | grep av1
Expected output:
V..... libsvtav1 SVT-AV1(Scalable Video Technology for AV1) encoder (codec av1)
V..... libaom-av1 libaom AV1 (codec av1)
If libsvtav1 is missing, install the latest FFmpeg from your package manager or the official FFmpeg website.
libsvtav1 — Fast AV1 Encoding (Recommended)
Basic Command (CRF mode)
ffmpeg -i input.mp4 -c:v libsvtav1 -crf 35 -preset 6 -c:a libopus -b:a 128k output.webm
| Parameter | Description |
|---|---|
-c:v libsvtav1 | Use SVT-AV1 encoder |
-crf 35 | Constant quality (lower = better quality, range 0–63) |
-preset 6 | Speed preset (0 = slow/high quality, 13 = fast/lower quality) |
-c:a libopus | Opus audio (ideal for AV1+WebM) |
CRF Values (libsvtav1)
| CRF | Quality | Use Case |
|---|---|---|
| 20–25 | Near-lossless | Archiving, master files |
| 28–35 | High quality | Distribution, streaming |
| 35–42 | Standard quality | Web delivery, preview |
| 43–55 | Low quality | Strict size constraints |
Preset Selection
# Quality-first (slower)
ffmpeg -i input.mp4 -c:v libsvtav1 -crf 30 -preset 2 -c:a libopus -b:a 128k output.webm
# Balanced (recommended default)
ffmpeg -i input.mp4 -c:v libsvtav1 -crf 30 -preset 6 -c:a libopus -b:a 128k output.webm
# Speed-first (real-time use)
ffmpeg -i input.mp4 -c:v libsvtav1 -crf 30 -preset 10 -c:a libopus -b:a 128k output.webm
Output to MP4 Container
ffmpeg -i input.mp4 -c:v libsvtav1 -crf 35 -preset 6 -c:a aac -b:a 128k output_av1.mp4
Note: AV1+MP4 has more limited compatibility than AV1+WebM.
libaom-av1 — High-Compression AV1
libaom-av1 is the AV1 reference encoder. It produces slightly smaller files than libsvtav1 but is significantly slower.
Basic Command (CRF mode)
ffmpeg -i input.mp4 -c:v libaom-av1 -crf 30 -b:v 0 -c:a libopus -b:a 128k output.webm
Important: Always pair -crf with -b:v 0 when using libaom-av1.
Multithreading
ffmpeg -i input.mp4 -c:v libaom-av1 -crf 30 -b:v 0 -row-mt 1 -tiles 2x2 \
-c:a libopus -b:a 128k output.webm
2-Pass Encoding (Bitrate Target)
Use 2-pass when you need a specific file size or streaming bitrate.
libsvtav1 2-pass
# Pass 1
ffmpeg -i input.mp4 -c:v libsvtav1 -b:v 2M -preset 6 -pass 1 -an -f null /dev/null
# Pass 2
ffmpeg -i input.mp4 -c:v libsvtav1 -b:v 2M -preset 6 -pass 2 -c:a libopus -b:a 128k output.webm
libaom-av1 2-pass
# Pass 1
ffmpeg -i input.mp4 -c:v libaom-av1 -b:v 2M -pass 1 -an -f null /dev/null
# Pass 2
ffmpeg -i input.mp4 -c:v libaom-av1 -b:v 2M -pass 2 -c:a libopus -b:a 128k output.webm
Platform-Specific Settings
YouTube (AV1)
ffmpeg -i input.mp4 \
-c:v libsvtav1 -crf 32 -preset 6 \
-vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2" \
-pix_fmt yuv420p \
-c:a libopus -b:a 256k \
output_youtube_av1.webm
Web Delivery (Lightweight)
ffmpeg -i input.mp4 \
-c:v libsvtav1 -crf 40 -preset 8 \
-vf "scale=1280:720" \
-c:a libopus -b:a 96k \
output_web.webm
Browser Compatibility
| Browser | AV1 Support |
|---|---|
| Chrome 70+ | ✅ |
| Firefox 67+ | ✅ |
| Edge 18+ | ✅ |
| Safari 16.4+ | ✅ (macOS Ventura+) |
| iOS Safari | ❌ (not supported as of 2024) |
If iOS coverage is required, provide an H.264 fallback.
Troubleshooting
libsvtav1 not found
Unknown encoder 'libsvtav1'
Install the latest FFmpeg:
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg
# Windows
winget install ffmpeg
Encoding is extremely slow
Switch from libaom-av1 to libsvtav1 — it is 10–50× faster:
# Slow
ffmpeg -i input.mp4 -c:v libaom-av1 -crf 30 -b:v 0 output.webm
# Fast
ffmpeg -i input.mp4 -c:v libsvtav1 -crf 35 -preset 6 output.webm
No audio / container error
WebM only supports Vorbis or Opus audio — not AAC:
# Wrong: AAC in WebM
ffmpeg -i input.mp4 -c:v libsvtav1 -crf 35 -c:a aac output.webm
# Correct: Opus in WebM
ffmpeg -i input.mp4 -c:v libsvtav1 -crf 35 -c:a libopus -b:a 128k output.webm
Related Articles
Tested with ffmpeg 7.0 / Ubuntu 24.04
Primary source: ffmpeg.org/ffmpeg-codecs.html#libsvtav1