Codec vs Container: The Confusing Part of Media Files
Understand why file extensions do not tell the whole story.
Container meaning
A container is the file structure that holds streams such as video, audio, subtitles, and metadata. MP4, WebM, MOV, and M4A are examples of containers.
Codec meaning
A codec describes how a stream is compressed and decoded. H.264, AAC, VP9, Opus, and MP3 are examples of codecs. The codec often matters more than the extension for playback support.
Why support varies
A browser may support one MP4 file and reject another because the codecs inside are different. This is normal and not always obvious from the filename.
Conversion planning
When compatibility matters, use common codec and container combinations. For broad playback, MP4 with H.264 and AAC is common; for audio sharing, MP3 remains practical.
FAQ
Is MP4 a codec?
No. MP4 is a container.
Why did changing the extension not work?
Renaming a file does not change its codec or container structure.