packages/docs/docs/cloudrun/renderstilloncloudrun.mdx
Kicks off a still rendering process on Remotion Cloud Run.
Requires a service to already be deployed to execute the render.
A site or a Serve URL needs to be specified to determine what will be rendered.
// ---cut---
import {renderStillOnCloudrun} from '@remotion/cloudrun/client';
const result = await renderStillOnCloudrun({
region: 'us-east1',
serviceName: 'remotion-render-bds9aab',
composition: 'MyStill',
imageFormat: 'png',
serveUrl: 'https://storage.googleapis.com/remotioncloudrun-123asd321/sites/abcdefgh',
});
if (result.type === 'success') {
console.log(result.bucketName);
console.log(result.renderId);
}
:::note
Import from @remotion/cloudrun/client to not load the whole renderer, which cannot be bundled.
:::
An object with the following properties:
cloudRunUrl?Required if serviceName not supplied. The url of the Cloud Run service which should be used to perform the render. You must set either cloudRunUrl or serviceName, but not both.
serviceName?Required if cloudRunUrl not supplied. The name of the Cloud Run 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.
metadata?<AvailableFrom v="4.0.216" />regionIn which GCP region your Cloud Run service is deployed. It's highly recommended that your Remotion site is also in the same region.
serveUrlA URL pointing to a Remotion project. Use deploySite() to deploy a Remotion project.
compositionThe id of the composition you want to render.
inputProps?Input Props to pass to the selected composition of your video..
Must be a JSON object.
From the root component the props can be read using getInputProps().
You may transform input props using calculateMetadata().
privacy?One of:
"public" (default): The rendered still is publicly accessible under the Cloud Storage URL."private": The rendered still is not publicly available, but is available within the GCP project to those with the correct permissions.downloadBehavior?<AvailableFrom v="4.0.176"/>How the output file should behave when accessed through the Cloud Storage output link in the browser.
{"type": "play-in-browser"} - the default. The video will play in the browser.{"type": "download", fileName: null} or {"type": "download", fileName: "download.mp4"} - a Content-Disposition header will be added which makes the browser download the file. You can optionally override the filename.forceBucketName?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.
jpegQuality?See renderStill() -> jpegQuality.
imageFormat?See renderStill() -> imageFormat.
scale?envVariables?See renderStill() -> envVariables.
frame?Which frame of the composition should be rendered. Frames are zero-indexed, and negative values are allowed, with -1 being the last frame.
chromiumOptions?Allows you to set certain Chromium / Google Chrome flags. See: Chromium flags.
disableWebSecurityboolean - default false
This will most notably disable CORS among other security features.
ignoreCertificateErrorsboolean - default false
Results in invalid SSL certificates, such as self-signed ones, being ignored.
glforceWidth?Overrides default composition width.
forceHeight?Overrides default composition height.
forceFps?<AvailableFrom v="4.0.424" />Overrides the default composition FPS.
forceDurationInFrames?<AvailableFrom v="4.0.424" />Overrides the default composition duration in frames.
logLevel?outName?The file name of the still output.
It can either be:
undefined - it will default to out plus the appropriate file extension, for example: renders/${renderId}/out.mp4.string - it will get saved to the same Cloud Storage bucket as your site under the key renders/{renderId}/{outName}. Make sure to include the file extension at the end of the string.delayRenderTimeoutInMilliseconds?A number describing how long the render may take to resolve all delayRender() calls before it times out. Default: 30000
mediaCacheSizeInBytes?<AvailableFrom v="4.0.352"/>offthreadVideoCacheSizeInBytes?<AvailableFrom v="4.0.23"/>offthreadVideoThreads<AvailableFrom v="4.0.261"/>Returns a promise resolving to an object containing the following:
renderIdA unique alphanumeric identifier for this render. Useful for obtaining status and finding the relevant files in the Cloud Storage bucket.
bucketNameThe Cloud Storage bucket name in which all files are being saved.
privacyPrivacy of the output file, either:
publicUrlIf the privacy is set to public, this will be the publicly accessible URL of the rendered file. If the privacy is not public, this will be null.
cloudStorageUriGoogle Storage path, beginning with gs://{bucket-name}. Can be used with the gsutil CLI tool.
sizeSize of the rendered still in KB.