{"record":{"id":"102a29f3136207fc","repo":"remotion-dev/remotion","slug":"unknown-video-matting-model-modelname","errorCode":null,"errorMessage":"Unknown video matting model: ${modelName}.","messagePattern":"Unknown video matting model: (.+?)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/WebMcp.tsx","lineNumber":699,"sourceCode":"\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' &&\n\t\t\t\t\t\t\taudio !== 'foreground' &&\n\t\t\t\t\t\t\taudio !== 'both' &&\n\t\t\t\t\t\t\taudio !== 'none'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error('audio must be base, foreground, both, or none.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst videoBitrate = input.videoBitrate ?? 'very-high';\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(typeof videoBitrate !== 'number' ||\n\t\t\t\t\t\t\t\t!Number.isInteger(videoBitrate) ||\n\t\t\t\t\t\t\t\tvideoBitrate <= 0) &&\n\t\t\t\t\t\t\tvideoBitrate !== 'very-low' &&","sourceCodeStart":681,"sourceCodeEnd":717,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/components/WebMcp.tsx#L681-L717","documentation":"Thrown when `input.model` is a string but does not match any model name returned by @remotion/video-matting's getAvailableModels(). Only installed/supported models (e.g. 'ben2-base') are accepted; the message echoes the unknown name.","triggerScenarios":"Passing a string like 'ben2', 'BEN2-Base' (case-sensitive), a model from another library, or a model name valid in a newer/older @remotion/video-matting version.","commonSituations":"Typo'd or hallucinated model names from AI agents, case mismatch, or version drift where the requested model was renamed or not yet released.","solutions":["Use an exact name from getAvailableModels(), e.g. 'ben2-base'.","Update @remotion/video-matting to the latest version if the model should exist.","Omit input.model entirely to accept the default model."],"exampleFix":"// before\n{ model: 'ben2' }\n// after\n{ model: 'ben2-base' }","handlingStrategy":"validation","validationCode":"const names = videoMatting.getAvailableModels().map(m => m.name);\nif (modelName != null && !names.includes(modelName)) throw new Error(`Pick one of: ${names.join(', ')}`);","typeGuard":null,"tryCatchPattern":"try { await separate(input); } catch (e) { if (String(e.message).startsWith('Unknown video matting model')) { input.model = 'ben2-base'; } else throw e; }","preventionTips":["Copy model names exactly from getAvailableModels().","Keep @remotion/video-matting up to date.","Treat model names as case-sensitive enums."],"tags":["validation","enum","video-matting"],"backgroundTag":"invalid-enum-value","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}