{"record":{"id":"cd8df6dc0b07d3ce","repo":"remotion-dev/remotion","slug":"unsupported-video-codec-strh-handler","errorCode":null,"errorMessage":"Unsupported video codec ${strh.handler}","messagePattern":"Unsupported video codec (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/riff/get-tracks-from-avi.ts","lineNumber":67,"sourceCode":"\t\toriginalTimescale: MEDIA_PARSER_RIFF_TIMESCALE,\n\t\ttrackId: index,\n\t\tstartInSeconds: 0,\n\t\ttimescale: WEBCODECS_TIMESCALE,\n\t\ttrackMediaTimeOffsetInTrackTimescale: 0,\n\t};\n};\n\nexport const makeAviVideoTrack = ({\n\tstrh,\n\tstrf,\n\tindex,\n}: {\n\tstrh: StrhBox;\n\tstrf: StrfBoxVideo;\n\tindex: number;\n}): MediaParserVideoTrack => {\n\tif (strh.handler !== 'H264') {\n\t\tthrow new Error(`Unsupported video codec ${strh.handler}`);\n\t}\n\n\treturn {\n\t\tcodecData: null,\n\t\tcodec: TO_BE_OVERRIDDEN_LATER,\n\t\tcodecEnum: 'h264',\n\t\tcodedHeight: strf.height,\n\t\tcodedWidth: strf.width,\n\t\twidth: strf.width,\n\t\theight: strf.height,\n\t\ttype: 'video',\n\t\tdisplayAspectHeight: strf.height,\n\t\toriginalTimescale: MEDIA_PARSER_RIFF_TIMESCALE,\n\t\tdescription: undefined,\n\t\tm3uStreamFormat: null,\n\t\ttrackId: index,\n\t\tcolorSpace: {\n\t\t\tfullRange: null,","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/riff/get-tracks-from-avi.ts#L49-L85","documentation":"Thrown by makeAviVideoTrack() when an AVI video stream's strh.handler FourCC is not 'H264'. The parser only knows how to feed H.264 samples to WebCodecs, so any other video codec FourCC (XVID, DX50/DIVX, MJPG, MP42, etc.) is rejected.","triggerScenarios":"Parsing an AVI whose video stream uses a non-H.264 codec: Xvid, DivX, Motion-JPEG, WMV, MPEG-4 Part 2 variants, etc. These are extremely common in older AVI files.","commonSituations":"Old DivX/Xvid movie rips, Motion-JPEG clips from cameras, screen-capture AVIs with custom codecs. Any AVI not produced by a modern H.264 encoder will hit this.","solutions":["Transcode the video to H.264: ffmpeg -i in.avi -c:v libx264 -pix_fmt yuv420p -c:a aac out.avi","If you only need the audio, drop the video stream: ffmpeg -i in.avi -vn -c:a aac out.m4a and parse the audio instead.","Pre-inspect codecs with ffprobe to filter unsupported files before parsing."],"exampleFix":"// before\nawait parseMediaStream({src: 'xvid.avi'}); // throws\n\n// after\n// ffmpeg -i xvid.avi -c:v libx264 -pix_fmt yuv420p -c:a aac out.avi\nawait parseMediaStream({src: 'out.avi'});","handlingStrategy":"validation","validationCode":"// Pre-check the AVI video codec FourCC via ffprobe before parsing.\n// ffprobe -v error -select_streams v -show_entries stream=codec_name -of csv in.avi\n// Expect: h264","typeGuard":"function isH264Handler(handler: string): boolean {\n  return handler === 'H264';\n}","tryCatchPattern":"try {\n  await parseMediaStream({src: 'in.avi'});\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Unsupported video codec')) {\n    // transcode: ffmpeg -i in.avi -c:v libx264 -pix_fmt yuv420p -c:a aac out.avi\n  } else throw err;\n}","preventionTips":["Encode AVI video as H.264 (FourCC 'H264') for parser support.","Avoid legacy codecs (Xvid/DivX/MJPG) when targeting this parser.","Use ffprobe to filter non-H.264 AVIs at ingest."],"tags":["riff","avi","video-codec","h264","unsupported-format","media-parser"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}