Skip to content

H.264 vs H.265 vs AV1: Video Codec Comparison and Selection Guide

Downloaded video won't play — it's H.265 encoded. Want to do 4K live streaming — should you use H.264 or H.265? Netflix uses AV1, should you follow? Which codec should you use to upload to YouTube? Video codec choices involve technical details, complex licensing, and uneven browser support. This guide compares the three major codecs side-by-side.

Three codecs overview

H.264 / AVC (2003)

Developed jointly by ITU-T and ISO/IEC as the industry standard. From phones to TVs, from browsers to satellites, almost every device that can play video supports H.264. YouTube, Netflix, Bilibili use it as the default codec. 20+ years of ecosystem made H.264 the unavoidable baseline.

H.265 / HEVC (2013)

H.264's official successor, 30-50% more efficient. But after release, it became mired in licensing issues — multiple patent pools (HEVC Advance, MPEG LA, Velos Media) with complex rules. Browser vendors (especially Chrome and Firefox) long refused native support. Today H.265 is popular in Apple ecosystem (iPhone, Mac, Safari), 4K Blu-ray, and IPTV, but awkward on the web.

AV1 (2018)

Released by the Alliance for Open Media (AOMedia), founded by Google, Mozilla, Cisco, Amazon, Netflix, Microsoft. Clear goal: replace H.265, no licensing fees, better compression. AV1 is 50-60% more efficient than H.264, 20-30% more than H.265, and fully open-source. The cost: very slow encoding, hardware decoding still rolling out. YouTube, Netflix, Twitch already use AV1.

Five-dimension comparison

DimensionH.264H.265AV1
Release year200320132018
Compression efficiency100% (baseline)130%-150%150%-160%
Encoding speedFastestMediumSlowest (1/10-1/20 of H.264)
Decoding complexityLowestMediumHighest
Hardware decodingAll devices2016+ devices2020+ new devices
Browser supportAllSafari, partial EdgeChrome, Firefox, Edge (recent)
LicensingYes (MPEG LA pool)Complex (multiple pools)Completely free
Use caseUniversal, compatibility first4K, local playback, Apple ecosystemModern web, future trend

Browser support details

BrowserH.264H.265AV1
Chrome (Windows/Mac/Linux)✅ Full🟡 Partial (needs hardware+OS)✅ 70+
Firefox✅ Full❌ No✅ 60+ (some platforms)
Safari (Mac)✅ Full✅ Native✅ 16.4+
Safari (iOS)✅ Full✅ Native✅ 16.4+
Edge✅ Full🟡 Partial (needs hardware)✅ 75+
Old browsers✅ Full❌ Generally no❌ Generally no

Conclusion: For web video compatible with all browsers, H.264 is the only stable choice. If only targeting Chrome and modern browsers, AV1 is better. H.265's awkward web position won't change soon.

Hardware decoding support

Hardware decoding (GPU/dedicated chip) is more power-efficient and faster than software decoding, almost necessary for 4K/8K video.

CodecHardware decoding adoption yearSupported devices
H.2642005+Almost all
H.2652016+Intel Kaby Lake+, AMD RX 400+, NVIDIA GTX 950+, iPhone 6s+, Android flagships 2015+
AV12020+NVIDIA RTX 30+, AMD RX 6000+, Intel Tiger Lake+, iPhone 15+, Android flagships 2021+

Practical advice: For pre-2015 devices, must use H.264. For 2020+ new devices, all three codecs work.

Compression efficiency test

For a 1080p/30fps/2-minute video:

CodecSame visual quality (CRF equivalent)File sizeRelative to H.264
H.264 CRF 23Visually lossless50 MB100%
H.265 CRF 28Visually lossless30 MB60%
AV1 CRF 32Visually lossless22 MB44%

CRF values aren't directly comparable — adjust based on each codec's "visually lossless" threshold. At same quality, AV1 is ~45% the size of H.264, H.265 is ~60%.

Storage/bandwidth savings:

  • 1TB video library: H.264 → H.265 saves 400GB, H.264 → AV1 saves 550GB
  • 1Gbps bandwidth: H.264 → AV1 can serve 2.2x more users

Encoding speed comparison

For a 1080p/10-minute video (mid-range PC, preset=medium):

CodecEncoding timeRelative to H.264
H.264 (libx264)~3 minutes1x
H.265 (libx265)~10 minutes~3.3x
AV1 (libaom-av1)~50 minutes~16x
AV1 (svt-av1)~15 minutes~5x

AV1's official encoder libaom-av1 is absurdly slow, but the new SVT-AV1 (Intel-led) brings speed to H.265 levels. Netflix, YouTube use dedicated hardware encoders; ordinary users can use SVT-AV1.

Practical advice: Real-time encoding (live streaming, screen sharing) can only use H.264 currently. Batch archival can tolerate AV1's slowness.

Licensing costs

This is the root cause of H.265's limited adoption:

CodecLicensingCommercial cost
H.264MPEG LA pool, clear rules$0.1-0.2/unit (free services exempt)
H.265At least 3 pools (HEVC Advance, MPEG LA, Velos Media) + independent holdersComplex and expensive, each pool charges separately
AV1Completely free, AOMedia holds0

H.264's licensing exists but rules are simple, browser vendors accept it. H.265's multiple pools made browser vendors (especially open-source Firefox and Chrome) unable to accept, so web H.265 support remains awkward. AV1's free strategy was designed to break this dilemma.

Scenario-based codec selection

Scenario 1: Web video (YouTube, Bilibili, self-hosted)

Recommendation: H.264 (fallback) + AV1 (upgrade)

H.264 ensures all browsers can play. AV1 provides better experience for modern browsers. Use <video> tag's multiple source feature:

html
<video controls>
  <source src="video-av1.mp4" type='video/mp4; codecs="av01.0.05M.08"'>
  <source src="video-h264.mp4" type='video/mp4; codecs="avc1.42E01E"'>
</video>

Scenario 2: Mobile apps

Recommendation: H.264 (compatibility) or H.265 (save bandwidth)

iOS and Android flagships support H.265 hardware decoding. If your app only targets new devices, H.265 saves 30-50% bandwidth. For older device compatibility, H.264 is safer.

Scenario 3: 4K/8K ultra HD

Recommendation: H.265 or AV1

4K with H.264 has explosive bitrate (50Mbps+). H.265 can compress to 20-25Mbps, AV1 to 15-18Mbps. 8K basically requires AV1.

Scenario 4: Live streaming

Recommendation: H.264 (real-time encoding)

Real-time encoding still favors H.264: fast encoding, mature hardware encoders. AV1 real-time encoders are still developing; large-scale commercial use came after 2024.

Scenario 5: Local archival/NAS

Recommendation: H.265 (efficiency) or AV1 (maximum savings)

Storage is cheap, but large video collections make differences significant. 10,000 1080p movies: H.265 saves 5TB over H.264. AV1 saves another 3TB but takes much longer to encode.

Scenario 6: Video conferencing

Recommendation: H.264 (compatibility) or VP9 (alternative)

Real-time requirements are high; AV1 can't keep up yet. H.264 is the default choice for conferencing software. VP9 is Google's open-source alternative.

FFmpeg encoding commands

bash
# H.264 encoding
ffmpeg -i input.mp4 -c:v libx264 -crf 23 -preset medium -c:a aac output.mp4

# H.265 encoding
ffmpeg -i input.mp4 -c:v libx265 -crf 28 -preset medium -c:a aac output.mp4

# AV1 encoding (libaom, slow but high quality)
ffmpeg -i input.mp4 -c:v libaom-av1 -crf 32 -b:v 0 -c:a libopus output.webm

# AV1 encoding (SVT-AV1, faster but slightly lower quality)
ffmpeg -i input.mp4 -c:v libsvtav1 -crf 32 -preset 6 -c:a libopus output.mkv

For more FFmpeg usage, see our FFmpeg Getting Started Tutorial.

Core technical differences

If you're curious why AV1 is so much more efficient than H.264, the key differences are:

Block partitioning

  • H.264: Max 16x16 blocks
  • H.265: Max 64x64 blocks, min 8x8
  • AV1: Max 128x128 blocks, min 4x4

Larger blocks dramatically improve compression for flat areas (sky, walls).

Prediction modes

  • H.264: 9 intra prediction directions
  • H.265: 35 intra prediction directions
  • AV1: 56 intra prediction directions

More prediction directions match image textures more precisely, reducing residual data.

Transforms

  • H.264: 4x4, 8x8 DCT
  • H.265: 4x4 to 32x32 DCT and DST
  • AV1: 4x4 to 64x64 multiple transforms, including identity

Larger transform blocks are more efficient for low-frequency signals (gradually changing areas).

Filtering

  • H.264: Deblocking filter
  • H.265: Deblocking + SAO (Sample Adaptive Offset)
  • AV1: CDEF (Constrained Directional Enhancement Filter) + LR (Loop Restoration)

More advanced filters reduce compression artifacts, improving subjective quality.

Common issues

IssueCauseSolution
H.265 won't play in ChromeNo native supportConvert to H.264 or use AV1
AV1 stutters on old devicesNo hardware decodingConvert to H.264 or H.265
AV1 encoding too slowlibaom is slowUse SVT-AV1, preset 8 or higher
File larger than expectedCRF too lowIncrease CRF (H.264: 23-28, H.265: 28-32, AV1: 32-35)
H.265 licensingComplexContact HEVC Advance etc. for commercial use
4K won't playDevice underpoweredDownscale to 1080p or use hardware decoding

H.266 / VVC (2020): H.265's successor, 30-50% more efficient than H.265. But licensing issues persist, and new hardware decoding is needed — adoption speed uncertain.

AV2 (in development): AV1's next generation, targeting another 30% efficiency improvement.

LCEVC (Low Complexity Enhancement Coding): MPEG-5 Part 2, an enhancement layer over base codecs (H.264/H.265/AV1).

Short-term prediction: Over the next 3-5 years, H.264 remains the fallback codec, AV1 rapidly gains ground in web and streaming, H.265 maintains strong position in 4K local playback and Apple ecosystem. Neither H.266 nor AV2 will become popular quickly.

Summary

Each codec has its place:

  • H.264: Compatibility king, fallback for all scenarios
  • H.265: Practical choice for 4K and local playback, awkward on web
  • AV1: Future trend, next-gen standard for web and streaming

For daily use, H.264 is the safest choice. To save storage or bandwidth with supported devices, use H.265 or AV1. For commercial web video, consider H.264 + AV1 dual-track.

Quick reference:

  • Compatibility first: H.264 (safe default)
  • Size first with H.265 support: H.265 (Apple ecosystem, 4K local)
  • Future trend: AV1 (modern web, streaming)
  • Avoid: H.265 on web, AV1 on old devices

References

Last updated: