{"record":{"id":"97a281bb06855fc5","repo":"remotion-dev/remotion","slug":"expected-flac-streaminfo","errorCode":null,"errorMessage":"Expected flac-streaminfo","messagePattern":"Expected flac-streaminfo","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/flac/parse-flac-frame.ts","lineNumber":194,"sourceCode":"\t\tif (bits !== 0b1111111111111000) {\n\t\t\tthrow new Error('Blocking bit changed, it should not');\n\t\t}\n\t}\n\n\tconst setBlockingBit = state.flac.getBlockingBitStrategy();\n\tif (setBlockingBit === undefined) {\n\t\tthrow new Error('Blocking bit should be set');\n\t}\n\n\titerator.stopReadingBits();\n\n\tconst structure = state.structure.getFlacStructure();\n\n\tconst minimumFrameSize =\n\t\tstructure.boxes.find((b) => b.type === 'flac-streaminfo')\n\t\t\t?.minimumFrameSize ?? null;\n\tif (minimumFrameSize === null) {\n\t\tthrow new Error('Expected flac-streaminfo');\n\t}\n\n\tif (minimumFrameSize !== 0) {\n\t\titerator.getSlice(minimumFrameSize - 2);\n\t}\n\n\twhile (true) {\n\t\tif (iterator.counter.getOffset() === state.contentLength) {\n\t\t\tconst size = iterator.counter.getOffset() - offset;\n\t\t\treturnToCheckpoint();\n\n\t\t\tconst slice = iterator.getSlice(size);\n\t\t\tawait emitSample({state, data: slice, offset});\n\t\t\tbreak;\n\t\t}\n\n\t\tif (iterator.bytesRemaining() === 0) {\n\t\t\treturnToCheckpoint();","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/flac/parse-flac-frame.ts#L176-L212","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the file has a valid STREAMINFO block: `ffprobe input.flac`.","Re-encode from a known-good source: `ffmpeg -i input.flac output.flac`.","Switch to Mediabunny (https://www.remotion.dev/docs/mediabunny/metadata).","Report the file to the Remotion team if standard tools can parse it."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const result = await parseMedia({src, fields: {durationInSeconds: true}});\n} catch (e) {\n  if (e instanceof Error && e.message === 'Expected flac-streaminfo') {\n    console.error('FLAC STREAMINFO missing minimumFrameSize. File is corrupt or truncated. Verify: ffprobe <file>');\n  } else {\n    throw e;\n  }\n}","preventionTips":["Validate FLAC file integrity with ffprobe before parsing.","Ensure the complete metadata header is available to the parser.","Re-encode corrupt FLAC files: ffmpeg -i input.flac output.flac.","Migrate to Mediabunny for more robust FLAC metadata handling."],"tags":["flac","media-parser","streaminfo","frame-parsing","missing-metadata"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}