remotion-dev/remotion · error · Error

Unsupported AVCC version ${confVersion}

Error message

Unsupported AVCC version ${confVersion}

What it means

Thrown in parseAvcc() after reading the first byte of an avcC (AVC/H.264 decoder configuration) box. The AVCC spec mandates configurationVersion === 1; any other value means the box is not a valid AVCC record and the parser cannot derive the H.264 profile/level/codec string, so it aborts.

Source

Thrown at packages/media-parser/src/containers/iso-base-media/stsd/avcc.ts:18

import type {BufferIterator} from '../../../iterator/buffer-iterator';

export interface AvccBox {
	type: 'avcc-box';
	privateData: Uint8Array;
	configurationString: string;
}

export const parseAvcc = ({
	data,
	size,
}: {
	data: BufferIterator;
	size: number;
}): AvccBox => {
	const confVersion = data.getUint8();
	if (confVersion !== 1) {
		throw new Error(`Unsupported AVCC version ${confVersion}`);
	}

	const profile = data.getUint8();
	const profileCompatibility = data.getUint8();
	const level = data.getUint8();

	const str = `${profile.toString(16).padStart(2, '0')}${profileCompatibility.toString(16).padStart(2, '0')}${level.toString(16).padStart(2, '0')}`;

	data.counter.decrement(4);

	const privateData = data.getSlice(size - 8);

	return {
		type: 'avcc-box',
		privateData,
		configurationString: str,
	};
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Re-mux the H.264 stream to rebuild a compliant avcC: ffmpeg -i in.mp4 -c:v copy out.mp4.
  2. If the version byte is genuinely corrupt, re-encode: ffmpeg -i in.mp4 -c:v libx264 -crf 20 out.mp4.
  3. Validate with ffprobe <file> (it reads avcC and will report the H.264 profile/level; failure indicates a bad avcC).
  4. Re-fetch the source if you suspect transfer corruption.
  5. Migrate to @remotion/mediabunny (parseMedia is deprecated).

Example fix

// before
const {videoCodec} = await parseMedia({src, reader: nodeReader});

// after
try {
  const {videoCodec} = await parseMedia({src, reader: nodeReader});
} catch (err) {
  if (err instanceof Error && /Unsupported AVCC version/.test(err.message)) {
    // avcC version byte invalid; re-mux or re-encode the H.264 stream
  } else throw err;
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Confirm the H.264 avcC is readable via ffprobe (it reports profile/level):
//   ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,profile,level -of json in.mp4
import {execFileSync} from 'node:child_process';
function h264ConfigReadable(file: string): boolean {
  try {
    const out = execFileSync('ffprobe',
      ['-v','error','-select_streams','v:0','-show_entries','stream=codec_name,profile,level','-of','json', file],
      {encoding:'utf8'});
    const j = JSON.parse(out);
    const s = j.streams?.[0];
    return s?.codec_name === 'h264' && typeof s.profile === 'string';
  } catch { return false; }
}

Type guard

// The avcC version byte is a deep binary field; not caller-type-guardable.
// => typeGuard: null

Try / catch

try {
  const {videoCodec} = await parseMedia({src, reader: nodeReader});
} catch (err) {
  if (err instanceof Error && /Unsupported AVCC version/.test(err.message)) {
    // avcC version byte invalid; re-mux or re-encode the H.264 stream
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: parseMedia({src}) on an H.264 MP4/MOV whose avcC box has a version byte other than 1 — e.g. a corrupt avcC, a box that is not actually AVCC (different NALU framing), or a file damaged in transfer. The avcC is read when processBox() encounters the 'avcC' box type.

Common situations: Corrupted H.264 sample descriptions; files with non-standard NALU layouts; truncated/malformed avcC boxes from faulty muxers; bit-flipped version bytes.

Related errors


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