Global Brand, Local Voices: A Practical Guide
Container Formats

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), one trak per stream (each with tkhd, and mdia > minf > stbl, the sample table with stsd, stts, stsz, stco).
  • mdat (media data box) — the actual encoded video and audio samples.

A typical layout looks like this:

video.mp4
ftyp
file type & compatibility
moov
metadata, duration, tracks
trak
video track
trak
audio track
mdat
all media data (interleaved samples)

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:

CodecTypeSupport in MP4
H.264/AVCVideoUniversal — the default pairing
HEVC (H.265)VideoBroad; Safari and modern devices
AV1VideoGrowing; standardized AV1-in-MP4 mapping
VP9VideoUnofficial but widely supported by tools
MPEG-4 Part 2VideoLegacy; the original MPEG-4 video
AACAudioUniversal — the default pairing
MP3AudioUniversal
ALACAudioApple ecosystem
OpusAudioLimited; 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.

MP4WebM
StandardISO/IEC 14496-14Google-maintained open spec
Based onISO BMFF (QuickTime)Matroska (EBML)
Typical codecsH.264, HEVC, AV1, AACVP9, AV1, Opus
Codec restrictionsNone in practiceSpec limits to VP8/VP9/AV1 + Vorbis/Opus
Browser supportEvery browserChrome, Firefox, Edge; partial Safari
LicensingContainer is free; codecs may be patentedFully royalty-free end to end
StreamingfMP4 is the basis of CMAFUsed 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.mp4

Move an H.264 stream from MKV into MP4 without re-encoding (seconds, zero quality loss):

ffmpeg -i in.mkv -c copy out.mp4

Move the moov box to the front for instant web playback:

ffmpeg -i in.mp4 -c copy -movflags faststart out.mp4

All 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.

moovMovie Box

The index box containing all metadata and sample tables. Playback is impossible without it, which is why its position in the file matters.

mdatMedia Data Box

The box holding the actual encoded audio and video samples.

Faststartmoov-before-mdat layout

A file layout where the moov box precedes mdat, allowing playback to start before the whole file downloads.

Fragmented MP4fMP4

An MP4 variant split into an init segment plus moof/mdat fragments, enabling segment-based adaptive streaming such as CMAF and DASH.

MuxingMultiplexing

Combining encoded streams into a container. Demuxing is the reverse. Neither touches the encoded data.

Tracktrak

A single stream inside the container — typically one video track, one or more audio tracks, and optional subtitle tracks.

SampleMedia 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