Nearly every "codec error" message and every "why won't this file play?" question comes down to the same basic confusion: mixing up the container and the codec. They're related but different things. Once the difference is clear, the mystery melts.
#The one-sentence version
A container is the file format wrapper - the .mp4, .mov, .mkv, .webm, .avi extension. A codec is the compression scheme for the video and audio bytes inside the wrapper - H.264, HEVC (also called H.265), VP9, AV1 for video; AAC, MP3, Opus for audio. Playback depends on both: the player needs to understand the container AND have a decoder for the codec inside.
#The analogy that finally sticks
A container is a shipping box. A codec is what's in the box. A .mp4 file is like a plain brown box that everyone knows how to open; a .mkv is a fancy plastic tote that some warehouses reject at the door. What's inside might be identical - the same H.264 video, the same AAC audio - but the delivery guy either accepts the shape of the box or refuses it before ever looking inside.
This is exactly why Windows Media Player refuses .mov files even when the H.264 video inside would play fine renamed to .mp4. It's why Chrome plays WebM but Safari didn't for years. It's why an MKV downloaded from a torrent site refuses to play on your iPad even though the video content is a completely standard H.264 stream.
What each layer contributes
- File extension you see (.mp4, .mov, .mkv, .webm, .avi)
- Decides which players will accept the file at all
- Holds metadata: chapters, subtitles, rotation, playlist info
- Doesn't change quality by itself
- Doesn't appear in the filename (usually)
- Decides the visual quality and file size trade-off
- Video: H.264, HEVC / H.265, VP9, AV1, MPEG-2, MPEG-4 Part 2
- Audio: AAC, MP3, Opus, AC-3, FLAC, Vorbis
#Which containers hold which codecs
Not every container accepts every codec. This is where the rules get specific:
- MP4 accepts H.264, HEVC, MPEG-4 Part 2, AV1 for video and AAC, MP3, AC-3, Opus for audio. It does not accept VP9 or Vorbis - which is why converting WebM to MP4 always requires re-encoding.
- MOV accepts everything MP4 accepts, plus Apple ProRes and some QuickTime-specific formats. MOV and MP4 are structurally almost identical - see MP4 vs MOV.
- MKV accepts effectively any codec. It was designed as an unrestricted container from the start.
- WebM accepts only VP8, VP9, or AV1 video and Opus or Vorbis audio. Google restricted it to royalty-free codecs by design.
- AVI accepts most older codecs (MPEG-4 Part 2, DivX, Xvid) but is bad at newer ones (HEVC, AV1 in AVI is rare and inconsistently supported).
#Converting: what changes and what doesn't
This is where the codec/container distinction has real consequences for how fast a conversion runs:
- Same container family, same codec: instant. Renaming .mov to .mp4 sometimes works because the container structure is nearly identical (see MP4 vs MOV). Proper conversion tools rewrite a few header bytes.
- Different container, same codec: a container swap (or "remux") - fast, no quality loss, seconds regardless of file size. The compressed video and audio bytes are copied through untouched. Wave's MKV to MP4 path does this for the common case (H.264 or HEVC video plus AAC audio). See Remux vs re-encode for the mechanics.
- Different container that requires a different codec: a full re-encode - decode every frame, re-compress to the target codec, re-mux. Slow (seconds per second of video), tiny amount of quality loss from the second encode. WebM to MP4 is always this because MP4 can't hold VP9 or Opus.
#Why the "codec error" message is often about the container
Player error messages routinely conflate the two - a lot of "codec not supported" messages are actually "we can't open this container at all." A .mov file in Windows Media Player triggers a codec error even though the video codec inside would decode fine; Windows Media Player just refuses to parse MOV headers. Converting the container to MP4 fixes it without touching the codec (see Why iPhone HEVC won't play on Windows for a specific case).
#Reading a video file's label
Common file naming that hints at both:
video_1080p.mp4- MP4 container, codec unstated (probably H.264 or HEVC)Movie.2024.1080p.BluRay.x265.mkv- MKV container, "x265" indicates HEVC codecscreen-recording.webm- WebM container, codec is VP8 / VP9 / AV1iPhone-video.mov- MOV container, codec is H.264 or HEVC (iPhone default)
File-inspector tools (VLC → Media Info, or the ffprobe command line) show the actual codec inside any file. Wave shows the codec on the inspect screen right after you drop a file.
#The takeaway
Container is the wrapper. Codec is what's inside. Playback needs both to match the player. The fastest conversions swap the container without touching the codec (remux); the slower ones re-encode to a different codec. When something "won't play", the fix is usually a container swap - not a re-encode, not a compression pass, just a header rewrite. Wave's converter pages map to specific source containers because that's the actual entry point for most "won't play" problems.