{"record":{"id":"88e11c059923dbd9","repo":"remotion-dev/remotion","slug":"the-name-prop-location-must-be-one-of-va","errorCode":null,"errorMessage":"The \"${name}\" prop ${location} must be one of ${validCodecs.join(', ')}, but you passed ${defaultCodec}.","messagePattern":"The \"(.+?)\" prop (.+?) must be one of (.+?), but you passed (.+?)\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/validation/validate-default-codec.ts","lineNumber":20,"sourceCode":"import {validCodecs} from '../codec';\n\nexport function validateCodec(\n\tdefaultCodec: unknown,\n\tlocation: string,\n\tname: string,\n): asserts defaultCodec is CodecOrUndefined {\n\tif (typeof defaultCodec === 'undefined') {\n\t\treturn;\n\t}\n\n\tif (typeof defaultCodec !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`The \"${name}\" prop ${location} must be a string, but you passed a value of type ${typeof defaultCodec}.`,\n\t\t);\n\t}\n\n\tif (!validCodecs.includes(defaultCodec as Codec)) {\n\t\tthrow new Error(\n\t\t\t`The \"${name}\" prop ${location} must be one of ${validCodecs.join(\n\t\t\t\t', ',\n\t\t\t)}, but you passed ${defaultCodec}.`,\n\t\t);\n\t}\n}\n","sourceCodeStart":2,"sourceCodeEnd":27,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validation/validate-default-codec.ts#L2-L27","documentation":"`validateCodec` rejects a codec string that is not in `validCodecs` (`h264, h265, vp8, vp9, av1, mp3, aac, wav, prores, h264-mkv, h264-ts, gif`). The match is case-sensitive. This guards both the `defaultCodec` from `calculateMetadata` and the `codec` argument to serverless render APIs.","triggerScenarios":"Passing a codec string that is misspelled, differently cased (`'H264'`, `'H.264'`, `'x264'`), uses a dot/dash variant (`'h.264'`, `'h-264'`), or names a codec Remotion does not support (`'webm'`, `'mkv'`, `'mp4'`).","commonSituations":"Typos; assuming case-insensitivity; using a container name instead of a codec; copying a codec name from another tool's vocabulary; version change where a codec was renamed or removed.","solutions":["Use one of the exact lowercase values listed in the error.","For MP4 video use `'h264'` (or `'h265'`); for audio-only use `'mp3'`/`'aac'`/`'wav'`.","Import the `Codec` type so the editor autocompletes valid values.","Check `validCodecs` from `@remotion/renderer`/core if unsure."],"exampleFix":"// before\nrenderMediaOnLambda({codec: 'H.264', ...})\n// after\nrenderMediaOnLambda({codec: 'h264', ...})","handlingStrategy":"validation","validationCode":"import {validCodecs} from '@remotion/core/codec';\nif (!validCodecs.includes(codec)) {\n  throw new Error('Unsupported codec: ' + codec + '. Use one of ' + validCodecs.join(', '));\n}","typeGuard":"const isValidCodec = (c) => validCodecs.includes(c);","tryCatchPattern":null,"preventionTips":["Codec matching is case-sensitive — always lowercase.","Differentiate container (mp4/mkv/webm) from codec (h264/vp9).","Let TypeScript's `Codec` union catch typos at compile time."],"tags":["validation","codec","enum","calculate-metadata","serverless"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}