Capítulo 425 de 988

Chapter 425: Cancelling Lambda renders

Core Idea

By default, a Lambda render continues until it finishes or fails.

Key Concepts

  • Cancelling from the CLI
  • Cost
  • How cancellation works
  • Detecting a cancelled render
  • See also

Code Examples

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,
});

// Call this when the render should stop
await cancelRenderOnLambda({
  region: 'us-east-1',
  bucketName,
  renderId,
});
  • What it demonstrates: Usage pattern for Cancelling Lambda renders from the official docs.

Key Takeaways

  1. Understand cancelling from the cli when working with Cancelling Lambda renders.
  2. Understand cost when working with Cancelling Lambda renders.
  3. Understand how cancellation works when working with Cancelling Lambda renders.
  4. Understand detecting a cancelled render when working with Cancelling Lambda renders.
  5. Understand see also when working with Cancelling Lambda renders.

Connects To

  • api: related page in the Lambda (@remotion/lambda) section.
  • Approuterwebhook: related page in the Lambda (@remotion/lambda) section.
  • Authentication: related page in the Lambda (@remotion/lambda) section.