remotion-dev/remotion · error · Error

Expected av1 private data to be version 1

Error message

Expected av1 private data to be version 1

What it means

AV1 codec-private data (per AV1-in-ISOBMFF) must start with a 1-bit marker equal to 1. parseAv1PrivateData reads that first bit and throws if it isn't 1, i.e. the buffer is not valid AV1 codec-private data. This runs when a WebM/Matroska A_AV1 track is being resolved into a codec string.

Source

Thrown at packages/media-parser/src/containers/webm/av1-codec-private.ts:16

import {getArrayBufferIterator} from '../../iterator/buffer-iterator';
import type {ColorParameterBox} from '../iso-base-media/stsd/colr';

export const parseAv1PrivateData = (
	data: Uint8Array,
	colrAtom: ColorParameterBox | null,
) => {
	const iterator = getArrayBufferIterator({
		initialData: data,
		maxBytes: data.byteLength,
		logLevel: 'error',
	});
	iterator.startReadingBits();
	if (iterator.getBits(1) !== 1) {
		iterator.destroy();
		throw new Error('Expected av1 private data to be version 1');
	}

	const version = iterator.getBits(7);
	if (version !== 1) {
		iterator.destroy();
		throw new Error(
			`Expected av1 private data to be version 1, got ${version}`,
		);
	}

	let str = 'av01.';

	// https://aomediacodec.github.io/av1-isobmff/#codecsparam

	const seqProfile = iterator.getBits(3);
	// Profile
	str += seqProfile;
	str += '.';

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Re-mux or re-encode the AV1 track: ffmpeg -i in.mkv -c:v libaom-av1 out.mkv.
  2. Confirm via ffprobe that the AV1 stream has valid headers.
  3. Use Mediabunny; try/catch parseMedia().

Example fix

# re-mux AV1 into a clean Matroska
ffmpeg -i in.mkv -c copy out.mkv

await parseMedia({ src: 'out.mkv' });
Defensive patterns

Strategy: try-catch

Validate before calling

// ffprobe confirms the AV1 stream has valid headers
// ffprobe -v error -show_streams in.mkv

Try / catch

try {
  await parseMedia({ src: 'in.mkv' });
} catch (err) {
  if (err instanceof Error && /av1 private data/i.test(err.message)) {
    // re-mux the AV1 track or skip
  } else throw err;
}

Prevention

When it happens

Trigger: A WebM/Matroska AV1 track whose CodecPrivate does not begin with the AV1 marker bit: empty/missing CodecPrivate, a non-AV1 stream mislabeled A_AV1, or a corrupted CodecPrivate.

Common situations: Malformed MKV/WebM from a broken muxer; AV1 track missing its sequence-header OBU; file corruption.

Related errors


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