Video File Types Explained: Containers, Codecs, and What to Serve

RT

Ryan Trann

AUTHOR

June 1, 2026

6 min read

Video

TL;DR

Serve MP4/H.264 by default — it works everywhere. Add WebM/VP9 as a secondary output if your pipeline supports multiple renditions and you want smaller files. Never serve raw uploads directly; transcode MOV, AVI, MKV, and WMV to your delivery format on the backend first.

Video file types explained — containers and codecs for web delivery

Video Formats Explained: Which to Use?

Adding video to your app is straightforward until you realize you need to decide what format to accept, what to transcode to, and what to actually serve to users. Get it wrong and you're looking at playback failures, bloated files, or a codec that half your users' browsers won't support.

This is a reference guide to the video file types and containers that matter for web and mobile app delivery in 2026. What each format is, when you'll encounter it, and what to do with it. For a direct comparison of MP4 and WebM specifically, see WebM vs MP4 for Web: A Developer's Guide.

What Is a Video Format?

A video format is a file type that defines how video data is stored and delivered. When developers talk about "video formats," they're usually conflating two separate things: the container and the codec.

  • Container: The wrapper file (.mp4, .mkv, .mov). It holds the video stream, audio stream, subtitles, and metadata together.
  • Codec: The compression algorithm used to encode the actual video data (H.264, H.265, AV1, VP9). The container and codec are independent — an .mp4 file can contain H.264, H.265, or AV1 video.
  • File extension: Indicates the container format, not the codec.

This distinction matters when you're deciding what to transcode to and what your player needs to support.

Container Formats: What You'll Actually Encounter

Most of the time, users will upload whatever format their device or editing software spits out. Your job is knowing which ones to accept, which to transcode from, and what to serve.

MP4 (.mp4)

The default choice for web and mobile delivery. MP4 is universally supported across browsers, iOS, Android, and desktop players. If you're serving video to end users, this is almost always your output format. It's not the most efficient container, but compatibility wins.

AVI (.avi)

A legacy Microsoft format from 1992. You'll still receive AVI uploads from older software, but it's not suitable for web delivery — no native browser support, large file sizes, and limited codec flexibility. Accept it as an input format and transcode immediately.

MOV (.mov)

Apple's native container, used by iPhones and Final Cut Pro. MOV files are common uploads from iOS users and video editors. They're not ideal for direct web delivery — transcode to MP4 before serving.

MKV (.mkv)

A flexible open-source container that supports multiple audio tracks, subtitles, and chapters. Common in desktop media players and downloaded content. Browser support is inconsistent — Chrome supports it, Safari doesn't. Not a reliable delivery format for web apps.

WMV (.wmv)

Windows Media Video — a legacy format you'll occasionally receive as uploads from older Windows software. There's no reason to serve WMV to users in 2026. Transcode to MP4.

Codecs: What Actually Compresses Your Video

The codec determines file size, quality, and whether a given browser or device can play it at all. This is where most of the meaningful decisions happen.

Here's a brief list of popular codecs:

  • H.264: Universal compatibility, safe default
  • H.265: Better compression, inconsistent browser support
  • VP9: Open-source, strong in Chrome/Firefox
  • AV1: Best compression, growing support, slow to encode

H.264 (AVC)

The most widely supported video codec in existence. H.264 plays natively in every major browser, iOS, Android, and practically every device made in the last decade. It's not the most efficient codec — H.265 and AV1 both beat it on compression — but nothing else matches its compatibility. For most apps, H.264 in an MP4 container is the safe default output.

H.265 (HEVC)

Roughly 25–50% better compression than H.264 at equivalent quality, which matters for 4K or bandwidth-constrained delivery. The catch: browser support is inconsistent. Safari handles it well on Apple hardware. Chrome and Firefox support depends on the user's hardware and OS — it's not guaranteed. If you serve H.265, have an H.264 fallback ready.

VP9

Google's open-source codec, used heavily by YouTube. Better compression than H.264, solid browser support in Chrome and Firefox, but limited on Safari and older iOS. A reasonable choice if you control the playback environment, but not a universal default.

AV1

The newest generation codec — better compression than H.265, fully open-source, no licensing fees. YouTube began deploying AV1 in 2018 and Netflix has been streaming it since 2020. Browser support has caught up: Chrome, Firefox, and Edge support it natively, and Safari added support in version 17. The tradeoff is encoding time — AV1 is computationally expensive to transcode. Worth it for new pipelines where bandwidth efficiency matters.

Where WebM Fits In

WebM is a container format built specifically for the web. It was designed to pair with open-source codecs: VP9 and AV1. You'll encounter it when you want better compression than MP4/H.264 can offer without paying H.265 licensing fees.

The short version: WebM/VP9 gets you 25–50% smaller files than MP4/H.264 at comparable quality. That's real money at scale. A typical 180MB iPhone upload transcodes to roughly 25–30MB as MP4/H.264, and around 15–18MB as WebM/VP9. WebM/AV1 pushes that down further to 12–15MB, but AV1 is still computationally expensive to encode and Safari support is patchy.

The catch has always been Safari. For years, WebM was a non-starter for any app targeting iOS users. That's changed. WebM/VP9 recently reached baseline browser support, meaning it now works across all major browsers on recent devices, including Safari.

How to Think About WebM in Your Pipeline

WebM is not a replacement for MP4 as your universal default, not yet. The practical breakdown:

  • MP4/H.264: Serve this as your baseline. It works everywhere, including embedded browsers, older iOS devices, and any edge case you haven't thought of.
  • WebM/VP9: A strong secondary output if your pipeline supports multiple renditions. Serve it to browsers that support it, fall back to MP4 for everything else.
  • WebM/AV1: Worth encoding to for new pipelines where bandwidth efficiency is the priority. Safari is still catching up, so keep MP4 as the fallback.

The real-world decision comes down to whether you want to manage format negotiation yourself or offload it. For a deeper breakdown of the tradeoffs with real file-size benchmarks, see WebM vs MP4 for Web: A Developer's Guide.

Choosing Your Delivery Format

Three Questions to Ask First

Choosing the right output format comes down to three questions: who are your users, what devices are they on, and how much complexity can your pipeline support?

For most app teams adding video as a feature, the answer is straightforward. Serve MP4/H.264 by default. It's not the most efficient codec, but it's the one that works everywhere without exceptions — Safari, embedded browsers, older Android devices, smart TVs. If you need better compression and can handle format negotiation or multiple renditions, add WebM/VP9 as a secondary output.

Decision Framework

  • Maximum compatibility: MP4/H.264. No exceptions, no fallbacks needed.
  • Smaller files, modern browsers: WebM/VP9 with MP4 fallback.
  • Best compression available: WebM/AV1, but only if you can accept Safari gaps and slower encoding.
  • Uploading from users: Accept anything. Transcode everything to your delivery format on the backend.

The format question matters less than the transcoding question. Raw uploads from users — MOV from iPhones, AVI from desktop software, MKV from downloaded content — should never go directly to playback. They need to be transcoded to a consistent output before delivery.

Video Format Comparison Table

FormatTypeUse for delivery?Notes
MP4/H.264Container + codecYes — defaultWorks everywhere
WebM/VP9Container + codecYes — secondary25–50% smaller than MP4; fallback to MP4 for Safari
WebM/AV1Container + codecYes — if bandwidth mattersBest compression; slow to encode; Safari still catching up
MOVContainerInput onlyTranscode before serving
AVIContainerInput onlyLegacy; no browser support
MKVContainerInput onlyInconsistent browser support
WMVContainerNoObsolete for web delivery

MP4/H.264

Type

Container + codec

Use for delivery?

Yes — default

Notes

Works everywhere

WebM/VP9

Type

Container + codec

Use for delivery?

Yes — secondary

Notes

25–50% smaller than MP4; fallback to MP4 for Safari

WebM/AV1

Type

Container + codec

Use for delivery?

Yes — if bandwidth matters

Notes

Best compression; slow to encode; Safari still catching up

MOV

Type

Container

Use for delivery?

Input only

Notes

Transcode before serving

AVI

Type

Container

Use for delivery?

Input only

Notes

Legacy; no browser support

MKV

Type

Container

Use for delivery?

Input only

Notes

Inconsistent browser support

WMV

Type

Container

Use for delivery?

No

Notes

Obsolete for web delivery

Key Takeaways

  • Serve MP4/H.264 by default. It's the only format that works everywhere without exceptions.
  • Add WebM/VP9 as a secondary output if your pipeline supports multiple renditions and you want smaller files.
  • Don't serve raw uploads. Transcode MOV, AVI, MKV, and WMV to your delivery format on the backend before playback.
  • AV1 is worth encoding to for new pipelines where bandwidth efficiency matters — just keep MP4 as the fallback.
  • The format decision matters less than the transcoding pipeline. Get that right and the rest follows.

Hyperserve handles upload, transcoding, storage, and delivery — you just call the API.

FAQs

What is the best video file type for web apps?

MP4 with H.264 is still the safest default for web apps because it works across browsers, mobile devices, and embedded players. If you want smaller files and can support fallback logic, WebM with VP9 or AV1 can be a strong secondary output.

What is the difference between a container and a codec?

A container is the file wrapper, like MP4, MOV, or MKV. A codec is the compression method inside the file, like H.264, H.265, VP9, or AV1. The container tells you how the file is packaged, while the codec determines playback efficiency and compatibility.

Should I accept AVI uploads from users?

Yes, if you need to support legacy uploads. AVI is still common in older software, but it is not a good delivery format for modern apps. Accept it as input, then transcode it to your standard output format before playback.

Where does WebM fit in a video pipeline?

WebM is a good secondary delivery format for browser-first apps, especially when you want better compression than MP4/H.264. It is best used alongside MP4 fallback, not as your only output, because compatibility still matters across mixed devices and browsers.

Is AV1 worth using yet?

AV1 is worth considering if bandwidth savings matter and your pipeline can handle slower encoding. It compresses well, but it is more expensive to encode than H.264 or VP9, so most teams use it selectively rather than as their only delivery format.

Add video to your app

Hyperserve handles upload, transcoding, storage, and delivery — you just call the API.

Hyperserve

The rapid deployment video backend for modern devs

Product

FeaturesPricingBlog

Social

© 2026 Hyperserve. All rights reserved.

Made by Misty Mountain Software