Skip to content
BENIBIX Learn

Video Container vs Video Codec

People think MP4 is a codec, and it is not. The codec is how the picture is shrunk to a small size, like H.264 or AV1. The container is the box that holds that picture, the sound and the subtitles in one file, like MP4 or WebM. A video plays only when the device can open both the box and what is inside.

Design🎞️ Motion & Video

Video Container Format

The file that holds a video's picture and sound in one box. MP4 is one.

A video container is the file type that holds the parts of a video together. Inside sit the picture, one or more sound tracks, often subtitles, and facts like the length. The container is named by the end of the file, like .mp4, .mov, .mkv or .webm. It is not the codec, which is how the picture is shrunk. Two MP4 files can hold video made with different codecs.

Example
A WebM file on a web page holds VP9 video and Opus sound. It can hold WebVTT subtitles too.
Why it matters
A device must open both the box and the codec inside it. If either fails, the video will not play.
Full entry
Design🎞️ Motion & Video

Video Codec

A way to shrink video so it can be sent. It opens it up again to play.

A video codec is a method for shrinking video and playing it back. Raw video is huge, so the codec throws away detail the eye will not miss. It also stores only what changes from frame to frame. To play the file, the same codec unpacks it. Common codecs are H.264, H.265 and AV1. The file type, like MP4, is only the box the video sits in.

Example
YouTube suggests H.264 in an MP4 file. Packed this way, a 10-minute HD clip fits in about 600 megabytes.
Why it matters
The codec decides the file size, the quality and which devices can play it. The wrong one can make a file fail to open.
Full entry

In one line

Video Container Format
The file that holds a video's picture and sound in one box. MP4 is one.
Video Codec
A way to shrink video so it can be sent. It opens it up again to play.