remotion-dev/remotion · error · TypeError

The FPS for a GIF cannot be higher than 50. Use the --every-

Error message

The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif

What it means

`validateFps()` enforces a hard cap of 50 fps when the output target is a GIF, because the GIF format cannot reliably encode frame rates above 50 fps. When `isGif` is `true` and `fps > 50`, it throws a `TypeError` directing you to use `--every-nth-frame` to subsample frames instead.

Source

Thrown at packages/core/src/validation/validate-fps.ts:27

		);
	}

	if (!Number.isFinite(fps)) {
		throw new Error(
			`"fps" must be a finite, but you passed ${fps} ${location}`,
		);
	}

	if (isNaN(fps)) {
		throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
	}

	if (fps <= 0) {
		throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
	}

	if (isGif && fps > 50) {
		throw new TypeError(
			`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`,
		);
	}
}

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Lower the composition fps to 50 or less when rendering as GIF.
  2. Pass `--every-nth-frame 2` (or higher) on the CLI to subsample frames while keeping the source fps.
  3. Create a dedicated low-fps composition variant dedicated to GIF export.

Example fix

// before (60fps source rendered as gif)
<Composition fps={60} ... />
// after
bunx remotion render my-comp --codec gif --every-nth-frame 2
Defensive patterns

Strategy: validation

Validate before calling

const gifFps = Math.min(50, compositionFps);

Type guard

const isValidGifFps = (fps: number): boolean => typeof fps === 'number' && fps > 0 && fps <= 50;

Prevention

When it happens

Trigger: Rendering a composition as a GIF (`renderer` set to gif / `--codec gif`) while the composition or sequence has `fps` greater than 50.

Common situations: Building a composition at 60 fps for video output and then also rendering it as a GIF without lowering the frame rate.

Related errors


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