{"record":{"id":"d963d1d7625f3b17","repo":"remotion-dev/remotion","slug":"the-h264-mkv-codec-for-rendermediaoncloudrun-i","errorCode":null,"errorMessage":"The \"h264-mkv\" codec for renderMediaOnCloudrun() is deprecated - it's now just \"h264\".","messagePattern":"The \"h264-mkv\" codec for renderMediaOnCloudrun\\(\\) is deprecated - it's now just \"h264\"\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/cloudrun/src/shared/validate-gcp-codec.ts","lineNumber":29,"sourceCode":"\nexport type CloudrunCodec = (typeof cloudrunCodecs)[number];\n\nexport const validateCloudrunCodec = (codec: unknown): CloudrunCodec => {\n\tif (typeof codec !== 'string') {\n\t\tthrow new TypeError('\"codec\" must be a string ');\n\t}\n\n\tif (!(cloudrunCodecs as readonly string[]).includes(codec)) {\n\t\tthrow new TypeError(\n\t\t\t\"'\" +\n\t\t\t\tcodec +\n\t\t\t\t\"' is not a valid codec for GCP Cloud Run. The following values are supported: \" +\n\t\t\t\tcloudrunCodecs.join(', '),\n\t\t);\n\t}\n\n\tif (codec === 'h264-mkv') {\n\t\tthrow new Error(\n\t\t\t'The \"h264-mkv\" codec for renderMediaOnCloudrun() is deprecated - it\\'s now just \"h264\".',\n\t\t);\n\t}\n\n\treturn codec as CloudrunCodec;\n};\n","sourceCodeStart":11,"sourceCodeEnd":36,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/shared/validate-gcp-codec.ts#L11-L36","documentation":"Intended to be thrown by validateCloudrunCodec() when codec === 'h264-mkv', instructing the user to switch to the plain 'h264' codec. In practice this branch is unreachable with the current allow-list, because 'h264-mkv' is not in cloudrunCodecs, so the earlier includes() check (error 149) rejects it first with a generic message. The guard exists for forward compatibility / documentation of the deprecation.","triggerScenarios":"Passing codec='h264-mkv'. In the current code this triggers error 149 ('not a valid codec') before reaching this specific deprecation message, because 'h264-mkv' is absent from the cloudrunCodecs array.","commonSituations":"Migrating from an older Remotion version where 'h264-mkv' was a valid Cloud Run codec; copy-pasting legacy code.","solutions":["Replace codec 'h264-mkv' with 'h264'.","Search the codebase for any 'h264-mkv' literal and remove it."],"exampleFix":"// before\nawait renderMediaOnCloudRun({ codec: 'h264-mkv', ... });\n// after\nawait renderMediaOnCloudRun({ codec: 'h264', ... });","handlingStrategy":"validation","validationCode":"if (codec === 'h264-mkv') codec = 'h264';\nvalidateCloudrunCodec(codec);","typeGuard":"function isH264MkvDeprecated(v: string): boolean {\n  return v === 'h264-mkv';\n}","tryCatchPattern":"// Replace the value before calling; no retry needed.","preventionTips":["Search and remove all 'h264-mkv' literals during upgrades.","Prefer the plain 'h264' codec in new code.","Document the deprecation in migration notes."],"tags":["cloudrun","codec","deprecation","unreachable"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}