{"record":{"id":"03bd45cb500e1a41","repo":"remotion-dev/remotion","slug":"unsupported-stsd-version-version-03bd45","errorCode":null,"errorMessage":"Unsupported STSD version ${version}","messagePattern":"Unsupported STSD version (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/iso-base-media/stsd/stsz.ts","lineNumber":32,"sourceCode":"export type StszBox = BaseBox & {\n\ttype: 'stsz-box';\n\tversion: number;\n\tflags: number[];\n\tsampleCount: number;\n} & Discriminated;\n\nexport const parseStsz = ({\n\titerator,\n\toffset,\n\tsize,\n}: {\n\titerator: BufferIterator;\n\toffset: number;\n\tsize: number;\n}): StszBox => {\n\tconst version = iterator.getUint8();\n\tif (version !== 0) {\n\t\tthrow new Error(`Unsupported STSD version ${version}`);\n\t}\n\n\tconst flags = iterator.getSlice(3);\n\n\tconst sampleSize = iterator.getUint32();\n\tconst sampleCount = iterator.getUint32();\n\n\tif (sampleSize !== 0) {\n\t\treturn {\n\t\t\ttype: 'stsz-box',\n\t\t\tboxSize: size,\n\t\t\toffset,\n\t\t\tversion,\n\t\t\tflags: [...flags],\n\t\t\tsampleCount,\n\t\t\tcountType: 'fixed',\n\t\t\tsampleSize,\n\t\t};","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/iso-base-media/stsd/stsz.ts#L14-L50","documentation":"The STSZ (Sample Size) box parser only supports version 0; any other version throws. The message text incorrectly says 'STSD version' (copy-paste bug) but the box is STSZ. Since STSZ is spec-version-0 only, a non-zero byte signals corruption or cursor desync.","triggerScenarios":"parseStsz reads a version byte != 0 at the start of an stsz box. Usually downstream of a sizing error in a sibling stbl box.","commonSituations":"Corrupt MP4/MOV files, partial downloads, or damaged moov tables.","solutions":["Validate: `mp4box -info input.mp4` or `ffprobe -v error input.mp4`.","Re-mux: `ffmpeg -i input.mp4 -c copy -movflags +faststart remuxed.mp4`.","Trace earlier thrown errors first — they are the likely root cause.","Ensure full segment delivery for streaming sources."],"exampleFix":"// before: cursor shift makes stsz read version 0x10\nffmpeg -i corrupt.mp4 -c copy fixed.mp4\n// after: stsz reads version 0","handlingStrategy":"try-catch","validationCode":"function isValidStszVersion(v: number): boolean {\n  return v === 0;\n}","typeGuard":"function isStszVersionZero(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 STSD version') && /* stsz context */) {\n    // ambiguous message also used by stco/stsc; re-mux to resolve\n  } else throw err;\n}","preventionTips":["Re-mux suspicious files with ffmpeg.","Treat 'Unsupported STSD version' as ambiguous across stco/stsc/stsz — use box context.","Investigate earlier errors first."],"tags":["media-parser","isobmff","stsz-box","corrupt-file","wrong-message","mp4"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}