Video
Container versus codec: why an .mp4 video does not play everywhere
You have probably met this situation: a video opens on your phone but not on the TV, or an .mp4 file plays the sound without the picture. The file extension, which everyone looks at, actually tells only half the story. A video is a container carrying streams encoded by codecs. Understanding that distinction lets you diagnose most playback problems, and avoid pointless conversions.
The envelope and the letter
The container is the envelope. MP4, MOV, MKV, AVI and WebM are containers: they define how to store, in a single file, one or more video tracks, audio tracks, subtitles, chapters and information such as duration or picture orientation. The container gives the file its extension.
The codec is the language the letter is written in. H.264 (also called AVC), H.265 (HEVC), VP9 and AV1 are video codecs; AAC, MP3, Opus and uncompressed PCM are audio codecs. The codec determines quality, size and above all what a device is able to decode.
The same container can carry very different codecs. An .mp4 file usually contains H.264 and AAC, which play everywhere, but it can also contain H.265 or AV1, which older devices cannot decode. Two files with the same extension can therefore have very different compatibility.
Common containers and what they are used for
Each container was born from a particular need, which explains where you come across it:
- MP4: the universal standard, defined by ISO. Played by browsers, phones, TVs and social networks. It is the default choice for sharing.
- MOV: Apple's QuickTime format, from which MP4 was actually derived. Used by iPhones and Apple editing software. Very close to MP4 in structure.
- MKV (Matroska): an open and very flexible container, able to carry many audio and subtitle tracks. Popular for archiving films, less well supported by browsers and some TVs.
- AVI: a Microsoft container dating from 1992. It handles modern codecs and features such as embedded subtitles poorly; you mostly find it in old archives.
- WebM: an open container derived from Matroska, designed for the web, with royalty-free codecs (VP8, VP9 or AV1 for video, Vorbis or Opus for audio).
Diagnosing an unplayable video
When a video does not play, or plays badly, the symptom often points to the cause:
- The file is rejected outright: the device does not know the container. This is common with MKV or AVI on a TV or an online service.
- The sound works but the picture stays black: the container is recognised, the video codec is not. The typical case is an H.265 video on a computer or browser that cannot decode it.
- The picture works but there is no sound: the same problem on the audio side, for example a track in uncompressed PCM or in an unusual codec.
- The video appears sideways: the orientation information, stored in the container, was lost or ignored.
Changing container without re-encoding: remuxing
When only the container is the problem, there is no need to re-encode the video: the streams can be copied as they are into a new envelope. This operation, called remuxing, is almost instant and strictly lossless, since the picture is neither decoded nor recompressed.
FileXvert applies it automatically in the most common case: converting a MOV that contains H.264 video to MP4, when you ask for neither size reduction nor a resolution change. We checked it on an 89-second smartphone video in 1080p at 60 frames per second, whose sound was stored as uncompressed PCM.
| Operation | Size | What changes |
|---|---|---|
| Original MOV | 261.3 MB | — |
| Remux to MP4 | 247.1 MB | Picture copied unchanged, PCM sound converted to 128 kbps AAC |
| H.264 re-encode, no reduction | 181.5 MB | Picture recompressed, with slight loss |
The 14 MB saved by remuxing come entirely from the sound: uncompressed PCM takes about 1.4 Mbit/s, against 128 kbit/s for AAC. The picture itself is bit-for-bit the original. Re-encoding saves more space, but at the cost of another compression: it is the right choice if the goal is to make the file lighter, not if you only want to make it playable.
When re-encoding cannot be avoided
Re-encoding is necessary whenever the codec itself is not supported by the target device, or when the target container does not accept the source codec. This is notably the case for videos from recent iPhones, recorded by default in H.265 (HEVC): to make them playable everywhere, FileXvert re-encodes them to H.264, the most universal codec. Conversions from MKV, AVI or WebM to MP4 also go through re-encoding.
Re-encoding takes longer, since every frame is decoded and then recompressed, and it introduces a slight loss. With the default settings it is invisible in everyday use; for a video meant for professional editing, always keep the original.
In practice: which container should you choose?
To share, publish or play on an unknown device: MP4 with H.264 and AAC, the combination that works everywhere. To archive a film with several languages and subtitles: MKV. To work within the Apple ecosystem: MOV is perfectly fine. And if you inherit old AVI files, converting them to MP4 will give them a second life on current devices.