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.
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.
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.
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.