remotion-dev/remotion · error · Error
No MP3 info
Error message
No MP3 info
What it means
Thrown in getAudioSampleFromCbr() when state.mp3.getMp3Info() returns null at seek time. The CBR seek math needs the parsed MP3 info (layer, sampleRate, mpegVersion) that is normally populated after the first frame is parsed. A null means the parser has not yet established the MP3 stream info.
Source
Thrown at packages/media-parser/src/containers/mp3/seek/audio-sample-from-cbr.ts:32
}: {
bitrateInKbit: number;
layer: number;
samplesPerFrame: number;
sampleRate: number;
initialOffset: number;
data: Uint8Array;
state: ParserState;
}) => {
const avgLength = getAverageMpegFrameLength({
bitrateKbit: bitrateInKbit,
layer,
samplesPerFrame,
samplingFrequency: sampleRate,
});
const mp3Info = state.mp3.getMp3Info();
if (!mp3Info) {
throw new Error('No MP3 info');
}
const nthFrame = Math.round(
(initialOffset - state.mediaSection.getMediaSectionAssertOnlyOne().start) /
avgLength,
);
const durationInSeconds = samplesPerFrame / sampleRate;
const timeInSeconds = (nthFrame * samplesPerFrame) / sampleRate;
// Important that we round down, otherwise WebCodecs might stall, e.g.
// Last input = 30570667 Last output = 30570666 -> stuck
const timestamp = Math.floor(timeInSeconds * WEBCODECS_TIMESCALE);
const duration = Math.floor(durationInSeconds * WEBCODECS_TIMESCALE);
const audioSample: MediaParserAudioSample = {
data,
decodingTimestamp: timestamp,
duration,View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Ensure the parser has consumed enough of the stream to populate mp3Info (wait for the first frame to be parsed) before seeking.
- Verify the input is genuinely an MP3 before using the MP3 seek path.
- Re-encode to guarantee a clean first frame and standard CBR layout.
Defensive patterns
Strategy: validation
Validate before calling
// Ensure mp3Info is populated before issuing a CBR seek.
const mp3Info = state.mp3.getMp3Info();
if (!mp3Info) {
// wait for the parser to parse the first frame, or reject the seek
throw new Error('Cannot seek: parser has not yet established MP3 info');
} Type guard
function hasMp3Info<T>(info: T | null): info is T {
return info != null;
} Try / catch
try {
const sample = getAudioSampleFromCbr({...});
} catch (err) {
if (err instanceof Error && err.message === 'No MP3 info') {
// defer the seek until more of the stream is parsed
} else throw err;
} Prevention
- Do not seek before the parser has parsed at least the first MP3 frame.
- Gate seek APIs on getMp3Info() returning non-null.
- Confirm the input is actually MP3 before using the MP3 seek path.
When it happens
Trigger: Invoking a CBR seek before the media parser has finished reading the initial MP3 header(s) and populated mp3Info. Also possible if the seek target offset precedes the first valid frame or if the stream never produced a parseable MP3 frame.
Common situations: Seeking very early in a streaming/progressive load before enough bytes are available; feeding a non-MP3 stream into the MP3 code path; a parser state that was reset between parses.
Related errors
- No MP3 info
- Bitrate mismatch at offset ${initialOffset}: ${bitrateInKbit
- Free bitrate not supported
- Invalid Xing header
- xing header was parsed wrong: read beyond available data
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/8545f6dd21eaa1ba.
Report an issue: GitHub.