remotion-dev/remotion · error · Error

Could not determine animated image duration

Error message

Could not determine animated image duration

What it means

Thrown by getAnimatedImageDurationInSeconds when the last decoded frame reports duration === null. Without a duration the total animated image duration cannot be computed, so Remotion cannot schedule playback.

Source

Thrown at packages/core/src/animated-image/get-duration-in-seconds.ts:29

	requestInit?: RequestInit;
	contentType: string | null;
}) => {
	const {decoder, selectedTrack} = await createImageDecoder({
		resolvedSrc,
		signal,
		requestInit,
		contentType,
	});

	try {
		const {image} = await decoder.decode({
			frameIndex: selectedTrack.frameCount - 1,
			completeFramesOnly: true,
		});

		try {
			if (image.duration === null) {
				throw new Error('Could not determine animated image duration');
			}

			return (image.timestamp + image.duration) / 1_000_000;
		} finally {
			image.close();
		}
	} finally {
		decoder.close();
	}
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Convert the image to a widely supported animated format (GIF or animated WebP).
  2. Try a Chromium-based browser/renderer.
  3. If you control the asset, re-export with explicit frame durations.
Defensive patterns

Strategy: fallback

Validate before calling

// Pre-check the asset's frame durations with a tool like ffprobe
// to ensure they are populated.

Try / catch

try {
  await getAnimatedImageDurationInSeconds({...});
} catch (e) {
  if (e.message === 'Could not determine animated image duration') {
    // fall back to a format the decoder handles, or a static image
  }
}

Prevention

When it happens

Trigger: Decoded the final frame of an animated image but the decoder did not supply a duration (some AVIF/GIF variants in certain browsers return null durations).

Common situations: Firefox decoding certain AVIF sequences; non-standard animated images; browser decoder implementation gaps.

Related errors


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