Guide

x264, x265 or AV1: Which to Use? Choosing by Situation for Archiving, Upload, Web Embedding and Real Time

H.264, H.265 and AV1 compared by compatibility, file size at the same VMAF, encoding time, and patents and licensing, then sorted by situation. The size and speed figures are exactly as measured in this site's crf-sweep and iso-time experiments.

The short answer

  • If you don’t know where it will be played, use x264 (H.264). It has the widest compatibility, and its files are the largest of the three codecs.
  • If file size matters and the receiving device plays AV1, use SVT-AV1. In this site’s measurements, the file size at the same VMAF was 41–63% of x264’s (crf-sweep) or 0.70–0.80x (iso-time).
  • x265 (H.265) sits in the middle. Its size savings varied from clip to clip, and its browser support is said to be not as broad as H.264’s.
  • Keep in mind that the measurements cover four 10-second 1080p clips, 8-bit, on one PC. The numbers below hold under those conditions and may differ for your video.

Choosing by situation

Playback compatibility is general knowledge, as of 2026-11-11. It varies by device, browser and profile, so check your target environment with the codec support checker. That tool only checks playback (decoding).

SituationCodec to consider firstWhyWatch out for
Archiving (replacing the original, long term)SVT-AV1 if size comes first, x264 if reliable playback comes firstSVT-AV1 was the smallest at the same VMAF (table below).Make sure you will still have a way to play it years from now. Re-encoding costs quality one more time, so decide first whether to keep the original.
Uploading to a platformx264 (H.264)Following the platform’s format and spec guidelines comes first, and H.264 is generally known to be accepted.Platforms often re-encode after upload. Meeting the spec comes before upload size efficiency. Check each platform’s guidelines.
Embedding on the web (your own site)H.264 as the default; if files are large, add AV1 alongside an H.264 fallbackSome devices can’t decode AV1, so an H.264 fallback is needed. Chapter 22 explains the same structure.Making two versions raises encoding and storage costs. See Chapter 18 for the recipe.
Real time (live streaming, video calls)This site’s measurements can’t settle itWhat we measured was file encoding. Low-latency settings and hardware encoders were not measured.The speed figures below are for file conversion. For live use, measure in your own environment.

For the fallback setup when embedding on the web, see Chapter 18, Web Embedding Recipe. For the order in which codecs spread across devices and for fallbacks, see Chapter 22, Hardware Support.

How different is the file size at the same quality?

A CRF value means something different in each codec, so the values can’t be compared directly. This site therefore compared file size at the same VMAF. Below are the numbers exactly as they appear in the articles.

MeasurementCompared codecSize vs. x264Speed
crf-sweep (x264 medium, SVT-AV1 6, nearest points paired)SVT-AV141–63% (4 clips. pedestrian_area 41%, riverbed 63%)Varied widely by clip
crf-sweep (same measurement)x265 mediumrush_hour 54% (VMAF 3.0 lower), riverbed about 104% (VMAF 3.3 higher)On riverbed, x265 was clearly slower than x264
iso-time (x264 slow as the baseline, interpolated at VMAF 90)x265 fast0.74–1.03x (average 0.84)CPU time 0.86–1.20x
iso-time (same measurement)SVT-AV1 100.70–0.80x (average 0.74)CPU time 0.15–0.39x
iso-time (same measurement)libaom 80.42–0.65x (average 0.52)CPU time 2.7–4.2x

The raw data and methods are in the file size and quality by CRF measurement and the size-versus-time measurement of fast presets head to head. The iso-time values are estimates interpolated between measured points, and the two measurements use different presets, so don’t read them as one continuous series.

Even within x264, the preset changes file size. At the same VMAF 90, with medium as 100%, ultrafast needed 141–308% (riverbed could not be calculated), veryfast 106–155%, slow 95–98% and slower 89–97% (x264 preset measurement). When making H.264 for a platform upload, the CRF that matches “8 Mbps” isn’t a single number either: for x264 slow it was about 20.1–20.7 on three clips and about 31.2 on riverbed (CRF vs. bitrate for YouTube uploads).

Encoding time and “real time”

In iso-time, encoding 1080p25 clips with 4 threads per job gave an fps_rt (processing speed) range of 4.76–41.08 for x264 slow, 7.80–37.26 for x265 fast, and 38.02–164.80 for SVT-AV1 10. Encoding was slower for more complex video and lower quality values. These were single runs at IDLE priority, so treat them as a rough reference. The low-latency settings that live streaming needs were not used. Don’t read them as an answer to “can I send this in real time?”

How far do patents and licenses matter?

  • Making and uploading a video file and distributing an app or device that contains an encoder carry different obligations. For the latter you need to look at both the encoder’s software license (x264 and x265 are GPL-family; SVT-AV1 is BSD-family with an AOMedia patent grant) and the codec patents. Chapter 22, Encoder Software Licenses, sums this up.
  • “AV1 is royalty-free” is a commitment by the participating rights holders not to charge royalties. It does not mean “there are no patents” (Chapter 22, lesson 3).
  • This site gives no legal advice and lists no royalty amounts. If this is for a product or a revenue-generating service, check the original license text and consult a professional.

What this guide doesn’t tell you

  • The clips are four 10-second clips in 8-bit. Animation, screen recordings, dark footage, 10-bit, HDR and 4K were not measured.
  • An equal average VMAF doesn’t guarantee the quality looks equal to the human eye, and an average hides bad frames (see the bottom 5% and minimum VMAF measurement).
  • Hardware encoders, low-latency modes, audio, and battery drain or heat during playback were not covered.
  • So we suggest making the final call after running two or three steps on your own video. The encoding commands are in the FFmpeg cheat sheet.

Frequently asked questions

Which should I use: x264, x265 or AV1?

If you don't know where it will be played, use x264 (H.264). It has the widest compatibility, but the largest files of the three codecs. If file size matters and the receiving device plays AV1, use SVT-AV1; in this site's measurements it came out at 41–63% of x264's size at the same VMAF (crf-sweep) or 0.70–0.80x (iso-time). x265 sits in the middle, and its size gain was uneven across videos.

Which codec is best for uploading to a platform such as YouTube?

Following the platform's format and specification guidance comes first, and H.264 is generally known to be accepted. Platforms often re-encode after upload, so meeting the spec matters more than upload size efficiency. Check each platform's guidance.

What should I use for real-time needs like live streaming or video calls?

This site's measurements can't settle that. What we measured is file encoding; low-latency settings and hardware encoders were not measured. For live use, you need to measure in your own environment.

AV1 is said to be royalty-free, so are there no patent concerns?

"AV1 is royalty-free" is a promise by the participating rights holders not to charge fees; it doesn't mean "there are no patents." Making and uploading a video file carries different obligations from distributing an app or device that contains an encoder, and this site does not give legal advice. For a product or a revenue-earning service, check the license text and ask a specialist.

How much does encoding speed differ between codecs?

In the iso-time measurement, encoding 1080p25 clips with 4 threads per job, the fps_rt (processing speed) range was 4.76–41.08 for x264 slow, 7.80–37.26 for x265 fast and 38.02–164.80 for SVT-AV1 10. These are single runs at IDLE priority, so treat them as a reference, not as an answer to "can I send this in real time?"