Data transfer cost
When rendering on Remotion Lambda, a headless browser is opened, which opens your bundle via the Serve URL.
Your site and assets are being loaded via HTTP, meaning that you will be charged by AWS for the data transfer.
If you have big assets, these charges may add up.
This site explains two options for reducing the cost if you have big assets.
Isn't data transfer free if the assets are in the same region?
No, with the default settings, since the transfer happens over HTTP, AWS counts this as egress, even if the assets are in the same S3 region.
Option 1: Use an alternate CDN for storing assets
Many people use Cloudflare R2 to store their big assets instead.
This is easy to achieve - simply put the assets in a Cloudflare R2 bucket and reference them using the HTTP URL that you get.
Cloudflare does not charge for data transfer, so this is a great way to reduce the cost.
Option 2: Enable VPC endpoints
You can with some configuration set up a VPC for the Lambda function.
Refer to these notes for how to enable VPC endpoints for Remotion Lambda.
Caveats
- If a Lambda function already existed, this will not update the settings. Delete the Remotion Lambda function and redeploy a new one.
- You still pay a flat fee per request.
- Setting up a VPC endpoint might restrict other network traffic.
- We do not have recommendations yet for how to configure the VPC endpoint.