remotion-dev/remotion · error · Error

Expected CuePoint

Error message

Expected CuePoint

What it means

formatCues iterates the children of the Cues element and throws if any non-Crc32 child is not a CuePoint. Per Matroska spec a Cues element must contain only CuePoint children (Crc32 is explicitly tolerated). A different child type means the seek-index table is malformed.

Source

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

import type {PossibleEbml} from '../segments/all-segments';

export type MatroskaCue = {
	trackId: number;
	timeInTimescale: number;
	clusterPositionInSegment: number;
	relativePosition: number;
};

export const formatCues = (cues: PossibleEbml[]) => {
	const matroskaCues: MatroskaCue[] = [];
	for (const cue of cues) {
		if (cue.type === 'Crc32') {
			continue;
		}

		if (cue.type !== 'CuePoint') {
			throw new Error('Expected CuePoint');
		}

		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',
		);

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Re-mux with ffmpeg to rebuild the Cues table ('ffmpeg -i in.mkv -c copy out.mkv').
  2. If the file is a live recording still being written, wait for it to finalize before parsing.
  3. Use a fresh source file.
  4. 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 CuePoint/.test(err.message)) {
    throw new Error('Malformed Cues table; re-mux to rebuild seek index.', {cause: err});
  }
  throw err;
}

Prevention

When it happens

Trigger: Loading the Cues section (triggered by parseMedia reading seek info, e.g. for duration or seeking) where the Cues element contains an unexpected child element ID. Caused by a corrupt seek table or a non-conformant muxer.

Common situations: Damaged Cues section, files with partially written seek indices (e.g. live-stream muxers that emit Cues last), or binary corruption.

Related errors


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