{"record":{"id":"c2325310a7d047ff","repo":"remotion-dev/remotion","slug":"unsupported-audio-format-strf-formattag","errorCode":null,"errorMessage":"Unsupported audio format ${strf.formatTag}","messagePattern":"Unsupported audio format (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/riff/get-tracks-from-avi.ts","lineNumber":38,"sourceCode":"export const getNumberOfTracks = (structure: RiffStructure): number => {\n\tconst avihBox = getAvihBox(structure);\n\tif (avihBox) {\n\t\treturn avihBox.streams;\n\t}\n\n\tthrow new Error('No avih box found');\n};\n\nexport const makeAviAudioTrack = ({\n\tstrf,\n\tindex,\n}: {\n\tstrf: StrfBoxAudio;\n\tindex: number;\n}): MediaParserAudioTrack => {\n\t// 255 = AAC\n\tif (strf.formatTag !== 255) {\n\t\tthrow new Error(`Unsupported audio format ${strf.formatTag}`);\n\t}\n\n\treturn {\n\t\ttype: 'audio',\n\t\tcodec: 'mp4a.40.2', // According to Claude 3.5 Sonnet\n\t\tcodecData: {type: 'aac-config', data: new Uint8Array([18, 16])},\n\t\tcodecEnum: 'aac',\n\t\tdescription: new Uint8Array([18, 16]),\n\t\tnumberOfChannels: strf.numberOfChannels,\n\t\tsampleRate: strf.sampleRate,\n\t\toriginalTimescale: MEDIA_PARSER_RIFF_TIMESCALE,\n\t\ttrackId: index,\n\t\tstartInSeconds: 0,\n\t\ttimescale: WEBCODECS_TIMESCALE,\n\t\ttrackMediaTimeOffsetInTrackTimescale: 0,\n\t};\n};\n","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/riff/get-tracks-from-avi.ts#L20-L56","documentation":"Thrown by makeAviAudioTrack() when an AVI audio stream's formatTag (wFormatTag in the strf chunk) is not 255. Tag 255 (0x00FF) is the FourCC 'AAC' indicator for raw AAC in AVI; the parser hard-codes codec 'mp4a.40.2' and a fixed AAC config for that tag and rejects everything else (MP3 = 0x0055, PCM = 1, WMA, etc.).","triggerScenarios":"Parsing an AVI whose audio stream uses any codec other than raw AAC: MP3 audio (very common in AVI), uncompressed PCM, AC3, or WMA.","commonSituations":"Legacy AVI files (especially from old capture tools / DivX/Xvid era) almost always use MP3 audio — these will throw. AVI exports from tools that default to MP3 or AC3.","solutions":["Transcode the AVI audio to AAC and remux: ffmpeg -i in.avi -c:v copy -c:a aac out.avi","If you need the video only, strip the audio: ffmpeg -i in.avi -an -c:v copy out.avi","If you need MP3-in-AVI support, that is not currently supported — request it upstream or pre-transcode."],"exampleFix":"// before\nawait parseMediaStream({src: 'mp3audio.avi'}); // throws\n\n// after: transcode audio to AAC (tag 255)\n// ffmpeg -i mp3audio.avi -c:v copy -c:a aac out.avi\nawait parseMediaStream({src: 'out.avi'});","handlingStrategy":"validation","validationCode":"// Use ffprobe or inspect the strf wFormatTag; only AAC (tag 255) is supported for AVI audio.\n// Pre-flight check via ffprobe:\n// ffprobe -v error -select_streams a -show_entries stream=codec_name -of csv in.avi\n// Expect: aac","typeGuard":"const SUPPORTED_AVI_AUDIO_TAG = 255; // AAC\nfunction isSupportedAviAudioTag(tag: number): boolean {\n  return tag === SUPPORTED_AVI_AUDIO_TAG;\n}","tryCatchPattern":"try {\n  await parseMediaStream({src: 'in.avi'});\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Unsupported audio format')) {\n    // transcode audio to AAC: ffmpeg -i in.avi -c:v copy -c:a aac out.avi\n  } else throw err;\n}","preventionTips":["Author AVIs with AAC audio (formatTag 255) for parser compatibility.","Prefer MP4/MKV over AVI; the AVI path is intentionally narrow.","Run ffprobe on uploads to reject non-AAC AVI audio early."],"tags":["riff","avi","audio-codec","aac","unsupported-format","media-parser"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}