{"record":{"id":"46fd19fbb263dc99","repo":"affaan-m/ECC","slug":"no-video-track-found","errorCode":null,"errorMessage":"No video track found","messagePattern":"No video track found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"skills/remotion-video-creation/rules/get-video-dimensions.md","lineNumber":27,"sourceCode":"\nMediabunny can extract the width and height of a video file. It works in browser, Node.js, and Bun environments.\n\n## Getting video dimensions\n\n```tsx\nimport { Input, ALL_FORMATS, UrlSource } from \"mediabunny\";\n\nexport const getVideoDimensions = async (src: string) => {\n  const input = new Input({\n    formats: ALL_FORMATS,\n    source: new UrlSource(src, {\n      getRetryDelay: () => null,\n    }),\n  });\n\n  const videoTrack = await input.getPrimaryVideoTrack();\n  if (!videoTrack) {\n    throw new Error(\"No video track found\");\n  }\n\n  return {\n    width: videoTrack.displayWidth,\n    height: videoTrack.displayHeight,\n  };\n};\n```\n\n## Usage\n\n```tsx\nconst dimensions = await getVideoDimensions(\"https://remotion.media/video.mp4\");\nconsole.log(dimensions.width);  // e.g. 1920\nconsole.log(dimensions.height); // e.g. 1080\n```\n\n## Using with local files","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/affaan-m/ECC/blob/d8409a4b0813771235555e32e3d8046a73988bfa/skills/remotion-video-creation/rules/get-video-dimensions.md#L9-L45","documentation":"Example from the mediabunny get-video-dimensions rule: getPrimaryVideoTrack() on the opened Input returned no track, so displayWidth/displayHeight cannot be read. The supplied src is audio-only or otherwise has no primary video track.","triggerScenarios":"Thrown at skills/remotion-video-creation/rules/get-video-dimensions.md:27 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the file is a video before requesting dimensions","Fall back to probing with ffprobe when mediabunny finds no track","Throw a descriptive error naming the offending src so callers can filter inputs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d8409a4b0813771235555e32e3d8046a73988bfa","analyzedAt":"2026-08-26T12:15:34.022Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}