Container formats explained: how media files hold video, audio, and more.
Core concept

What is a

Container
Format?

Container formats are often confused with codecs. Understanding the difference makes everything else about media much clearer.

TL;DR: a container format is a file that holds video, audio, subtitles, and metadata together.
Container • Codec • Media

TL;DR

Container: holds media

Codec: compresses media

Example: MP4 file with H.264 video

Simple explanation

Video stream

Encoded with H.264 or AV1

Audio stream

Encoded with AAC or Opus

Subtitles & metadata

Text tracks, chapters, timing

Container (MP4 / MKV / WebM)

All elements combined into one file