npx remotion lambda render
Using the npx remotion lambda render
command, you can render a video in the cloud.
The structure of a command is as follows:
npx remotion lambda render <serve-url> [<composition-id>] [<output-location>]
npx remotion lambda render <serve-url> [<composition-id>] [<output-location>]
Arguments:
- Obtain a Serve URL using the
sites create
command or by callingdeploySite()
. - The Composition ID. If not specified, the list of compositions will be fetched and you can choose a composition.
- The
output-location
parameter is optional. If you don't specify it, the video is stored in your S3 bucket. If you specify a location, it gets downloaded to your device in an additional step.
Example commands
Rendering a video:
npx remotion lambda render https://remotionlambda-abcdef.s3.eu-central-1.amazonaws.com/sites/testbed/index.html my-comp
npx remotion lambda render https://remotionlambda-abcdef.s3.eu-central-1.amazonaws.com/sites/testbed/index.html my-comp
Rendering a video and saving it to out/video.mp4
:
npx remotion lambda render https://remotionlambda-abcdef.s3.eu-central-1.amazonaws.com/sites/testbed/index.html my-comp out/video.mp4
npx remotion lambda render https://remotionlambda-abcdef.s3.eu-central-1.amazonaws.com/sites/testbed/index.html my-comp out/video.mp4
Using the shorthand serve URL:
npx remotion lambda render testbed my-comp
npx remotion lambda render testbed my-comp
If you are using the shorthand serve URL, you have to pass a composition ID. Available compositions can only be fetched if a complete serve URL is passed.
Passing in input props:
npx remotion lambda render --props='{"hi": "there"}' testbed my-comp
npx remotion lambda render --props='{"hi": "there"}' testbed my-comp
Printing debug information including a CloudWatch link:
npx remotion lambda render --log=verbose testbed my-comp
npx remotion lambda render --log=verbose testbed my-comp
Keeping the output video private:
npx remotion lambda render --privacy=private testbed my-comp
npx remotion lambda render --privacy=private testbed my-comp
Rendering only the audio:
npx remotion lambda render --codec=mp3 testbed my-comp
npx remotion lambda render --codec=mp3 testbed my-comp
Flags
--region
The AWS region to select. Both project and function should be in this region.
--props
Input Props to pass to the selected composition of your video..
Must be a serialized JSON string (--props='{"hello": "world"}'
) or a path to a JSON file (./path/to/props.json
).
From the root component the props can be read using getInputProps()
.
You may transform input props using calculateMetadata()
.
Inline JSON string isn't supported on Windows shells because it removes the "
character, use a file name instead.
--log
Log level to be used inside the Lambda function. Also, if you set it to verbose
, a link to CloudWatch will be printed where you can inspect logs.
--privacy
One of:
"public"
(default): The rendered media is publicly accessible under the S3 URL."private"
: The rendered media is not publicly available, but signed links can be created using presignUrl()."no-acl"
(available from v.3.1.7): The ACL option is not being set at all, this option is useful if you are writing to another bucket that does not support ACL usingoutName
.
--max-retries
How many times a single chunk is being retried if it fails to render. Default 1
.
--frames-per-lambda
How many frames should be rendered in a single Lambda function. Increase it to require less Lambda functions to render the video, decrease it to make the render faster.
Default value: Dependant on video length
Minimum value: 4
The framesPerLambda
parameter cannot result in more than 200 functions being spawned. See: Concurrency
--concurrency-per-lambda
v3.0.30
By default, each Lambda function renders with concurrency 1 (one open browser tab). You may use the option to customize this value.
--jpeg-quality
Value between 0 and 100 for JPEG rendering quality. Doesn't work when PNG frames are rendered.
--quality
--quality
Renamed to jpegQuality
in v4.0.0
.
--muted
v3.2.1
Disables audio output. This option may only be used when rendering a video.
--codec
h264
or h265
(supported since v4.0.32) or png
or vp8
or mp3
or aac
or wav
or prores
. If you don't supply --codec
, it will use h264
.
--audio-codec
v3.3.42
Set the format of the audio that is embedded in the video. Not all codec and audio codec combinations are supported and certain combinations require a certain file extension and container format. See the table in the docs to see possible combinations.
--audio-bitrate
v3.2.32
Specify the target bitrate for the generated video. The syntax for FFmpeg's -b:a
parameter should be used. FFmpeg may encode the video in a way that will not result in the exact audio bitrate specified. Example values: 512K
for 512 kbps, 1M
for 1 Mbps. Default: 320k
--video-bitrate
v3.2.32
Specify the target bitrate for the generated video. The syntax for FFmpeg's-b:v
parameter should be used. FFmpeg may encode the video in a way that will not result in the exact video bitrate specified. Example values: 512K
for 512 kbps, 1M
for 1 Mbps.
--prores-profile
Set the ProRes profile. This option is only valid if the codec
has been set to prores
. Possible values: 4444-xq
, 4444
, hq
, standard
, light
, proxy
. See here for explanation of possible values. Default: hq
.
--x264-preset
Sets a x264 preset profile. Only applies to videos rendered with h264
codec.Possible values:
superfast
, veryfast
, faster
, fast
, medium
, slow
, slower
, veryslow
, placebo
.Default:
medium
--crf
To set Constant Rate Factor (CRF) of the output. Minimum 0. Use this rate control mode if you want to keep the best quality and care less about the file size.
--pixel-format
Set a custom pixel format. See here for available values.
--image-format
jpeg
or png
- JPEG is faster, but doesn't support transparency. The default image format is jpeg
.
--scale
Scales the output frames by the factor you pass in. For example, a 1280x720px frame will become a 1920x1080px frame with a scale factor of 1.5
. Vector elements like fonts and HTML markups will be rendered with extra details.
--env-file
Specify a location for a dotenv file - Default .env
. Read about how environment variables work in Remotion.
--frames
Render a subset of a video. Example: --frames=0-9
to select the first 10 frames. To render a still, use the still
command.
--every-nth-frame
v3.1.0
Render only every nth frame. This option may only be set when rendering GIFs. This allows you to lower the FPS of the GIF.
For example only every second frame, every third frame and so on. Only works for rendering GIFs. See here for more details.
--number-of-gif-loops
v3.1.0
Allows you to set the number of loops as follows:null
(or omitting in the CLI) plays the GIF indefinitely.0
disables looping1
loops the GIF once (plays twice in total)2
loops the GIF twice (plays three times in total) and so on.
--timeout
A number describing how long the render may take to resolve all delayRender()
calls before it times out. Default: 30000
--out-name
The file name of the media output as stored in the S3 bucket. By default, it is out
plus the appropriate file extension, for example: out.mp4
. Must match /([0-9a-zA-Z-!_.*'()/]+)/g
.
--overwrite
v3.2.25
If a custom out name is specified and a file already exists at this key in the S3 bucket, decide whether that file will be deleted before the render begins. Default false
.
An existing file at the output S3 key will conflict with the render and must be deleted beforehand. If this setting is false
and a conflict occurs, an error will be thrown.
--webhook
v3.2.30
Sets a webhook to be called when the render finishes or fails. renderMediaOnLambda() -> webhook.url
. To be used together with --webhook-secret
.
--webhook-secret
v3.2.30
Sets a webhook secret for the webhook (see above). renderMediaOnLambda() -> webhook.secret
. To be used together with --webhook
.
--height
v3.2.40
--width
v3.2.40
--function-name
v3.3.38
Specify the name of the function which should be used to invoke and orchestrate the render. You only need to pass it if there are multiple functions with different configurations.
--renderer-function-name
v3.3.38
If specified, this function will be used for rendering the individual chunks. This is useful if you want to use a function with higher or lower power for rendering the chunks than the main orchestration function.
If you want to use this option, the function must be in the same region, the same account and have the same version as the main function.
--force-bucket-name
v3.3.42
Specify a specific bucket name to be used. This is not recommended, instead let Remotion discover the right bucket automatically.
--ignore-certificate-errors
Results in invalid SSL certificates in Chrome, such as self-signed ones, being ignored.
--disable-web-security
This will most notably disable CORS in Chrome among other security features.
--gl
Changelog
- From Remotion v2.6.7 until v3.0.7, the default for Remotion Lambda was
swiftshader
, but from v3.0.8 the default isswangle
(Swiftshader on Angle) since Chrome 101 added support for it. - From Remotion v2.4.3 until v2.6.6, the default was
angle
, however it turns out to have a small memory leak that could crash long Remotion renders.
Select the OpenGL renderer backend for Chromium.
Accepted values:
"angle"
"egl"
"swiftshader"
"swangle"
"vulkan"
(from Remotion v4.0.41)"angle-egl"
(from Remotion v4.0.51)
The default is null
, letting Chrome decide, except on Lambda where the default is "swangle"
--user-agent
v3.3.83
Lets you set a custom user agent that the headless Chrome browser assumes.
--offthreadvideo-cache-size-in-bytes
v4.0.23
From v4.0, Remotion has a cache for <OffthreadVideo>
frames. The default is null
, corresponding to half of the system memory available when the render starts.This option allows to override the size of the cache. The higher it is, the faster the render will be, but the more memory will be used.
The used value will be printed when running in verbose mode.
Default:
null
--delete-after
v4.0.32
Automatically delete the render after a certain period. Accepted values are 1-day
, 3-days
, 7-days
and 30-days
.For this to work, your bucket needs to have lifecycles enabled.
--webhook-custom-data
v4.0.25
Pass up to 1,024 bytes of a JSON-serializable object to the webhook. This data will be included in the webhook payload. Alternatively, pass a file path pointing to a JSON file
--color-space
v4.0.28
Color space to use for the video. Acceptable values: "default"
(default since 5.0), "bt709"
(since v4.0.28), "bt2020-ncl"
(since v4.0.88), "bt2020-cl"
(since v4.0.88), .For best color accuracy, it is recommended to also use
"png"
as the image format to have accurate color transformations throughout.Only since v4.0.83, colorspace conversion is actually performed, previously it would only tag the metadata of the video.
--prefer-lossless
v4.0.110
Uses a lossless audio codec, if one is available for the codec. If you setaudioCodec
, it takes priority over preferLossless
.