remotion-dev/remotion · error · Error

Expected CueTrack

Error message

Expected CueTrack

What it means

Inside a CueTrackPositions, formatCues requires a CueTrack child (the track number the cue applies to); if it is absent the cue cannot be associated with a track, so parsing throws.

Source

Thrown at packages/media-parser/src/containers/webm/seek/format-cues.ts:38

		const cueTime = cue.value.find((_cue) => _cue.type === 'CueTime');
		if (!cueTime) {
			throw new Error('Expected CueTime');
		}

		const cueTrackPositions = cue.value.find(
			(c) => c.type === 'CueTrackPositions',
		);
		if (!cueTrackPositions) {
			throw new Error('Expected CueTrackPositions');
		}

		const cueTimeValue = cueTime.value.value;
		const cueTrack = cueTrackPositions.value.find(
			(_c) => _c.type === 'CueTrack',
		);
		if (!cueTrack) {
			throw new Error('Expected CueTrack');
		}

		const cueClusterPosition = cueTrackPositions.value.find(
			(_c) => _c.type === 'CueClusterPosition',
		);
		if (!cueClusterPosition) {
			throw new Error('Expected CueClusterPosition');
		}

		const cueRelativePosition = cueTrackPositions.value.find(
			(_c) => _c.type === 'CueRelativePosition',
		);

		const matroskaCue: MatroskaCue = {
			trackId: cueTrack.value.value,
			timeInTimescale: cueTimeValue,
			clusterPositionInSegment: cueClusterPosition.value.value,
			relativePosition: cueRelativePosition?.value.value ?? 0,

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Re-mux the file to regenerate Cues.
  2. Use a fresh source file.
  3. Try Mediabunny.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await parseMedia({src: 'in.mkv', fields: {durationInSeconds: true}});
} catch (err) {
  if (err instanceof Error && /Expected CueTrack/.test(err.message)) {
    throw new Error('Incomplete CueTrackPositions; re-mux the file.', {cause: err});
  }
  throw err;
}

Prevention

When it happens

Trigger: A CueTrackPositions element that lacks CueTrack - incomplete seek table entry, typically from a corrupt or partially finalized file.

Common situations: Damaged Cues section, muxer bugs, or truncation.

Related errors


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