remotion-dev/remotion · error · Error

Could not find video codec

Error message

Could not find video codec

What it means

Thrown by getVideoCodecFromIsoTrak after inspecting the stsd's first video sample: none of the recognized FourCC format codes (hvc1/hev1 for H.265, avc1 for H.264, av01 for AV1, vp09 for VP9, ap4h/ap4x/apch/apcn/apcs/apco/aprh/aprn for ProRes) matched videoSample.format. The parser knows the track is video but cannot map its codec to a WebCodecs-compatible identifier, so it refuses to construct the track.

Source

Thrown at packages/media-parser/src/containers/iso-base-media/get-video-codec-from-iso-track.ts:67

			// apco: ProRes 422 Proxy
			if (videoSample.format === 'apco') {
				return 'prores';
			}

			// aprh: ProRes RAW High Quality
			if (videoSample.format === 'aprh') {
				return 'prores';
			}

			// aprn: ProRes RAW Standard Definition
			if (videoSample.format === 'aprn') {
				return 'prores';
			}
		}
	}

	throw new Error('Could not find video codec');
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Transcode the video to a supported codec: `ffmpeg -i in.mp4 -c:v libx264 -c:a copy out.mp4` (H.264 is universally supported).
  2. Confirm the actual codec with `ffprobe -v error -select_streams v:0 -show_entries stream=codec_name in.mp4`.
  3. Request support for the codec in the Remotion media-parser if it has a standard FourCC.
  4. Filter unsupported files before parse (probe with ffprobe first).

Example fix

// before
await parseMedia({ src: file });

// after
// Pre-validate codec before handing the file to media-parser
const probe = await runFfprobe(file);
const supported = new Set(['h264', 'hevc', 'av1', 'vp9', 'prores']);
if (!supported.has(probe.streams[0].codec_name)) {
  throw new Error(`Unsupported video codec: ${probe.streams[0].codec_name}. Transcode to H.264 first.`);
}
await parseMedia({ src: file });
Defensive patterns

Strategy: validation

Validate before calling

import {execFileSync} from 'node:child_process';
const SUPPORTED = new Set(['h264', 'hevc', 'av1', 'vp9', 'prores']);
function isSupportedVideoCodec(file: string): boolean {
  try {
    const out = execFileSync('ffprobe', ['-v', 'error', '-select_streams', 'v:0', '-show_entries', 'stream=codec_name', '-of', 'csv=p=0', file], {encoding: 'utf8'}).trim();
    return SUPPORTED.has(out);
  } catch { return false; }
}

Type guard

const SUPPORTED_FORMATS = new Set(['hvc1', 'hev1', 'avc1', 'av01', 'vp09', 'ap4h', 'ap4x', 'apch', 'apcn', 'apcs', 'apco', 'aprh', 'aprn']);
function isSupportedVideoFormat(format: string): boolean {
  return SUPPORTED_FORMATS.has(format);
}

Try / catch

try {
  await parseMedia({ src: file });
} catch (err) {
  if (/Could not find video codec/i.test(String(err?.message))) {
    throw new Error('Video codec is not supported by media-parser. Transcode to H.264/HEVC/AV1/VP9/ProRes with ffmpeg.');
  }
  throw err;
}

Prevention

When it happens

Trigger: A video track whose stsd sample uses an unsupported or non-standard FourCC. Reachable for codecs the media-parser does not yet support (e.g. theora, VP6, MPEG-2 video, AV1 variants with a different FourCC, proprietary codecs), or when the format string is corrupt/misread.

Common situations: Files containing rare or proprietary video codecs. Old media encoded with codecs WebCodecs cannot decode. Files with non-standard FourCC aliases. Screen captures or DVR exports using vendor-specific codecs.

Related errors


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