Up to 50% off yearly plansSee yearly prices

Remotion Lambda:
How to Render Remotion Videos on AWS

Updated · 6 min read

Rendering one Remotion video on a laptop is a single command. Rendering one per customer, on demand, needs somewhere else to run, and Remotion Lambda is the option Remotion's own docs recommend for most teams. This guide covers how it works, the setup, what a render costs, the limits, and the alternatives, all from Remotion's documentation.

What is Remotion Lambda?

Remotion Lambda is Remotion's package for rendering videos on AWS Lambda, where one video is split into chunks that many functions render at the same time. Remotion's comparison of rendering options calls it the fastest, because only Lambda does distributed rendering; the others render a video on one machine.

A render runs like this, per Remotion's description:

  1. You call renderMediaOnLambda(), renderMediaOnLambdaAndStream() or the CLI, which invokes one Lambda function, the main function.
  2. The main function opens your deployed Remotion project, its serve URL, in a headless browser and works out the composition's props and length.
  3. It splits the video into chunks and invokes a renderer function for each one.
  4. The renderer functions stream progress and their finished chunks back to the main function.
  5. The main function joins the chunks and uploads the final video to S3.

The pieces in your AWS account are one Lambda function with a Chromium layer, which Remotion currently hosts, and an S3 bucket that holds your projects, renders and render metadata. You drive them with the npx remotion lambda CLI or the Node.js API in @remotion/lambda, which can do the same things.

You need a basic Remotion project first. If you don't have one, the Remotion tutorial builds one step by step.

How do you set up Remotion Lambda?

Install the package, create an IAM policy, role and user in AWS, then deploy a function and a site and render. Remotion's setup page has eleven steps; in short:

  1. Install: npx remotion add @remotion/lambda.
  2. Create a role policy in AWS IAM from the output of npx remotion lambda policies role, named exactly remotion-lambda-policy.
  3. Create a Lambda role with that policy, named exactly remotion-lambda-role.
  4. Create a user, with no console access.
  5. Create an access key for the user and put it in your project's .env as REMOTION_AWS_ACCESS_KEY_ID and REMOTION_AWS_SECRET_ACCESS_KEY.
  6. Add an inline policy to the user from the output of npx remotion lambda policies user.
  7. Optionally, check the setup with npx remotion lambda policies validate.
  8. Deploy a function: npx remotion lambda functions deploy.
  9. Deploy your project as a site: npx remotion lambda sites create src/index.ts --site-name=my-video. It prints the serve URL.
  10. Check your concurrency limit with npx remotion lambda quotas.
  11. Render: npx remotion lambda render <serve-url> <composition-id>.

Two rules keep it working. A function is bound to the Remotion version it was deployed with, so upgrading Remotion means deploying a new function. And when your Remotion code changes, redeploy the site with the same --site-name to overwrite it; without a name, every deploy gets a new URL.

From your own code, the same render is renderMediaOnLambdaAndStream() from @remotion/lambda/client, after getFunctions() finds a function that matches your Remotion version. Its promise resolves when the render finishes.

How much does Remotion Lambda cost?

You pay for Lambda only while a render runs, and Remotion's own examples range from $0.001 for its Hello World template to $0.108 for a 10-minute HD video. Remotion measured these with 2048 MB of memory and 10240 MB of disk in us-east-1, on Remotion 4.0.381:

RenderWarm LambdaCold Lambda
Hello World template$0.001, 7.56 s$0.001, 11.02 s
1-minute video from the same S3 bucket$0.017, 18.91 s$0.021, 15.52 s
10-minute HD video from a URL$0.103, 56.09 s$0.108, 60.98 s
10-second 4K video from a URL$0.013, 45.28 s$0.014, 53.09 s

Those figures are Lambda compute only, which Remotion says is usually most of the bill. On top come S3 bandwidth for every asset pulled in, S3 storage for sites and renders, and CloudWatch logs, which are on by default and kept for 14 days. Each render also shows Remotion's own cost estimate, and estimatePrice() estimates the Lambda cost in code, without S3 or licensing fees.

The license is separate again. Companies that need a Remotion license and render in the cloud must cover those renders with Remotion for Automators, at $0.01 a render with a $100 monthly minimum; Remotion pricing has the full terms.

To spend less, Remotion suggests:

  • Less memory. Cost falls in step with memory: a quarter less memory is a quarter less cost.
  • Lower concurrency. Fewer functions means less warm-up, browser start and asset download, at some cost in speed.
  • <Video> from @remotion/media, which starts decoding before the whole file has downloaded.
  • Cheaper regions, and data computed once and passed in as input props rather than recomputed in every function.

What are the limits of Remotion Lambda?

Each function gets at most 10 GB of memory, 10 GB of disk and 15 minutes, and an AWS account runs 1000 concurrent functions per region by default.

  • Video length. Disk must hold the chunks and the joined file, so it caps length: about 32 minutes of 1080p at 2048 MB and about 2 hours 40 minutes at 10240 MB. The default disk is 2048 MB before Remotion 5.0 and 10240 MB from 5.0, and Remotion recommends the maximum, which costs less than 1% more.
  • Concurrency. A single render may use up to 200 functions. New AWS accounts can start with a limit as low as 10, so check npx remotion lambda quotas and request an increase with npx remotion lambda quotas increase (root accounts only) or in the AWS console. While you wait, a concurrency of 1 renders the whole video in the main function, from Remotion 4.0.517.
  • Chunk size. Remotion picks framesPerLambda for you, never fewer than 20 frames per function. If you set it yourself, keep it at 5 or more.
  • Codecs. AV1 encoding is not available on Lambda.
  • Fonts. The function ships a set of Noto fonts, with Chinese, Japanese and Korean only on the arm64 version; load any other font as a web font.
  • Regions. It runs only in the AWS regions Remotion supports.

If a limit rules Lambda out, Remotion's docs point to rendering on your own server or to Cloud Run.

What are the alternatives to Remotion Lambda?

Remotion documents four other ways to render in the cloud, and Lambda is the only one that splits a video across machines.

OptionHow it rendersStrengthsWatch out for
Remotion LambdaDistributed, on AWSFastest; webhooks, cost estimates, renders from PHP, Go, Python and RubyCompute costs more than the others
Vercel SandboxOne VM per renderEasiest setup for Vercel customersSlower; 45-minute timeout on Hobby, 5 hours on Pro
Node.js or Bun APIs on your own serverOne machineCheapest compute; most controlYou build queueing, progress, error handling and logging, and pay for idle time
Cloud RunOne container, on Google CloudUp to 32 GB of memory and 60 minutesAlpha, and not actively developed
Cloudflare ContainersYour own containerA demo you can adoptA proof of concept, not production-ready

Remotion's conclusion: the more videos you render, the more a long-running server might be worth it. To start one, npx create-video@latest --render-server creates an Express.js Render Server that starts, tracks and cancels renders with the Node.js APIs. For an occasional render, a GitHub Actions workflow that runs npx remotion render is enough; Remotion also suggests client-side rendering in the browser.

AdAnt, an AI social media marketing team, took the server route for its Studio video editor: exports render with renderMedia() on a render worker we run ourselves, not on Lambda. The worker pins the Remotion version, bounds each render's time, memory and temporary disk, and probes the finished MP4 before it is published. Remotion examples describes how that editor's preview and export share one composition.

How do you remove Remotion Lambda from AWS?

Delete the functions, the sites and the remotionlambda- buckets, in every region you used. Remotion's commands:

Bash
npx remotion lambda functions rmall -y
npx remotion lambda sites rmall -y

Then delete every S3 bucket whose name starts with remotionlambda-. This removes all videos already rendered and breaks any program still rendering with Lambda, so download what you need first. Repeat in each region, since functions, sites and buckets are created per region.

Frequently asked questions

Is Remotion Lambda free?

The package comes under the normal Remotion license, so it is free for individuals, companies of up to 3 people and non-profits. You always pay AWS for the compute, storage and bandwidth in your own account, and a company that needs a license covers its cloud renders with Remotion for Automators.

How long a video can Remotion Lambda render?

It depends on the function's disk. Remotion estimates about 32 minutes of 1080p video at 2048 MB and about 2 hours 40 minutes at the 10240 MB maximum, and each function must finish within AWS Lambda's 15-minute timeout.

Do I need to redeploy Remotion Lambda after upgrading Remotion?

Yes. A Lambda function is bound to the Remotion version it was deployed with, so an upgrade needs a new function. Redeploy the site, with the same site name, whenever your Remotion code changes.

Can I use Remotion Lambda on Google Cloud or Azure?

No, Lambda is AWS only. Remotion has a Cloud Run package for Google Cloud, but it is in Alpha and not actively developed. For Azure, Remotion's guide deploys a render service built on its Node.js APIs to Azure Container Apps.

Does Remotion Lambda use a GPU?

No. Remotion Lambda and Vercel Sandbox are CPU-only, and Remotion says most renders do not get faster with a GPU anyway. For content that does, it documents a GPU server setup.

The studio dispatch

One useful idea on AI-made ads, every other week. No fluff.