What is an MP2 File?
An MP2 file contains lossy audio encoded with MPEG-1 or MPEG-2 Audio Layer II. Layer II is the audio coding specified for DAB digital radio and used on Video CD, and it is frequently carried inside MPEG program and transport streams.
How MP2 Files work
MP2 carries MPEG Audio Layer II frames. Like Layer I, the encoder splits the signal into 32 subbands and allocates bits with a psychoacoustic model, but it codes three groups of 12 samples per subband together, shares scale factors between groups where it can, and packs the side information more compactly, so each frame represents 1152 samples per channel. MPEG-1 defines Layer II at 32, 44.1, and 48 kHz; MPEG-2 adds 16, 22.05, and 24 kHz, lower bitrates, and multichannel audio. The same frames can be stored as a bare .mp2 elementary stream or carried as one stream of an MPEG program or transport stream, so software has to tell the audio coding apart from whatever wraps it.
Key facts
- 1A Layer II frame holds 1152 samples per channel, which is 24 ms at 48 kHz, and each frame is self-contained with no pointer into earlier frames, whereas an MP3 frame can depend on data carried in earlier frames. Losing or damaging a frame therefore takes no data that later frames need, but the decoder’s synthesis filter carries history across frame boundaries, so the audible disturbance can run briefly into the next frame.
- 2The optional CRC that follows the frame header protects part of the header, the bit allocation, and the scale factor selection fields, not the subband samples, and it only detects errors. RFC 3003 allows
audio/mpegdata to omit it when lower layers handle transmission errors, so its absence is not a defect. - 3In a transport stream’s program map, stream type
0x03marks ISO/IEC 11172-3 (MPEG-1) audio and0x04marks ISO/IEC 13818-3 (MPEG-2) audio. Neither value names the layer, which still has to be read from the two-bit layer field in the audio frame header. - 4A
.mp2file is typically a raw sequence of Layer II frames, the same frames a program or transport stream carries in packetized form. Extracting them to a file, or wrapping a file into a stream, is a remultiplexing step that does not need to re-encode the audio. Cuts made by copying whole frames land on frame boundaries, 24 ms steps at 48 kHz. A sample-exact cut means decoding and trimming the PCM, then choosing an output that can keep that boundary: re-encoding to a bare.mp2stream again produces whole 1152-sample frames and adds encoder delay.
When MP2 Files matter
Preserve MP2 when a broadcast chain or transport stream explicitly requires Layer II audio. For general client playback, test device support or transcode to a more widely accepted delivery codec.
How Transloadit helps with MP2 Files
Transloadit’s audio codec table lists MP2 (MPEG audio layer 2) as both readable and writable on each ffmpeg_stack version it covers (v5–v7). FFmpeg-based Robots such as /audio/encode can therefore take Layer II audio as input when converting to a delivery codec.
Explore Transloadit’s file formats & compression capabilities
Sources
- ETSI TS 103 466 V1.2.1: DAB audio coding (MPEG Layer II)
- Davis Pan, “A Tutorial on MPEG/Audio Compression”, IEEE Multimedia, 1995
- Library of Congress: MPEG-1 and MPEG-2 Layer II Audio Encoding (fdd000338)
- RFC 5219: A More Loss-Tolerant RTP Payload Format for MP3 Audio (layer independence)
- RFC 3003: The audio/mpeg Media Type
- ITU-T H.222.0 | ISO/IEC 13818-1: MPEG-2 Systems (stream type assignments)