{"record":{"id":"cd9719a05724d602","repo":"remotion-dev/remotion","slug":"unsupported-stts-version-version","errorCode":null,"errorMessage":"Unsupported STTS version ${version}","messagePattern":"Unsupported STTS version (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/iso-base-media/stsd/stts.ts","lineNumber":27,"sourceCode":"\tsampleCount: number;\n\tsampleDelta: number;\n};\n\nexport const parseStts = ({\n\tdata,\n\tsize,\n\tfileOffset,\n}: {\n\tdata: BufferIterator;\n\tsize: number;\n\tfileOffset: number;\n}): SttsBox => {\n\tconst initialOffset = data.counter.getOffset();\n\tconst initialCounter = initialOffset - fileOffset;\n\n\tconst version = data.getUint8();\n\tif (version !== 0) {\n\t\tthrow new Error(`Unsupported STTS version ${version}`);\n\t}\n\n\t// flags, we discard them\n\tdata.discard(3);\n\n\t// entry count\n\tconst entryCount = data.getUint32();\n\n\tconst sampleDistributions: SampleDistribution[] = [];\n\n\t// entries\n\tfor (let i = 0; i < entryCount; i++) {\n\t\tconst sampleCount = data.getUint32();\n\t\tconst sampleDelta = data.getUint32();\n\n\t\tconst sampleDistribution: SampleDistribution = {\n\t\t\tsampleCount,\n\t\t\tsampleDelta,","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/iso-base-media/stsd/stts.ts#L9-L45","documentation":"The STTS (Time-to-Sample / decoding time) box parser only supports version 0; any other version byte throws. STTS is spec-version-0 only, so a non-zero value indicates corruption or that an earlier box left the iterator cursor misaligned.","triggerScenarios":"parseStts reads a version byte != 0. Typically a downstream symptom of a sizing error in an earlier stbl box.","commonSituations":"Corrupt MP4/MOV files, incomplete fragments, or files with damaged moov tables after a crashed encode.","solutions":["Run `ffprobe -v error input.mp4` to detect moov damage.","Re-mux: `ffmpeg -i input.mp4 -c copy remuxed.mp4`.","Check for earlier thrown size/version errors and address those first.","For streamed fragments, confirm the moof+mdat segment is fully received."],"exampleFix":"// before: desynced cursor makes stts read version 0x04\nffmpeg -i corrupt.mp4 -c copy fixed.mp4\n// after: stts reads version 0","handlingStrategy":"try-catch","validationCode":"function isValidSttsVersion(v: number): boolean {\n  return v === 0;\n}","typeGuard":"function isSttsVersionZero(v: number): v is 0 {\n  return v === 0;\n}","tryCatchPattern":"try {\n  await parseMedia({src, fields: {dimensions: true}});\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Unsupported STTS version')) {\n    // corrupt stts or upstream desync; re-mux\n  } else throw err;\n}","preventionTips":["Re-mux with ffmpeg to normalize timing tables.","Investigate earlier thrown errors first.","Pre-validate with ffprobe."],"tags":["media-parser","isobmff","stts-box","corrupt-file","mp4"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}