remotion-dev/remotion · error

Unknown RIFF container ${segments.type}

Error message

Unknown RIFF container ${segments.type}

What it means

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.

Source

Thrown at packages/media-parser/src/get-container.ts:37

	if (segments.type === 'mp3') {
		return 'mp3';
	}

	if (segments.type === 'wav') {
		return 'wav';
	}

	if (segments.type === 'flac') {
		return 'flac';
	}

	if (segments.type === 'riff') {
		if (isRiffAvi(segments)) {
			return 'avi';
		}

		throw new Error('Unknown RIFF container ' + segments.type);
	}

	if (segments.type === 'aac') {
		return 'aac';
	}

	if (segments.type === 'm3u') {
		return 'm3u8';
	}

	throw new Error('Unknown container ' + (segments satisfies never));
};

export const hasContainer = (boxes: MediaParserStructureUnstable): boolean => {
	try {
		return getContainer(boxes) !== null;
	} catch {
		return false;

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Confirm the file's actual RIFF form (use a hex viewer or ffprobe); route WAV to the wav parser path instead.
  2. Pre-classify the file by extension or sniffed FourCC and reject unsupported RIFF subtypes before parsing.
  3. Re-export the source as AVI (if AVI is required) using ffmpeg.

Example fix

// before
const container = getContainer(structure); // throws on RIFF/WAVE

// after
if (structure.type === 'riff' && !isRiffAvi(structure)) {
  throw new Error('Unsupported RIFF subtype: ' + structure.type);
}
const container = getContainer(structure);
Defensive patterns

Strategy: validation

Validate before calling

import {isRiffAvi} from '@remotion/media-parser/containers/riff/traversal';
if (structure.type === 'riff' && !isRiffAvi(structure)) { /* unsupported RIFF subtype */ }

Type guard

const isAviStructure = (s): s is RiffStructure => s.type === 'riff' && isRiffAvi(s);

Try / catch

try { getContainer(structure); } catch (e) { if (e.message.startsWith('Unknown RIFF container')) { /* unsupported */ } else throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: Passing a .wav file where an AVI was expected. Processing mixed-format uploads. Handling RIFF variants the parser does not treat as AVI.

Related errors


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