What is a video codec?
Short answer
A video codec is the method used to compress and decompress video, such as H.264 or AV1. It is separate from the container (MP4, WebM, MOV) that wraps the file. The codec controls file size, quality, and how widely the video plays.
Codec vs container
People say 'MP4' as if it were the video format, but MP4 is only the container — the box. Inside the box, the actual picture is compressed with a codec like H.264. The same H.264 video can sit in an MP4 or a MOV; the codec is what really decides size and quality.
- Container = the file wrapper: MP4, WebM, MOV, MKV
- Codec = how the video is compressed: H.264, H.265, VP9, AV1
- A playable file needs both a container and a codec the player understands
The common video codecs
- H.264 (AVC) — the universal baseline; plays almost everywhere
- H.265 (HEVC) — about half the size of H.264, but licensing and patchy browser support
- VP9 — royalty-free, efficient, common on the web in WebM
- AV1 — the most efficient, newer, slower to encode
Why the codec matters when you convert
Changing only the container (say MP4 to MKV) can be a quick remux with no quality loss. Changing the codec re-encodes every frame, which takes longer and loses a little quality — so start from the highest-quality source you have and avoid repeated re-encodes.