{"record":{"id":"0d4b7616c0151a4b","repo":"remotion-dev/remotion","slug":"no-dimensions-found-for-broll","errorCode":null,"errorMessage":"No dimensions found for bRoll: ","messagePattern":"No dimensions found for bRoll: ","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/template-recorder/remotion/layout/get-broll-dimensions.ts","lineNumber":41,"sourceCode":"  ) {\n    const { width, height } = await getImageDimensions(bRoll.source);\n    return {\n      ...bRoll,\n      type: \"image\",\n      assetWidth: width,\n      assetHeight: height,\n    };\n  }\n\n  if (\n    videoFileExtensions.some((ext) => bRoll.source.toLowerCase().endsWith(ext))\n  ) {\n    const metadata = await getVideoMetadata({\n      src: bRoll.source,\n      includeDuration: false,\n    });\n    if (!metadata.dimensions) {\n      throw new Error(\"No dimensions found for bRoll: \" + bRoll.source);\n    }\n\n    return {\n      ...bRoll,\n      type: \"video\",\n      assetWidth: metadata.dimensions.width,\n      assetHeight: metadata.dimensions.height,\n    };\n  }\n\n  throw new Error(\n    `Unsupported file extension for bRoll: ${bRoll.source}. Only ${[...imageFileExtensions, ...videoFileExtensions].join(\", \")} are supported.`,\n  );\n};\n","sourceCodeStart":23,"sourceCodeEnd":56,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/template-recorder/remotion/layout/get-broll-dimensions.ts#L23-L56","documentation":"getBRollDimensions fetches video metadata for a b-roll source with getVideoMetadata and needs dimensions to size the b-roll asset. When the returned metadata lacks a dimensions field, the function cannot proceed and throws, naming the offending source URL. This typically means the video could not be probed (unsupported/corrupt file) or the metadata did not include video tracks.","triggerScenarios":"Calling getBRollDimensions with a bRoll.source pointing at a video whose getVideoMetadata result has no dimensions — e.g. an audio-only file, a corrupt or unsupported codec, or a src that failed to fully load.","commonSituations":"Pointing bRoll.source at an audio file or image instead of a video; a broken/404 or CORS-blocked URL; a video codec the browser cannot decode so no video track metadata is available.","solutions":["Verify bRoll.source is a valid, decodable video file with video dimensions (test in a browser `<video>` tag)","Fix the URL: ensure the file exists, is served with correct MIME type, and is CORS-accessible","Re-encode the asset to H.264/MP4 with a video track if the codec is unsupported","Handle the error by falling back to explicit assetWidth/assetHeight supplied by the caller"],"exampleFix":"// before\nconst bRoll = {source: 'audio.mp3'}; // no video track\n// after\nconst bRoll = {source: 'clip.mp4'}; // video with dimensions\n// or validate first:\nconst meta = await getVideoMetadata({src: bRoll.source, includeDuration: false});\nif (!meta.dimensions) throw new Error(`Unusable video: ${bRoll.source}`);","handlingStrategy":"validation","validationCode":"const meta = await getVideoMetadata({src: bRoll.source, includeDuration: false});\nif (!meta.dimensions) {\n  throw new Error(`Source has no video dimensions: ${bRoll.source}`);\n}","typeGuard":"const hasDimensions = (m: Awaited<ReturnType<typeof getVideoMetadata>>): m is typeof m & {dimensions: {width: number; height: number}} =>\n  m.dimensions != null;","tryCatchPattern":"try {\n  const dims = await getBRollDimensions(bRoll);\n} catch (e) {\n  if (e.message.startsWith('No dimensions found for bRoll')) {\n    // fall back to default dimensions or skip the asset\n  }\n}","preventionTips":["Only use real video files (with a video track) as b-roll sources","Verify source URLs are reachable and CORS-enabled","Re-encode unsupported codecs to H.264 MP4 before use"],"tags":["video-metadata","template-recorder","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"46a3a6bf13ca367376ff18bbb06dae2e87e0d068","analyzedAt":"2026-09-18T00:12:20.256Z","contentChangedAt":"2026-09-18T00:12:20.256Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}