{"record":{"id":"a84d5963986378f5","repo":"remotion-dev/remotion","slug":"the-separation-asset-must-be-a-video","errorCode":null,"errorMessage":"The separation asset must be a video.","messagePattern":"The separation asset must be a video\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/WebMcp.tsx","lineNumber":686,"sourceCode":"\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tdefault: 'very-high',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\t},\n\t\t\t\t\tannotations: {readOnlyHint: false},\n\t\t\t\t\texecute: async (input) => {\n\t\t\t\t\t\tif (!isOptionalPackageInstalled(VIDEO_MATTING_PACKAGE)) {\n\t\t\t\t\t\t\treturn missingOptionalPackageResult(VIDEO_MATTING_PACKAGE);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst assetPath = resolveAssetPath({\n\t\t\t\t\t\t\tassetPath: input.assetPath,\n\t\t\t\t\t\t\tcurrentContent: currentContentRef.current,\n\t\t\t\t\t\t\tstaticFiles: staticFilesRef.current,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (getPreviewFileType(assetPath) !== 'video') {\n\t\t\t\t\t\t\tthrow new Error('The separation asset must be a video.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst videoMatting = await import('@remotion/video-matting');\n\t\t\t\t\t\tconst modelName = input.model ?? 'ben2-base';\n\t\t\t\t\t\tif (typeof modelName !== 'string') {\n\t\t\t\t\t\t\tthrow new Error('model must be a string.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst model = videoMatting\n\t\t\t\t\t\t\t.getAvailableModels()\n\t\t\t\t\t\t\t.find((candidate) => candidate.name === modelName)?.name;\n\t\t\t\t\t\tif (!model) {\n\t\t\t\t\t\t\tthrow new Error(`Unknown video matting model: ${modelName}.`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst audio = input.audio ?? 'base';\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\taudio !== 'base' &&","sourceCodeStart":668,"sourceCodeEnd":704,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/components/WebMcp.tsx#L668-L704","documentation":"Thrown by the Remotion Studio WebMcp video-matting tool when the asset resolved from `input.assetPath` is not a video file. Before starting background/foreground separation, the Studio resolves the asset path against current content and static files and checks its preview file type via getPreviewFileType; only 'video' assets can be matted. Images, audio, or unresolvable paths fail this check.","triggerScenarios":"Calling the Studio WebMcp separation tool with input.assetPath pointing to a non-video static file (image, audio, JSON), or to a path that resolves to a file whose detected type is not 'video'.","commonSituations":"Passing a public/ image or audio file by mistake, passing a path relative to the wrong directory so resolution lands on an unexpected file, or expecting GIF/WebM variants to be classified as video when they are not.","solutions":["Point input.assetPath at an actual video file (mp4/webm) inside the public folder.","Verify the resolved path with staticFile() and check its extension/type before invoking the tool.","Ensure the file exists and is included in Remotion static files so getPreviewFileType classifies it as video."],"exampleFix":"// before\n{ assetPath: 'poster.png' }\n// after\n{ assetPath: 'clips/interview.mp4' }","handlingStrategy":"validation","validationCode":"const isVideo = /\\.(mp4|webm|mov|mkv|m4v)$/i.test(assetPath);\nif (!isVideo) throw new Error('Provide a video asset for separation.');","typeGuard":"const isVideoAsset = (p: string): boolean => /\\.(mp4|webm|mov|mkv|m4v)$/i.test(p);","tryCatchPattern":null,"preventionTips":["Only reference video files in the public folder for matting inputs.","Verify the resolved static file type before invoking the separation tool.","Keep asset paths relative to public/ and confirm the file exists."],"tags":["validation","asset-type","video-matting"],"backgroundTag":"incompatible-source-type","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}