video/mp4 MP4 Flagship
Identifies MP4 video files — the most universally supported video container format for web and device playback.
What it's for
video/mp4 identifies MP4 video files — a container format (MPEG-4 Part 14) that typically wraps H.264 or H.265 video alongside AAC audio, and is by a wide margin the most universally compatible video format across browsers, mobile devices, smart TVs, and video editing software. It's the safe default for web video delivery precisely because of that near-universal playback support, even though technically superior (better compression) alternatives exist for specific contexts.
It's worth understanding that "MP4" refers to the container — the wrapper format that bundles video/audio streams and metadata together — while the actual video compression is handled by a separate codec (most commonly H.264) inside that container; this container-vs-codec distinction matters for compatibility troubleshooting, since two MP4 files can use different codecs internally with very different playback support.
Format & syntax
Content-Type: video/mp4
No parameters typically used in the Content-Type header itself, though the actual codec used inside the MP4 container (commonly signaled separately via a codecs parameter in more detailed content negotiation contexts, like <source type="video/mp4; codecs=avc1.42E01E">) affects real-world compatibility more than the container format alone.
How it's used in practice
<video>element sources — the default, most broadly compatible choice for HTML5 video, typically listed first among multiple<source>fallbacks for maximum device/browser coverage.- User-generated video uploads — video upload features (social media, content platforms) commonly accept MP4 directly or transcode uploaded videos to MP4/H.264 for guaranteed playback compatibility across the widest range of viewer devices.
- Video streaming platforms (as a delivery format) — even platforms using adaptive bitrate streaming protocols (which break video into small segments) often ultimately deliver MP4-based segments (via fragmented MP4) as part of the underlying technology.
- Downloadable video content — MP4's broad device support makes it the practical default when offering video as a direct download rather than a streaming player, since recipients can reliably play it without needing specific software.
Common mistakes & gotchas
- Confusing the container format with the codec — an MP4 file can contain different video codecs (H.264 is most universal, H.265/HEVC offers better compression but less universal support, AV1 is newer still with growing but incomplete support) — "it's an MP4" doesn't guarantee playback compatibility on its own; the codec inside matters just as much.
- Large video files without proper streaming/range request support — self-hosted video playback benefits significantly from proper HTTP range request support (letting the browser request only the portion needed rather than the whole file), which requires correct server configuration separate from the MIME type itself.
- Not providing multiple format/codec fallbacks for broader compatibility — relying on a single MP4/H.264 file usually works broadly, but for genuinely universal compatibility (including some open-source-focused platforms or specific device constraints), pairing with a WebM fallback via multiple
<source>elements provides better coverage. - Uploading vertical/mobile-recorded video without correct orientation metadata — similar to JPEG's EXIF orientation issue, video files can carry rotation metadata that some players/processing pipelines don't respect correctly, leading to sideways playback in certain contexts.
Comparison & FAQ
| Type | Purpose | Key difference from video/mp4 |
|---|---|---|
| video/webm | Open, often more efficient web-focused container | Strong browser support but historically less universal than MP4 across non-browser devices/players |
| video/quicktime | Apple's QuickTime container format (.mov) | Less universally supported for web playback than MP4, more common in professional video editing workflows |
Why won't my MP4 video play on some devices/browsers even though it's an MP4?
Almost always a codec compatibility issue rather than a container issue — check whether the video is encoded with H.264 (most universally supported) versus a newer codec like H.265/HEVC or AV1, which have narrower device/browser support.
What's the difference between the MP4 container and the video codec?
The container (MP4) is the wrapper format bundling video, audio, and metadata together; the codec (commonly H.264, sometimes H.265 or AV1) is the actual compression algorithm used for the video data inside that container — two MP4 files can have very different playback compatibility depending on their internal codec.
Should I provide multiple video formats for web playback?
For maximum compatibility, pairing an MP4/H.264 source with a WebM fallback via multiple <source> elements in a <video> tag covers the broadest range of browsers and devices, though MP4/H.264 alone already covers the vast majority of modern use cases.
Why is my uploaded video playing sideways?
Likely a rotation/orientation metadata issue, similar to JPEG's EXIF orientation problem — video recorded in portrait orientation on mobile devices often stores rotation as metadata rather than physically re-encoding the pixel orientation, and not every player or processing step respects that metadata correctly.