What is MP4? MPEG-4 Container Format Explained
Learn what the MP4 container format (MPEG-4 Part 14) is, how MP4 files work, which codecs MP4 supports, and how Videospan uses MP4 for web delivery today.
MP4 (MPEG-4 Part 14) is the most widely used video container format on the web, defined by the ISO/IEC 14496-14 standard. A container is not a codec: it wraps already-encoded video, audio, and metadata into a single file without changing how those streams are compressed. The same H.264 stream can live inside an MP4, an MKV, or a MOV file, and you can move it between them without re-encoding.
MP4 was first published in 2001, is based on Apple's QuickTime .mov format, and is a profile of the ISO Base Media File Format (ISO/IEC 14496-12) — the same foundation used by MOV, 3GP, HEIF, and CMAF.
MP4 is also the container our own rendering pipeline is built around. Every video Videospan produces — from a single executive recording to hundreds of localized, multi-aspect-ratio variants of a global campaign — leaves our infrastructure as an MP4, because it's the one format we can hand to any audience, on any device, and know it will play.
How the MP4 container works
An MP4 file is a tree of boxes (also called atoms). Every box has a 4-byte size, a 4-byte type code, and a payload that may contain raw data or more boxes. Three boxes dominate almost every file:
- ftyp (file type box) — declares the file's brand and compatibility, so players know what they're parsing.
- moov (movie box) — the index. It holds metadata and the full table of where every audio and video sample lives:
mvhd(movie header), onetrakper stream (each withtkhd, andmdia>minf>stbl, the sample table withstsd,stts,stsz,stco). - mdat (media data box) — the actual encoded video and audio samples.
A typical layout looks like this:
Because playback requires the index in moov, its position matters. Many encoders write moov at the end of the file, which forces web players to download the whole file (or issue extra range requests) before playback can start. Faststart moves moov before mdat so playback begins immediately — a one-flag, lossless change.
Fragmented MP4 splits the file into an init segment (ftyp + moov) followed by a sequence of moof + mdat fragment pairs. Fragments can be generated and delivered independently, which makes fMP4 the basis of modern adaptive streaming: CMAF, DASH, and HLS with fMP4 segments all build on it.
How Videospan uses MP4
MP4 is our export standard. When a brand video finishes rendering — in every aspect ratio and variant a campaign needs — the deliverable your team downloads, shares, embeds, and archives is an MP4. Universal playback isn't a nice-to-have for us: a video that stalls in a stakeholder's email client or on an investor's phone is a failed deliverable, and MP4 is the only container with truly universal coverage.
We write every deliverable with faststart — the moov index before the media — so shared links and embedded players start playing instantly instead of buffering while the index downloads. It's a one-flag, lossless detail, and it's the difference between a video that feels instant and one that feels broken.
For streaming delivery, we package fragmented MP4 as CMAF: the same ISO BMFF structure, split into independently cacheable segments that serve both HLS and DASH players from one encode. And because MP4 is codec-agnostic, we can pair the container with H.264 and AAC for maximum compatibility, or AV1 where efficiency matters, without ever changing what we hand you.
What codecs does MP4 support?
MP4 is codec-agnostic in practice. Official and de-facto mappings exist for nearly every mainstream codec:
| Codec | Type | Support in MP4 |
|---|---|---|
| H.264/AVC | Video | Universal — the default pairing |
| HEVC (H.265) | Video | Broad; Safari and modern devices |
| AV1 | Video | Growing; standardized AV1-in-MP4 mapping |
| VP9 | Video | Unofficial but widely supported by tools |
| MPEG-4 Part 2 | Video | Legacy; the original MPEG-4 video |
| AAC | Audio | Universal — the default pairing |
| MP3 | Audio | Universal |
| ALAC | Audio | Apple ecosystem |
| Opus | Audio | Limited; mapping exists, player support varies |
MP4 vs WebM
MP4's closest sibling on the web is WebM. The short version: MP4 wins on compatibility, WebM wins on licensing.
| MP4 | WebM | |
|---|---|---|
| Standard | ISO/IEC 14496-14 | Google-maintained open spec |
| Based on | ISO BMFF (QuickTime) | Matroska (EBML) |
| Typical codecs | H.264, HEVC, AV1, AAC | VP9, AV1, Opus |
| Codec restrictions | None in practice | Spec limits to VP8/VP9/AV1 + Vorbis/Opus |
| Browser support | Every browser | Chrome, Firefox, Edge; partial Safari |
| Licensing | Container is free; codecs may be patented | Fully royalty-free end to end |
| Streaming | fMP4 is the basis of CMAF | Used for live/WebRTC-adjacent workflows |
Advantages
- Universal support. Every browser, phone, TV, and editing tool plays MP4.
- Mature tooling. ffmpeg, ffprobe, gpac/MP4Box, and every CDN understand it deeply.
- Codec flexibility. H.264, HEVC, and AV1 all fit, so you can pick per device or budget.
- Streaming-ready. Fragmented MP4 underpins CMAF, so one encode can serve DASH and HLS.
- Lossless remuxing. Streams can be moved in and out of MP4 without re-encoding.
Limitations
- moov placement. A non-faststart MP4 delays web playback until the index is fetched.
- Patent exposure. The container is free, but common pairings (H.264, HEVC, AAC) carry patent royalties in some commercial contexts.
- Overhead. Box structure adds a small per-sample overhead compared to raw elementary streams — irrelevant for files, noticeable only in exotic pipelines.
- Subtitle/attachment variety. MKV carries a broader range of subtitle and chapter formats.
When to use MP4
Use MP4 as your default delivery and archival format: website embeds, social uploads, email attachments, and anywhere you can't control the playback environment. If you're building adaptive streaming, use fragmented MP4 (ideally via CMAF) so HLS and DASH share segments.
If you're evaluating a video platform, the container is worth a question. Ask what format deliverables ship in — anything other than MP4 invites playback failures you won't discover until a stakeholder complains. Ask whether shared videos start playing instantly or buffer first — that's faststart, or the lack of it. And ask whether streaming delivery is built on the fragmented MP4 structure this page describes.
Inspect any MP4 to see its container layout, stream codecs, and moov placement:
ffprobe -v quiet -print_format json -show_format -show_streams video.mp4Move an H.264 stream from MKV into MP4 without re-encoding (seconds, zero quality loss):
ffmpeg -i in.mkv -c copy out.mp4Move the moov box to the front for instant web playback:
ffmpeg -i in.mp4 -c copy -movflags faststart out.mp4All three are stream copies — the encoded media is untouched, only the container changes.
Glossary
- Box (atom)— MP4 structural unit
The fundamental building block of an MP4 file: a size, a 4-character type code, and a payload of data or nested boxes.
- moov— Movie Box
The index box containing all metadata and sample tables. Playback is impossible without it, which is why its position in the file matters.
- mdat— Media Data Box
The box holding the actual encoded audio and video samples.
- Faststart— moov-before-mdat layout
A file layout where the moov box precedes mdat, allowing playback to start before the whole file downloads.
- Fragmented MP4— fMP4
An MP4 variant split into an init segment plus moof/mdat fragments, enabling segment-based adaptive streaming such as CMAF and DASH.
- Muxing— Multiplexing
Combining encoded streams into a container. Demuxing is the reverse. Neither touches the encoded data.
- Track— trak
A single stream inside the container — typically one video track, one or more audio tracks, and optional subtitle tracks.
- Sample— Media sample
One unit of media in a track: a video frame or an audio frame. The stbl tables map samples to byte offsets and timestamps.
Frequently asked questions
Related
Video Container Formats Explained: MP4 & WebM
Learn what video container formats are, how they differ from codecs, and when to use MP4 vs WebM — including fragmented MP4, the basis of CMAF streaming.
What is WebM? The Open Video Container Format Explained
Learn what the WebM container format is, how its EBML structure works, which codecs WebM supports, and why Videospan's browser recording starts with WebM.