{"record":{"id":"825fa5283f4c4665","repo":"remotion-dev/remotion","slug":"only-1-is-supported-as-a-stream-type-in-avi-go","errorCode":null,"errorMessage":"Only \"1\" is supported as a stream type in .avi, got ${handler}","messagePattern":"Only \"1\" is supported as a stream type in \\.avi, got (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/riff/parse-strh.ts","lineNumber":29,"sourceCode":"}): RiffBox => {\n\tconst box = iterator.startBox(size);\n\tconst fccType = iterator.getByteString(4, false);\n\tif (fccType !== 'vids' && fccType !== 'auds') {\n\t\tthrow new Error('Expected AVI handler to be vids / auds');\n\t}\n\n\tconst handler =\n\t\tfccType === 'vids'\n\t\t\t? iterator.getByteString(4, false)\n\t\t\t: iterator.getUint32Le();\n\tif (typeof handler === 'string' && handler !== 'H264') {\n\t\tthrow new Error(\n\t\t\t`Only H264 is supported as a stream type in .avi, got ${handler}`,\n\t\t);\n\t}\n\n\tif (fccType === 'auds' && handler !== 1) {\n\t\tthrow new Error(\n\t\t\t`Only \"1\" is supported as a stream type in .avi, got ${handler}`,\n\t\t);\n\t}\n\n\tconst flags = iterator.getUint32Le();\n\tconst priority = iterator.getUint16Le();\n\tconst language = iterator.getUint16Le();\n\tconst initialFrames = iterator.getUint32Le();\n\tconst scale = iterator.getUint32Le();\n\tconst rate = iterator.getUint32Le();\n\tconst start = iterator.getUint32Le();\n\tconst length = iterator.getUint32Le();\n\tconst suggestedBufferSize = iterator.getUint32Le();\n\tconst quality = iterator.getUint32Le();\n\tconst sampleSize = iterator.getUint32Le();\n\tbox.discardRest();\n\n\tconst ckId = iterator.getByteString(4, false);","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/riff/parse-strh.ts#L11-L47","documentation":"Thrown by parseStrh() for an 'auds' stream when the handler value (read as a little-endian uint32) is not 1. For audio streams the handler field is interpreted as wFormatTag; tag 1 is PCM, and the parser treats only that value as acceptable at the strh level. (Note: track construction in makeAviAudioTrack separately requires formatTag 255 for AAC, so an 'auds' stream must satisfy both gates depending on path.)","triggerScenarios":"An AVI audio stream whose strh handler/codec field is not 1 — e.g. an audio stream declared with a non-PCM format tag at the strh level.","commonSituations":"AVIs where the audio stream's strh handler is set to a non-1 value (MP3=0x55, AAC=0x00FF, etc.). Files produced by encoders that write the actual codec tag into strh.handler instead of 1.","solutions":["Remux/transcode so the audio stream is AAC and conforms to what the parser expects: ffmpeg -i in.avi -c:v copy -c:a aac out.avi","Strip the audio if only video is needed: ffmpeg -i in.avi -an -c:v copy out.avi","Inspect with ffprobe -show_streams to confirm strh handler values before parsing."],"exampleFix":"// before\nawait parseMediaStream({src: 'oddstrh.avi'});\n\n// after: normalize the audio\n// ffmpeg -i oddstrh.avi -c:v copy -c:a aac out.avi\nawait parseMediaStream({src: 'out.avi'});","handlingStrategy":"validation","validationCode":"// Inspect the auds strh handler value; must be 1 (PCM-style tag) for the parser.\n// Use ffprobe to confirm AVI audio structure before parsing.","typeGuard":"function isPcmHandler(handler: number): boolean {\n  return handler === 1;\n}","tryCatchPattern":"try {\n  await parseMediaStream({src: 'in.avi'});\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Only \"1\" is supported')) {\n    // remux/transcode the audio: ffmpeg -i in.avi -c:v copy -c:a aac out.avi\n  } else throw err;\n}","preventionTips":["Author AVI audio streams with a strh handler of 1.","Re-mux with ffmpeg to normalize unusual handler values.","Validate with ffprobe before parsing."],"tags":["riff","avi","audio-codec","strh","media-parser"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}