H.264 vs HEVC vs AV1 Video Codec Comparison | Compression, Compatibility, Encoding Selection Guide
이 글의 핵심
H.264 vs HEVC vs AV1 — compare compression ratio, compatibility, and encoding cost with practical selection criteria.
Introduction
From streaming to video calls, game recording, and archiving, video codec selection determines quality, size, and playback environment simultaneously. H.264 is still the default, HEVC offers high efficiency, and AV1 has established itself as a royalty-free next-generation alternative. This guide compares all three on the same criteria.
As an analogy, H.264 is like a standard TV that plays everywhere, HEVC is a high-efficiency set that uses less power but needs compatible TV, and AV1 is next-generation equipment that reduces royalty burden but may have heavy encoding.
When to Use H.264, HEVC, or AV1?
| Aspect | H.264 (AVC) | HEVC (H.265) | AV1 |
|---|---|---|---|
| Performance | Low decoding load | Bitrate reduction at same quality | Long-term alternative for royalty & bandwidth |
| Usability | Almost all devices | Check license & device issues | Check encoding time & HW |
| Application Scenario | Maximum compatibility | 4K, low bandwidth | Web, OTT long-term strategy |
After Reading This
- Understand roles and licensing/compatibility differences of H.264, HEVC, and AV1
- Grasp approximate bitrate and encoding time relationships at same subjective quality
- Learn how to apply encoding and fallback strategies with FFmpeg
- Make decisions matching service stage (wide compatibility vs latest devices)
Table of Contents
- Quick Comparison
- Codec Details
- Performance Comparison
- Recommendations by Scenario
- Migration Guide
- Practical Tips
- Common Questions
- Conclusion
1. Quick Comparison
| Feature | H.264 (AVC) | HEVC (H.265) | AV1 |
|---|---|---|---|
| Standard | ITU-T H.264 / MPEG-4 AVC | ITU-T H.265 / MPEG-H | AOMedia Video 1 (AV1) |
| Approx Compression Efficiency (same quality) | Baseline (1×) | ~40-50% reduction vs H.264 typical | ~20-30% additional reduction vs HEVC often reported |
| Encoding Speed (same hardware) | Fastest | Slower than H.264 | Often slower than HEVC (software) |
| Decoding | Almost all devices | Modern TV, mobile, GPU (old unsupported) | Modern browsers, chipsets (old restricted) |
| Royalty | Patent pool (per-product fee structure exists) | Patent pool | AOMedia royalty-free (implementation cautions separate) |
| Typical Profile/Use | Baseline~High, broadcast, web, storage | Main/Main 10, 4K, HDR | 8/10bit, web streaming, VOD |
2. Codec Details
H.264 (AVC)
Feature: Closest to industry standard, highest hardware decoder availability. Still often default choice for live and low-latency scenarios.
Pros
- Best playback compatibility from smart TVs to old mobile and embedded
- Mature encoder/decoder ecosystem, relatively low real-time encoding burden
Cons
- Larger bitrate than HEVC/AV1 at same quality
- Efficiency limits at high resolution and HDR
FFmpeg Example (libx264)
ffmpeg -i input.mp4 -c:v libx264 -preset medium -crf 23 \
-pix_fmt yuv420p -c:a aac -b:a 128k output.mp4
HEVC (H.265)
Feature: Focused on significantly reducing bitrate at same subjective quality vs H.264. Widely used for 4K and HDR content.
Pros
- Advantageous for reducing streaming bandwidth and storage costs
- Hardware-accelerated encoding/decoding widely supported on modern devices
Cons
- Patent and licensing issues require checking vendor policies for implementation and distribution
- Old browsers and OS have software decoding or no support
FFmpeg Example (libx265)
ffmpeg -i input.mp4 -c:v libx265 -preset medium -crf 28 \
-tag:v hvc1 -c:a aac -b:a 128k output.mp4
AV1
Feature: Open codec developed by Alliance for Open Media, aiming for royalty-free. Large streaming services like YouTube are expanding adoption.
Pros
- Potential for additional bandwidth reduction at same quality (varies by content and settings)
- Long-term advantage for license-cost-sensitive services
Cons
- Software encoding has high CPU load (hardware encoders vary by platform)
- Old devices and browsers require fallback
FFmpeg Example (libaom-av1 / libsvtav1)
# SVT-AV1: Speed and quality balance often used in practice
ffmpeg -i input.mp4 -c:v libsvtav1 -preset 6 -crf 30 \
-c:a libopus -b:a 128k output.mkv
3. Performance Comparison
Absolute numbers vary greatly by resolution, frames, content complexity, preset, and CRF. Below are relative trends commonly observed on same machine and similar settings.
| Metric | H.264 | HEVC | AV1 |
|---|---|---|---|
| File size at same CRF class | Largest | Medium | Often smallest |
| Encoding time (software) | Short | Medium | Long |
| Real-time encoding | Easy | Depends on GPU/NVENC, etc. | CPU real-time is heavy burden |
Visualization: Selection Decision Flow
flowchart TD
A[Codec Selection] --> B{Top Priority?}
B -->|All device playback| C[H.264]
B -->|Bandwidth reduction + modern devices| D[HEVC or AV1]
B -->|Minimize royalty| E[AV1 + H.264 fallback]
C --> F[Maximum compatibility]
D --> G[Check decoder support matrix]
E --> H[Multi-codec pipeline]
When measuring: Record quality metrics like VMAF/SSIM and encoding time with same source, and parallel playback testing on target decoders (real devices) is safe.
4. Recommendations by Scenario
| Scenario | Recommendation | Reason |
|---|---|---|
| Wide compatibility (web, embedded) | H.264 | Best decoder availability |
| 4K/HDR VOD, modern TV | HEVC or AV1 | Bandwidth & storage efficiency |
| Low-latency live | H.264 or HW HEVC | Encoding latency & stability |
| Long-term archive + cost | Consider AV1 + metadata preservation | Review size & licensing aspects |
| Game recording, editing compatibility | H.264 (editing tools, sharing) | Simplify workflow |
Practical Decision: (1) Confirm supported decoder list first, (2) encoding budget (time, power), (3) CDN cost in order of weight simplifies selection.
5. Migration Guide
H.264 → HEVC
- Check HEVC decoding support on target platform (especially web has browser differences).
- Match container compatibility tags like
-tag:v hvc1(MP4). - For existing users, maintain H.264 track (multi-codec) or gradual transition with separate URL.
# H.264 to HEVC
ffmpeg -i input_h264.mp4 -c:v libx265 -preset medium -crf 28 \
-tag:v hvc1 -c:a copy output_hevc.mp4
HEVC/H.264 → AV1
- If software encoding, adjust time and quality balance with preset and tile options.
- Fallback: Adaptive streaming (HLS/DASH) configuration that switches to H.264/HEVC on AV1 playback failure.
- Old devices: Keep archive source (H.264/uncompressed) separately to leave re-encoding room.
# H.264 to AV1
ffmpeg -i input_h264.mp4 -c:v libsvtav1 -preset 6 -crf 30 \
-c:a libopus -b:a 128k output_av1.webm
Caution: Patent and distribution policies vary by product and region, so always check legal/vendor guidance.
6. Practical Tips
Mixed Pipeline (e.g., MP4 + H.264 + AAC)
- Compatible baseline: H.264 + AAC + MP4 plays on almost all clients.
- High-efficiency layer: Add AV1 or HEVC variant of same content to provide only to users with ample bandwidth.
Fallback Strategy
<video>+ multiple<source>(browser selects supported codec).- HLS/DASH: Separate renditions by codec, client adaptively selects.
- Server transcoding: Keep source as master (e.g., ProRes/lossless) and branch codec for distribution only.
<video controls>
<source src="trailer.av1.mp4" type='video/mp4; codecs="av01.0.08M.08"'>
<source src="trailer.hevc.mp4" type='video/mp4; codecs="hev1.1.6.L93.B0"'>
<source src="trailer.h264.mp4" type="video/mp4">
</video>
Encoding Best Practices
# H.264 baseline (maximum compatibility)
ffmpeg -i input.mp4 -c:v libx264 -preset medium -crf 23 -profile:v high -level 4.1 \
-pix_fmt yuv420p -c:a aac -b:a 128k -movflags +faststart h264.mp4
# HEVC (4K, bandwidth reduction)
ffmpeg -i input.mp4 -c:v libx265 -preset medium -crf 28 -tag:v hvc1 \
-c:a aac -b:a 128k -movflags +faststart hevc.mp4
# AV1 (next-gen, royalty-free)
ffmpeg -i input.mp4 -c:v libsvtav1 -preset 6 -crf 30 \
-c:a libopus -b:a 128k av1.webm
7. Common Questions
Q1. Can I use same CRF number for H.264, HEVC, and AV1?
No. Each codec has different CRF scale and subjective quality. Better to tune separately per codec and match with VMAF, etc.
Q2. Does AV1 always create smaller files than HEVC?
Generally that trend exists, but short clips, low frames, specific presets may reduce difference. Always validate with samples.
Q3. What is suitable for real-time broadcasting?
If low latency and stability are priority, H.264 or verified hardware HEVC are common. AV1 real-time has high CPU burden depending on environment.
Q4. AV1 on iOS Safari?
Depends on policy and version. Even in 2026, safe to check compatibility matrix with official docs and prepare H.264/HEVC fallback.
Q5. For HDR?
Both HEVC and AV1 have complex HDR metadata and profile combinations. Need separate validation matching target platform specs (HLG/Dolby Vision, etc.).
Conclusion
- If compatibility is top priority, H.264 is still the safest default.
- If bandwidth and storage costs are high, consider HEVC or AV1, calculating decoder support and encoding cost together.
- AV1 is attractive long-term for open ecosystem and cost aspects, but premise on fallback and encoding time.
One-line summary: To cover all devices, default to H.264 and add HEVC/AV1 as additional layer when efficiency needed.
Quick Decision Guide
Maximum compatibility? → H.264
4K/HDR + modern devices? → HEVC
Royalty-free priority? → AV1 (with H.264 fallback)
Real-time low latency? → H.264 or HW HEVC
Long-term archive? → Consider AV1 (keep H.264 master)
Related Posts
- H.264 (AVC) Complete Guide
- HEVC (H.265) Practical Guide
- AV1 Next-Generation Codec Guide
Keywords
H.264, HEVC, H.265, AV1, Video Codec, Compression, FFmpeg, Streaming, Comparison, Encoding, Decoding, Compatibility