32blogby Studio Mitsu

AV1 vs H.265 vs H.264: Which Codec Should You Use?

Compare AV1, H.265, and H.264 across compression efficiency, quality, speed, and compatibility. Includes FFmpeg command examples and a CRF equivalency table.

by omitsu10 min read
On this page

Short answer: Use H.264 when you need maximum device compatibility, AV1 (via SVT-AV1) when you want the smallest files with royalty-free licensing, and H.265 only for Apple ecosystem delivery. In FFmpeg, equivalent quality is roughly x264 CRF 23 ≈ x265 CRF 28 ≈ libsvtav1 CRF 30.

When you open the FFmpeg docs to compress a video, the sheer number of codec options can be paralyzing. H.264, H.265, AV1 — each one is marketed as "high quality," "highly compressed," or "next-generation." But which one should you actually use?

This article compares the three codecs across compression efficiency, encoding speed, compatibility, and practical FFmpeg usage. By the end, you'll be able to make a clear decision based on your own use case.

What Each Codec Is and Where It Came From

Choosing a codec isn't about picking "the best one" — it's about understanding when each was introduced, who manages it, and what trade-offs it carries.

H.264 (AVC) was standardized in 2003. It's managed by Via Licensing Alliance (formerly MPEG-LA). Commercial use technically requires a license, though since 2010 MPEG-LA has permanently waived royalties for internet video that is free to end users. Paid streaming services and hardware manufacturers still pay licensing fees. With over 20 years of history, it runs on virtually every device and platform in existence.

H.265 (HEVC) was standardized in 2013. Designed as the successor to H.264, it achieves roughly 40–50% bitrate savings at equivalent quality. However, its patent landscape is notoriously complex — multiple competing patent pools exist. This complexity is a significant reason why browser support has remained inconsistent.

AV1 was released in 2018 by the Alliance for Open Media (AOMedia), a consortium founded by Google and other major tech companies. It is completely royalty-free.

H.264 (2003)8 Mbps baseline−40~45%H.265 (2013)~4.5 Mbps (−45%)−10~20%AV1 (2018)~4 Mbps (−50%)

Compression Efficiency Compared

When comparing codecs at equivalent perceptual quality (measured via VMAF or SSIM), newer generations are consistently more efficient.

As a general benchmark:

  • AV1 achieves roughly 50% bitrate reduction compared to H.264
  • H.265 achieves roughly 40–45% reduction compared to H.264
  • The gap between AV1 and H.265 is typically 10–20% (varies by content)

For example, if a clip requires 8 Mbps in H.264, you can expect roughly 4.5 Mbps in H.265 and under 4 Mbps in AV1 at comparable quality. For streaming or long-term archiving, that difference compounds significantly.

That said, "higher compression efficiency" doesn't mean "always choose AV1." Encoding speed and compatibility impose real-world constraints.

The Reality of Encoding Speed

AV1's biggest historical weakness was encoding speed. The original libaom-av1 encoder could take 10–50x longer than H.264 for the same clip, making it impractical for many workflows.

SVT-AV1 (Scalable Video Technology for AV1) has fundamentally changed that situation. As of March 2026, SVT-AV1 is at version 4.0.0.

EncoderCodecRelative SpeedQuality
libx264H.264Baseline (1x)Good
libx265H.265~0.3–0.5xGood to Excellent
libaom-av1AV1~0.05–0.1xExcellent
libsvtav1AV1~0.3–0.6xExcellent

SVT-AV1's preset parameter (0–13) gives you fine-grained control over the speed/quality trade-off. Preset 6–8 is the practical sweet spot for most workflows.

Device and Browser Compatibility

Compatibility is the factor most often overlooked when choosing a codec.

H.264 plays everywhere. Smartphones, old smart TVs, web browsers, video editing software — nothing breaks with H.264. In 2026, it remains the most universally compatible codec.

AV1 is supported in Chrome, Firefox, and Edge with both software and hardware decoding. Safari supports AV1 since version 17 (2023), but only on Apple hardware with a dedicated AV1 decoder — that means M3 or later Macs, iPhone 15 Pro (A17 Pro) or later, and M4 iPads. Older Apple devices cannot play AV1 in Safari. On Android, hardware AV1 decoding is standard on devices from 2023 onward.

H.264H.265AV1
Web browsersFull supportHardware-dependentFull (Safari: M3/A17 Pro+)
iOS / macOSFull supportFull supportM3/A17 Pro or later
AndroidFull supportPartial2023+ devices
Legacy devicesFull supportPartialOften unsupported

FFmpeg Commands for Each Codec

H.264 (libx264)

The safest, most compatible choice. CRF 23 is the widely-used default.

bash
# H.264 basic encode
ffmpeg -i input.mp4 \
  -c:v libx264 \
  -crf 23 \
  -preset slow \
  -c:a aac -b:a 128k \
  output_h264.mp4

The -preset flag ranges from ultrafast to veryslow. Slower presets produce smaller files at the same CRF. For everyday use, medium or slow is the right balance.

H.265 (libx265)

More efficient than H.264. CRF 28 is the rough equivalent of H.264's CRF 23.

bash
# H.265 encode
ffmpeg -i input.mp4 \
  -c:v libx265 \
  -crf 28 \
  -preset slow \
  -tag:v hvc1 \
  -c:a aac -b:a 128k \
  output_h265.mp4

The -tag:v hvc1 flag improves compatibility with Apple devices and QuickTime. Worth including whenever you target macOS or iOS playback.

AV1 (libsvtav1)

The most compression-efficient option available today.

bash
# AV1 (SVT-AV1) encode
ffmpeg -i input.mp4 \
  -c:v libsvtav1 \
  -crf 30 \
  -preset 6 \
  -svtav1-params tune=0 \
  -c:a libopus -b:a 128k \
  output_av1.mkv

-preset 6 is a solid starting point for speed/quality balance. Pair it with libopus audio — the two are well-matched for MKV/WebM containers.

Batch Processing Example

Convert multiple files to AV1 in a single shell script.

bash
#!/bin/bash
# batch_av1_encode.sh
# Usage: bash batch_av1_encode.sh *.mp4

for input in "$@"; do
  filename="${input%.*}"
  ffmpeg -i "$input" \
    -c:v libsvtav1 \
    -crf 30 \
    -preset 6 \
    -c:a libopus -b:a 128k \
    "${filename}_av1.mkv"
  echo "Done: ${filename}_av1.mkv"
done

CRF Equivalency Table

CRF (Constant Rate Factor) controls quality — lower values mean higher quality and larger files. Because each codec uses a different scale, equivalent quality maps to different CRF numbers.

Quality LevelH.264 (libx264)H.265 (libx265)AV1 (libsvtav1)
High quality (archival/streaming)CRF 18–20CRF 22–24CRF 24–26
Standard quality (everyday use)CRF 23CRF 28CRF 30
Low quality (lightweight delivery)CRF 28–30CRF 32–34CRF 36–38

These are guidelines, not universal rules. Animation, live action, and sports content all respond differently. When precision matters, encode a few short samples and compare VMAF scores or do a side-by-side review.

A handy rule of thumb for equivalent quality:

  • x264 CRF 23 ≈ x265 CRF 28 ≈ libsvtav1 CRF 30

For a deep dive into SVT-AV1 encoding parameters, see FFmpeg SVT-AV1 Optimal Settings.

Which Codec to Use for Each Scenario

Here's a practical decision guide based on common use cases.

Web delivery and streaming (priority: compatibility) Start with H.264 as your baseline. If your audience is on modern hardware and browsers, AV1 is a strong upgrade. Avoid H.265 for web.

Long-term archiving and backup (priority: file size efficiency) AV1 is the clear winner. The encoding time is a one-time cost, and 50% storage savings pay off over years.

Intermediate editing files (priority: encoding speed) H.264 with -preset ultrafast. When you're bouncing between edits, speed matters more than compression efficiency.

Apple ecosystem delivery (priority: device compatibility) H.265 is optimal here. iPhones and Macs have hardware H.265 decoding, giving you smaller files than H.264 with guaranteed playback.

Uploading to YouTube or social platforms (priority: post-compression quality) Platforms re-encode everything on their end. If you upload in AV1, YouTube may serve it to viewers in AV1, which can preserve more quality. Otherwise, upload in whatever codec makes the source look best.

For a broader look at FFmpeg video compression workflows, check out the FFmpeg Video Compression Guide.

Frequently Asked Questions

Is AV1 better than H.265?

In most scenarios, yes. AV1 offers 10–20% better compression than H.265, is royalty-free, and has broader browser support (Chrome, Firefox, Edge all decode AV1 natively). H.265's advantage is Apple ecosystem integration — iPhones and Macs have reliable hardware H.265 decoding. For web delivery, AV1 is the better choice.

Can I use AV1 for YouTube uploads?

Yes. YouTube accepts AV1 uploads and may serve your video to viewers in AV1 format, which preserves quality better after re-encoding. Upload at a high bitrate or low CRF regardless of codec — YouTube re-encodes everything.

Why is AV1 encoding so slow?

The reference encoder libaom-av1 is extremely slow (10–50x slower than H.264). Use SVT-AV1 (libsvtav1 in FFmpeg) instead — it's only about 2–3x slower than H.264 at preset 6–8, which is practical for most workflows.

What CRF should I use for AV1?

Start with CRF 30 for standard quality using libsvtav1. This is roughly equivalent to x264 CRF 23 or x265 CRF 28. For archival quality, use CRF 24–26. Always test with a short sample before encoding long videos.

Does H.265 work in Chrome?

Chrome supports H.265/HEVC playback since version 105 (2022), but only through the platform's hardware decoder. There is no software fallback — if the user's device lacks an HEVC hardware decoder, playback fails silently. This makes H.265 unreliable for general web delivery.

Is H.264 still worth using in 2026?

Absolutely. H.264 remains the safest choice when you need to guarantee playback on every device, including smart TVs, old phones, embedded systems, and all browsers. For intermediate editing files where encoding speed matters, H.264 with -preset ultrafast is also the practical choice.

Can I hardware-encode AV1?

Yes. NVIDIA RTX 40-series and later GPUs support AV1 hardware encoding via NVENC. Intel Arc GPUs and AMD RX 7000 series also support hardware AV1 encoding. However, hardware encoders trade quality for speed — for maximum compression efficiency, software encoding with SVT-AV1 still wins. See our GPU encoding guide for details.

What container should I use with AV1?

MKV (Matroska) and WebM are the most common containers for AV1. MP4 also supports AV1 since the ISO standard was updated, and browser support for AV1-in-MP4 is solid. For web delivery, MP4 is often the better choice for compatibility with video players and CDNs.

Wrapping Up

Here's the short version after comparing all three codecs:

  • Compatibility is the priority → H.264
  • File size reduction is the priority → AV1 (SVT-AV1)
  • Apple ecosystem delivery → H.265

H.265 is increasingly caught in the middle — too limited in browser support for web use, while AV1 has caught up in speed and surpassed it in efficiency. In 2026, AV1 is winning the web, and H.265 holds its ground within Apple's ecosystem.

If you want to start experimenting with AV1 encoding in FFmpeg, libsvtav1 + -preset 6 + -crf 30 is a solid starting point. Tune from there based on your content and target platform.

Related articles: