{"record":{"id":"f08a6f6ffbd3cf4f","repo":"remotion-dev/remotion","slug":"videobitrate-is-invalid","errorCode":null,"errorMessage":"videoBitrate is invalid.","messagePattern":"videoBitrate is invalid\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/WebMcp.tsx","lineNumber":723,"sourceCode":"\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' &&\n\t\t\t\t\t\t\tvideoBitrate !== 'low' &&\n\t\t\t\t\t\t\tvideoBitrate !== 'medium' &&\n\t\t\t\t\t\t\tvideoBitrate !== 'high' &&\n\t\t\t\t\t\t\tvideoBitrate !== 'very-high'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error('videoBitrate is invalid.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst src = staticFile(assetPath);\n\t\t\t\t\t\tconst displayName = assetPath.split('/').at(-1) ?? assetPath;\n\t\t\t\t\t\tconst baseName = getDefaultOutputBaseName(\n\t\t\t\t\t\t\tsrc,\n\t\t\t\t\t\t\tdisplayName,\n\t\t\t\t\t\t\t'video',\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst baseOutputPath =\n\t\t\t\t\t\t\tinput.baseOutputPath ?? `${baseName}-base.webm`;\n\t\t\t\t\t\tconst foregroundOutputPath =\n\t\t\t\t\t\t\tinput.foregroundOutputPath ?? `${baseName}-foreground.webm`;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof baseOutputPath !== 'string' ||\n\t\t\t\t\t\t\ttypeof foregroundOutputPath !== 'string'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error('Output paths must be strings.');","sourceCodeStart":705,"sourceCodeEnd":741,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/components/WebMcp.tsx#L705-L741","documentation":"Thrown when `input.videoBitrate` is neither an integer bitrate (number) nor one of the preset strings 'very-low' | 'low' | 'medium' | 'high' | 'very-high'. Floats, negative numbers, or unknown preset strings are rejected.","triggerScenarios":"Passing videoBitrate: '5M', videoBitrate: 1.5, videoBitrate: -100, or videoBitrate: 'ultra'.","commonSituations":"Using ffmpeg-style bitrate strings ('5M', '4000k') instead of an integer bits-per-second, or inventing preset names.","solutions":["Use a preset string: 'very-low' | 'low' | 'medium' | 'high' | 'very-high'.","Or pass an integer number of bits per second, e.g. 4_000_000.","Omit the field to use the default 'very-high'."],"exampleFix":"// before\n{ videoBitrate: '5M' }\n// after\n{ videoBitrate: 5000000 }","handlingStrategy":"validation","validationCode":"const PRESETS = ['very-low','low','medium','high','very-high'];\nconst ok = v == null || PRESETS.includes(v) || (typeof v === 'number' && Number.isInteger(v) && v > 0);\nif (!ok) throw new Error('invalid videoBitrate');","typeGuard":"const isBitrate = (v: unknown): v is number | 'very-low'|'low'|'medium'|'high'|'very-high' => PRESETS.includes(v) || (typeof v === 'number' && Number.isInteger(v));","tryCatchPattern":null,"preventionTips":["Prefer preset strings over raw numbers.","If using numbers, pass integer bits-per-second (e.g. 4_000_000), not '5M'.","Omit the option to use the 'very-high' default."],"tags":["validation","bitrate","video-matting"],"backgroundTag":"invalid-argument-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"}