remotion-dev/remotion · error · Error

No MP3 info

Error message

No MP3 info

What it means

Thrown in getAudioSampleFromVbr() when the caller passes mp3Info === null. VBR seek math needs the layer/mpegVersion from mp3Info to compute samplesPerFrame and to interpret the Xing TOC. Unlike 1384 this is an explicit parameter, so a null means the upstream caller did not have MP3 info ready.

Source

Thrown at packages/media-parser/src/containers/mp3/seek/audio-sample-from-vbr.ts:21

import {WEBCODECS_TIMESCALE} from '../../../webcodecs-timescale';
import {getDurationFromMp3Xing} from '../get-duration';
import {getTimeFromPosition} from '../parse-xing';
import {getSamplesPerMpegFrame} from '../samples-per-mpeg-file';
import type {AudioSampleFromCbr} from './audio-sample-from-cbr';

export const getAudioSampleFromVbr = ({
	info,
	position,
	mp3Info,
	data,
}: {
	position: number;
	info: VariableMp3BitrateInfo;
	mp3Info: Mp3Info | null;
	data: Uint8Array;
}): AudioSampleFromCbr => {
	if (!mp3Info) {
		throw new Error('No MP3 info');
	}

	const samplesPerFrame = getSamplesPerMpegFrame({
		layer: mp3Info.layer,
		mpegVersion: mp3Info.mpegVersion,
	});
	const wholeFileDuration = getDurationFromMp3Xing({
		samplesPerFrame,
		xingData: info.xingData,
	});
	if (!info.xingData.fileSize) {
		throw new Error('file size');
	}

	if (!info.xingData.tableOfContents) {
		throw new Error('table of contents');
	}

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Gate the VBR seek on mp3Info being non-null: fetch/await parser state until getMp3Info() returns a value before calling getAudioSampleFromVbr().
  2. Fall back to CBR seek when mp3Info is null.
  3. Confirm the file is actually VBR MP3 with a valid Xing header so mp3Info gets populated.

Example fix

// before
const sample = getAudioSampleFromVbr({info, position, mp3Info, data});

// after
if (!mp3Info) {
  throw new Error('Cannot seek: mp3Info not yet available');
}
const sample = getAudioSampleFromVbr({info, position, mp3Info, data});
Defensive patterns

Strategy: type-guard

Validate before calling

// Require mp3Info before calling the VBR seek helper.
if (!mp3Info) {
  throw new Error('Cannot seek VBR: mp3Info not available');
}
const sample = getAudioSampleFromVbr({info, position, mp3Info, data});

Type guard

function hasMp3Info(info: Mp3Info | null): info is Mp3Info {
  return info != null;
}

Try / catch

if (!mp3Info) {
  // fall back to CBR seek or defer
} else {
  try {
    const sample = getAudioSampleFromVbr({info, position, mp3Info, data});
  } catch (err) {
    if (!(err instanceof Error && err.message === 'No MP3 info')) throw err;
  }
}

Prevention

When it happens

Trigger: Calling getAudioSampleFromVbr() without first obtaining mp3Info from the parser state, e.g. seeking before the first MP3 frame has been parsed, or wiring VBR seek into a code path where mp3Info is optional and unresolved.

Common situations: Early seek on a partially-loaded VBR MP3; integration code that did not gate the VBR seek on mp3Info availability.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/773b9ab271ae5f65. Report an issue: GitHub.