What a container is, and how MP4 differs from MKV
A video file is almost never just "video." It's a container that holds one or more compressed streams — video, audio, sometimes subtitles — plus a table of contents that tells a player how those streams line up in time. The container and the codec are independent choices: the same H.264 video can be packaged inside an MP4, an MKV, or several other container formats without re-encoding the picture itself.
What actually lives inside a container
- One or more video streams (usually one, encoded with a codec such as H.264 or H.265).
- One or more audio streams (a film might carry several language tracks).
- Optional subtitle or caption tracks.
- An index or timing table so a player can seek and keep audio and video in sync.
- Metadata: title, chapter markers, cover art, language tags.
The process of combining separate streams into a container is called muxing; splitting them back apart is demuxing. Because muxing doesn't touch the compressed video or audio data, changing a file from one container to another — when both containers support the codecs involved — can often be done without any quality loss and in a fraction of the time a full re-encode would take.
MP4
MP4 (formally MPEG-4 Part 14) is the closest thing to a universal default for web and consumer video. Its main strengths are compatibility and structure:
- Playback support across essentially every browser, phone, and device made in the last decade.
- A well-defined structure that streaming servers and browsers rely on, including a "fragmented" variant used heavily in adaptive streaming.
- Solid support for the most common codecs (H.264, H.265, AAC audio) and for metadata like chapters and cover art.
Its main limitation is flexibility: MP4 can technically carry multiple audio and subtitle tracks, but tooling and player support for that is less consistent than in formats designed around it from the start.
MKV
MKV (Matroska) was designed from the ground up to be an open, extensible container. It's a common choice when a file needs to carry more than "one video, one audio":
- Comfortable support for many simultaneous audio tracks (different languages or commentary) and many subtitle tracks (including both image-based and text-based formats).
- Support for chapter menus, attachments (like fonts for styled subtitles), and richer metadata.
- An open, published specification rather than one controlled by a single standards body's licensing terms.
The trade-off is compatibility: MKV playback is common on desktop media players and many TVs, but it is not supported natively by every browser, and some mobile platforms and web contexts expect MP4 specifically.
| MP4 | MKV | |
|---|---|---|
| Browser / device support | Very broad, near-universal | Common on desktop players, inconsistent in browsers |
| Multiple audio/subtitle tracks | Possible, less consistently supported | Built around this use case |
| Streaming-friendly variants | Yes (fragmented MP4) | Less commonly used for adaptive streaming |
| Typical use | Web delivery, general sharing, editing pipelines | Archiving, multi-track releases, local media libraries |
Other containers worth knowing
- WebM
- An open container built for the web, typically pairing VP9 or AV1 video with Opus audio. Common for browser-native video that avoids licensed codecs.
- MOV
- Apple's QuickTime container, structurally close to MP4 and common in professional editing workflows, especially on macOS.
- TS (MPEG Transport Stream)
- Designed for broadcast and live transmission, where the stream needs to tolerate data loss and allow a player to join mid-stream. Also the segment format used by HLS, covered on the adaptive streaming page.
How to choose
For most web delivery and general-purpose sharing, MP4 is the pragmatic default because it will simply play everywhere. Reach for MKV when a single file genuinely needs to carry multiple audio tracks, multiple subtitle tracks, or is meant for long-term archiving where flexibility and an open specification matter more than guaranteed playback in every browser.