Skip to main content

cancelRenderOnLambda()v4.0.515

Signals the renderer functions of an in-progress Lambda render to stop.

The render must have been started with enableCancellation: true. Otherwise, this function throws an error.

Example

cancel-render.ts
import { cancelRenderOnLambda, renderMediaOnLambda, } from '@remotion/lambda/client'; const {bucketName, renderId} = await renderMediaOnLambda({ region: 'us-east-1', functionName: 'remotion-render-bds9aab', composition: 'MyVideo', serveUrl: 'https://remotionlambda-qg35eyp1s1.s3.eu-central-1.amazonaws.com/sites/bf2jrbfkw', codec: 'h264', enableCancellation: true, }); await cancelRenderOnLambda({ region: 'us-east-1', bucketName, renderId, });

Cancellation is asynchronous. Renderer functions stop after their next S3 poll, which occurs once per second.

Arguments

An object with the following properties:

region

The AWS region in which the render is running.

bucketName

The bucket name returned by renderMediaOnLambda().

renderId

The render ID returned by renderMediaOnLambda().

forcePathStyle?

Passes forcePathStyle to the AWS S3 client. If you don't know what this is, you probably don't need it.

requestHandler?

An AWS SDK request handler. Use it to configure a proxy.

Return value

A promise that resolves when the cancellation signal has been written to S3.

Compatibility

BrowsersServersEnvironments
Chrome
Firefox
Safari
Node.js
Bun
Serverless Functions

See also