remotion-dev/remotion · error · Error

The Canvas Capture does not contain cursor movements

Error message

The Canvas Capture does not contain cursor movements

What it means

generateCanvasCaptureComposition builds a composition source file from Canvas Capture cursor data. After collapsing mouse movements by frame it requires at least one movement; if the recorded data contains no cursor movements there is nothing to render, so it throws this error early with a clear message.

Solutions

  1. Re-record the capture ensuring the mouse actually moves within the recorded region.
  2. Inspect the capture data (data array) and confirm it contains mouse movement entries.
  3. Check keyframeFps — an incorrect value may collapse all movements away.
  4. Verify you are passing the correct capture export, not an empty or unrelated data file.

Example fix

// before
generateCanvasCaptureComposition({data: emptyCapture, keyframeFps: 30, ...}); // throws
// after
if (capture.data.length === 0) throw new Error('Capture is empty, re-record');
generateCanvasCaptureComposition({data: capture.data, keyframeFps: 30, ...});
Defensive patterns

Strategy: validation

Validate before calling

const movements = collapseMouseMovementsByFrame({data, keyframeFps});
if (movements.length === 0) {
  throw new Error('Capture has no cursor movements; re-record with mouse activity');
}

Try / catch

try {
  makeNewCompositionComponentSource(capture);
} catch (e) {
  if (e instanceof Error && e.message.includes('does not contain cursor movements')) {
    console.warn('Empty capture; prompting re-record');
  } else throw e;
}

Prevention

When it happens

Trigger: Calling generateCanvasCaptureComposition (directly or via makeNewCompositionComponentSource) with capture data whose mouse-movement samples collapse to zero frames — i.e. data has no cursor positions for the given keyframeFps.

Common situations: Recording a Canvas Capture session with no mouse activity; passing data from a keyboard-only or click-less session; wrong data buffer/keyframeFps combination filtering out all movements; loading an empty or wrong export file.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of remotion-dev/remotion@46a3a6bf13 (2026-09-18). Data as JSON: /api/errors/6552657b27ab8b94. Report an issue: GitHub.

Appendix: source

Thrown at packages/studio-codemods/src/generate-canvas-capture-composition.ts:113

	videoHeight,
	videoWidth,
	width,
}: {
	readonly componentName: string;
	readonly compositionId: string;
	readonly data: CanvasCaptureData;
	readonly durationInFrames: number;
	readonly fps: number;
	readonly height: number;
	readonly keyframeFps: number;
	readonly videoFileName: string;
	readonly videoHeight: number;
	readonly videoWidth: number;
	readonly width: number;
}) => {
	const movements = collapseMouseMovementsByFrame({data, keyframeFps});
	if (movements.length === 0) {
		throw new Error('The Canvas Capture does not contain cursor movements');
	}

	const cursorKeyframes = movements.reduce<
		Array<{readonly frame: number; readonly value: string}>
	>((keyframes, movement) => {
		const value = getCursorName(movement.cursor);
		if (keyframes.at(-1)?.value !== value) {
			keyframes.push({frame: movement.frame, value});
		}

		return keyframes;
	}, []);

	const positionKeyframes: Array<{
		readonly frame: number;
		readonly value: string;
	}> = [];
	for (const movement of movements) {

View on GitHub (pinned to 46a3a6bf13)