{"record":{"id":"12d1dd818174cefc","repo":"remotion-dev/remotion","slug":"expected-cuepoint","errorCode":null,"errorMessage":"Expected CuePoint","messagePattern":"Expected CuePoint","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/webm/seek/format-cues.ts","lineNumber":18,"sourceCode":"import type {PossibleEbml} from '../segments/all-segments';\n\nexport type MatroskaCue = {\n\ttrackId: number;\n\ttimeInTimescale: number;\n\tclusterPositionInSegment: number;\n\trelativePosition: number;\n};\n\nexport const formatCues = (cues: PossibleEbml[]) => {\n\tconst matroskaCues: MatroskaCue[] = [];\n\tfor (const cue of cues) {\n\t\tif (cue.type === 'Crc32') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (cue.type !== 'CuePoint') {\n\t\t\tthrow new Error('Expected CuePoint');\n\t\t}\n\n\t\tconst cueTime = cue.value.find((_cue) => _cue.type === 'CueTime');\n\t\tif (!cueTime) {\n\t\t\tthrow new Error('Expected CueTime');\n\t\t}\n\n\t\tconst cueTrackPositions = cue.value.find(\n\t\t\t(c) => c.type === 'CueTrackPositions',\n\t\t);\n\t\tif (!cueTrackPositions) {\n\t\t\tthrow new Error('Expected CueTrackPositions');\n\t\t}\n\n\t\tconst cueTimeValue = cueTime.value.value;\n\t\tconst cueTrack = cueTrackPositions.value.find(\n\t\t\t(_c) => _c.type === 'CueTrack',\n\t\t);","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/webm/seek/format-cues.ts#L1-L36","documentation":"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.","triggerScenarios":"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.","commonSituations":"Damaged Cues section, files with partially written seek indices (e.g. live-stream muxers that emit Cues last), or binary corruption.","solutions":["Re-mux with ffmpeg to rebuild the Cues table ('ffmpeg -i in.mkv -c copy out.mkv').","If the file is a live recording still being written, wait for it to finalize before parsing.","Use a fresh source file.","Try Mediabunny."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({src: 'in.mkv', fields: {durationInSeconds: true}});\n} catch (err) {\n  if (err instanceof Error && /Expected CuePoint/.test(err.message)) {\n    throw new Error('Malformed Cues table; re-mux to rebuild seek index.', {cause: err});\n  }\n  throw err;\n}","preventionTips":["Re-mux to rebuild the Cues table before parsing.","Ensure live-recorded files are fully finalized before parsing.","Avoid seek-based fields on streaming muxer output."],"tags":["webm","matroska","media-parser","cues","seek","malformed-file"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}