Can an MP4 Container Hold Non-MPEG Codecs?
This article explains whether the MPEG-4 Part 14 (MP4) container format can store audio and video tracks encoded with non-MPEG standards. While developed by the Moving Picture Experts Group, the MP4 container is a flexible format capable of housing a variety of non-MPEG codecs, including AV1, VP9, FLAC, and Opus. Below, we examine how this compatibility works, which non-MPEG codecs are supported, and how player compatibility is maintained.
The Flexibility of the ISO Base Media File Format
The MP4 container format is based directly on the ISO Base Media File Format (ISO/IEC 14496-12). Because it was designed as a modular, extensible “wrapper,” the container separates the storage structure from the actual media compression formats.
This design allows MP4 to hold virtually any data stream, provided there is a standardized way to describe the media format within the container’s metadata track (often referred to as “atoms” or “boxes”).
Common Non-MPEG Codecs in MP4 Containers
While MP4 is most famously paired with MPEG standards like H.264 (AVC), H.265 (HEVC), and AAC, it officially supports several prominent non-MPEG codecs:
- AV1 (AOMedia Video 1): Developed by the Alliance for Open Media as a royalty-free alternative to HEVC, AV1 video streams are fully supported and standardized for encapsulation inside MP4 containers.
- VP9: Created by Google, this open-source video codec is frequently multiplexed into MP4 containers, especially for web-based streaming.
- Opus: A highly versatile, open-source audio codec standardized by the IETF. It is officially supported within the MP4 container and is commonly paired with AV1 or VP9 video.
- FLAC (Free Lossless Audio Codec): This popular open-source lossless audio format has defined mappings for encapsulation within the MP4 container structure.
- ALAC (Apple Lossless Audio Codec): Originally a proprietary Apple format, ALAC is a non-MPEG codec that is widely used inside MP4 (.m4a) wrappers.
How Compatibility is Maintained
To ensure that media players know how to decode non-MPEG streams inside an MP4 file, the format relies on the MP4 Registration Authority (MP4RA).
The MP4RA registers unique four-character codes (FourCCs)—such as
av01 for AV1, opus for Opus, and
vp09 for VP9. When a media player opens an MP4 file, it
reads these FourCC codes in the file header to identify the codec and
route the data stream to the correct decoder. If a player lacks the
specific decoder for a non-MPEG codec, it will fail to play the stream,
even though the MP4 container itself is successfully opened.