{"record":{"id":"06c2e03c8e358f08","repo":"remotion-dev/remotion","slug":"could-not-find-video-codec","errorCode":null,"errorMessage":"Could not find video codec","messagePattern":"Could not find video codec","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/iso-base-media/get-video-codec-from-iso-track.ts","lineNumber":67,"sourceCode":"\n\t\t\t// apco: ProRes 422 Proxy\n\t\t\tif (videoSample.format === 'apco') {\n\t\t\t\treturn 'prores';\n\t\t\t}\n\n\t\t\t// aprh: ProRes RAW High Quality\n\t\t\tif (videoSample.format === 'aprh') {\n\t\t\t\treturn 'prores';\n\t\t\t}\n\n\t\t\t// aprn: ProRes RAW Standard Definition\n\t\t\tif (videoSample.format === 'aprn') {\n\t\t\t\treturn 'prores';\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow new Error('Could not find video codec');\n};\n","sourceCodeStart":49,"sourceCodeEnd":69,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/iso-base-media/get-video-codec-from-iso-track.ts#L49-L69","documentation":"Thrown by getVideoCodecFromIsoTrak after inspecting the stsd's first video sample: none of the recognized FourCC format codes (hvc1/hev1 for H.265, avc1 for H.264, av01 for AV1, vp09 for VP9, ap4h/ap4x/apch/apcn/apcs/apco/aprh/aprn for ProRes) matched videoSample.format. The parser knows the track is video but cannot map its codec to a WebCodecs-compatible identifier, so it refuses to construct the track.","triggerScenarios":"A video track whose stsd sample uses an unsupported or non-standard FourCC. Reachable for codecs the media-parser does not yet support (e.g. theora, VP6, MPEG-2 video, AV1 variants with a different FourCC, proprietary codecs), or when the format string is corrupt/misread.","commonSituations":"Files containing rare or proprietary video codecs. Old media encoded with codecs WebCodecs cannot decode. Files with non-standard FourCC aliases. Screen captures or DVR exports using vendor-specific codecs.","solutions":["Transcode the video to a supported codec: `ffmpeg -i in.mp4 -c:v libx264 -c:a copy out.mp4` (H.264 is universally supported).","Confirm the actual codec with `ffprobe -v error -select_streams v:0 -show_entries stream=codec_name in.mp4`.","Request support for the codec in the Remotion media-parser if it has a standard FourCC.","Filter unsupported files before parse (probe with ffprobe first)."],"exampleFix":"// before\nawait parseMedia({ src: file });\n\n// after\n// Pre-validate codec before handing the file to media-parser\nconst probe = await runFfprobe(file);\nconst supported = new Set(['h264', 'hevc', 'av1', 'vp9', 'prores']);\nif (!supported.has(probe.streams[0].codec_name)) {\n  throw new Error(`Unsupported video codec: ${probe.streams[0].codec_name}. Transcode to H.264 first.`);\n}\nawait parseMedia({ src: file });","handlingStrategy":"validation","validationCode":"import {execFileSync} from 'node:child_process';\nconst SUPPORTED = new Set(['h264', 'hevc', 'av1', 'vp9', 'prores']);\nfunction isSupportedVideoCodec(file: string): boolean {\n  try {\n    const out = execFileSync('ffprobe', ['-v', 'error', '-select_streams', 'v:0', '-show_entries', 'stream=codec_name', '-of', 'csv=p=0', file], {encoding: 'utf8'}).trim();\n    return SUPPORTED.has(out);\n  } catch { return false; }\n}","typeGuard":"const SUPPORTED_FORMATS = new Set(['hvc1', 'hev1', 'avc1', 'av01', 'vp09', 'ap4h', 'ap4x', 'apch', 'apcn', 'apcs', 'apco', 'aprh', 'aprn']);\nfunction isSupportedVideoFormat(format: string): boolean {\n  return SUPPORTED_FORMATS.has(format);\n}","tryCatchPattern":"try {\n  await parseMedia({ src: file });\n} catch (err) {\n  if (/Could not find video codec/i.test(String(err?.message))) {\n    throw new Error('Video codec is not supported by media-parser. Transcode to H.264/HEVC/AV1/VP9/ProRes with ffmpeg.');\n  }\n  throw err;\n}","preventionTips":["Probe uploads with ffprobe and reject unsupported video codecs before parsing.","Transcode user uploads to H.264 as a normalization step.","Maintain an allow-list of supported FourCCs and validate up front.","Surface a clear 'unsupported codec' message instead of the raw parser error."],"tags":["mp4","isobmff","media-parser","video-codec","unsupported-codec","stsd"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}