{"record":{"id":"f90a5f479f93aac1","repo":"remotion-dev/remotion","slug":"cannot-determine-timestamp","errorCode":null,"errorMessage":"Cannot determine timestamp","messagePattern":"Cannot determine timestamp","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/flac/parse-flac-frame.ts","lineNumber":120,"sourceCode":"\t});\n\tconst parsed = parseFrameHeader({iterator, state});\n\tif (!parsed) {\n\t\tthrow new Error('Invalid CRC');\n\t}\n\n\tconst {blockSize, num, sampleRate} = parsed;\n\n\tconst duration = blockSize / sampleRate;\n\tconst structure = state.structure.getFlacStructure();\n\tconst streamInfo = structure.boxes.find(\n\t\t(box) => box.type === 'flac-streaminfo',\n\t);\n\tif (!streamInfo) {\n\t\tthrow new Error('Stream info not found');\n\t}\n\n\tif (streamInfo.minimumBlockSize !== streamInfo.maximumBlockSize) {\n\t\tthrow new Error('Cannot determine timestamp');\n\t}\n\n\tconst timestamp = (num * streamInfo.maximumBlockSize) / streamInfo.sampleRate;\n\tstate.flac.audioSamples.addSample({\n\t\ttimeInSeconds: timestamp,\n\t\toffset,\n\t\tdurationInSeconds: duration,\n\t});\n\n\tconst audioSample = convertAudioOrVideoSampleToWebCodecsTimestamps({\n\t\tsample: {\n\t\t\tdata,\n\t\t\tduration,\n\t\t\tdecodingTimestamp: timestamp,\n\t\t\ttimestamp,\n\t\t\ttype: 'key',\n\t\t\toffset,\n\t\t},","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/flac/parse-flac-frame.ts#L102-L138","documentation":"Thrown by emitSample() during FLAC frame parsing when streamInfo.minimumBlockSize does not equal streamInfo.maximumBlockSize. The parser uses a fixed block size (maximumBlockSize) multiplied by the frame number to compute timestamps; if block sizes vary across frames (as indicated by differing min/max in STREAMINFO), this linear formula is invalid and the parser cannot determine the timestamp for a given frame number.","triggerScenarios":"Parsing a FLAC file where the STREAMINFO block reports different minimum and maximum block sizes (i.e. variable-block-size encoding). The timestamp computation `(num * maximumBlockSize) / sampleRate` assumes a constant block size, which breaks for variable-block-size files.","commonSituations":"FLAC files encoded with variable block sizes per frame. This is valid per RFC 9639 but less common; many encoders use fixed block sizes. Files produced by encoders like 'flake' or certain libFLAC configurations that use variable block sizes. Some archival or professionally mastered FLAC files use this mode.","solutions":["Re-encode with fixed block sizes: `ffmpeg -i input.flac output.flac` or `flac --force-raw-format --blocksize=4096 -o output.flac input.wav`.","Switch to Mediabunny (https://www.remotion.dev/docs/mediabunny/metadata) which may handle variable block sizes.","Report the file to the Remotion team — variable block size support may be a feature gap.","Use ffprobe for metadata extraction on these specific files."],"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 === 'Cannot determine timestamp') {\n    console.error('FLAC file uses variable block sizes. Re-encode with fixed blocks: ffmpeg -i input.flac output.flac');\n  } else {\n    throw e;\n  }\n}","preventionTips":["Re-encode FLAC files with fixed block sizes if you control encoding.","Check min/max block size with mediainfo or ffprobe for problematic files.","Migrate to Mediabunny which may support variable block size FLAC.","Use ffprobe as a fallback metadata extractor for variable-block-size FLAC files."],"tags":["flac","media-parser","block-size","variable-blocksize","timestamp","unsupported-format"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}