{"record":{"id":"b86c94f8d5e73831","repo":"remotion-dev/remotion","slug":"unknown-mp4a-codec-codec-primaryspecificator","errorCode":null,"errorMessage":"Unknown mp4a codec: ${codec.primarySpecificator}","messagePattern":"Unknown mp4a codec: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/get-audio-codec.ts","lineNumber":346,"sourceCode":"\n\tif (codec.format === 'Opus') {\n\t\treturn 'opus';\n\t}\n\n\tif (codec.format === 'mp4a') {\n\t\tif (codec.primarySpecificator === 0x40) {\n\t\t\treturn 'aac';\n\t\t}\n\n\t\tif (codec.primarySpecificator === 0x6b) {\n\t\t\treturn 'mp3';\n\t\t}\n\n\t\tif (codec.primarySpecificator === null) {\n\t\t\treturn 'aac';\n\t\t}\n\n\t\tthrow new Error('Unknown mp4a codec: ' + codec.primarySpecificator);\n\t}\n\n\tthrow new Error(`Unknown audio format: ${codec.format}`);\n};\n\nexport const getAudioCodecFromTrack = (track: TrakBox) => {\n\tconst audioSample = getAudioCodecFromTrak(track);\n\tif (!audioSample) {\n\t\tthrow new Error('Could not find audio sample');\n\t}\n\n\treturn getAudioCodecFromAudioCodecInfo(audioSample);\n};\n","sourceCodeStart":328,"sourceCodeEnd":360,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/get-audio-codec.ts#L328-L360","documentation":"Thrown by getAudioCodecFromAudioCodecInfo when the audio format is 'mp4a' but primarySpecificator is a value other than 0x40 (AAC), 0x6b (MP3), or null (defaults to AAC). The library only maps those specificators to known codecs; any other objectTypeIndication is unsupported and surfaces as this error with the offending value.","triggerScenarios":"An MP4 audio track whose esds objectTypeIndication is an uncommon value (e.g. 0x66 for CELP, 0x67 for HVXC, 0x40 variants, alac-in-mp4a, etc.). Files using niche or legacy MPEG-4 audio object types.","commonSituations":"Parsing music libraries containing unusual codecs. Handling files from voice-recording hardware. Encountering object types not yet implemented by the parser.","solutions":["Re-encode the audio to a supported codec (AAC or MP3) with ffmpeg before parsing.","Wrap the call in try/catch and report the unsupported specificator to the user, falling back to skipping the track.","Check for an upstream update of @remotion/media-parser; new specificators may be added over time."],"exampleFix":"// before\nconst codec = getAudioCodecFromTrack(trak);\n\n// after\nlet codec;\ntry {\n  codec = getAudioCodecFromTrack(trak);\n} catch (err) {\n  console.warn('Unsupported mp4a subtype, skipping', err.message);\n  codec = null;\n}","handlingStrategy":"try-catch","validationCode":"const info = getAudioCodecFromTrak(trak);\nif (info && info.format === 'mp4a' && ![0x40, 0x6b, null].includes(info.primarySpecificator)) { /* unsupported subtype */ }","typeGuard":"null","tryCatchPattern":"try { getAudioCodecFromTrack(trak); } catch (e) { if (e.message.startsWith('Unknown mp4a codec')) { /* skip unsupported subtype */ } else throw e; }","preventionTips":["Re-encode uncommon mp4a subtypes to AAC or MP3.","Surface unsupported-specificator errors to the user.","Keep the library updated for new specificator support."],"tags":["mp4","audio","codec","unsupported","corrupt-file"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}