Skip to main content

npx remotion cloudrun render

Using the npx remotion cloudrun render command, you can render a video on GCP.

The structure of a command is as follows:

npx remotion cloudrun render <serve-url> [<composition-id>] [<output-location>]
  • The serve URL is obtained by deploying a Remotion project to a GCP Storage Bucket using the sites create command or calling deployService().
  • 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 Cloud Storage bucket. If you specify a location, it gets downloaded to your device in an additional step.

Example commands​

Rendering a video, passing the service name:

npx remotion cloudrun render https://storage.googleapis.com/remotioncloudrun-123asd321/sites/abcdefgh/index.html tiles --service-name=remotion--3-3-82--mem512mi--cpu1-0--t-800

Using the site name as opposed to the full serve-url:

npx remotion cloudrun render test-site tiles --service-name=remotion--3-3-82--mem512mi--cpu1-0--t-800

Passing in input props:

npx remotion cloudrun render test-site tiles --service-name=remotion--3-3-82--mem512mi--cpu1-0--t-800 --props='{"hi": "there"}'

Flags​

--region​

The GCP region to select. For lowest latency, the service, site and output bucket should be in the same 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).
note

Inline JSON string isn't supported on Windows shells because it removes the " character, use a file name instead.

--privacy​

One of:

  • "public" (default): The rendered media is publicly accessible under the Cloud Storage URL.
  • "private": The rendered media is not publicly available, but is available within the GCP project to those with the correct permissions.

--force-bucket-name​

Specify a specific bucket name to be used for the output. The resulting Google Cloud Storage URL will be in the format gs://{bucket-name}/renders/{render-id}/{file-name}. If not set, Remotion will choose the right bucket to use based on the region.

--concurrency​

How many browser tabs should render frames in parallel. Minimum 1. The maximum is the amount of CPU threads you have (In Node.JS os.cpus().length). You can also provide a percentage value (e.g. 50%). See Concurrency for how this differs on Lambda.
note

Before v4.0.76, this was "100%" by default. It is now aligned to the other server-side rendering APIs.

--disable-shared-memory-capturev4.0.534​

Disables shared-memory capture and uses regular JPEG or PNG screenshots instead. Parallel encoding remains enabled. Default false.

See Shared-memory capture.

--jpeg-quality​

Value between 0 and 100 for JPEG rendering quality. Doesn't work when PNG frames are rendered.

--image-format​

The image format to use when rendering frames for a video. Must be one of "png", "jpeg", "none". Default: "jpeg". JPEG is faster, but does not support transparency.
When shared-memory capture is active, this option has no effect. The output pixel format determines transparency.

--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.

--out-name​

The file name of the media output as stored in the Cloud Storage bucket. By default, it is out plus the appropriate file extension, for example: out.mp4. Must match /([0-9a-zA-Z-!_.*'()/]+)/g.

--cloud-run-url​

Specify the url of the service which should be used to perform the render. You must set either cloud-run-url or service-name, but not both

--service-name​

Specify the name of the service which should be used to perform the render. This is used in conjunction with the region to determine the service endpoint, as the same service name can exist across multiple regions. You must set either cloud-run-url or service-name, but not both

--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-codec​

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​

Specify the target bitrate for the generated audio. For server-side renders, the syntax for FFmpeg's -b:a parameter should be used. FFmpeg may encode the audio in a way that will not result in the exact audio bitrate specified. Example values: 512K for 512 kbps, 1M for 1 Mbps. Default for server-side renders: 320k.
renderMediaOnWeb() instead accepts a number in bits per second or a quality preset.

--video-bitrate​

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.

--webhook​

Your webhook URL that will be called with the progress of the render. This will be sent using a POST request.

Example:

--webhook=https://example.com/webhook

The webhook will receive a POST request with a JSON body containing:

{
  "progress": 0.1,
  "renderedFrames": 100,
  "encodedFrames": 100,
  "renderId": "1234567890",
  "projectId": "1234567890"
}

--render-id-override​

Provide a specific render ID for the render. Otherwise a random one will be generated.

Example:

--render-id-override=my-custom-render-id
note

You will be responsible for ensuring that the render ID is unique, otherwise it will overwrite existing renders with the same configured Render ID.

--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". Default: "hq". See here for an explanation of possible values.

--prores-bits-per-macroblockv4.0.543​

Set the bit budget per macroblock for software ProRes encoding. Accepts an integer from 128 to 8192. Lower values can reduce file size and quality; higher values may produce the same output depending on the content and ProRes profile. Default: null, which lets the encoder choose based on the profile. This maps to FFmpeg's -bits_per_mb option for prores_ks and requires the prores codec. With hardwareAcceleration set to if-possible, encoding falls back to software; required is not supported. The ProRes profile and pixel format still determine the output format and alpha channel support.

--x264-preset​

Sets a x264 preset profile. Only applies to videos rendered with the h264, h264-mkv or h264-ts codec.
Possible values: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo.
Default: medium

--gopv4.0.466​

Set the maximum number of frames between two keyframes. This maps to FFmpeg's -g option. Default: Let the encoder decide.

--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​

Sets the pixel format in FFmpeg. See the FFmpeg docs for an explanation. Acceptable values: "yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le".

--every-nth-frame​

Determines how many frames are rendered, while the other ones get skipped. Commonly used to lower the frame rate of GIFs. For example, if the fps is 30, and everyNthFrame is 2, the FPS of the output is 15.

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​

Allows you to set the number of loops as follows:
  • null (or omitting in the CLI) plays the GIF indefinitely.
  • 0 disables looping
  • 1 loops the GIF once (plays twice in total)
  • 2 loops the GIF twice (plays three times in total) and so on.

--frames​

Render a subset of a video. Pass a single number to render a still, or a range (e.g. 0-9) to render a subset of frames. Pass 100- to render from frame 100 to the end.
Since v4.0.502, you can also pass a comma-separated list of frames and ranges (e.g. 0,30-59,90-). A list of individual frames renders them as an image sequence, while multiple ranges get concatenated into one video, omitting the frames in between.

Comma-separated frame selections are only supported by the local remotion render command.

--media-cache-size-in-bytesv4.0.352​

Specify the memory budget for decoded media cached by <Video> and <Audio> from @remotion/media, in bytes. This value also determines the maximum read cache size for each distinct media source. It is not a limit on total memory usage.
The default is half of the available system memory when the render starts.

--preferred-effect-backendv4.0.540​

Prefer webgpu, webgl2, or 2d implementations of effects. Default: auto, which tries WebGPU, WebGL2, then 2D. Falls back when an implementation or backend is unavailable. Lambda selects WebGL2 or 2D implementations. Rendering fails if an effect has no supported implementation. This option also applies to Studio preview.

--offthreadvideo-cache-size-in-bytesv4.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.

--offthreadvideo-video-threadsv4.0.261​

The number of threads that <OffthreadVideo> can start to extract frames. The default is 2. Increase carefully, as too many threads may cause instability.

--color-spacev4.0.28​

Color space to use for the video. Acceptable values: "default", "bt601" (same as "default", since v4.0.424), "bt709" (since v4.0.28), "bt2020-ncl" (since v4.0.88).
Default: "default" ("bt709" from Remotion 5.0).
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.

--metadatav4.0.216​

Metadata to be embedded in the video. See here for which metadata is accepted.
The parameter must be in the format of --metadata key=value and can be passed multiple times.

--sample-ratev4.0.448​

Controls the sample rate of the output audio. The default is 48000 Hz. Match this to your source audio to avoid resampling artifacts.

--license-keyv4.0.540​

License key for sending a usage event using @remotion/licensing. For server-side rendering, including renderMedia() and renderStill(), and CLI renders, pass your private license key starting with rm_sec_. For client-side rendering with @remotion/web-renderer, pass your public license key starting with rm_pub_. You can find both keys on the License keys page for your project in the Remotion Dashboard. If you qualify for the free license, pass "free-license" instead.

--is-productionv4.0.540​

Pass false for a development render so it is not counted as a billable render in your Remotion account. Defaults to true. Only has an effect when a license key is provided.

--chromium-flagsv4.0.543​

Adds, replaces, or removes Chrome flags. Keys omit the leading --. true adds a bare flag, a string sets its value, and false removes it. Overrides take precedence over other Chromium options. The user-data-dir and remote-debugging-* flags are reserved. Defaults to {}. Remotion’s default Chrome flags and enabled or disabled features may change between patch versions. There is no guarantee that these defaults remain unchanged.

--chromium-featuresv4.0.543​

Overrides individual Chrome features. true enables a feature and removes it from the disabled list; false disables it and removes it from the enabled list. Unspecified features retain their defaults. Applied after raw flag overrides. Defaults to {}. Remotion’s default Chrome flags and enabled or disabled features may change between patch versions. There is no guarantee that these defaults remain unchanged. Overrides individual Blink features. true enables a feature and removes it from the disabled list; false disables it and removes it from the enabled list. Unspecified features retain their defaults. Applied after raw flag overrides. Defaults to {}. Remotion’s default Chrome flags and enabled or disabled features may change between patch versions. There is no guarantee that these defaults remain unchanged.