{"record":{"id":"dcae734a52106722","repo":"remotion-dev/remotion","slug":"unsupported-stss-version-version","errorCode":null,"errorMessage":"Unsupported STSS version ${version}","messagePattern":"Unsupported STSS version (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/iso-base-media/stsd/stss.ts","lineNumber":22,"sourceCode":"export interface StssBox extends BaseBox {\n\ttype: 'stss-box';\n\tversion: number;\n\tflags: number[];\n\tsampleNumber: Set<number>;\n}\n\nexport const parseStss = ({\n\titerator,\n\toffset,\n\tboxSize,\n}: {\n\titerator: BufferIterator;\n\toffset: number;\n\tboxSize: number;\n}): StssBox => {\n\tconst version = iterator.getUint8();\n\tif (version !== 0) {\n\t\tthrow new Error(`Unsupported STSS version ${version}`);\n\t}\n\n\tconst flags = iterator.getSlice(3);\n\tconst sampleCount = iterator.getUint32();\n\n\tconst sampleNumber: Set<number> = new Set();\n\tfor (let i = 0; i < sampleCount; i++) {\n\t\tsampleNumber.add(iterator.getUint32());\n\t}\n\n\tconst bytesRemainingInBox = boxSize - (iterator.counter.getOffset() - offset);\n\n\tif (bytesRemainingInBox > 0) {\n\t\titerator.discard(bytesRemainingInBox);\n\t}\n\n\treturn {\n\t\ttype: 'stss-box',","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/iso-base-media/stsd/stss.ts#L4-L40","documentation":"The STSS (Sync Sample / keyframe table) box parser only supports version 0; any other version byte throws. STSS is spec-defined as version 0 only, so a non-zero byte indicates corruption or cursor desync from an earlier mis-parsed box.","triggerScenarios":"parseStss reads a version byte != 0. Typically a symptom of an earlier box in the stbl leaving the cursor at the wrong offset.","commonSituations":"Corrupt MP4 files, files with damaged moov tables, or files where the stbl box ordering/sizing is off.","solutions":["Run `mp4box -info input.mp4` to locate the corruption.","Re-mux with ffmpeg: `ffmpeg -i input.mp4 -c copy remuxed.mp4`.","Investigate earlier parse errors in the same run first.","For fragmented streams, confirm segment completeness."],"exampleFix":"// before: stss version reads 0x80 due to upstream desync\nffmpeg -i corrupt.mp4 -c copy fixed.mp4\n// after: stss parses with version 0","handlingStrategy":"try-catch","validationCode":"function isValidStssVersion(v: number): boolean {\n  return v === 0;\n}","typeGuard":"function isStssVersionZero(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 STSS version')) {\n    // corrupt stss or upstream desync; re-mux\n  } else throw err;\n}","preventionTips":["Re-mux with ffmpeg to rebuild the stbl.","Investigate earlier thrown errors first.","Use mp4box -info to confirm integrity."],"tags":["media-parser","isobmff","stss-box","corrupt-file","mp4"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}