Capítulo 492 de 988

Chapter 492: Using Remotion Lambda with R2

Core Idea

R2 by Cloudflare is a popular way to store renders because there are no egress fees.

Key Concepts

  • Storing the site and assets in R2
  • See also

Code Examples

const {bucketName, renderId, cloudWatchMainLogs} = await renderMediaOnLambda({
  serveUrl: 'https://remotion-helloworld.vercel.app',
  // FIXME: Add your function specs here
  functionName: speculateFunctionName({
    diskSizeInMb: 2048,
    memorySizeInMb: 2048,
    timeoutInSeconds: 120,
  }),
  composition: 'HelloWorld',
  region: 'eu-central-1',
  codec: 'h264',
  outName: {
    // FIXME: Use the bucket name from your Cloudflare Storage settings
    bucketName: 'remotion-test-bucket',
    key: 'out.mp4',
    s3OutputProvider: {
      // FIXME: Use the endpoint from your Cloudflare Storage settings
      endpoint: 'https://2fe488b3b0f4deee223aef7464784c46.r2.cloudflarestorage.com',
      // FIXME: Use the Access Key from your Cloudflare settings
      accessKeyId: process.env.R2_ACCESS_KEY_ID ?? '',
      // FIXME: Use the Secret Access Key from your Cloudflare settings
      secretAccessKey: process.env.R2_SECRET_ACCESS_KEY ?? '',
    },
  },
});
  • What it demonstrates: Usage pattern for Using Remotion Lambda with R2 from the official docs.

Key Takeaways

  1. Understand storing the site and assets in r2 when working with Using Remotion Lambda with R2.
  2. Understand see also when working with Using Remotion Lambda with R2.

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.