{"record":{"id":"f3ea226244f8d8f0","repo":"remotion-dev/remotion","slug":"no-strh-box","errorCode":null,"errorMessage":"No strh box","messagePattern":"No strh box","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/get-fps.ts","lineNumber":129,"sourceCode":"\t}\n\n\tconst trackBoxes = getTraks(moovBox);\n\n\tconst trackBox = trackBoxes.find(trakBoxContainsVideo);\n\tif (!trackBox) {\n\t\treturn null;\n\t}\n\n\treturn getFpsFromMp4TrakBox(trackBox);\n};\n\nconst getFpsFromAvi = (structure: RiffStructure) => {\n\tconst strl = getStrlBoxes(structure);\n\n\tfor (const s of strl) {\n\t\tconst strh = getStrhBox(s.children);\n\t\tif (!strh) {\n\t\t\tthrow new Error('No strh box');\n\t\t}\n\n\t\tif (strh.fccType === 'auds') {\n\t\t\tcontinue;\n\t\t}\n\n\t\treturn strh.rate;\n\t}\n\n\treturn null;\n};\n\nexport const getFps = (state: ParserState) => {\n\tconst segments = state.structure.getStructure();\n\n\tif (segments.type === 'iso-base-media') {\n\t\treturn getFpsFromIsoMaseMedia(state);\n\t}","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/get-fps.ts#L111-L147","documentation":"Thrown by getFpsFromAvi() while iterating stream-list (strl) children: a strl was found but getStrhBox returned null, meaning the stream header subchunk ('strh') is missing from that stream list. Without strh the parser cannot read the rate denominator needed for FPS, so it aborts rather than guess.","triggerScenarios":"Parsing an AVI file where one of the stream lists omits the strh chunk (malformed or truncated index). AVI files written by non-standard capture tools or repaired with incomplete reconstruction.","commonSituations":"Handling legacy AVI captures. Processing AVI files that were partially downloaded or repaired. Files muxed by tools that omit strh for certain stream types.","solutions":["Re-mux the AVI with ffmpeg (ffmpeg -i in.avi -c copy out.avi) to rebuild complete stream headers.","Wrap FPS extraction in try/catch and fall back to a default or null FPS.","Pre-validate the AVI structure with ffmpeg/ffprobe; skip files missing strh chunks."],"exampleFix":"// before\nconst fps = getFps(state);\n\n// after\nlet fps;\ntry {\n  fps = getFps(state);\n} catch (err) {\n  console.warn('AVI missing strh, cannot derive FPS', err);\n  fps = null;\n}","handlingStrategy":"try-catch","validationCode":"import {getStrhBox} from '@remotion/media-parser/containers/riff/traversal';\nconst strl = getStrlBoxes(structure);\nif (strl.every((s) => getStrhBox(s.children))) { const fps = getFps(state); }","typeGuard":"null","tryCatchPattern":"try { getFps(state); } catch (e) { if (e.message === 'No strh box') { /* malformed AVI, fall back */ } else throw e; }","preventionTips":["Re-mux AVI files with ffmpeg.","Validate AVI structure with ffprobe before parsing.","Fall back to null FPS when strh is missing."],"tags":["avi","riff","fps","corrupt-file"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}