toolsmith

No upload · everything runs in your browser

What is a codec — and how is it different from MP4?

Almost everything confusing about video files comes from a single distinction: the extension names the box, not the thing inside it. Separate those two and most of the mystery goes away.

Updated

The box and the contents

A container — MP4, MOV, WebM, MKV — describes how the parts of a file are arranged: where the video stream is, where the audio is, how they line up in time, and where the index lives.

A codec — H.264, HEVC, VP9, AV1 for pictures; AAC, Opus, MP3 for sound — is how that content was compressed in the first place.

So `.mp4` tells you the shape of the box and almost nothing about what it holds. Two files that both end in `.mp4` can contain completely different codecs, and one of them may not play on a device where the other plays perfectly.

This is why some conversions are free and others are not

MOV to MP4 is nearly free. Both are the same underlying format family, and the video inside a MOV is usually already H.264 — which MP4 accepts. So the compressed data is copied across unchanged and a new index is written around it. Nothing is decoded and nothing is re-compressed. It is lossless and close to instant. The proper name for this is a remux.

MP4 to WebM is the opposite. WebM does not accept H.264, so every frame has to be decoded and compressed again as VP9, and the audio again as Opus. That takes real time and costs a generation of quality.

The two operations share the word "convert" and nothing else, which is why our converter tells you which one you are about to run before you press anything.

You can do a surprising amount without a codec at all

Trimming, for instance, is just choosing which already-compressed samples to keep. Nothing gets decoded, so the quality is bit-for-bit identical and the operation finishes almost immediately.

There is one cost, and it comes straight out of how compression works. You can only start at a keyframe — a frame that stands on its own. The frames between keyframes are stored as descriptions of how they differ from earlier ones, so if you cut in the middle of that chain the first seconds have nothing to refer back to and come out broken.

So we snap the start back to the nearest keyframe before the point you asked for, and show you where the cut will actually land. The alternative is re-encoding the beginning to hit the exact frame, which costs quality — and that should be your choice, not a silent substitution.

Extracting audio as M4A works the same way: the compressed AAC data is lifted into a new container without being touched.

Support is per-codec, not per-extension

When a device says it cannot play an MP4, the container is almost never the problem. What it usually means is that the codec inside is not supported — HEVC in an `.mp4` is the common case, since it is what newer phones record and what older software refuses.

This also explains why renaming a file changes nothing. Changing `.mov` to `.mp4` relabels the box while leaving both the box and the contents exactly as they were.

Where our own limits come from

Our demuxer reads ISOBMFF, the family MP4, MOV and M4V belong to. We have no code that opens Matroska, which is what WebM is built on — so "WebM to MP4" is not on our list even though it sounds like the reverse of something we already do. Listing it would be claiming an ability we do not have.

Encoding is the browser's job rather than ours, and which codecs a browser can encode varies by machine and operating system. So we ask it directly what it supports and offer only that, instead of printing a menu and failing halfway through.

Do it now, without uploading anything

Why won't my .mp4 play on this device?

Most often because of the codec inside rather than the container. HEVC video in an MP4 is the usual culprit — newer phones record it and older players cannot decode it. Re-encoding to H.264 fixes it; renaming the file does not.

Does changing the file extension convert the video?

No. The extension is a label, not the format. Renaming can occasionally make a player attempt a file it would otherwise skip, but the bytes inside are unchanged and it will fail if it genuinely cannot read them.

Is converting MOV to MP4 lossy?

Not when the video inside is already H.264, which it usually is. The compressed data is copied into the new container untouched, so the result is identical picture in a different box.

Worth reading