Why an .mp4 isn't always an .mp4: codecs and containers explained
Two videos with the same extension can be completely different inside. Understanding the difference between container and codec solves almost every "this video won't play" problem.
You download an .mp4. It plays perfectly on your computer. You send it to someone and they say it won’t open — or worse, they see the picture but hear nothing.
Both files have the same extension. Both are genuinely MP4. And they still aren’t the same thing.
The explanation is a distinction almost nobody tells you about: the container is not the codec.
The box and what’s inside
Think of a video file as a box holding several things:
- A video track
- One or more audio tracks
- Subtitles, perhaps
- Chapters, cover art, metadata
The container is the box: it defines how those tracks are laid out, how they stay in sync, and where the player finds each one. .mp4, .mkv, .avi, .mov, .webm are containers.
The codec is how the contents are compressed. H.264, H.265, AV1, VP9 for video; AAC, MP3, Opus, FLAC for audio.
The file extension tells you the box. It tells you nothing about what’s inside.
It’s like knowing something came in a cardboard box: that doesn’t tell you whether it holds books or glassware.
This is why playback fails
A player needs two things: to know how to open the box and how to decompress its contents. Missing either one breaks something.
The symptoms tell you which:
| What you see | What’s happening |
|---|---|
| Won’t open at all | The container isn’t recognised |
| Picture but no sound | Missing the audio codec |
| Sound but a black screen | Missing the video codec |
| Stutters with CPU at 100% | Decoding in software, no hardware acceleration |
| Bad on an old phone, fine on a new one | Modern codec with no support in older hardware |
“Picture but no sound” is the most common and the most baffling, because the file almost works. It’s usually an MP4 with audio in an unusual codec.
The containers you’ll meet
MP4 is the de facto standard. Everything plays it. It’s what you want when sharing something and you don’t know what will open it.
MKV (Matroska) accepts practically any codec, multiple audio tracks and embedded subtitles. It’s the favourite for archiving. In exchange, support outside computers is patchy: plenty of TVs and phones choke on it.
MOV is Apple’s. Technically very close to MP4 — they share an ancestor — which is why renaming .mov to .mp4 often works. Not always, but more often than you’d expect.
WebM is built for browsers. It only takes royalty-free codecs, which is why it carries no licensing weight.
AVI is from 1992 and it shows. It handles modern codecs and subtitles poorly. If you meet one, it almost always comes from an old archive.
The video codecs
H.264 (also called AVC) is from 2003 and is still the most compatible thing in the world. Essentially any device with a screen decodes it in hardware. When in doubt, this one.
H.265 (HEVC) compresses to roughly half the size at the same quality. Its problem isn’t technical but legal: the patent pool meant many browsers never supported it. Modern phones record in it, which is why an iPhone video sometimes won’t open on a PC.
AV1 is royalty-free and compresses better still. It’s where everything is heading, but hardware support is recent: on a device a few years old it decodes in software and heats the machine up.
VP9 is Google’s, and it’s what YouTube serves for much of its catalogue.
The audio codecs
AAC is the natural companion to MP4 and H.264. Compatible everywhere.
MP3 survives on pure inertia and universal compatibility, though technically it’s been surpassed.
Opus is markedly better at low bitrates and is what internet voice calls use. Inside an MP4 container it can cause trouble.
FLAC and ALAC are lossless: they discard nothing. For archiving music, not for distribution.
AC-3 and E-AC-3 come from cinema and turn up in multichannel tracks.
What “converting” a video means
Here’s a distinction that saves enormous amounts of time.
Remuxing changes the box without touching the contents: you take the tracks out of the MKV and put them in an MP4, as they are. It’s near-instant and loses absolutely no quality, because nothing is re-compressed.
Re-encoding means decompressing and compressing again. It takes far longer and always loses some quality, because lossy codecs aren’t reversible.
The practical consequence matters: if your problem is an incompatible container, remuxing fixes it in seconds at no quality cost. You only need to re-encode when the codec itself is the incompatible part.
Plenty of people spend twenty minutes re-encoding something that two seconds would have fixed.
How to see what’s inside
In VLC: Tools → Codec Information. It shows the container, the video codec, the audio codec, resolution and frame rate.
That’s the first thing to check when a video misbehaves, before converting anything. With that information you know whether you need to change the box or the contents — two operations with very different costs.
The short rule
If you’re sharing a video and don’t know what will open it: MP4 container, H.264 video, AAC audio. It’s the most boring combination that exists, and it works on anything with a screen made in the last fifteen years.
Modern formats compress better. But a file the recipient can’t open has, in practice, a quality of zero.