A codec describes how audio or video is encoded and decoded. A container packages those streams together with items such as subtitles, chapters, and metadata. Confusing the two is one of the main reasons playback problems are misdiagnosed.
MP4, MKV, MOV, AVI, and WebM are containers. H.264/AVC, HEVC/H.265, AV1, AAC, AC3, and DTS are codecs. A familiar container can still fail to play when one of the streams inside uses a codec the current playback path cannot decode.
A container is the file structure that holds one or more media streams and related information.
Examples: MP4, MKV/Matroska, MOV/QuickTime, AVI, WebM, MPEG-TS.
A codec defines how a video or audio stream is compressed/encoded and decoded for playback.
Video: H.264, HEVC, AV1, MPEG-2, ProRes.
Audio: AAC, AC3, EAC3, DTS, FLAC, MP3.
Both files end in .mp4, but they require different decoding support. That is why “MP4 works on my computer” does not guarantee that every MP4 file will play.
| Name | Type | Common role |
|---|---|---|
| MP4 | Container | Common delivery container for H.264, HEVC, AV1 and AAC-based media. |
| MKV / Matroska | Container | Flexible container for many video, audio and subtitle formats. |
| MOV / QuickTime | Container | Common in phones, cameras, editing and Apple workflows. |
| AVI | Container | Older Windows-era container that can hold many legacy codecs. |
| H.264 / AVC | Video codec | Very widely supported HD and web/video codec. |
| HEVC / H.265 | Video codec | More efficient compression, common in 4K, HDR, phones and cameras. |
| AV1 | Video codec | Modern high-efficiency codec used in newer web and distribution workflows. |
| AAC | Audio codec | Common audio codec in MP4 and streaming media. |
| AC3 / EAC3 | Audio codec | Common surround-sound formats in video media. |
| DTS | Audio codec | Surround-sound format often found in disc-derived or MKV media. |
No. MP4 is primarily a container. It can hold H.264, HEVC, AV1, and other video streams together with audio such as AAC.
No. MKV (Matroska) is a container. Its flexibility is one reason two MKV files can have very different playback requirements.
H.264 is a video codec; MP4 is a container. H.264 is commonly stored inside MP4, but MP4 can also contain other codecs.