{"record":{"id":"5fa4b2502d93959e","repo":"remotion-dev/remotion","slug":"unknown-riff-container-segments-type","errorCode":null,"errorMessage":"Unknown RIFF container ${segments.type}","messagePattern":"Unknown RIFF container (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/get-container.ts","lineNumber":37,"sourceCode":"\n\tif (segments.type === 'mp3') {\n\t\treturn 'mp3';\n\t}\n\n\tif (segments.type === 'wav') {\n\t\treturn 'wav';\n\t}\n\n\tif (segments.type === 'flac') {\n\t\treturn 'flac';\n\t}\n\n\tif (segments.type === 'riff') {\n\t\tif (isRiffAvi(segments)) {\n\t\t\treturn 'avi';\n\t\t}\n\n\t\tthrow new Error('Unknown RIFF container ' + segments.type);\n\t}\n\n\tif (segments.type === 'aac') {\n\t\treturn 'aac';\n\t}\n\n\tif (segments.type === 'm3u') {\n\t\treturn 'm3u8';\n\t}\n\n\tthrow new Error('Unknown container ' + (segments satisfies never));\n};\n\nexport const hasContainer = (boxes: MediaParserStructureUnstable): boolean => {\n\ttry {\n\t\treturn getContainer(boxes) !== null;\n\t} catch {\n\t\treturn false;","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/get-container.ts#L19-L55","documentation":"Thrown by getContainer() when the parsed structure is a RIFF file but isRiffAvi() returns false, i.e. the RIFF form is not an AVI container (not the 'AVI ' FourCC). The parser recognizes AVI specifically; other RIFF subtypes such as 'WAVE', 'WEBP', or 'CDR' are unsupported and surface here. It indicates a RIFF file the library cannot classify.","triggerScenarios":"Feeding a WAV (RIFF/WAVE), WebP, or other non-AVI RIFF file into a code path that calls getContainer on a riff structure. Usually this happens when the wrong container detector ran, or the file was mislabeled.","commonSituations":"Passing a .wav file where an AVI was expected. Processing mixed-format uploads. Handling RIFF variants the parser does not treat as AVI.","solutions":["Confirm the file's actual RIFF form (use a hex viewer or ffprobe); route WAV to the wav parser path instead.","Pre-classify the file by extension or sniffed FourCC and reject unsupported RIFF subtypes before parsing.","Re-export the source as AVI (if AVI is required) using ffmpeg."],"exampleFix":"// before\nconst container = getContainer(structure); // throws on RIFF/WAVE\n\n// after\nif (structure.type === 'riff' && !isRiffAvi(structure)) {\n  throw new Error('Unsupported RIFF subtype: ' + structure.type);\n}\nconst container = getContainer(structure);","handlingStrategy":"validation","validationCode":"import {isRiffAvi} from '@remotion/media-parser/containers/riff/traversal';\nif (structure.type === 'riff' && !isRiffAvi(structure)) { /* unsupported RIFF subtype */ }","typeGuard":"const isAviStructure = (s): s is RiffStructure => s.type === 'riff' && isRiffAvi(s);","tryCatchPattern":"try { getContainer(structure); } catch (e) { if (e.message.startsWith('Unknown RIFF container')) { /* unsupported */ } else throw e; }","preventionTips":["Sniff the RIFF form type before parsing.","Route WAV files to the wav parser path.","Reject unsupported RIFF subtypes up front."],"tags":["riff","avi","container","unsupported"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}