How Remotion Lambda works
This document describes the procedure that gets executed when a Remotion Lambda video render is triggered.
This document explains the Lambda architecture from version 4.0.165 on.
Previously, Lambda functions did not use Response Streaming, and instead saved chunks to S3.
renderMediaOnLambda(), renderMediaOnLambdaAndStream(), or the CLI. This invocation is called the main function.
concurrency to 1 to render the video on the main function.
progress.json file and periodically uploads it to S3.
renderMediaOnLambdaAndStream() and the CLI receive progress updates streamed from the main function. getRenderProgress() remains available to check a render started separately.
FAQ
Can I roll my own distributed renderer?
The seamless concatenation of chunks is not a public API at the moment.
You may render chunks using frameRange and audioCodec: "pcm-16" which you can concatenate using FFmpeg.
Building a distributed renderer is hard, and not recommended for most.
Will each chunk download all assets?
Each chunk will download all assets that are referenced in this chunk.
This can lead to assets being downloaded many times at the same time, which may overwhelm a server or trigger rate limits.
In addition, you pay for the bandwidth, even if the assets are on S31).
Keep this in mind when designing your solution and consider using a CDN to serve assets.
1) An API for avoiding the S3 bandwidth charge is planned.