{"record":{"id":"b4df40bf0ff0013d","repo":"remotion-dev/remotion","slug":"unknown-codec-codec-value","errorCode":null,"errorMessage":"Unknown codec: ${codec.value}","messagePattern":"Unknown codec: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/webm/make-track.ts","lineNumber":76,"sourceCode":"\t}\n\n\tif (codec.value === 'V_VP9') {\n\t\treturn 'vp9';\n\t}\n\n\tif (codec.value === 'V_MPEG4/ISO/AVC') {\n\t\treturn 'h264';\n\t}\n\n\tif (codec.value === 'V_AV1') {\n\t\treturn 'av1';\n\t}\n\n\tif (codec.value === 'V_MPEGH/ISO/HEVC') {\n\t\treturn 'h265';\n\t}\n\n\tthrow new Error(`Unknown codec: ${codec.value}`);\n};\n\nconst getMatroskaVideoCodecString = ({\n\ttrack,\n\tcodecSegment: codec,\n}: {\n\ttrack: TrackEntry;\n\tcodecSegment: CodecIdSegment;\n}): string | null => {\n\tif (codec.value === 'V_VP8') {\n\t\treturn 'vp8';\n\t}\n\n\tif (codec.value === 'V_VP9') {\n\t\tconst priv = getPrivateData(track);\n\t\tif (priv) {\n\t\t\tthrow new Error(\n\t\t\t\t'@remotion/media-parser cannot handle the private data for VP9. Do you have an example file you could send so we can implement it? https://remotion.dev/report',","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/webm/make-track.ts#L58-L94","documentation":"Thrown by `getMatroskaVideoCodecEnum` (make-track.ts:76) when the `CodecID` string of a video track is not one of V_VP8, V_VP9, V_MPEG4/ISO/AVC, V_AV1, V_MPEGH/ISO/HEVC. The parser enumerates only those five Matroska video codecs; any other CodecID is unsupported.","triggerScenarios":"A WebM/MKV whose video track uses a CodecID outside the supported set — e.g. `V_THEORA`, `V_MPEG4/ISO/ASP`, `V_MPEG4/ISO/SP`, `V_MS/VFW/FOURCC`, `V_REAL/RV10`, or a custom/fourcc codec. Fires during the tracks pass of `parseMedia({ fields: { tracks: true } })`.","commonSituations":"Legacy MKV files (Theora, DivX, Xvid, WMV, RealVideo); MKVs created by older muxers; mislabelled test fixtures. WebM strictly allows VP8/VP9/AV1, so this is far more common with .mkv than .webm.","solutions":["Transcode the video to a supported codec: `ffmpeg -i in.mkv -c:v libx264 out.mkv` (H.264) or `-c:v libvpx-vp9 out.webm`.","If you only need metadata that doesn't require decoding this track, request narrower fields and skip the offending track.","Report the codec at https://remotion.dev/report if you believe it should be supported.","Catch the error and present 'unsupported codec' feedback to the end user."],"exampleFix":"// before\nconst { tracks } = await parseMedia({ src: 'legacy.mkv', fields: { tracks: true } });\n\n// after — transcode first\n// $ ffmpeg -i legacy.mkv -c:v libx264 -c:a aac supported.mkv\nconst { tracks } = await parseMedia({ src: 'supported.mkv', fields: { tracks: true } });","handlingStrategy":"validation","validationCode":"// Probe the file's codecs before handing it to parseMedia.\n// Uses ffprobe (must be on PATH). Returns the list of video codec names.\nimport { execFile } from 'node:child_process';\nimport { promisify } from 'node:util';\nconst exec = promisify(execFile);\nasync function getVideoCodecs(filePath) {\n  const { stdout } = await exec('ffprobe', ['-v', 'error', '-select_entries', 'stream=codec_name', '-of', 'csv=p=0', filePath]);\n  return stdout.trim().split('\\n').filter(Boolean);\n}\nconst SUPPORTED = new Set(['h264', 'vp8', 'vp9', 'av1', 'hevc']);\nasync function isSupportedVideo(filePath) {\n  const codecs = await getVideoCodecs(filePath);\n  return codecs.every((c) => SUPPORTED.has(c));\n}","typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({ src, fields: { tracks: true } });\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Unknown codec: V_')) {\n    console.error('Unsupported video codec:', err.message);\n    // Transcode with ffmpeg to H.264/AV1/VP9 and retry.\n  }\n  throw err;\n}","preventionTips":["Restrict uploads/inputs to WebM (VP8/VP9/AV1) or H.264/HEVC MKV to stay within supported codecs.","Run an ffprobe pre-flight to filter unsupported codecs before parseMedia.","Provide a server-side transcode step (ffmpeg) for unsupported inputs.","Surface a clear 'unsupported codec' message to end users instead of crashing."],"tags":["media-parser","webm","matroska","unsupported-codec","video-codec"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}