remotion-dev/remotion · error · Error
MPEG Layer I is not supported
Error message
MPEG Layer I is not supported
What it means
Thrown by `getMpegFrameLength` / `getUnroundedMpegFrameLength` when the MPEG audio layer is `1` (MPEG Layer I). The library explicitly supports only Layer II and Layer III (the common MP3 layers); Layer I uses a different frame structure and is unsupported.
Source
Thrown at packages/media-parser/src/containers/mp3/get-frame-length.ts:15
const getUnroundedMpegFrameLength = ({
samplesPerFrame,
bitrateKbit,
samplingFrequency,
padding,
layer,
}: {
samplesPerFrame: number;
bitrateKbit: number;
samplingFrequency: number;
padding: boolean;
layer: number;
}) => {
if (layer === 1) {
throw new Error('MPEG Layer I is not supported');
}
return (
(((samplesPerFrame / 8) * bitrateKbit) / samplingFrequency) * 1000 +
(padding ? (layer === 1 ? 4 : 1) : 0)
);
};
export const getAverageMpegFrameLength = ({
samplesPerFrame,
bitrateKbit,
samplingFrequency,
layer,
}: {
samplesPerFrame: number;
bitrateKbit: number;
samplingFrequency: number;
layer: number;View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Convert the audio file to MP3 (MPEG Layer III) using a tool like `ffmpeg`: `ffmpeg -i input.mp1 -codec:a libmp3lame output.mp3`.
- Use a different audio format (AAC/M4A, WAV, Ogg) that `@remotion/media-parser` fully supports.
- Verify the file is genuinely Layer III MP3 and not mislabeled.
- If Layer I support is critical, report the file at remotion.dev/report.
Example fix
# convert Layer I to MP3 Layer III ffmpeg -i input.mp1 -codec:a libmp3lame -qscale:a 2 output.mp3
Defensive patterns
Strategy: validation
Validate before calling
// Check file type before parsing
import {parseFile} from 'music-metadata'; // or ffprobe
async function isLayer3Mp3(file: File): Promise<boolean> {
// Use ffprobe or a metadata library to check the MPEG layer
// If layer is I, reject before calling parseMedia
return true; // implement with your preferred tool
} Try / catch
try {
await parseMedia({src, fields: {durationInSeconds: true}});
} catch (e) {
if (e instanceof Error && e.message === 'MPEG Layer I is not supported') {
console.error('This is an MPEG Layer I file. Convert to Layer III MP3 or AAC.');
}
throw e;
} Prevention
- Ensure audio files are MPEG Layer III (MP3), not Layer I or II.
- Convert Layer I files with ffmpeg: ffmpeg -i input -codec:a libmp3lame output.mp3.
- Prefer AAC/M4A or WAV formats if you don't need MP3 specifically.
- Validate file codecs with ffprobe before parsing.
When it happens
Trigger: Parsing an MPEG audio file whose frame header indicates Layer I (`layerBits === 0b11`). This can be reached during frame-length calculation in `get-frame-length.ts:14-16` or `parse-packet-header.ts` via `getMpegFrameLength`.
Common situations: Files with the `.mp1` extension or MPEG Layer I audio. Old `.mpa` or `.mpg` files from legacy MPEG-1 systems. Misidentified files that are labeled `.mp3` but are actually Layer I encoded.
Related errors
- MP3 files with VBRI are currently unsupported because we hav
- Free bitrate not supported
- Unsupported audio format ${strf.formatTag}
- Unexpected audio object type ${audioObjectType}
- Only supporting MPEG-4 for .aac
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/0e821c0b4d96cb36.
Report an issue: GitHub.