Yatoshi Video playback
Technical index
Format index

Container Formats Compared: What AVI, MP4 and MKV Can Each Carry

The extension on a video file names its container, not its contents. Knowing which is which removes most of the guesswork from a file that refuses to play.

01

CBR and CBZ Archives

Open CBR and CBZ Archives
Extensions

CBR, CBZ, CB7, CBT

Summary

A CBR is a renamed RAR and a CBZ a renamed ZIP. What the extensions mean, which readers handle them per platform, and why CBZ travels better.

02

MKV and Matroska

Open MKV and Matroska
Extensions

MKV, MKA, MKS, WebM

Summary

Matroska holds many tracks, chapters, fonts and two kinds of subtitle. What that flexibility buys, and which playback failures it explains.

What Each Container Can Hold

Container file.mkv Video · H.264 Audio · AC3 5.1 Audio · AAC 2.0 Subtitles · ASS Attachment · font Splitter Picture Sound Text Renderer
A Matroska file separated into its tracks. The container holds them side by side; the splitter hands each one to a decoder, and only then does anything reach the screen or the speakers.
Six containers in general circulation, and the limitation that defines each.
ContainerSinceVideoAudioMain limitation
AVI 1992 MPEG-4 ASP, DivX, XviD, uncompressed MP3, AC3, PCM No modern codecs, no chapters, poor variable frame rate support
MP4 2001 H.264, HEVC, AV1 AAC, AC3, ALAC One subtitle kind, limited track flexibility, no attachments
MKV 2002 Anything Anything Not read by browsers, uneven support on televisions
WebM 2010 VP8, VP9, AV1 Vorbis, Opus Deliberately restricted codec set
MOV 1991 H.264, HEVC, ProRes AAC, PCM Some professional codecs need vendor software
TS 1995 MPEG-2, H.264 AC3, AAC Broadcast stream, seeks badly, often no index

Telling a Container Fault From a Codec Fault

An open case with a silver disc, a slim case and a videotape cassette side by side
Six containers are compared here. AVI, the oldest at 1992, cannot store any modern codec; Matroska, from 2002, can store almost anything.

The two produce different symptoms, and separating them saves the usual cycle of installing components until something changes. A container fault stops the file being read as a file: it will not open, or it opens and seeks badly, or it lists no tracks where tracks plainly exist. A codec fault lets the file open normally and leaves one track blank, which is why silence with a good picture is never a container problem.

Container faults are also the ones that can be repaired without any new software. Rewriting the container while copying the tracks untouched takes seconds, loses nothing, and fixes malformed headers and missing indexes alike. A codec fault survives that operation completely, because nothing about the track has changed. If a rewrite made no difference, the answer was never the container.

Age explains most of the rest. AVI predates almost everything now in use and cannot store modern codecs at all, so an AVI file is usually old and its contents usually need decoders nothing ships any more. Matroska sits at the other end, able to store anything, which makes it the container where a playback failure is most likely to be about one specific track out of many. The Matroska reference covers those cases, and the diagnostic index maps a symptom onto the failing stage before anything gets installed.

Why So Many Containers Exist at All

The list is long because each entry answered a different question at a different moment. AVI arrived when video on a computer was a novelty and the requirement was simply to interleave one picture stream with one sound stream. It was never designed for variable frame rates, multiple language tracks or subtitles, which is why every later container looks like a reply to something AVI could not do.

MP4 came out of a standards process and inherited its priorities: broad interoperability, predictable structure, and a codec list agreed in advance. That restraint is exactly why it plays on phones, in browsers and on televisions, and exactly why it frustrates anyone who wants to attach a font or carry three subtitle formats at once. Matroska was designed from the opposite premise, that a container should refuse nothing, and it pays for that flexibility in patchy support outside computers.

The broadcast formats sit apart from all of them. A transport stream was built to be received rather than stored: it can start mid-file, survive missing data, and carry several programmes at once. Those properties are useful over the air and unhelpful on a disk, which is why recordings in that format seek poorly and are usually the first thing anyone remuxes.

Choosing One on Purpose

Two questions settle it in almost every case. Does the file need to play on hardware that cannot be changed, such as a television, a phone or a browser? Then the answer is the restricted container with the widely implemented codec, because compatibility is the whole requirement and flexibility buys nothing. Does the file need to keep several audio tracks, styled subtitles or chapter structure? Then the permissive container is the only one that can hold them, and playback will be on a computer where support is not in doubt.

What does not work is choosing by file size, because the container contributes almost none of it. Overhead is a fraction of a percent in every format on the list; the bytes are in the tracks. A file that shrinks noticeably after a container change was re-encoded rather than remuxed, and something was lost in the process.

Questions about containers

What is the practical difference between a container and a codec?

A container describes how tracks sit next to each other in one file; a codec describes how one track is compressed. Renaming a file changes neither. The container determines what can be stored at all, and the codec determines whether anything on the machine can read it.

Does converting between containers lose quality?

Not if it is done as a remux, which copies the tracks unchanged into a new container. Quality is only lost when the tracks themselves are re-encoded, which is a different and much slower operation. A remux of an hour of video takes seconds.

Why does the same video work on a computer and not on a television?

Televisions decode in fixed hardware with a short list of supported combinations, and they cannot be extended. A container the set does not read, or a codec its chip does not implement, produces a refusal with no route around it other than converting the file.

Which container should a file be stored in for the long term?

For anything with multiple tracks or subtitles, Matroska, because it can hold everything and is openly documented. For a single video and audio track that must play anywhere including phones and browsers, MP4, because support is close to universal.

Can one file hold several videos meant to be watched separately?

Technically yes in Matroska, and it is a poor idea in practice. Most players expose multiple video tracks as alternates rather than as separate items, so the second one is easy to miss entirely. Separate files stay findable.