Triggering renders from Python
available from v4.0.15
To trigger a Lambda render using Python, install the remotion-lambda package using pip, by executing pip install remotion-lambda from your python project. Use the same version as the remotion version you are using from NPM, e.g. pip install remotion-lambda==4.0.15 (see newest version).
You first need to complete the Lambda setup.
Limitations
Before v4.0.315: Sending large input props (>200KB) was not supported.
Starting from v4.0.315, the Python SDK automatically handles large input props by uploading them to S3 when they exceed AWS Lambda payload limits. Props larger than 200KB for video renders and 5MB for still renders are automatically compressed using the same logic as the JavaScript SDK. The SDK will automatically find or create an appropriate S3 bucket following Remotion's naming conventions.
Rendering a video
Below is a snippet showing how to initiate a render request and get its status.
render_media.pypython
Large input props available from v4.0.315
The Python SDK automatically handles large input props by uploading them to S3 when they exceed AWS Lambda payload limits:
- Video/audio renders: Props larger than ~194KB
- Still renders: Props larger than ~4.9MB
When large props are detected, they are automatically uploaded to S3 and referenced by the Lambda function. The SDK will find an existing Remotion bucket or create a new one automatically, following the same logic as the JavaScript SDK. This process is transparent to the user.
large_props_example.pypython
Rendering an image
Below is a snippet showing how to initiate a still image render. Note that it does not require monitoring the render progress.
render_still.pypython
Breaking changes
4.0.82
- The datafield is nowinput_props.
- RenderParamshas been renamed to- RenderMediaParams.
- RenderProgresshas been renamed to- RenderMediaProgress.
- RenderResponseis now- RenderMediaResponse, and its fields have been updated:- renderIdis now- render_id, and- bucketNamehas been changed to- bucket_name.
- The following types have been added: CostsInfo,Privacy,ValidStillImageFormats,LogLevel,OpenGlRenderer,ChromiumOptions,CustomCredentialsWithoutSensitiveData,CustomCredentials,OutNameInputObject,PlayInBrowser,Download,DeleteAfter. These can be used for the fields onRenderMediaParamsandRenderStillParams.