{"record":{"id":"5737850c551ec060","repo":"remotion-dev/remotion","slug":"background-and-foreground-outputs-must-be-differen","errorCode":null,"errorMessage":"Background and foreground outputs must be different.","messagePattern":"Background and foreground outputs must be different\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/WebMcp.tsx","lineNumber":762,"sourceCode":"\t\t\t\t\t\tconst baseError = validatePublicOutputName({\n\t\t\t\t\t\t\textension: '.webm',\n\t\t\t\t\t\t\toutName: baseOutputPath,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tconst foregroundError = validatePublicOutputName({\n\t\t\t\t\t\t\textension: '.webm',\n\t\t\t\t\t\t\toutName: foregroundOutputPath,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (baseError !== null || foregroundError !== null) {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\tbaseError ?? foregroundError ?? 'Invalid output path.',\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tbaseOutputPath.normalize('NFC').toLowerCase() ===\n\t\t\t\t\t\t\tforegroundOutputPath.normalize('NFC').toLowerCase()\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t'Background and foreground outputs must be different.',\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst jobId = addVideoMattingJob({\n\t\t\t\t\t\t\taudio,\n\t\t\t\t\t\t\tbaseOutName: baseOutputPath,\n\t\t\t\t\t\t\tdisplayName,\n\t\t\t\t\t\t\tforegroundOutName: foregroundOutputPath,\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\tsrc,\n\t\t\t\t\t\t\tvideoBitrate,\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tbaseOutputPath,\n\t\t\t\t\t\t\tforegroundOutputPath,\n\t\t\t\t\t\t\tjobId,\n\t\t\t\t\t\t\tsuccess: true,","sourceCodeStart":744,"sourceCodeEnd":780,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/components/WebMcp.tsx#L744-L780","documentation":"Thrown when the background and foreground output names are identical after NFC normalization and lowercasing. The two separation outputs must target distinct files, otherwise one would overwrite the other.","triggerScenarios":"Passing baseOutputPath and foregroundOutputPath with the same name, or names differing only by case/Unicode normalization (e.g. 'Out.webm' vs 'out.webm').","commonSituations":"Programmatically deriving both names from one template and forgetting the -base/-foreground suffix, or expecting case-insensitive filesystems to disambiguate.","solutions":["Give the two outputs distinct names, e.g. 'clip-base.webm' and 'clip-foreground.webm'.","Omit both paths so the defaults ('<name>-base.webm' / '<name>-foreground.webm') are used.","Ensure any suffix inserted differs between the two names regardless of case."],"exampleFix":"// before\n{ baseOutputPath: 'clip.webm', foregroundOutputPath: 'clip.webm' }\n// after\n{ baseOutputPath: 'clip-base.webm', foregroundOutputPath: 'clip-foreground.webm' }","handlingStrategy":"validation","validationCode":"if (base.toLowerCase() === foreground.toLowerCase()) throw new Error('outputs must differ');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive foreground names by appending '-foreground' before the extension.","Compare final names case-insensitively before submitting.","Rely on defaults when custom names are not needed."],"tags":["validation","duplicate-output","video-matting"],"backgroundTag":"conflicting-config-options","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"}