Render Endpoint
The render endpoint initiates a new video render job on AWS Lambda.Endpoint
Implementation
The render endpoint is implemented insrc/app/api/lambda/render/route.ts:
Request Body
The request expects a JSON body with your composition’s input properties:Response
The endpoint returns aRenderMediaOnLambdaOutput object containing:
renderId: Unique identifier for this render jobbucketName: S3 bucket where the video will be stored- Additional metadata about the render job
Render Configuration
The render uses these settings:- Codec: H.264 (MP4 format)
- Frames per Lambda: 60 frames per function invocation for parallel rendering
- Download Behavior: Videos are named
video.mp4when downloaded - Function Name: Automatically determined based on your Lambda configuration (RAM, disk, timeout)
Progress Endpoint
Monitor the status of your render job using the progress endpoint.Endpoint
Implementation
The progress endpoint tracks render job status insrc/app/api/lambda/progress/route.ts:
Request Body
Response Types
The progress endpoint returns one of three response types:In Progress
progress: A number between 0 and 1 (minimum 0.03 to show initial progress)
Complete
url: Direct URL to the rendered video filesize: File size in bytes
Error
message: Description of what went wrong during rendering
Complete Workflow
Here’s a complete example of rendering a video and checking its progress:Error Handling
Missing Credentials
If AWS credentials are not configured, you’ll receive:REMOTION_AWS_ACCESS_KEY_IDorAWS_ACCESS_KEY_IDREMOTION_AWS_SECRET_ACCESS_KEYorAWS_SECRET_ACCESS_KEY
Render Failures
Common render failures include:- Timeout: Render exceeded 240 seconds (increase
TIMEOUTinconfig.mjs) - Out of Memory: Increase
RAMinconfig.mjs - Invalid Props: Check that your
inputPropsmatch the composition’s expected schema
Performance Optimization
Parallel Rendering
TheframesPerLambda: 60 setting determines how work is distributed:
- Lower values (e.g., 30): More parallel Lambda invocations, faster for complex scenes
- Higher values (e.g., 120): Fewer invocations, lower cost but slower
Region Selection
Choose a region close to your users for faster uploads and downloads. Configure inconfig.mjs:
Cost Considerations
Lambda rendering costs depend on:- Number of frames in your video
framesPerLambdasetting (determines number of invocations)- Lambda function configuration (RAM/disk/timeout)
- Region selected