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>]
- The serve URL is obtained by deploying a project to Remotion using the
sites create
command or 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
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
React Props to pass to the root component of your video. Must be a serialized JSON string (--props='{"hello": "world"}'
) or a path to a JSON file (./path/to/props.json
).
--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
Available from 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.
--quality
Value between 0 and 100 for JPEG rendering quality. Doesn't work when PNG frames are rendered.
--muted
available from v3.2.1
Disables audio output. This option may only be used when rendering a video.
--codec
h264
or h265
or png
or vp8
or mp3
or aac
or wav
or prores
. If you don't supply --codec
, it will use h264
.
--audio-bitrate
Available from v3.2.32
Specify the target bitrate for the generated audio.
The syntax for FFMPEGs -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: 128K
for 128 kbps, 1M
for 1 Mbps.
Default: 320k
--video-bitrate
Specify the target bitrate for the generated video.
The syntax for FFMPEGs -b:v
parameter should be used.
FFMPEG may encode the video in a way that will not result in the exact video bitrate specified.
This option cannot be set if --crf
is set.
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
.
--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
.
--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
available from v3.1
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
available from v3.1
Set the looping behavior. This option may only be set when rendering GIFs. See here for more details.
--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
available from 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
available from 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
available from v3.2.30
Sets a webhook secret for the webhook (see above). renderMediaOnLambda() -> webhook.secret
. To be used together with --webhook
.
--height
available from v3.2.40
--width
available from v3.2.40