What is MP4?

Discover the MP4 format, the world's most popular video container. Learn about its codecs, file structure, and best use cases in this comprehensive guide.

The MP4 video format explained: how the container works, codecs vs containers, and when to use it.

MP4

What is MP4?

MP4 (MPEG-4 Part 14) is a digital multimedia container format most commonly used to store video and audio, but which can also store subtitles, images, and other data.

How MP4 Works: A Container, Not a Codec

The single most important thing to understand about MP4 is that it is a container, not a codec. An MP4 file does not itself compress video; it is a box that holds separately compressed streams, typically H.264 or H.265 video and AAC audio, and keeps them synchronized. This is why two MP4 files can behave very differently: one might play everywhere while another stutters or refuses to open, not because of the .mp4 wrapper, but because of the codec used for the video inside it. The container and the codec are two separate decisions.

Technically, MP4 (formally MPEG-4 Part 14) is built on the ISO Base Media File Format, organizing everything into nested boxes, also called atoms. The moov box holds metadata describing each track and a sample table that maps timestamps to byte positions, while the mdat box holds the actual compressed media samples. The container's job is to multiplex these independently encoded streams and store the index that lets a player seek instantly to any point in the video.

That moov metadata box matters in practice. When it sits at the start of the file (a layout often called "fast start"), a player can begin streaming immediately because it learns the file's structure up front. When it sits at the end, a browser may have to download the whole file before playback begins. This is why exporting video for the web with the metadata moved to the front noticeably improves streaming start times, even though the bytes are otherwise identical.

Why MP4 Won

MP4 became the universal default for one main reason: compatibility. The H.264 video plus AAC audio combination it usually carries is hardware-accelerated on virtually every phone, computer, smart TV, and browser made in the last fifteen years, so an MP4 simply plays, smoothly and with low battery use, almost anywhere you put it. No other video format can match that reach. It is the format cameras record, phones export, social platforms accept, and streaming services deliver.

Alongside that reach, MP4 offers genuinely good compression: H.264 delivers high visual quality at modest file sizes, and H.265 (HEVC) roughly halves the size again at the cost of slightly less universal support. MP4 can also carry subtitles, multiple audio tracks, and chapter markers, so it is flexible enough for most real-world video without the complexity of heavier container formats.

When to Use MP4

Use MP4 as your default for almost everything: sharing video, uploading to any platform, embedding on a website, or delivering a file that must open on an unknown device. Pair it with H.264 video and AAC audio when maximum compatibility is the goal, the combination that works everywhere, or with H.265 when you want smaller files and know your audience has reasonably modern devices. For the web specifically, export with fast start enabled so playback begins immediately.

Limitations

MP4's constraints are minor but real. It is less feature-rich than MKV: while it handles multiple audio and subtitle tracks, it is not as flexible for the many-track, many-subtitle, many-attachment use cases that movie archivists prefer. The popular H.264 and H.265 codecs it usually carries are also covered by patents, which is why royalty-free formats like WebM exist as web alternatives. And like any lossy delivery format, re-encoding an MP4 repeatedly loses quality, so you should keep a higher-quality master and export MP4 copies for sharing rather than editing the same MP4 over and over.

MP4 vs Other Video Formats

FeatureMP4MKVWebMMOV
Standardized byISO/MPEG[3]Matroska.orgGoogleApple
TypeContainer[1]ContainerContainerContainer
Common codecsH.264, H.265[2]Any codecVP9, AV1H.264, ProRes
Device supportUniversal[4]LimitedWeb-focusedApple-focused
Subtitles/tracksLimitedUnlimitedLimitedMultiple
Best forUniversal sharingMedia archivingWeb streamingMac editing

MP4 offers the widest device compatibility, while MKV is more flexible for storing many tracks and WebM targets open web streaming.

Pros and Cons of MP4

Advantages

Universal Compatibility | FileFormer, Plays on every device - phones, TVs, computers, gaming consoles - without conversion.

Excellent Compression | FileFormer, H.264 and H.265 codecs produce high-quality video at small file sizes.

Streaming Ready | FileFormer, Supports progressive download and HTTP streaming for smooth online playback.

Metadata Support | FileFormer, Stores subtitles, chapters, thumbnails, and multiple audio tracks in one file.

Disadvantages

Codec Dependent | FileFormer, Quality depends heavily on which codec was used - not all MP4 files are equal.

Not Lossless | FileFormer, Standard codecs are lossy. For professional editing workflows, use ProRes or DNxHD.

H.265 Patent Fees | FileFormer, The more efficient H.265 codec involves licensing fees, limiting some open-source use.

Limited Editing | FileFormer, Not ideal for video editing - use intermediate codecs during production, export to MP4 for delivery.

When to Use MP4

MP4 is the right choice for almost all video distribution and sharing scenarios.

Video Sharing | FileFormer

YouTube, Vimeo, Instagram, and TikTok all accept and prefer MP4 uploads.

Streaming | FileFormer

Netflix, Amazon Prime, and most streaming platforms distribute content in MP4 containers.

Mobile Video | FileFormer

Smartphones record and play MP4 natively - the default format for recorded video.

Web Embedding | FileFormer

HTML5 video elements support MP4/H.264 natively in all modern browsers.

Technical Specifications

StandardMPEG-4 Part 14 (ISO 14496-12)[1]
File Extension.mp4 / .m4v[1]
MIME Typevideo/mp4[1]
Common Video CodecH.264, H.265 (HEVC)[1]
Common Audio CodecAAC, MP3[1]
SubtitlesSupported[1]

Frequently Asked Questions

What is the difference between MP4 and H.264?

MP4 is the container format (the wrapper), while H.264 is the video codec (the compression method). Most MP4 files use H.264 video, but MP4 can also contain H.265, VP9, or other codecs.

Why is my MP4 file so large?

File size depends on video resolution, frame rate, bitrate, and length. Use a video compressor to reduce size - lowering bitrate or resolution significantly reduces file size.

Can I play MP4 on any device?

Yes. MP4 with H.264 video and AAC audio is the most universally compatible video format in existence. If a device plays video, it almost certainly plays MP4.

Is MP4 good for editing?

MP4 works for basic editing, but professional workflows use intermediate formats like ProRes. Re-encoding MP4 multiple times reduces quality. Edit in a lossless format and export to MP4 for delivery.

What is the difference between MP4 and MKV?

Both are container formats, but MKV is open-source and more flexible - supporting more codecs and unlimited audio/subtitle tracks. MP4 has broader device compatibility. MKV is preferred for archiving, MP4 for sharing.

References

  1. MPEG-4 / MP4 File Format - Library of Congress
  2. Video codecs guide - MDN Web Docs
  3. ISO/IEC 14496-14:2020 (MP4 file format) - ISO
  4. MP4 file format - Wikipedia