H.264 vs HEVC vs AV1 Video Codec Comparison | Compression, Compatibility, Encoding Selection Guide

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?

AspectH.264 (AVC)HEVC (H.265)AV1
PerformanceLow decoding loadBitrate reduction at same qualityLong-term alternative for royalty & bandwidth
UsabilityAlmost all devicesCheck license & device issuesCheck encoding time & HW
Application ScenarioMaximum compatibility4K, low bandwidthWeb, 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

  1. Quick Comparison
  2. Codec Details
  3. Performance Comparison
  4. Recommendations by Scenario
  5. Migration Guide
  6. Practical Tips
  7. Common Questions
  8. Conclusion

1. Quick Comparison

FeatureH.264 (AVC)HEVC (H.265)AV1
StandardITU-T H.264 / MPEG-4 AVCITU-T H.265 / MPEG-HAOMedia 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)FastestSlower than H.264Often slower than HEVC (software)
DecodingAlmost all devicesModern TV, mobile, GPU (old unsupported)Modern browsers, chipsets (old restricted)
RoyaltyPatent pool (per-product fee structure exists)Patent poolAOMedia royalty-free (implementation cautions separate)
Typical Profile/UseBaseline~High, broadcast, web, storageMain/Main 10, 4K, HDR8/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.

MetricH.264HEVCAV1
File size at same CRF classLargestMediumOften smallest
Encoding time (software)ShortMediumLong
Real-time encodingEasyDepends 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

ScenarioRecommendationReason
Wide compatibility (web, embedded)H.264Best decoder availability
4K/HDR VOD, modern TVHEVC or AV1Bandwidth & storage efficiency
Low-latency liveH.264 or HW HEVCEncoding latency & stability
Long-term archive + costConsider AV1 + metadata preservationReview size & licensing aspects
Game recording, editing compatibilityH.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

  1. Check HEVC decoding support on target platform (especially web has browser differences).
  2. Match container compatibility tags like -tag:v hvc1 (MP4).
  3. 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

  1. If software encoding, adjust time and quality balance with preset and tile options.
  2. Fallback: Adaptive streaming (HLS/DASH) configuration that switches to H.264/HEVC on AV1 playback failure.
  3. 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

  1. <video> + multiple <source> (browser selects supported codec).
  2. HLS/DASH: Separate renditions by codec, client adaptively selects.
  3. 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)

  • 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