remotion-dev/remotion · error · Error

Expected flac-streaminfo

Error message

Expected flac-streaminfo

What it means

Thrown by parseFlacFrame() when the FLAC structure contains no box of type 'flac-streaminfo', or the found box has no minimumFrameSize field (evaluated as null). The minimumFrameSize from STREAMINFO is used to optimize frame-size-based seeking; if STREAMINFO is absent or lacks this field, the parser cannot proceed with frame boundary detection.

Source

Thrown at packages/media-parser/src/containers/flac/parse-flac-frame.ts:194

		if (bits !== 0b1111111111111000) {
			throw new Error('Blocking bit changed, it should not');
		}
	}

	const setBlockingBit = state.flac.getBlockingBitStrategy();
	if (setBlockingBit === undefined) {
		throw new Error('Blocking bit should be set');
	}

	iterator.stopReadingBits();

	const structure = state.structure.getFlacStructure();

	const minimumFrameSize =
		structure.boxes.find((b) => b.type === 'flac-streaminfo')
			?.minimumFrameSize ?? null;
	if (minimumFrameSize === null) {
		throw new Error('Expected flac-streaminfo');
	}

	if (minimumFrameSize !== 0) {
		iterator.getSlice(minimumFrameSize - 2);
	}

	while (true) {
		if (iterator.counter.getOffset() === state.contentLength) {
			const size = iterator.counter.getOffset() - offset;
			returnToCheckpoint();

			const slice = iterator.getSlice(size);
			await emitSample({state, data: slice, offset});
			break;
		}

		if (iterator.bytesRemaining() === 0) {
			returnToCheckpoint();

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Verify the file has a valid STREAMINFO block: `ffprobe input.flac`.
  2. Re-encode from a known-good source: `ffmpeg -i input.flac output.flac`.
  3. Switch to Mediabunny (https://www.remotion.dev/docs/mediabunny/metadata).
  4. Report the file to the Remotion team if standard tools can parse it.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const result = await parseMedia({src, fields: {durationInSeconds: true}});
} catch (e) {
  if (e instanceof Error && e.message === 'Expected flac-streaminfo') {
    console.error('FLAC STREAMINFO missing minimumFrameSize. File is corrupt or truncated. Verify: ffprobe <file>');
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: Parsing FLAC frames when the STREAMINFO metadata block (which provides minimumFrameSize) is absent from the parsed structure, or when the field is not populated. This indicates the mandatory STREAMINFO block was never parsed, is corrupt, or the structure was queried before header parsing completed.

Common situations: Truncated or corrupt FLAC files missing the STREAMINFO block. Files with damaged metadata headers. Edge cases in streaming/incremental parsing where frame data is encountered before STREAMINFO is fully registered.

Related errors


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