{"record":{"id":"62572d29dec0f00e","repo":"remotion-dev/remotion","slug":"no-audio-specific-config","errorCode":null,"errorMessage":"No audio-specific-config","messagePattern":"No audio-specific-config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/get-audio-codec.ts","lineNumber":74,"sourceCode":"\t\tthrow new Error('Expected decoder-config-descriptor');\n\t}\n\n\tif (descriptor.asNumber !== 0x40) {\n\t\treturn {\n\t\t\tprimary: descriptor.asNumber,\n\t\t\tsecondary: null,\n\t\t\tdescription: undefined,\n\t\t};\n\t}\n\n\tconst audioSpecificConfig = descriptor.decoderSpecificConfigs.find((d) => {\n\t\treturn d.type === 'mp4a-specific-config' ? d : null;\n\t});\n\tif (\n\t\t!audioSpecificConfig ||\n\t\taudioSpecificConfig.type !== 'mp4a-specific-config'\n\t) {\n\t\tthrow new Error('No audio-specific-config');\n\t}\n\n\treturn {\n\t\tprimary: descriptor.asNumber,\n\t\tsecondary: audioSpecificConfig.audioObjectType,\n\t\tdescription: audioSpecificConfig.asBytes,\n\t};\n};\n\ntype AudioCodecInfo = {\n\tformat: string;\n\tprimarySpecificator: number | null;\n\tsecondarySpecificator: number | null;\n\tdescription: Uint8Array | undefined;\n};\n\nexport const getCodecPrivateFromTrak = (\n\ttrakBox: TrakBox,","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/get-audio-codec.ts#L56-L92","documentation":"Thrown when an mp4a/AAC decoder-config-descriptor (objectTypeIndication 0x40) has no child of type 'mp4a-specific-config'. For AAC the audio-specific-config holds the audioObjectType and decoder bytes; without it the codec cannot be positively identified as AAC, so the parser refuses to guess.","triggerScenarios":"An MP4 audio track whose esds declares objectType 0x40 (AAC) but omits the mp4a-specific-config element. Truncated or hand-edited esds boxes; files produced by muxers that skip the config for raw AAC.","commonSituations":"Parsing files muxed with stripped/placeholder esds. Handling fragmented MP4 where the config lives elsewhere. Encountering HE-AAC or LC-AAC variants with non-standard descriptor layouts.","solutions":["Re-mux with ffmpeg (ffmpeg -i in.mp4 -c:a aac -b:a 128k out.mp4) to regenerate a complete esds with audio-specific-config.","Catch the error and treat the track as AAC by default, or skip codec-string derivation.","Validate with mp4box -info; reject tracks lacking audio-specific-config before parsing."],"exampleFix":"// before\nconst cfg = getCodecSpecificatorFromEsdsBox({child: esdsBox});\n\n// after\nlet cfg = null;\ntry {\n  cfg = getCodecSpecificatorFromEsdsBox({child: esdsBox});\n} catch (err) {\n  // descriptor present but no audio-specific-config; assume AAC\n  cfg = {primary: 0x40, secondary: null, description: undefined};\n}","handlingStrategy":"try-catch","validationCode":"const dcd = esdsBox.descriptors.find((d) => d.type === 'decoder-config-descriptor');\nconst hasAsc = dcd?.decoderSpecificConfigs.some((d) => d.type === 'mp4a-specific-config');\nif (!hasAsc) { /* handle as best-effort AAC */ }","typeGuard":"null","tryCatchPattern":"try { getCodecSpecificatorFromEsdsBox({child: esdsBox}); } catch (e) { if (e.message === 'No audio-specific-config') { /* best-effort AAC */ } else throw e; }","preventionTips":["Re-mux AAC files with a conformant tool.","Reject files whose esds lacks audio-specific-config during pre-validation.","Fall back to a default AAC assumption when the config is missing."],"tags":["mp4","audio","codec","aac","esds","corrupt-file"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}