remotion-dev/remotion · error

Unsupported audio format ${strf.formatTag}

Error message

Unsupported audio format ${strf.formatTag}

What it means

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.).

Source

Thrown at packages/media-parser/src/containers/riff/get-tracks-from-avi.ts:38

export const getNumberOfTracks = (structure: RiffStructure): number => {
	const avihBox = getAvihBox(structure);
	if (avihBox) {
		return avihBox.streams;
	}

	throw new Error('No avih box found');
};

export const makeAviAudioTrack = ({
	strf,
	index,
}: {
	strf: StrfBoxAudio;
	index: number;
}): MediaParserAudioTrack => {
	// 255 = AAC
	if (strf.formatTag !== 255) {
		throw new Error(`Unsupported audio format ${strf.formatTag}`);
	}

	return {
		type: 'audio',
		codec: 'mp4a.40.2', // According to Claude 3.5 Sonnet
		codecData: {type: 'aac-config', data: new Uint8Array([18, 16])},
		codecEnum: 'aac',
		description: new Uint8Array([18, 16]),
		numberOfChannels: strf.numberOfChannels,
		sampleRate: strf.sampleRate,
		originalTimescale: MEDIA_PARSER_RIFF_TIMESCALE,
		trackId: index,
		startInSeconds: 0,
		timescale: WEBCODECS_TIMESCALE,
		trackMediaTimeOffsetInTrackTimescale: 0,
	};
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Transcode the AVI audio to AAC and remux: ffmpeg -i in.avi -c:v copy -c:a aac out.avi
  2. If you need the video only, strip the audio: ffmpeg -i in.avi -an -c:v copy out.avi
  3. If you need MP3-in-AVI support, that is not currently supported — request it upstream or pre-transcode.

Example fix

// before
await parseMediaStream({src: 'mp3audio.avi'}); // throws

// after: transcode audio to AAC (tag 255)
// ffmpeg -i mp3audio.avi -c:v copy -c:a aac out.avi
await parseMediaStream({src: 'out.avi'});
Defensive patterns

Strategy: validation

Validate before calling

// Use ffprobe or inspect the strf wFormatTag; only AAC (tag 255) is supported for AVI audio.
// Pre-flight check via ffprobe:
// ffprobe -v error -select_streams a -show_entries stream=codec_name -of csv in.avi
// Expect: aac

Type guard

const SUPPORTED_AVI_AUDIO_TAG = 255; // AAC
function isSupportedAviAudioTag(tag: number): boolean {
  return tag === SUPPORTED_AVI_AUDIO_TAG;
}

Try / catch

try {
  await parseMediaStream({src: 'in.avi'});
} catch (err) {
  if (err instanceof Error && err.message.startsWith('Unsupported audio format')) {
    // transcode audio to AAC: ffmpeg -i in.avi -c:v copy -c:a aac out.avi
  } else throw err;
}

Prevention

When it happens

Trigger: Parsing an AVI whose audio stream uses any codec other than raw AAC: MP3 audio (very common in AVI), uncompressed PCM, AC3, or WMA.

Common situations: 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.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/c2325310a7d047ff. Report an issue: GitHub.