MEDIA GUIDES / Video Formats

H.264 vs AV1 Explained: Which Codec Should We Choose?

Key Takeaways:

  • H.264 gives us near-universal compatibility and fast encoding, but it’s less efficient at compression
  • AV1 cuts file sizes significantly compared to H.264 at similar quality, and it’s royalty-free
  • The right choice depends on our audience, encoding budget, and whether we’re delivering live or on-demand content

Video is everywhere on the web these days, and the codec that we pick to compress it shapes everything from our bandwidth bills to how snappy playback feels for our users. H.264 has been a reliable video workhorse for more than two decades, but AV1 is quickly becoming the new go-to for teams that want smaller files without giving up too much quality.

In this article, we’ll break down the h264 vs AV1 debate in a way that helps us make a decision. We’ll look at how each codec works, where their strengths are, and when one makes more sense than the other. We’ll also see how Cloudinary’s video tools handle codec selection automatically so we can avoid format fatigue and get back to building.

In this article:

What the H.264 Codec Is

H.264, also known as AVC (Advanced Video Coding), is a video compression standard that was finalized in 2003 by the ITU-T and ISO/IEC. It became the default codec for pretty much everything video related on the web. It’s still powering Blu-ray discs, video conferencing platforms, streaming services, and broadcast systems to this day.

The design goal for H.264 was simple; shrink video files without wrecking their quality. It uses clever tricks like motion prediction and block-based compression to strip out redundant data across frames.

Because it’s been around for so long, almost every device, browser, and operating system out there has native support for decoding it, and most hardware has dedicated chips that handle H.264 playback without breaking a sweat.

This near-universal hardware acceleration is a big part of why H.264 is still so dominant. When a codec is baked into the silicon of our phones, laptops, and TVs, it plays back smoothly and sips power instead of draining our batteries.

What the AV1 Codec Is

AV1 (AOMedia Video 1) is a much newer codec that was finalized in 2018 by the Alliance for Open Media, which is a consortium backed by companies like Google, Netflix, Amazon, Mozilla, and Apple.It was designed completely for today’s internet, where saving data and keeping licence fees low matter.

What makes AV1 special is that it’s royalty-free. H.264 comes with licensing fees through Via Licensing Alliance, which can add up fast for companies delivering video at scale. AV1 sidesteps that entirely, which is part of the reason why the big streaming platforms got behind it so quickly.

Behind the scenes, AV1 uses more advanced compression algorithms than H.264. This includes better motion prediction, larger block sizes, and smarter filtering. The result is that AV1 can deliver the same visual quality as H.264, but use 40% less data, based on testing from NVIDIA and others.

Browser and device support is growing fast, with Chrome, Firefox, and Edge supporting it on most modern hardware, and Apple adding decode support across its newer M-series chips and iOS devices.

Strengths and Trade-Offs of H.264

H.264’s biggest flex is that it just works. Nearly every device manufactured in the last 15 years can decode it, often using dedicated hardware that keeps CPU usage and battery drain low. This makes it the safe default whenever we need to reach the widest possible audience.

Encoding is also fast, which is practical for real-time use cases. Live streaming, video calls, and user-generated content uploads all benefit from H.264’s established encoding pipelines.

Hardware encoders are everywhere, so we can push out H.264 streams at scale without needing expensive infrastructure.

File size is the trade-off: H.264 was designed when 4K had not yet become widespread, and this limitation is becoming apparent. At higher resolutions, H.264 files get big fast; serving a 4K stream in H.264 can double or triple our bandwidth costs compared to newer codecs.

There are also licensing fees to think about, which scale up if we have a large subscriber base.

Strengths and Trade-Offs of AV1

AV1’s main strength is compression efficiency: the same video that might need 5 Mbps to look good in H.264 can often be delivered at 3 Mbps or lower in AV1 with the same perceived quality. That translates to lower bandwidth bills, faster start times for our users, and better playback on shaky mobile connections.

The fact that it’s royalty-free is a major advantage. There’s no need to worry about per-user license charges or patent pool commitments. For startups and companies delivering video at scale, that can translate to real savings and a lot less legal overhead.

However, AV1 does struggle with encoding speed. The advanced algorithms that give it better compression also make it much slower to encode than H.264. This matters less for on-demand content that is encoded once and served multiple times, but it’s a real barrier for live streaming or real-time encoding.

Hardware decode support is also still catching up on older devices, so we’ll usually want H.264 as a fallback.

Choosing Between H.264 and AV1 in Practice

Fortunately, we aren’t required to select just a single option. Most advanced video streaming setups use both codecs at the same time, delivering whichever is most appropriate for each individual user.

  • For audiences that include older devices, enterprise environments, or regions with lots of legacy hardware, H.264 remains the safe choice. It’s also still the right pick for live streaming and video conferencing, where every millisecond of encoding latency counts.
  • For pre-encoded content delivered to modern browsers and devices, AV1 is the smart play. Streaming platforms, on-demand video libraries, and marketing videos all benefit from AV1’s efficiency; anything that we encode once and display many times.

The slower encoding happens once on our server, and then every subsequent playback uses less bandwidth. The hybrid approach is what we see in production; AV1 for users on supported hardware, with H.264 as the universal fallback.

This gives us the best of both worlds, and it’s exactly how the big streaming services handle it.

H.264 vs AV1 at a Glance

Feature H.264 AV1
Compression efficiency Baseline ~40% less data than H.264
Encoding speed Fast, real-time capable Slower, heavy on CPU
Hardware support Universal Modern devices only
Licensing MPEG LA fees Royalty-free
Best for Live, legacy devices On-demand, 4K/8K

Cloudinary Video: Delivering the Right Codec for Every User

Managing multiple codecs manually is a headache. We’d need to encode each video in H.264 and AV1, figure out which one each browser supports, handle fallbacks, and then juggle storage for all the different versions. That’s where Cloudinary steps in and handles the whole thing for us.

Cloudinary’s automatic format selection detects the requesting browser and device, and then delivers the best codec for that specific user. We upload one master video, and Cloudinary handles the transcoding, optimization, and delivery behind the scenes.

Automatic Codec Selection with f_auto

The magic happens with a single URL parameter. By adding f_auto to our Cloudinary video URL, we tell the platform to choose the best format automatically:

https://res.cloudinary.com/our-cloud-name/video/upload/f_auto,q_auto/our-video.mp4

With this, Chrome and Firefox users might receive an AV1-encoded MP4 or VP9 WebM, Safari users get HEVC, and older browsers fall back to H.264. We don’t have to write any detection logic or maintain a matrix of compatible formats ourselves.

Pairing f_auto with q_auto is the standard move. The q_auto parameter analyzes each video and picks the optimal quality level based on its content, which combined with the codec selection gives us the smallest possible file without any visible quality loss.

Explicit Codec Control When We Need It

Sometimes we want more control over the codec that gets delivered. Cloudinary’s video_codec parameter (vc_ in URLs) lets us specify exactly which codec to use:

<!-- Force AV1 delivery -->
https://res.cloudinary.com/our-cloud-name/video/upload/vc_av1,q_auto/our-video.mp4

<!-- Force H.264 with a specific profile -->
https://res.cloudinary.com/our-cloud-name/video/upload/vc_h264:baseline:3.1/our-video.mp4

This is useful when building HTML5 video elements with multiple source elements for manual fallback control, or when you want to pre-encode specific renditions for an adaptive streaming pipeline.

Multi-Source Video with Manual Fallbacks

For tighter control, we can build an HTML5 video tag with multiple sources ordered by preference. The browser picks the first one it can play:

<video controls width="1280">
  <source
    src="https://res.cloudinary.com/our-cloud-name/video/upload/vc_av1,q_auto/our-video.mp4"
    type="video/mp4; codecs=av01">
  <source
    src="https://res.cloudinary.com/our-cloud-name/video/upload/vc_vp9,q_auto/our-video.webm"
    type="video/webm; codecs=vp9">
  <source
    src="https://res.cloudinary.com/our-cloud-name/video/upload/vc_h264,q_auto/our-video.mp4"
    type="video/mp4">
</video>

AV1 is listed first for browsers that support it, VP9 comes next as a middle ground, and H.264 catches everything else. Cloudinary handles all three encodings from our single uploaded master file, so we don’t have to manage separate source files for each codec.

Wrapping Up

Choosing between h264 vs AV1 isn’t really an either/or decision for most modern projects. H.264 gives us rock-solid compatibility and fast encoding, which is perfect for live content and reaching every connected user on the planet. AV1 gives better compression and royalty-free licensing, which makes it the prime choice for on-demand content and high-resolution streaming. The real win is being able to serve whichever codec is best for each user, without having to build that logic ourselves.

Cloudinary’s automatic format selection does the heavy lifting for us, picking the right codec based on each request and falling back gracefully when needed. Sign up for a free Cloudinary account and start delivering video that adapts to every user, device, and connection automatically.

Frequently Asked Questions

Is AV1 better than H.264?

AV1 is more efficient than H.264 and produces smaller files at the same quality, but that doesn’t automatically make it better for every situation. AV1 encoding is slower and needs more processing power, and older devices may not have hardware support for decoding it.

For on-demand streaming to modern devices, AV1 is usually the better choice. For live streaming, video calls, or delivery to mixed audiences that include older hardware, H.264 is still the more practical pick.

Do I have to choose between H.264 and AV1?

Not at all. Most production video setups deliver both codecs and let each user’s browser pick whichever one it supports best.

You can build this manually with multiple source elements in an HTML5 video tag, or you can use a platform like Cloudinary that handles codec selection automatically with the f_auto parameter.

The hybrid approach gives you AV1’s efficiency where it’s supported and H.264’s compatibility as a safe fallback.

Why does AV1 take so long to encode?

AV1 uses more advanced compression techniques than H.264, like larger block sizes, more sophisticated motion prediction, and better filtering. These improvements give you smaller files at the same quality, but they also require much more processing power during encoding.

Software optimizations and hardware acceleration are both improving quickly, but AV1 encoding can still take 5-10 times longer than H.264. This trade-off is usually worth it for content that gets encoded once and streamed many times, where the slower encode happens on your server instead of affecting your users.

QUICK TIPS
Tali Rosman
Cloudinary Logo Tali Rosman

In my experience, here are tips that can help you better choose and deploy H.264 vs AV1:

  1. Test by content class, not one “representative” clip
    Animation, screen recordings, sports, film grain, and talking heads compress very differently. Build a small corpus reflecting your actual library before deciding how much AV1 saves.
  2. Compare codecs with perceptual metrics
    File size at an arbitrary CRF or quality setting is a poor comparison. Normalize against VMAF, SSIMPLUS, or another perceptual target and then compare bitrate—the useful question is how many bits each codec needs to reach the same perceived quality.
  3. Treat grain as a special case
    Film grain and sensor noise consume a surprising amount of bitrate because encoders struggle to distinguish intentional texture from expendable detail. AV1’s film-grain synthesis capabilities can preserve the appearance of grain without encoding every grain pattern directly.
  4. Optimize the ladder, not just individual renditions
    With adaptive bitrate streaming, AV1’s efficiency can make some adjacent rungs unnecessarily similar. Rebuilding resolution/bitrate ladders per codec can produce greater savings than simply recreating an H.264 ladder in AV1.
  5. Measure decode cost alongside bitrate
    A stream that saves bandwidth can still provide a worse experience if a device falls back to software AV1 decoding. Track CPU utilization, dropped frames, battery impact, and thermal behavior on representative low-end devices—not merely whether the browser reports AV1 support.
  6. Prioritize AV1 by viewing volume
    Don’t automatically AV1-encode an entire back catalog. Encoding your highest-traffic assets first often captures most of the bandwidth savings while avoiding compute and storage costs for videos that receive very few plays.
  7. Keep mezzanine masters codec-independent
    Avoid generating AV1 from an already compressed H.264 delivery copy. Preserve a high-quality mezzanine or original master so every delivery codec is derived from the cleanest practical source and doesn’t inherit H.264 artifacts.
  8. Align keyframes across codec ladders
    For HLS/DASH deployments, matching keyframe and segment boundaries across renditions makes adaptive switching and packaging more predictable. This becomes especially important when maintaining parallel H.264 and AV1 presentation sets.
  9. Calculate the AV1 break-even point
    For each asset class, estimate AV1’s extra encoding cost against expected CDN egress savings over its lifetime. High-view VOD can repay an expensive encode quickly; low-view or short-lived content may never recover that compute cost.
  10. Watch real playback telemetry before expanding AV1
    Track codec share alongside startup time, rebuffering, fatal playback errors, dropped frames, and watch time. Gradually increasing AV1 delivery based on observed QoE is safer than assuming that advertised codec support means every supported device handles AV1 equally well.
Last updated: Sep 10, 2026
★★★★★
4.7 (24 reviews)
Talk to Sales Talk to Sales