{"record":{"id":"33e8eb3b994d10ee","repo":"remotion-dev/remotion","slug":"expected-height-segment","errorCode":null,"errorMessage":"Expected height segment","messagePattern":"Expected height segment","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/webm/make-track.ts","lineNumber":288,"sourceCode":"\tconst trackType = getTrackTypeSegment(track);\n\n\tif (!trackType) {\n\t\tthrow new Error('Expected track type segment');\n\t}\n\n\tconst trackId = getTrackId(track);\n\n\tif (trackTypeToString(trackType.value.value) === 'video') {\n\t\tconst width = getWidthSegment(track);\n\n\t\tif (width === null) {\n\t\t\tthrow new Error('Expected width segment');\n\t\t}\n\n\t\tconst height = getHeightSegment(track);\n\n\t\tif (height === null) {\n\t\t\tthrow new Error('Expected height segment');\n\t\t}\n\n\t\tconst displayHeight = getDisplayHeightSegment(track);\n\t\tconst displayWidth = getDisplayWidthSegment(track);\n\n\t\tconst codec = getCodecSegment(track);\n\t\tif (!codec) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst codecPrivate = getPrivateData(track);\n\t\tconst codecString = getMatroskaVideoCodecString({\n\t\t\ttrack,\n\t\t\tcodecSegment: codec,\n\t\t});\n\t\tconst colour = getColourSegment(track);\n\n\t\tif (!codecString) {","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/webm/make-track.ts#L270-L306","documentation":"Thrown by `getTrack` (make-track.ts:288) for a video track whose TrackEntry has no `PixelHeight` element (`getHeightSegment` returns null). Sibling guard to 1458: PixelHeight is mandatory for video tracks and is required (along with PixelWidth and optional DisplayWidth/Height) to populate the track's coded and display dimensions.","triggerScenarios":"A video TrackEntry missing `PixelHeight`. Same root causes as 1458 — truncated/corrupt EBML headers or non-conformant muxers. Fires immediately after the PixelWidth check passes.","commonSituations":"Corrupt or partially written MKV/WebM video track headers; experimental muxer output; interrupted encodes.","solutions":["Re-mux/re-encode with a conformant tool so both PixelWidth and PixelHeight are written: `ffmpeg -i in.webm -c copy out.webm`.","Verify integrity with `ffprobe`; reject if it also fails.","Catch the parse error and skip the asset."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Same dimension probe as 1458 — both width and height must be present.\nimport { execFile } from 'node:child_process';\nimport { promisify } from 'node:util';\nconst exec = promisify(execFile);\nasync function hasDimensions(filePath) {\n  const { stdout } = await exec('ffprobe', ['-v', 'error', '-select_entries', 'stream=width,height', '-of', 'json', filePath]);\n  const info = JSON.parse(stdout);\n  return info.streams?.some((s) => s.width && s.height) ?? false;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({ src, fields: { tracks: true } });\n} catch (err) {\n  if (err instanceof Error && err.message === 'Expected height segment') {\n    console.warn('Video TrackEntry missing PixelHeight — malformed file:', src);\n    return null;\n  }\n  throw err;\n}","preventionTips":["Probe video dimensions with ffprobe before parsing.","Re-mux/re-encode so both PixelWidth and PixelHeight are present in the TrackEntry.","Reject malformed video assets upstream."],"tags":["media-parser","webm","matroska","malformed-input","video-track","dimensions"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}