CGJU
CGJU
July 1, 2026 Β· 6 min read
πŸ’‘ Quick Verdict: Choose H.264 for compatibility; choose H.265 to save bandwidth with newer devices; choose AV1 if you're future-oriented and don't mind encoding speed.

1. Overview of Three Major Codecs

1.1 H.264 (AVC)

H.264, also known as AVC (Advanced Video Coding), was jointly developed by MPEG and VCEG and officially released in 2003. It is currently the most widely used video coding standard, with native support in almost all devices and browsers.

H.264 uses technologies such as intra prediction, inter prediction, transform coding, and entropy coding, saving about 50% bitrate compared to the previous generation MPEG-2 while maintaining the same visual quality.

1.2 H.265 (HEVC)

H.265, also known as HEVC (High Efficiency Video Coding), is the successor to H.264, released in 2013. It introduces more advanced technologies on top of H.264, such as larger coding tree units (CTU), more flexible prediction modes, and SAO filtering.

At the same quality level, H.265 saves about 50% more bitrate than H.264, meaning higher-definition video can be transmitted with the same bandwidth.

1.3 AV1

AV1 (AOMedia Video 1) is an open-source, royalty-free video coding standard developed by the Alliance for Open Media (AOMedia), officially released in 2018. Companies involved in development include Google, Mozilla, Netflix, Amazon, Microsoft, and others.

AV1 aims to save about 30% more bitrate than H.265 at the same quality level, and it's completely free with no patent licensing issues.

2. Compression Efficiency Comparison

Compression efficiency is one of the most important metrics for video codecs. Below is a comparison of relative bitrates among the three at the same visual quality (similar PSNR):

Codec Relative Bitrate Savings (vs H.264)
H.264 100% Baseline
H.265 ~50% ~50%
AV1 ~35% ~65%

As the data shows, AV1 has the highest compression efficiency, followed by H.265, with H.264 being the lowest. Note that actual compression efficiency varies depending on video content, encoding parameters, quality assessment methods, and other factors.

3. Encoding Speed Comparison

Encoding speed is another important factor to consider when choosing a codec. Generally speaking, the higher the compression efficiency, the slower the encoding speed.

Codec Relative Speed Real-Time Encoding
H.264 (x264) Fast (baseline) βœ“ Easily supported
H.265 (x265) Medium (~0.3-0.5x) β–³ Requires high-end config
AV1 (libaom) Slow (~0.05-0.1x) βœ— Currently difficult
⚠️ Note: The speed comparison above is based on software encoders (x264, x265, libaom). When using hardware-accelerated encoders (such as NVENC, QSV, AMF), speed increases significantly but compression efficiency may be slightly lower.

4. Browser and Device Support

4.1 Browser Support

  • H.264: Supported by all major browsers (Chrome, Firefox, Safari, Edge), best compatibility
  • H.265: Native support in Safari, Chrome/Edge require system support, limited Firefox support
  • AV1: Supported in Chrome, Firefox, Edge; Safari 16.4+ support

4.2 Device Support

  • H.264: Hardware decoding supported on almost all devices (phones, TVs, set-top boxes, game consoles)
  • H.265: Most devices released after 2016 support hardware decoding
  • AV1: High-end devices after 2020 are starting to support hardware decoding, adoption is growing rapidly

5. Patent Licensing

5.1 H.264 Patents

H.264 patents are managed by MPEG LA and require royalty payments. For free internet video services, H.264 is royalty-free; however, for paid content and hardware devices, licensing fees apply.

5.2 H.265 Patents

The patent situation for H.265 is complex, with multiple patent pools (MPEG LA, HEVC Advance, Velos Media), high licensing fees, and some patent holders not joining any pool. This is one of the main reasons H.265 has been slow to adopt in browsers.

5.3 AV1 Patents

AV1 is completely open-source and royalty-free, with the AOMedia alliance pledging that its members will not assert their patents against AV1 users. This is a huge advantage for commercial applications.

6. Use Cases

6.1 H.264 Use Cases

  • Video distribution requiring broad compatibility (e.g., general video websites)
  • Live streaming (fast encoding speed)
  • Legacy device compatibility
  • Real-time applications like video conferencing and surveillance

6.2 H.265 Use Cases

  • 4K/8K UHD video (bandwidth savings)
  • Mobile video (data savings)
  • Storage-constrained scenarios (storage space savings)
  • Video platforms with newer devices

6.3 AV1 Use Cases

  • Large video platforms (long-term bandwidth cost savings)
  • Royalty-free commercial applications
  • Future-oriented projects
  • High-quality web video (good browser support)

7. FFmpeg Encoding Command Examples

7.1 H.264 Encoding

Using libx264 encoder, CRF mode (recommended):

ffmpeg -i input.mp4 -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k output_h264.mp4

Parameter explanation:

  • -crf 23: Constant Rate Factor, range 0-51, default 23, lower values = higher quality
  • -preset medium: Encoding speed preset, options from ultrafast to veryslow

7.2 H.265 Encoding

Using libx265 encoder:

ffmpeg -i input.mp4 -c:v libx265 -crf 28 -preset medium -c:a aac -b:a 128k output_h265.mp4

The default CRF value for H.265 is 28, which provides roughly the same visual quality as H.264 at CRF 23.

7.3 AV1 Encoding

Using libaom-av1 encoder (slower):

ffmpeg -i input.mp4 -c:v libaom-av1 -crf 30 -b:v 0 -cpu-used 4 -c:a libopus -b:a 128k output_av1.mkv

Parameter explanation:

  • -cpu-used 4: Encoding speed control, 0 = slowest best quality, 8 = fastest worst quality
  • -b:v 0: Used with CRF, indicates no bitrate limit

Using SVT-AV1 encoder (faster, recommended):

ffmpeg -i input.mp4 -c:v libsvtav1 -crf 30 -preset 4 -c:a libopus -b:a 128k output_av1.mp4

Summary

Choosing a video codec requires considering multiple factors such as compression efficiency, encoding speed, compatibility, and patent licensing.

Recommended strategy:

  • If compatibility is the top priority, choose H.264
  • If you want a balance between quality and compatibility, choose H.265
  • If you pursue the highest compression efficiency and don't mind encoding speed, choose AV1
  • For large video platforms, a multi-encoding strategy can be used to automatically select the best codec based on user device

If you don't want to remember these complex commands, you can use our Video Compressor Tool to easily complete video encoding conversions right in your browser.

Related Recommendations

More great articles and useful tools

Want to try video encoding conversion?

Use our online Video Compressor Tool β€” no software installation needed, complete H.264/H.265 encoding conversion right in your browser

Try It Now ➑