Skip to content

YouTube Video Formats Explained: MP4, WebM, H.264, VP9, and AV1

Published

Container vs. codec — the distinction almost everyone glosses over

When you see "MP4" or "WebM" next to a YouTube download, that's the container — a wrapper file format that holds video, audio, subtitles, and metadata together. It says nothing on its own about quality or file size. The thing that actually determines those is the codec — the compression algorithm used to encode the video data inside that container.

MP4 almost always wraps H.264 video (sometimes AV1). WebM almost always wraps VP9 (sometimes AV1 as well). This pairing isn't arbitrary — it's a legacy of format support: H.264 predates WebM's public existence, so MP4 became its natural home, while Google introduced WebM specifically to give VP9 (and later AV1) an open, royalty-free container.

Why YouTube splits video and audio into separate streams

If you've pulled format data from a YouTube video, you've probably noticed that most quality options above 480p have no audio track at all — they're video-only, and a separate audio-only stream has to be merged in afterward. This isn't an accident or a limitation — it's YouTube's DASH (Dynamic Adaptive Streaming) delivery model working as intended.

Splitting video and audio lets YouTube's player switch video quality on the fly (say, dropping from 1080p to 480p on a slow connection) without re-buffering the audio track at all — the two streams are independent. The tradeoff for anyone downloading rather than streaming: getting a single playable file back usually means muxing (combining) a video-only stream and an audio-only stream together, which is exactly what a "Merge" download is doing behind the scenes. A "Direct" download, by contrast, means YouTube happened to still have a pre-combined stream available at that quality — increasingly rare above 480p as YouTube phases progressive formats out entirely.

H.264 vs. VP9 vs. AV1 — what the codec choice actually costs you

All three codecs can produce a 1080p video. The difference is efficiency: how much visual quality you get per byte of file size, and how much processing power is needed to decode it.

  • H.264 (AVC) is the oldest of the three and the least efficient — it needs a larger file to hit the same visual quality as VP9 or AV1. Its advantage is universal compatibility: every device, browser, and video editor made in the last 15+ years can play it without issue.
  • VP9 is roughly 30-50% more efficient than H.264 at the same visual quality, meaning meaningfully smaller files. Support is very good on modern browsers and Android, but noticeably weaker on older hardware, some smart TVs, and certain video editing software.
  • AV1 is the newest and most efficient of the three, squeezing out further file-size savings over VP9. The tradeoff is decoding cost — AV1 is computationally heavier to play back, and older devices without hardware AV1 decoding support can struggle or fail to play it smoothly at all.

So which should you actually pick?

  • Editing the video afterward (in software that doesn't explicitly support VP9/AV1) → H.264. Broadest compatibility, least likely to cause an import error.
  • Archiving at the smallest file size for a given quality, and you'll play it back on something modern → AV1, if available at your target quality.
  • Playing on an older TV, set-top box, or embedded device → H.264, almost always the safest bet.
  • Not sure, just want something that works everywhere → H.264 MP4 remains the "no surprises" default, even though it's the least space-efficient option of the three.

None of these choices affect the actual visual content — a 1080p H.264 file and a 1080p VP9 file of the same video look the same when played back correctly. The difference is purely in file size and where each one is guaranteed to work without a hitch.

FAQ

Questions about this article

Does converting between H.264, VP9, and AV1 lose quality?
Only if you re-encode from one to the other. Downloading a stream in its original codec — which is what a direct or merged download does — doesn't re-compress anything; you get the exact quality YouTube stored, not a lossy conversion.
Why do some 4K downloads only offer VP9 or AV1, never H.264?
YouTube generally doesn't encode its highest resolutions in H.264 at all, specifically because the file-size savings from VP9/AV1 matter most at high resolutions. If you need 4K in H.264 specifically, you'd have to re-encode it yourself after downloading.
Is WebM a worse format than MP4?
Not in terms of quality — WebM is simply the container built for VP9/AV1, which are technically more efficient codecs than H.264. It's "worse" only in the sense of slightly narrower compatibility with older software.