A video file is two things at once: a container and the codecs inside it. The container, named by the extension (.mp4, .mkv, .webm, .mov), is the box that holds the tracks and their timing. The codecs, such as H.264, VP9, AV1, AAC or Opus, are the compression formats of the video and audio tracks themselves. A player needs to understand both. That is why one .mp4 plays everywhere and another .mp4 shows a black screen: same box, different contents.
This post explains the difference, what each common container can hold, the four usual reasons a video will not play, and how to tell whether changing a video's format will be a fast, lossless repack or a slow re-encode. To look inside your own files, use the FindUtils Media Info Viewer; to change the container, use the Video Format Converter.
Container vs Codec in One Table
MDN describes a media container as "a file format that encapsulates one or more media streams (such as audio or video) along with metadata, enabling them to be stored and played back together". The codec is how each of those streams was compressed.
| Container | Codec | |
|---|---|---|
| What it is | The file format that packs tracks together | The compression format of one track |
| Examples | MP4, WebM, MKV (Matroska), MOV (QuickTime), Ogg | H.264 (AVC), H.265 (HEVC), VP8, VP9, AV1, AAC, MP3, Opus, Vorbis |
| Shown by | The file extension and MIME type | Only by looking inside the file |
| Decides | How tracks, timing, chapters, subtitles and metadata are stored | Picture and sound quality for a given file size |
| Changing it | Usually a fast repack (remux) | Always a re-encode: slow and lossy |
A useful picture: the container is the shipping box with a packing list; the codecs are the languages the letters inside are written in. You can move the letters into a different box without rewriting them, as long as the new box accepts letters in that language.
What Each Common Container Can Hold
Containers do not accept every codec. These are the combinations that matter most for everyday files, from MDN's container guide and the WebM Project's own specification.
| Container | Built on | Typical video codecs | Typical audio codecs | Notes |
|---|---|---|---|---|
MP4 (.mp4, .m4v) | ISO base media file format, which came from QuickTime | H.264, AV1, VP9 | AAC, MP3, Opus, FLAC | The most widely playable choice |
WebM (.webm) | A subset of Matroska | VP8, VP9, AV1 | Opus, Vorbis | Compliant players must support VP8, VP9, Vorbis and Opus |
MKV (.mkv) | Matroska, standardised as RFC 9559 in 2024 | Almost anything | Almost anything | Popular for recordings and archives; can carry many audio and subtitle tracks |
MOV (.mov) | Apple's QuickTime file format | H.264, HEVC, ProRes and many more | AAC, PCM and more | MDN notes MP4 grew out of it, but the two "are not quite interchangeable" |
Two consequences follow. WebM is strict: an H.264 video cannot simply be repacked into WebM, because WebM players are not required to decode it. Matroska is permissive: almost anything can go into an MKV, which is great for archiving and a gamble for playback.
Extensions can mislead in the other direction too. MDN points out that an Ogg file with only Opus audio is often called an "Opus file" and may end in .opus, "but it's still actually just an Ogg file". An MP3 file, by contrast, is not in a conventional container at all; it is a stream of MP3 frames, often with ID3 tags.
Four Reasons a Video Will Not Play
1. The player does not read the container. MDN's list of containers commonly supported on the web covers MP4, WebM and Ogg among others, and does not include Matroska. A .mkv screen recording may open in a desktop player and fail in a browser or on a phone, even when the codecs inside are ones the device knows.
2. The player does not decode a codec inside. A player can open the box and still fail on what is in it. A typical case is an MP4 with HEVC video on a device or browser without an HEVC decoder: the file is a valid MP4, but there is no picture, or the player refuses the file.
3. Only one track fails. Sometimes you get picture without sound, or sound over a black frame. The container opened, one codec was supported and the other was not. An MKV whose audio track uses a surround codec such as AC-3 or DTS can do this on a device or browser without a decoder for it.
4. The extension is wrong. Renaming clip.mkv to clip.mp4 changes nothing inside the file. Some players reject it, others sniff the real format and play it anyway, which makes the problem look random.
The fix starts the same way every time: find out what is actually inside.
How to See What Is Inside a Video
Drop the file onto the Media Info Viewer. It reads the container itself and lists the video codec, resolution, frame rate and bitrate, and the audio codec, sample rate and channel count. On the tool page the file is read in your browser, not uploaded.
The codec appears as a codec string such as avc1.640028, the same notation the codecs parameter of a MIME type uses (RFC 6381). It packs more than the codec name:
| Codec string | Means |
|---|---|
avc1.640028 | H.264, High profile, level 4.0 |
avc1.42E01E | H.264, Constrained Baseline profile, level 3.0 |
mp4a.40.2 | AAC, Low Complexity (AAC-LC) |
vp09... / av01... | VP9 / AV1, followed by profile, level and bit depth |
opus | Opus audio |
Web pages use the same strings to ask a browser what it can play. The WebM Project's guidelines show the pattern: canPlayType('video/webm') should answer only "maybe", while a type with codecs, such as video/webm; codecs="vp9, opus", can answer "probably". The container alone is never enough to decide.
Remux or Re-encode: When Is Converting Lossless?
Changing a video's format means one of two very different jobs.
Remuxing copies the already-compressed tracks into a new container. Nothing is decoded, so it is fast and the picture and sound are bit-for-bit the same. It works when the target container accepts the codecs in the source. MP4 with H.264 and AAC into MKV, or MOV with H.264 and AAC into MP4, are typical remuxes.
Re-encoding decodes the tracks and compresses them again with a codec the target accepts. It is slow, and because H.264, VP9, AAC and the rest are lossy, every re-encode loses a little quality. It is unavoidable when the target container does not accept the source codec, as with H.264 into WebM.
The Video Format Converter converts between MP4, WebM, MKV and MOV and makes this choice for you: when the target container accepts the source codecs, the tracks are copied across; only when it does not, they are re-encoded. Re-encoding in the browser needs a browser that can encode video. If yours cannot encode any codec the target accepts, the tool stops with a clear message instead of producing a file without a picture, and suggests trying the latest Chrome or Edge on desktop or a different output format.
| You want | Pick | Likely job |
|---|---|---|
| A file that plays almost everywhere | MP4 | Remux if the source is H.264/AAC in MOV or MKV |
| Video for your own website, open formats | WebM | Re-encode unless the source is already VP8, VP9 or AV1 |
| An archive with several audio or subtitle tracks | MKV | Usually a remux |
| A file for an Apple editing workflow | MOV | Usually a remux from MP4 |
If the file is too big rather than unplayable, a container change will not help: the size comes from the codec and bitrate. Use the Video Compressor, which keeps MP4 and MOV sources in MP4 and WebM and MKV sources in WebM. If you only need the sound, Video to Audio pulls the audio track out, and the Audio Format Converter changes its format.
A Quick Checklist Before You Share a Video
- Open it in the Media Info Viewer and note the video and audio codecs.
- If it must play in browsers and on phones, aim for MP4 with H.264 and AAC, or WebM with VP9 or AV1 and Opus.
- Remux first. Re-encode only when the codec itself is the problem.
- Keep the original. Each re-encode costs quality, so always convert from the best copy you have.
- Need the subtitles separately? For an MKV or WebM file, the Subtitle Extractor saves the embedded subtitle tracks as SRT or VTT.
FAQ
What is the difference between a container and a codec?
The container is the file format that holds the video, audio and subtitle tracks together with their timing and metadata, for example MP4 or MKV. A codec is the compression format of one track, for example H.264 for video or AAC for audio. The extension tells you the container, not the codecs.
Why does one MP4 play and another MP4 doesn't?
Because MP4 is only the container. One file may hold H.264 video, which almost every device decodes; the other may hold HEVC or another codec your device or browser cannot decode. Check the codecs with a media info tool.
Is converting MKV to MP4 lossless?
It is when the tracks inside are codecs MP4 accepts, such as H.264 or HEVC video with AAC audio: they are copied into the new container without re-encoding. If a track uses a codec MP4 does not accept, it has to be re-encoded, which costs time and some quality.
Is WebM better than MP4?
Neither is better in general. WebM uses open, royalty-free codecs and is widely supported in browsers. MP4 is the most widely playable container across phones, TVs and editing software. For a single file that must play everywhere, MP4 with H.264 and AAC is the safer choice.
Does renaming .mkv to .mp4 convert the file?
No. Renaming changes only the label. The data inside is still Matroska, so some players will reject it. Use a converter that remuxes the tracks into a real MP4 container.
Can I change a video's format without uploading it?
Yes. The FindUtils Video Format Converter runs in your browser, so on the tool page the video stays on your device during conversion.
Related Reading
- How to convert video format online without uploading
- Media Info Viewer guide
- Video Compressor guide
- Subtitle Extractor guide
Need help with a project? The team behind FindUtils takes on freelance work, such as a fast REST API or back-end service built in Go for your media pipeline.