remotion-dev/remotion · error
Streaminfo not found
Error message
Streaminfo not found
What it means
Thrown by getDurationFromFlac() when the FLAC structure has no box of type 'flac-streaminfo'. The STREAMINFO metadata block is mandatory in every valid FLAC file (RFC 9639) and contains the total sample count and sample rate needed to compute duration. Its absence means the file was not fully parsed, the STREAMINFO block is missing/corrupt, or the structure was not populated before duration was requested.
Source
Thrown at packages/media-parser/src/containers/flac/get-duration-from-flac.ts:8
import type {ParserState} from '../../state/parser-state';
export const getDurationFromFlac = (parserState: ParserState) => {
const structure = parserState.structure.getFlacStructure();
const streaminfo = structure.boxes.find((b) => b.type === 'flac-streaminfo');
if (!streaminfo) {
throw new Error('Streaminfo not found');
}
return streaminfo.totalSamples / streaminfo.sampleRate;
};
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Verify the file is valid FLAC: `ffprobe input.flac` — if it fails, the file is corrupt.
- Re-encode from a known-good source: `ffmpeg -i input.wav output.flac`.
- Switch to Mediabunny (https://www.remotion.dev/docs/mediabunny/metadata).
- If you call getDurationFromFlac directly, check structure.boxes for 'flac-streaminfo' before calling.
Example fix
// before const duration = getDurationFromFlac(parserState); // after (guard before calling) const structure = parserState.structure.getFlacStructure(); const hasStreamInfo = structure.boxes.some((b) => b.type === 'flac-streaminfo'); const duration = hasStreamInfo ? getDurationFromFlac(parserState) : null;
Defensive patterns
Strategy: validation
Try / catch
try {
const duration = await parseMedia({src, fields: {durationInSeconds: true}});
} catch (e) {
if (e instanceof Error && e.message === 'Streaminfo not found') {
console.error('FLAC file missing STREAMINFO. Verify: ffprobe <file>. Re-encode: ffmpeg -i <file> out.flac');
} else {
throw e;
}
} Prevention
- Validate FLAC files with ffprobe or flac -t before parsing.
- Ensure files are fully downloaded (not truncated) before parsing.
- Re-encode corrupt FLAC files from a known-good source.
- Migrate to Mediabunny for more robust FLAC parsing.
When it happens
Trigger: Requesting duration from parseMedia on a FLAC file where the STREAMINFO metadata block was not found or stored during the initial header parse. This can occur with severely truncated files (missing the metadata header), files with a corrupt STREAMINFO block, or if the parser was invoked in a mode that skipped metadata parsing.
Common situations: Truncated FLAC files (e.g. incomplete downloads) missing the STREAMINFO block. Corrupt FLAC files where the 'fLaC' marker exists but the first metadata block is damaged. Files misidentified as FLAC that are actually another format.
Related errors
- Sample rate not found
- Stream info not found
- Expected flac-streaminfo
- Invalid block size
- Invalid channel count: ${bits.toString(2)}
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/c76a1e38eaaf7759.
Report an issue: GitHub.