Video codec comparison, measured

Compare AV1, HEVC, VP9 and H.264 on size, speed, cost and VMAF quality, measured on one file. AV1 delivered 20 more VMAF points at an identical byte budget.

Share

Most codec comparisons fix the encoder setting and report the resulting size. That is easy to run and close to meaningless, because CRF 23 does not mean the same thing to x264 and to libaom and there is no conversion between them.

This page does it both ways: at each codec’s own conventional setting, and again with the file size held constant and the quality measured. The second is the one that settles arguments.

The comparison that settles it

Hold every codec to a 150 KB ceiling, let a search find the setting that lands there, and score the result with VMAF.

Each case asked for the same 150 KB ceiling. The job probed candidate encodes and scored each with VMAF, so size is the constant and quality is the measurement.
CaseVerdictCodecVMAFSizeProbes
codec autolowh26464.3 146.5 KB6
codec h264lowh26464.3 146.5 KB6
codec hevclowhevc76.2 140.2 KB5
codec av1acceptableav184.8 146.1 KB6
Measured 2026-08-20 with the compress.target job type. VMAF is scored by the job against the original while it searches. Across all 17 cases the search ran 92 probe encodes for $0.260989.
CodecSizeVMAF
H.264146.5 KB64.3
HEVC140.2 KB76.2
AV1146.1 KB84.8

20.5 points of measured quality, at the same number of bytes. VMAF above 90 is hard to distinguish from source, the 80s are good, and the 60s are where most viewers would complain. So at this bitrate H.264 produces something people notice and AV1 produces something they do not.

That is the entire modern-codec argument, stated the only way that is not arguable. Full detail in AV1 vs H.264 VMAF compared.

At each codec’s own settings

The other way round: give each codec its conventional CRF and see what falls out.

Video codecs
How do H.264, HEVC, VP9 and AV1 compare on the same clip?
Held constant: Default-ish quality for each codec, 5 seconds of the same source
Bar chart. Video codecs. Encode time and output size for each variant, each metric scaled to its own maximum.
VariantEncodeSizeCost
H.264 (libx264)898 ms fastest433.0 KB$0.0024
HEVC (libx265)1674 ms233.0 KB$0.0032
VP9 (libvpx-vp9)5347 ms346.6 KB$0.0071
AV1 (libsvtav1)1111 ms224.4 KB$0.0026
AV1 (libaom-av1)4769 ms146.5 KB$0.0062
Measured 2026-08-20 on the Rendobar API. Encode time is the FFmpeg step alone, separated from download and upload. 5 of 5 runs succeeded. Sizes are exact and repeatable. Timings are a single sample and vary up to 2x run to run, so treat small differences as noise. Why.

VP9 is dominated. SVT-AV1 produced a file 35% smaller in 4.8x less encode time for 63% less cost. Not a tradeoff, a straight loss on every axis measured.

That matters because VP9’s argument was never technical, it was practical: the royalty-free codec with real browser support while AV1 encoders were too slow to use. SVT-AV1 removes it.

The encoder matters more than the codec. The two AV1 rows are the same codec and barely comparable: libaom produced a file 35% smaller than SVT-AV1 and took 4.3x longer. A benchmark that says “AV1” without naming the encoder and the speed preset has not told you anything actionable. Detail in AV1 vs VP9 vs HEVC vs H.264.

Choosing an AV1 speed preset

SVT-AV1 speed presets
How far can you turn SVT-AV1's speed dial before it hurts?
Held constant: libsvtav1 CRF 35, same source, audio stripped
Bar chart. SVT-AV1 speed presets. Encode time and output size for each variant, each metric scaled to its own maximum.
VariantEncodeSizeCost
preset 42399 ms174.6 KB$0.0058
preset 61585 ms197.3 KB$0.0043
preset 81105 ms224.4 KB$0.0028
preset 10653 ms229.7 KB$0.0021
preset 12614 ms fastest219.7 KB$0.0021
Measured 2026-08-20 on the Rendobar API. Encode time is the FFmpeg step alone, separated from download and upload. 5 of 5 runs succeeded. Sizes are exact and repeatable. Timings are a single sample and vary up to 2x run to run, so treat small differences as noise. Why.

Preset 4 to preset 12 is 3.91x in time for 25.8% in size, so the dial is real but narrower than AV1’s reputation suggests.

One rung is worth skipping entirely: preset 12 was both faster and smaller than preset 10, so preset 10 is strictly dominated on this content. That is the same non-monotonicity that appears in x264’s presets, and the same cause: -crf targets quality, so size is emergent.

Preset 8 is the sensible default, at 2.2x faster than preset 4 for 28% more bytes. Detail in SVT-AV1 presets compared.

Hardware encoding

NVENC against libx264
Is hardware encoding actually cheaper once you pay for the GPU?
Held constant: Same 1280x720 source, 5 seconds, audio stripped
Bar chart. NVENC against libx264. Encode time and output size for each variant, each metric scaled to its own maximum.
VariantEncodeSizeCost
libx264 medium (CPU)913 ms fastest433.0 KB$0.0030
libx264 veryfast (CPU)1371 ms388.4 KB$0.0031
h264_nvenc p4 (GPU)1225 ms956.2 KB$0.0018
h264_nvenc p7 (GPU)1762 ms1127.4 KB$0.0011
hevc_nvenc p4 (GPU)1171 ms501.1 KB$0.0008
Measured 2026-08-20 on the Rendobar API. Encode time is the FFmpeg step alone, separated from download and upload. 5 of 5 runs succeeded. Sizes are exact and repeatable. Timings are a single sample and vary up to 2x run to run, so treat small differences as noise. Why.

hevc_nvenc on an L4 cost $0.0008 where the same libx264 command measured $0.0023 to $0.0039 across ten runs. The GPU sits below that entire band, so call it three to five times cheaper per job.

It also produced 2.2x the bytes at a nominally comparable quality setting, because NVENC’s rate control is simpler than x264’s.

That is the actual trade, and it is not the one the marketing describes. You are not buying speed; on a five-second clip we could not separate the two on time at all. You are buying cheaper jobs at the cost of larger files, and which way that lands depends on whether you pay more for compute or for bandwidth. Detail in NVENC vs libx264 compared.

Still images

The same argument runs for images, with a cleaner result.

Still image formats
How do JPEG, WebP, AVIF and PNG compare on the same frame?
Held constant: One frame from the same 1280x720 source, conventional quality per format
Bar chart. Still image formats. Encode time and output size for each variant, each metric scaled to its own maximum.
VariantEncodeSizeCost
JPEG q3126 ms39.2 KB$0.0015
JPEG q8124 ms fastest23.4 KB$0.0022
WebP q80168 ms24.6 KB$0.0015
AVIF crf30428 ms13.4 KB$0.0017
PNG lossless197 ms264.3 KB$0.0016
Measured 2026-08-20 on the Rendobar API. Encode time is the FFmpeg step alone, separated from download and upload. 5 of 5 runs succeeded. Sizes are exact and repeatable. Timings are a single sample and vary up to 2x run to run, so treat small differences as noise. Why.

AVIF produced 13.4 KB against JPEG’s 23.4 KB and WebP’s 24.6 KB on the same frame, so 43% and 45% smaller respectively. PNG produced 264.3 KB, nearly twenty times the AVIF, which is why it does not belong on a delivery path for photography.

WebP came out marginally larger than JPEG at comparable settings, which is not its reputation. The widely repeated “30% smaller than JPEG” claim is usually measured against a badly tuned JPEG. Detail in AVIF vs WebP vs JPEG compared.

Audio

Audio codecs and bitrates
What does an audio codec choice cost in bytes?
Held constant: Same source audio, 5 seconds, video stripped
Bar chart. Audio codecs and bitrates. Encode time and output size for each variant, each metric scaled to its own maximum.
VariantEncodeSizeCost
Opus 64k128 ms50.5 KB$0.0022
Opus 128k101 ms93.2 KB$0.0016
AAC 128k257 ms80.2 KB$0.0017
AAC 192k170 ms119.4 KB$0.0017
MP3 192k108 ms118.7 KB$0.0016
FLAC lossless62 ms fastest453.0 KB$0.0016
Measured 2026-08-20 on the Rendobar API. Encode time is the FFmpeg step alone, separated from download and upload. 6 of 6 runs succeeded. Sizes are exact and repeatable. Timings are a single sample and vary up to 2x run to run, so treat small differences as noise. Why.

Opus at half the nominal bitrate of AAC produced 37% fewer bytes, which is why WebRTC, Discord and most modern voice stacks standardised on it. AAC still wins on playback support, particularly on older Apple hardware.

One detail that breaks storage estimates: Opus delivered 16% more bytes than its nominal bitrate predicts, because libopus defaults to variable bitrate and Ogg carries more container overhead. Nominal bitrate is a request, not a receipt. Detail in Opus vs AAC vs MP3 vs FLAC.

What to actually use

Web video, broad audience: H.264 in MP4 with yuv420p and +faststart. It is the largest of the options and it plays on everything, and that is usually the right trade. The settings around it matter more than you would think, and FFmpeg encoding settings compared has the full set measured.

Web video, modern players: AV1 via SVT-AV1 at preset 8, with an H.264 fallback. Worth 20 VMAF points at the same size.

Large library, cost-sensitive: NVENC. Several times cheaper per job, and the extra bytes only matter for files people actually watch.

Archival: libaom-av1 at a slow preset, or a lossless codec if the source is a master rather than a delivery copy.

Audio: Opus where support allows, AAC where it does not, and never FLAC over a network.

About the quality settings

In the second table each codec ran at its own conventional value: CRF 23 for x264, 28 for x265, 32 for VP9, 35 for both AV1 encoders. These scales are not interchangeable, so read that table as “what you get at each codec’s normal setting” rather than as matched quality.

The first table has no such caveat, which is why it leads this page. Fixing the size and measuring the quality needs a search that probes candidate encodes and scores each one, and that is what produced the VMAF column.

How these numbers were produced

Every figure came from a job run against a live API on one fixed source, a 5-second 1280x720 clip with audio stripped for the video tests. The codec sweeps here total 106 encodes plus 92 VMAF-scored probe encodes for the matched-size comparison.

Sizes are exact and repeatable. The same command produced byte-identical output on all ten runs we checked. Timings are single samples unless a sweep states otherwise, and identical work varied up to 2.13x on this infrastructure, so treat small timing differences as noise. That is documented in FFmpeg benchmark variance.

Where this stops

One clip, one resolution, one content type. Grain and motion move codec rankings more than almost anything else, and a 5-second clip flatters fast encoders because slow ones have less opportunity to amortise their analysis.

VMAF is a model of human perception rather than human perception, and it is known to be generous to some blur and harsh on some grain. A 20-point gap is far outside the range where that would reverse an ordering; a 2-point gap would not be.

Before you encode anything

Picking a codec assumes you know what you are holding. The source’s container, streams and durations decide half of these choices, and the container duration disagrees with the video stream by up to 493 ms on files that carry audio. How to get video duration with ffprobe has the measurements, and common ffprobe commands compared has the command set.

For letting the codec be chosen per file rather than picked once, see how to compress video to a target size, where a search over 120 jobs chose h264 47 times, AVIF 41 and AV1 only 7.

Frequently asked questions

Which video codec is best?

AV1 for efficiency and H.264 for compatibility. Held to the same file size, AV1 scored VMAF 84.8 where H.264 scored 64.3, but H.264 decodes on essentially every device made in the last fifteen years.

Is AV1 better than HEVC?

On our matched-size test, yes. AV1 scored 84.8 against HEVC's 76.2 at the same byte budget, and AV1 has no patent licensing burden. HEVC still has broader hardware decode support.

Is VP9 still worth using?

On this evidence, no. SVT-AV1 beat it on size, encode time and cost simultaneously. VP9's historical argument was that AV1 encoders were too slow, and SVT-AV1 removed it.

How much smaller is AV1 than H.264?

At matched quality settings rather than matched size, libaom-av1 produced 146.5 KB against H.264's 433 KB on the same clip, which is 66% smaller. The tradeoff is encode time.

Should I use hardware encoding?

If cost per job dominates, yes. NVENC on an L4 cost a fraction of libx264 per job while producing 2.2x the bytes, so it suits transcoding large libraries that are mostly never watched.

What is VMAF?

A perceptual video quality metric from Netflix, trained on human scoring. Above 90 is hard to distinguish from source, the 80s are good, and the 60s are where most viewers would call a result bad.

Sources

Tags #av1#hevc#vp9#h264#codecs#vmaf#guide
All posts
Share
  1. How to compress video to a target size Guides for the video API
  2. FFmpeg API pricing compared Guides for the video API
  3. How to burn subtitles into a video Guides for the video API