remotion-dev/remotion · warning · Error

The "h264-mkv" codec for renderMediaOnCloudrun() is deprecat

Error message

The "h264-mkv" codec for renderMediaOnCloudrun() is deprecated - it's now just "h264".

What it means

Intended to be thrown by validateCloudrunCodec() when codec === 'h264-mkv', instructing the user to switch to the plain 'h264' codec. In practice this branch is unreachable with the current allow-list, because 'h264-mkv' is not in cloudrunCodecs, so the earlier includes() check (error 149) rejects it first with a generic message. The guard exists for forward compatibility / documentation of the deprecation.

Source

Thrown at packages/cloudrun/src/shared/validate-gcp-codec.ts:29

export type CloudrunCodec = (typeof cloudrunCodecs)[number];

export const validateCloudrunCodec = (codec: unknown): CloudrunCodec => {
	if (typeof codec !== 'string') {
		throw new TypeError('"codec" must be a string ');
	}

	if (!(cloudrunCodecs as readonly string[]).includes(codec)) {
		throw new TypeError(
			"'" +
				codec +
				"' is not a valid codec for GCP Cloud Run. The following values are supported: " +
				cloudrunCodecs.join(', '),
		);
	}

	if (codec === 'h264-mkv') {
		throw new Error(
			'The "h264-mkv" codec for renderMediaOnCloudrun() is deprecated - it\'s now just "h264".',
		);
	}

	return codec as CloudrunCodec;
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Replace codec 'h264-mkv' with 'h264'.
  2. Search the codebase for any 'h264-mkv' literal and remove it.

Example fix

// before
await renderMediaOnCloudRun({ codec: 'h264-mkv', ... });
// after
await renderMediaOnCloudRun({ codec: 'h264', ... });
Defensive patterns

Strategy: validation

Validate before calling

if (codec === 'h264-mkv') codec = 'h264';
validateCloudrunCodec(codec);

Type guard

function isH264MkvDeprecated(v: string): boolean {
  return v === 'h264-mkv';
}

Try / catch

// Replace the value before calling; no retry needed.

Prevention

When it happens

Trigger: Passing codec='h264-mkv'. In the current code this triggers error 149 ('not a valid codec') before reaching this specific deprecation message, because 'h264-mkv' is absent from the cloudrunCodecs array.

Common situations: Migrating from an older Remotion version where 'h264-mkv' was a valid Cloud Run codec; copy-pasting legacy code.

Related errors


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