32blogby StudioMitsu
ffmpeg8 min read

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.

FFmpegAV1H.265H.264codecvideo compression
On this page

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 MPEG-LA, a patent pool consortium. Commercial use technically requires a license, though royalties have been largely waived for many use cases since 2024. 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.

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.

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 now supported in Chrome, Firefox, Edge, and Safari. Hardware decoding has become standard on Android and iOS devices released from 2023 onward. If your audience is on modern hardware, AV1 compatibility is no longer a concern.

H.264H.265AV1
Web browsersFull supportInconsistentFull support
iOS / macOSFull supportFull supportModern only
AndroidFull supportPartialModern only
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.

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.