remotion-dev/remotion · error · Error
Expected CueClusterPosition
Error message
Expected CueClusterPosition
What it means
Inside a CueTrackPositions, formatCues requires a CueClusterPosition child (the absolute byte position of the cluster within the Segment); without it the cue cannot resolve to a byte offset for seeking, so parsing throws.
Source
Thrown at packages/media-parser/src/containers/webm/seek/format-cues.ts:45
(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,
};
matroskaCues.push(matroskaCue);
}
return matroskaCues;
};View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Re-mux with ffmpeg to rebuild the seek table.
- Re-encode from the original source.
- 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 CueClusterPosition/.test(err.message)) {
throw new Error('Incomplete CueClusterPosition; re-mux the file.', {cause: err});
}
throw err;
} Prevention
- Re-mux to rebuild CueClusterPosition values.
- Finalize live muxer output before parsing.
- Keep a fallback source/parser.
When it happens
Trigger: A CueTrackPositions element that lacks CueClusterPosition - incomplete seek table entry. Note CueRelativePosition is optional (it uses ?.value ?? 0), but CueClusterPosition is mandatory.
Common situations: Corrupt Cues section, partially written seek index, or non-conformant muxer.
Related errors
- Expected CuePoint
- Expected CueTime
- Expected CueTrackPositions
- Expected CueTrack
- Could not find sample rate or number of channels
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/25ed7242a5db1c7f.
Report an issue: GitHub.