remotion-dev/remotion · error · Error

Unsupported STTS version ${version}

Error message

Unsupported STTS version ${version}

What it means

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.

Source

Thrown at packages/media-parser/src/containers/iso-base-media/stsd/stts.ts:27

	sampleCount: number;
	sampleDelta: number;
};

export const parseStts = ({
	data,
	size,
	fileOffset,
}: {
	data: BufferIterator;
	size: number;
	fileOffset: number;
}): SttsBox => {
	const initialOffset = data.counter.getOffset();
	const initialCounter = initialOffset - fileOffset;

	const version = data.getUint8();
	if (version !== 0) {
		throw new Error(`Unsupported STTS version ${version}`);
	}

	// flags, we discard them
	data.discard(3);

	// entry count
	const entryCount = data.getUint32();

	const sampleDistributions: SampleDistribution[] = [];

	// entries
	for (let i = 0; i < entryCount; i++) {
		const sampleCount = data.getUint32();
		const sampleDelta = data.getUint32();

		const sampleDistribution: SampleDistribution = {
			sampleCount,
			sampleDelta,

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Run `ffprobe -v error input.mp4` to detect moov damage.
  2. Re-mux: `ffmpeg -i input.mp4 -c copy remuxed.mp4`.
  3. Check for earlier thrown size/version errors and address those first.
  4. For streamed fragments, confirm the moof+mdat segment is fully received.

Example fix

// before: desynced cursor makes stts read version 0x04
ffmpeg -i corrupt.mp4 -c copy fixed.mp4
// after: stts reads version 0
Defensive patterns

Strategy: try-catch

Validate before calling

function isValidSttsVersion(v: number): boolean {
  return v === 0;
}

Type guard

function isSttsVersionZero(v: number): v is 0 {
  return v === 0;
}

Try / catch

try {
  await parseMedia({src, fields: {dimensions: true}});
} catch (err) {
  if (err instanceof Error && err.message.startsWith('Unsupported STTS version')) {
    // corrupt stts or upstream desync; re-mux
  } else throw err;
}

Prevention

When it happens

Trigger: parseStts reads a version byte != 0. Typically a downstream symptom of a sizing error in an earlier stbl box.

Common situations: Corrupt MP4/MOV files, incomplete fragments, or files with damaged moov tables after a crashed encode.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/cd9719a05724d602. Report an issue: GitHub.