remotion-dev/remotion · error

File type ${fileType} not supported

Error message

File type ${fileType} not supported

What it means

Thrown by parseRiffHeader() after reading bytes 8..12 of the RIFF header: the fileType field must be 'WAVE' or 'AVI'. Other RIFF subtypes exist (e.g. 'WEBP' for WebP, 'CDXA' for Video CD, 'RF64' for extended WAV) and are not supported by this parser.

Source

Thrown at packages/media-parser/src/containers/riff/parse-riff-header.ts:15

import type {ParseResult} from '../../parse-result';
import type {ParserState} from '../../state/parser-state';

export const parseRiffHeader = (state: ParserState): ParseResult => {
	const riff = state.iterator.getByteString(4, false);
	if (riff !== 'RIFF') {
		throw new Error('Not a RIFF file');
	}

	const structure = state.structure.getRiffStructure();

	const size = state.iterator.getUint32Le();
	const fileType = state.iterator.getByteString(4, false);
	if (fileType !== 'WAVE' && fileType !== 'AVI') {
		throw new Error(`File type ${fileType} not supported`);
	}

	structure.boxes.push({type: 'riff-header', fileSize: size, fileType});

	return null;
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Identify the RIFF subtype (bytes 8..12) and route accordingly — WebP must go through an image decoder, RF64 WAV needs a different parser.
  2. Re-export to a plain WAV (PCM) or AVI if your workflow requires RIFF/WAVE.
  3. Pre-check the subtype and surface a clearer error to the user before invoking the parser.

Example fix

// before
await parseMediaStream({src: assetUrl}); // assetUrl is actually a WebP

// after: confirm WAVE/AVI subtype
const sub = new TextDecoder().decode(bytes8to12);
if (sub !== 'WAVE' && sub !== 'AVI') throw new Error(`RIFF subtype ${sub} not supported`);
Defensive patterns

Strategy: validation

Validate before calling

// Check the RIFF subtype (bytes 8..12) before parsing.
const head = new Uint8Array(await (await fetch(url, {headers: {Range: 'bytes=0-11'}})).arrayBuffer());
const subtype = new TextDecoder().decode(head.subarray(8, 12));
if (subtype !== 'WAVE' && subtype !== 'AVI') {
  throw new Error(`RIFF subtype ${subtype} not supported (use WAV/AVI)`);
}

Type guard

type RiffSubtype = 'WAVE' | 'AVI';
function isSupportedRiffSubtype(s: string): s is RiffSubtype {
  return s === 'WAVE' || s === 'AVI';
}

Try / catch

try {
  await parseMediaStream({src: url});
} catch (err) {
  if (err instanceof Error && err.message.endsWith('not supported') && err.message.startsWith('File type')) {
    // it is RIFF but not WAV/AVI (e.g. WebP) — route elsewhere
  } else throw err;
}

Prevention

When it happens

Trigger: Parsing a RIFF file whose subtype is neither WAVE nor AVI — most commonly a WebP image (RIFF/WEDP... actually 'WEBP'), an RF64 broadcast WAV, or a lesser-known RIFF form.

Common situations: Passing a WebP image or an RF64 WAV to @remotion/media-parser expecting WAV/AVI support; mislabeled file extension.

Related errors


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