What is Container?
Definition
A container (or wrapper) is a file format that bundles one or more video, audio, subtitle, and metadata streams into a single file. Examples include MP4, MKV, WebM, MOV, and AVI. A container does not compress the data - that is the codec's job.
A container is the outer file format that holds your media streams together and describes how they fit. It defines how video, audio, subtitles, and metadata such as chapters, timestamps, and language tags are interleaved and synced, so a player knows how to read them. The file extension you see, such as .mp4 or .mkv, usually names the container, not the codec inside it.
The container is not the same as the codec. A codec such as H.264, AV1, or AAC compresses and decompresses the actual stream data, while the container just packages those streams. That is why the same H.264 video can live inside an MP4, MKV, or MOV file - the encoded video is identical, and only the wrapper changes. Moving streams to a new container without re-encoding is called remuxing, and it is fast and lossless.
Containers differ in which codecs and features they support. MP4 is the most widely compatible and the standard for web and mobile. MKV is flexible and handles many audio tracks, subtitles, and chapters. WebM is built for the web and royalty-free codecs. Choosing the wrong container can mean a file plays in one app but not another, even when the codecs are fine.
Quick facts
- A container bundles video, audio, subtitle, and metadata streams into one file
- Also called a wrapper; common examples are MP4, MKV, WebM, MOV, and AVI
- A container does not compress data - the codec does
- The same codec, such as H.264, can live in different containers like MP4, MKV, or MOV
- The file extension usually names the container, not the codec inside