Compression & Formats
What Is a Container Format?
Quick answer
What a container actually does
Think of a container as a physical package. It has structure — sections, headers, indices — that tell a media player where to find the audio track, where the video starts, what metadata is attached, where chapter markers are. Without the container's organisation, the encoded audio or video data inside would be an unstructured blob that nothing could easily read.
A container handles the practical logistics of the file:
- Where each track starts and ends
- How to synchronise audio and video streams
- What codecs are used (so the player knows which decoder to load)
- Embedded metadata: title, artist, album, cover art, year
- Chapter markers and navigation points
- Multiple audio tracks (e.g., different language versions)
- Subtitle or caption tracks
Common containers and what they hold
| Container | Extension | Can hold | Common use |
|---|---|---|---|
| MP4 | .mp4 | AAC, MP3, PCM + H.264/H.265 video | Video sharing, streaming, phone recordings |
| M4A | .m4a | AAC (audio-only MP4) | Apple audio, music downloads, podcasts |
| WAV | .wav | PCM (usually), some others | Professional audio editing, broadcast |
| OGG | .ogg | Vorbis, Opus, FLAC audio | Open-source audio, games, web |
| MKV | .mkv | Almost any audio+video codec | Movies, TV shows, flexible archiving |
| WebM | .webm | Vorbis, Opus + VP8/VP9 video | Web video (YouTube, HTML5) |
| MOV | .mov | AAC, PCM, MP3 + video | Apple cameras, Final Cut Pro |
| FLAC | .flac | FLAC codec only (audio-only) | Lossless music archiving |
| MP3 | .mp3 | MP3 codec only (audio-only) | Music, podcasts, legacy compatibility |
Why the same extension can sound completely different
Because a container can hold different codecs, files with the same extension can contain very different audio. An OGG file might contain Vorbis audio (lossy) or FLAC audio (lossless). An MP4 file from one camera might have AAC audio at 128 kbps; from another it might have PCM audio at full quality.
This is why specifying just the container isn't enough to know what you're working with. A media analysis tool like MediaInfo or VLC's codec information dialog will tell you both the container and the codec inside — the information that actually matters.
Container limitations
Not every codec works in every container. WAV is designed for PCM audio — you can technically put other codecs in a WAV file but most software won't handle it. M4A is designed for AAC — trying to put Vorbis in an M4A container would confuse most players. MKV and MP4 are flexible and support many combinations, but even they have limits.
When you convert audio to a specific format, you're choosing both a container and a codec — sometimes they're the same name (MP3, FLAC), sometimes different (M4A uses AAC). Understanding both levels helps you make informed decisions.
Why video containers are the most common source of confusion
Most of the time people encounter container questions is when they're working with video files and want to extract or convert the audio. An MP4 from a phone camera, a MOV from Final Cut Pro, an MKV of a downloaded film — all of these are video containers with audio tracks inside.
When you convert an MP4 to MP3, you're doing two things: extracting the audio track from the video container, and re-encoding it from whatever codec the MP4 used (usually AAC) to MP3. The container change is unavoidable; the codec change is where any quality trade-off occurs.
This is why "convert video to audio" tools always ask what audio format you want — they can't just strip the container; they have to decode the audio track and re-encode it in a format your audio software or device can handle directly.
Metadata lives in the container, not the codec
Song title, artist name, album artwork, track number — all of this metadata is stored by the container, not the codec. When you convert an MP3 to WAV, metadata handling becomes unpredictable: WAV has very limited metadata support compared to formats like FLAC or M4A, and some tools don't transfer metadata during conversion at all.
FLAC and M4A have rich metadata containers — they can store embedded artwork, multiple tags, replay gain data, and more. MP3 uses ID3 tags, which are widely supported. WAV uses RIFF INFO chunks, which most consumer software doesn't display.
If you're building an audio library and metadata matters, FLAC or M4A (AAC) are better archival container choices than WAV — not because of audio quality (all three are lossless when using PCM or FLAC codecs), but because the container supports richer, more reliable metadata embedding.
Converters
Last updated: March 28, 2026