π₯ Make videos programmatically with React
split still CLI command out from render
Matt McGillivraye785b75ed3e7
diff --git a/packages/cloudrun/src/cli/commands/render/index.ts b/packages/cloudrun/src/cli/commands/render/index.tsindex ec0fa23cb7..7097d0a99f 100644--- a/packages/cloudrun/src/cli/commands/render/index.ts+++ b/packages/cloudrun/src/cli/commands/render/index.ts@@ -1,38 +1,217 @@import {CliInternals} from '@remotion/cli';-import {BINARY_NAME} from '../../../shared/constants';-import {quit} from '../../helpers/quit';+import {renderMediaOnCloudrun} from '../../../api/render-media-on-cloudrun';+import type {CloudrunCodec} from '../../../shared/validate-gcp-codec';+// import {validateMaxRetries} from '../../../shared/validate-retries';+import {ConfigInternals} from '@remotion/cli/config';+import {RenderInternals} from '@remotion/renderer';+import {downloadFile} from '../../../api/download-file';+import {validateServeUrl} from '../../../shared/validate-serveurl';+import {parsedCloudrunCli} from '../../args';import {Log} from '../../log';-import {renderMediaSubcommand, RENDER_MEDIA_SUBCOMMAND} from './renderMedia';-import {renderStillSubcommand, RENDER_STILL_SUBCOMMAND} from './renderStill';+import {renderArgsCheck} from './helpers/renderArgsCheck';export const RENDER_COMMAND = 'render';-const printCloudRunHelp = () => {- Log.info(`${BINARY_NAME} ${RENDER_COMMAND} <subcommand>`);- Log.info();- Log.info('Available subcommands:');- Log.info('');- Log.info(`${BINARY_NAME} ${RENDER_COMMAND} ${RENDER_MEDIA_SUBCOMMAND}`);- Log.info(CliInternals.chalk.gray('Render Media on Cloud Run'));- Log.info('');- Log.info(`${BINARY_NAME} ${RENDER_COMMAND} ${RENDER_STILL_SUBCOMMAND}`);- Log.info(CliInternals.chalk.gray('Render Still on Cloud Run'));-};+export const renderCommand = async (args: string[], remotionRoot: string) => {+ const {+ serveUrl,+ cloudRunUrl,+ outName,+ forceBucketName,+ downloadName,+ privacy,+ region,+ } = await renderArgsCheck(RENDER_COMMAND, args);-export const renderCommand = (args: string[], remotionRoot: string) => {- if (args[0] === RENDER_MEDIA_SUBCOMMAND) {- return renderMediaSubcommand(args.slice(1), remotionRoot);- }+ const {codec, reason: codecReason} = CliInternals.getFinalOutputCodec({+ cliFlag: CliInternals.parsedCli.codec,+ downloadName,+ outName: outName ?? null,+ configFile: ConfigInternals.getOutputCodecOrUndefined() ?? null,+ uiCodec: null,+ });- if (args[0] === RENDER_STILL_SUBCOMMAND) {- return renderStillSubcommand(args.slice(1), remotionRoot);- }+ const imageFormat = parsedCloudrunCli['image-format'];++ const audioCodec = parsedCloudrunCli['audio-codec'];- if (args[0]) {- Log.error(`Subcommand ${args[0]} not found.`);- printCloudRunHelp();- quit(1);+ const {+ chromiumOptions,+ crf,+ envVariables,+ frameRange,+ inputProps,+ logLevel,+ puppeteerTimeout,+ pixelFormat,+ proResProfile,+ jpegQuality,+ scale,+ everyNthFrame,+ numberOfGifLoops,+ muted,+ audioBitrate,+ videoBitrate,+ height,+ width,+ browserExecutable,+ port,+ } = await CliInternals.getCliOptions({+ type: 'series',+ isLambda: true,+ remotionRoot,+ });++ let composition: string = args[1];+ if (!composition) {+ Log.info('No compositions passed. Fetching compositions...');++ validateServeUrl(serveUrl);++ const server = RenderInternals.prepareServer({+ concurrency: 1,+ indent: false,+ port,+ remotionRoot,+ verbose: RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),+ webpackConfigOrServeUrl: serveUrl,+ });++ const {compositionId} =+ await CliInternals.getCompositionWithDimensionOverride({+ args,+ compositionIdFromUi: null,+ browserExecutable,+ chromiumOptions,+ envVariables,+ height,+ indent: false,+ inputProps,+ port,+ puppeteerInstance: undefined,+ serveUrlOrWebpackUrl: serveUrl,+ timeoutInMilliseconds: puppeteerTimeout,+ verbose: RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),+ width,+ server: await server,+ });+ composition = compositionId;}- printCloudRunHelp();+ // Todo: Check cloudRunUrl is valid, as the error message is obtuse+ CliInternals.Log.info(+ CliInternals.chalk.gray(+ `+Cloud Run Service URL = ${cloudRunUrl}+Region = ${region}+Type = media+Composition = ${composition}+Codec = ${codec}+Output Bucket = ${forceBucketName}+Output File = ${outName ?? 'out.mp4'}+Output File Privacy = ${privacy}+${downloadName ? ` Downloaded File = ${downloadName}` : ''}+ `.trim()+ )+ );+ Log.info();++ const renderStart = Date.now();+ const progressBar = CliInternals.createOverwriteableCliOutput({+ quiet: CliInternals.quietFlagProvided(),+ cancelSignal: null,+ updatesDontOverwrite: false,+ indent: false,+ });++ const renderProgress: {+ progress: number;+ doneIn: number | null;+ } = {+ doneIn: null,+ progress: 0,+ };+ const updateProgress = () => {+ progressBar.update(+ [+ `Rendering on Cloud Run: `,+ CliInternals.makeProgressBar(renderProgress.progress),+ `${renderProgress.doneIn === null ? 'Rendering' : 'Rendered'}`,+ renderProgress.doneIn === null+ ? `${Math.round(renderProgress.progress * 100)}%`+ : CliInternals.chalk.gray(`${renderProgress.doneIn}ms`),+ ].join(' '),+ false+ );+ };++ const updateRenderProgress = (progress: number) => {+ renderProgress.progress = progress;+ updateProgress();+ };++ const res = await renderMediaOnCloudrun({+ cloudRunUrl,+ serveUrl,+ region,+ inputProps,+ codec: codec as CloudrunCodec,+ imageFormat,+ crf: crf ?? undefined,+ envVariables,+ pixelFormat,+ proResProfile,+ jpegQuality,+ composition,+ privacy,+ frameRange: frameRange ?? undefined,+ outName,+ chromiumOptions,+ scale,+ numberOfGifLoops,+ everyNthFrame,+ muted,+ audioBitrate,+ videoBitrate,+ forceHeight: height,+ forceWidth: width,+ audioCodec,+ forceBucketName,+ updateRenderProgress,+ logLevel: ConfigInternals.Logging.getLogLevel(),+ });+ renderProgress.doneIn = Date.now() - renderStart;+ updateProgress();++ Log.info(`++ `);+ Log.info(+ CliInternals.chalk.blueBright(+ `+${res.publicUrl ? `Public URL = ${decodeURIComponent(res.publicUrl)}` : ``}+Cloud Storage Uri = ${res.cloudStorageUri}+Size (KB) = ${Math.round(Number(res.size) / 1000)}+Bucket Name = ${res.bucketName}+Privacy = ${res.privacy}+Render ID = ${res.renderId}+Codec = ${codec} (${codecReason})+ `.trim()+ )+ );++ if (downloadName) {+ Log.info('');+ Log.info('downloading file...');++ const destination = await downloadFile({+ bucketName: res.bucketName,+ gsutilURI: res.cloudStorageUri,+ downloadName,+ });++ Log.info(+ CliInternals.chalk.blueBright(`Downloaded file to ${destination}!`)+ );+ }};diff --git a/packages/cloudrun/src/cli/commands/render/renderMedia.ts b/packages/cloudrun/src/cli/commands/render/renderMedia.tsdeleted file mode 100644index e45aa5f34e..0000000000--- a/packages/cloudrun/src/cli/commands/render/renderMedia.ts+++ /dev/null@@ -1,220 +0,0 @@-import {CliInternals} from '@remotion/cli';-import {renderMediaOnCloudrun} from '../../../api/render-media-on-cloudrun';-import type {CloudrunCodec} from '../../../shared/validate-gcp-codec';-// import {validateMaxRetries} from '../../../shared/validate-retries';-import {ConfigInternals} from '@remotion/cli/config';-import {RenderInternals} from '@remotion/renderer';-import {downloadFile} from '../../../api/download-file';-import {validateServeUrl} from '../../../shared/validate-serveurl';-import {parsedCloudrunCli} from '../../args';-import {Log} from '../../log';-import {renderArgsCheck} from './helpers/renderArgsCheck';--export const RENDER_MEDIA_SUBCOMMAND = 'media';--export const renderMediaSubcommand = async (- args: string[],- remotionRoot: string-) => {- const {- serveUrl,- cloudRunUrl,- outName,- forceBucketName,- downloadName,- privacy,- region,- } = await renderArgsCheck(RENDER_MEDIA_SUBCOMMAND, args);-- const {codec, reason: codecReason} = CliInternals.getFinalOutputCodec({- cliFlag: CliInternals.parsedCli.codec,- downloadName,- outName: outName ?? null,- configFile: ConfigInternals.getOutputCodecOrUndefined() ?? null,- uiCodec: null,- });-- const imageFormat = parsedCloudrunCli['image-format'];-- const audioCodec = parsedCloudrunCli['audio-codec'];-- const {- chromiumOptions,- crf,- envVariables,- frameRange,- inputProps,- logLevel,- puppeteerTimeout,- pixelFormat,- proResProfile,- jpegQuality,- scale,- everyNthFrame,- numberOfGifLoops,- muted,- audioBitrate,- videoBitrate,- height,- width,- browserExecutable,- port,- } = await CliInternals.getCliOptions({- type: 'series',- isLambda: true,- remotionRoot,- });-- let composition: string = args[1];- if (!composition) {- Log.info('No compositions passed. Fetching compositions...');-- validateServeUrl(serveUrl);-- const server = RenderInternals.prepareServer({- concurrency: 1,- indent: false,- port,- remotionRoot,- verbose: RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),- webpackConfigOrServeUrl: serveUrl,- });-- const {compositionId} =- await CliInternals.getCompositionWithDimensionOverride({- args,- compositionIdFromUi: null,- browserExecutable,- chromiumOptions,- envVariables,- height,- indent: false,- inputProps,- port,- puppeteerInstance: undefined,- serveUrlOrWebpackUrl: serveUrl,- timeoutInMilliseconds: puppeteerTimeout,- verbose: RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),- width,- server: await server,- });- composition = compositionId;- }-- // Todo: Check cloudRunUrl is valid, as the error message is obtuse- CliInternals.Log.info(- CliInternals.chalk.gray(- `-Cloud Run Service URL = ${cloudRunUrl}-Region = ${region}-Type = media-Composition = ${composition}-Codec = ${codec}-Output Bucket = ${forceBucketName}-Output File = ${outName ?? 'out.mp4'}-Output File Privacy = ${privacy}-${downloadName ? ` Downloaded File = ${downloadName}` : ''}- `.trim()- )- );- Log.info();-- const renderStart = Date.now();- const progressBar = CliInternals.createOverwriteableCliOutput({- quiet: CliInternals.quietFlagProvided(),- cancelSignal: null,- updatesDontOverwrite: false,- indent: false,- });-- const renderProgress: {- progress: number;- doneIn: number | null;- } = {- doneIn: null,- progress: 0,- };- const updateProgress = () => {- progressBar.update(- [- `Rendering on Cloud Run: `,- CliInternals.makeProgressBar(renderProgress.progress),- `${renderProgress.doneIn === null ? 'Rendering' : 'Rendered'}`,- renderProgress.doneIn === null- ? `${Math.round(renderProgress.progress * 100)}%`- : CliInternals.chalk.gray(`${renderProgress.doneIn}ms`),- ].join(' '),- false- );- };-- const updateRenderProgress = (progress: number) => {- renderProgress.progress = progress;- updateProgress();- };-- const res = await renderMediaOnCloudrun({- cloudRunUrl,- serveUrl,- region,- inputProps,- codec: codec as CloudrunCodec,- imageFormat,- crf: crf ?? undefined,- envVariables,- pixelFormat,- proResProfile,- jpegQuality,- composition,- privacy,- frameRange: frameRange ?? undefined,- outName,- chromiumOptions,- scale,- numberOfGifLoops,- everyNthFrame,- muted,- audioBitrate,- videoBitrate,- forceHeight: height,- forceWidth: width,- audioCodec,- forceBucketName,- updateRenderProgress,- logLevel: ConfigInternals.Logging.getLogLevel(),- });- renderProgress.doneIn = Date.now() - renderStart;- updateProgress();-- Log.info(`-- `);- Log.info(- CliInternals.chalk.blueBright(- `-${res.publicUrl ? `Public URL = ${decodeURIComponent(res.publicUrl)}` : ``}-Cloud Storage Uri = ${res.cloudStorageUri}-Size (KB) = ${Math.round(Number(res.size) / 1000)}-Bucket Name = ${res.bucketName}-Privacy = ${res.privacy}-Render ID = ${res.renderId}-Codec = ${codec} (${codecReason})- `.trim()- )- );-- if (downloadName) {- Log.info('');- Log.info('downloading file...');-- const destination = await downloadFile({- bucketName: res.bucketName,- gsutilURI: res.cloudStorageUri,- downloadName,- });-- Log.info(- CliInternals.chalk.blueBright(`Downloaded file to ${destination}!`)- );- }-};diff --git a/packages/cloudrun/src/cli/commands/render/renderStill.ts b/packages/cloudrun/src/cli/commands/still.tssimilarity index 88%rename from packages/cloudrun/src/cli/commands/render/renderStill.tsrename to packages/cloudrun/src/cli/commands/still.tsindex 49aff98fb8..51a71382f6 100644--- a/packages/cloudrun/src/cli/commands/render/renderStill.ts+++ b/packages/cloudrun/src/cli/commands/still.ts@@ -1,18 +1,15 @@import {CliInternals} from '@remotion/cli';import {ConfigInternals} from '@remotion/cli/config';import {RenderInternals} from '@remotion/renderer';-import {downloadFile} from '../../../api/download-file';-import {renderStillOnCloudrun} from '../../../api/render-still-on-cloudrun';-import {validateServeUrl} from '../../../shared/validate-serveurl';-import {Log} from '../../log';-import {renderArgsCheck} from './helpers/renderArgsCheck';--export const RENDER_STILL_SUBCOMMAND = 'still';--export const renderStillSubcommand = async (- args: string[],- remotionRoot: string-) => {+import {downloadFile} from '../../api/download-file';+import {renderStillOnCloudrun} from '../../api/render-still-on-cloudrun';+import {validateServeUrl} from '../../shared/validate-serveurl';+import {Log} from '../log';+import {renderArgsCheck} from './render/helpers/renderArgsCheck';++export const STILL_COMMAND = 'still';++export const stillCommand = async (args: string[], remotionRoot: string) => {const {serveUrl,cloudRunUrl,@@ -21,7 +18,7 @@ export const renderStillSubcommand = async (privacy,downloadName,region,- } = await renderArgsCheck(RENDER_STILL_SUBCOMMAND, args);+ } = await renderArgsCheck(STILL_COMMAND, args);const {chromiumOptions,diff --git a/packages/cloudrun/src/cli/help.ts b/packages/cloudrun/src/cli/help.tsindex 7ce860cd2a..c73c0cf02b 100644--- a/packages/cloudrun/src/cli/help.ts+++ b/packages/cloudrun/src/cli/help.ts@@ -5,6 +5,7 @@ import {REGIONS_COMMAND} from './commands/regions';import {RENDER_COMMAND} from './commands/render';import {SERVICES_COMMAND} from './commands/services';import {SITES_COMMAND} from './commands/sites';+import {STILL_COMMAND} from './commands/still';import {Log} from './log';const packagejson = require('../../package.json');@@ -21,9 +22,11 @@ export const printHelp = () => {Log.info();Log.info(`${BINARY_NAME} ${RENDER_COMMAND}`);- Log.info(- CliInternals.chalk.gray('Render Remotion media/still on GCP Cloud Run.')- );+ Log.info(CliInternals.chalk.gray('Render Remotion media on GCP Cloud Run.'));++ Log.info();+ Log.info(`${BINARY_NAME} ${STILL_COMMAND}`);+ Log.info(CliInternals.chalk.gray('Render Remotion still on GCP Cloud Run.'));Log.info();Log.info(`${BINARY_NAME} ${SERVICES_COMMAND}`);diff --git a/packages/cloudrun/src/cli/index.ts b/packages/cloudrun/src/cli/index.tsindex d08d73be05..c76acc49b5 100644--- a/packages/cloudrun/src/cli/index.ts+++ b/packages/cloudrun/src/cli/index.ts@@ -2,6 +2,7 @@ import {parsedCloudrunCli} from './args';import {permissionsCommand, PERMISSIONS_COMMAND} from './commands/permissions';import {regionsCommand, REGIONS_COMMAND} from './commands/regions';import {renderCommand, RENDER_COMMAND} from './commands/render';+import {stillCommand, STILL_COMMAND} from './commands/still';import {servicesCommand, SERVICES_COMMAND} from './commands/services';import {sitesCommand, SITES_COMMAND} from './commands/sites';import {printHelp} from './help';@@ -18,6 +19,10 @@ const matchCommand = (args: string[], remotionRoot: string) => {return renderCommand(args.slice(1), remotionRoot);}+ if (args[0] === STILL_COMMAND) {+ return stillCommand(args.slice(1), remotionRoot);+ }+if (args[0] === SERVICES_COMMAND) {return servicesCommand(args.slice(1));}diff --git a/packages/docs/docs/cloudrun/cli.md b/packages/docs/docs/cloudrun/cli.mdindex 619a562bc4..d2fc6e9e78 100644--- a/packages/docs/docs/cloudrun/cli.md+++ b/packages/docs/docs/cloudrun/cli.md@@ -13,6 +13,7 @@ To use the Remotion Cloudrun CLI, you first need to [install it](/docs/cloudrun/- [sites](/docs/cloudrun/cli/sites)- [services](/docs/cloudrun/cli/services)- [render](/docs/cloudrun/cli/render)+- [still](/docs/cloudrun/cli/still)- [permissions](/docs/cloudrun/cli/permissions)- [regions](/docs/cloudrun/cli/regions)diff --git a/packages/docs/docs/cloudrun/cli/render.md b/packages/docs/docs/cloudrun/cli/render.mdindex cce7dd6a6c..ef7acf1ddf 100644--- a/packages/docs/docs/cloudrun/cli/render.md+++ b/packages/docs/docs/cloudrun/cli/render.md@@ -7,12 +7,12 @@ slug: /cloudrun/cli/rendercrumb: "Cloud Run CLI Reference"----Using the `npx remotion cloudrun render` command, you can render a video or image on GCP.+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 <media | still> <serve-url> [<composition-id>] [<output-location>]+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`](/docs/cloudrun/cli/sites#create) command or calling [`deployService()`](/docs/cloudrun/deployservice).@@ -24,25 +24,19 @@ npx remotion cloudrun render <media | still> <serve-url> [<composition-id>] [<ouRendering a video, passing the service name:```-npx remotion cloudrun render media https://storage.googleapis.com/remotioncloudrun-123asd321/sites/abcdefgh/index.html tiles --service-name=remotion--3-3-82--mem512mi--cpu1-0--t-800-```--Rendering a still, passing the service name:--```-npx remotion cloudrun render still https://storage.googleapis.com/remotioncloudrun-123asd321/sites/abcdefgh/index.html tiles --service-name=remotion--3-3-82--mem512mi--cpu1-0--t-800+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 media test-site tiles --service-name=remotion--3-3-82--mem512mi--cpu1-0--t-800+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 media test-site tiles --service-name=remotion--3-3-82--mem512mi--cpu1-0--t-800 --props='{"hi": "there"}'+npx remotion cloudrun render test-site tiles --service-name=remotion--3-3-82--mem512mi--cpu1-0--t-800 --props='{"hi": "there"}'```## Flags@@ -94,10 +88,6 @@ Specify the url of the service which should be used to perform the render. You mSpecify 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-## Media Rendering Specific Flags--The above flags can be used for rendering both Still and Media. These flags are specific for Media rendering.-### `--codec`[`h264` or `h265` or `png` or `vp8` or `mp3` or `aac` or `wav` or `prores`](/docs/config#setcodec). If you don't supply `--codec`, it will use `h264`.@@ -146,4 +136,4 @@ For example only every second frame, every third frame and so on. Only works for### `--frames`-[Render a subset of a video](/docs/config#setframerange). Example: `--frames=0-9` to select the first 10 frames. To render a still, use the [`still`](/docs/lambda/cli/still) command.+[Render a subset of a video](/docs/config#setframerange). Example: `--frames=0-9` to select the first 10 frames.diff --git a/packages/docs/docs/cloudrun/cli/still.md b/packages/docs/docs/cloudrun/cli/still.mdnew file mode 100644index 0000000000..592fcfdde1--- /dev/null+++ b/packages/docs/docs/cloudrun/cli/still.md@@ -0,0 +1,89 @@+---+image: /generated/articles-docs-cloudrun-cli-still.png+id: still+sidebar_label: render+title: "npx remotion cloudrun still"+slug: /cloudrun/cli/still+crumb: "Cloud Run CLI Reference"+---++Using the `npx remotion cloudrun still` command, you can render an image on GCP.++The structure of a command is as follows:++```+npx remotion cloudrun still <serve-url> [<still-id>] [<output-location>]+```++- The serve URL is obtained by deploying a Remotion project to a GCP Storage Bucket using the [`sites create`](/docs/cloudrun/cli/sites#create) command or calling [`deployService()`](/docs/cloudrun/deployservice).+- The [still ID](/docs/terminology#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 image 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 still, passing the service name:++```+npx remotion cloudrun still 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 still test-site tiles --service-name=remotion--3-3-82--mem512mi--cpu1-0--t-800+```++Passing in input props:++```+npx remotion cloudrun still test-site tiles --service-name=remotion--3-3-82--mem512mi--cpu1-0--t-800 --props='{"hi": "there"}'+```++## Flags++### `--region`++The [GCP region](/docs/cloudrun/region-selection) to select. For lowest latency, the service, site and output bucket should be in the same region.++### `--props`++[React Props to pass to the root component of your still.](/docs/parametrized-rendering#passing-input-props-in-the-cli) Must be a serialized JSON string (`--props='{"hello": "world"}'`) or a path to a JSON file (`./path/to/props.json`).++### `--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.++### `--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.++### `--jpeg-quality`++[Value between 0 and 100 for JPEG rendering quality](/docs/config#setjpegquality). Doesn't work when a PNG is rendered.++### `--image-format`++[`jpeg` or `png` - JPEG is faster, but doesn't support transparency.](/docs/config#setStillImageFormat) The default image format is `jpeg`.++### `--scale`++[Scales the output frame by the factor you pass in.](/docs/scaling) 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`. This is not for invoking the cloud run service, but for passing environment variables that you would want to read inside the render.++### `--out-name`++The file name of the still output as stored in the Cloud Storage bucket. By default, it is `out` plus the appropriate file extension, for example: `out.png`. 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.\ No newline at end of filediff --git a/packages/docs/docs/cloudrun/deploysite.md b/packages/docs/docs/cloudrun/deploysite.mdindex bfcf87be7c..66e6742049 100644--- a/packages/docs/docs/cloudrun/deploysite.md+++ b/packages/docs/docs/cloudrun/deploysite.md@@ -112,7 +112,7 @@ An object with the following values:You can use this "Serve URL" to render a video on Remotion Cloud Run using:- - The [`npx remotion cloudrun render <media | still>`](/docs/cloudrun/cli/render) command+ - The [`npx remotion cloudrun render`](/docs/cloudrun/cli/render) command- The [`renderMediaOnCloudrun()`](/docs/cloudrun/rendermediaoncloudrun) and [`renderStillOnCloudrun()`](/docs/cloudrun/renderstilloncloudrun) functions.- Locally using the [`renderMedia()`](/docs/renderer/render-media) and [`renderStill()`](/docs/renderer/render-still) functions.- Locally using the [`npx remotion render`](/docs/cli) and [`npx remotion still`](/docs/cli) commandsdiff --git a/packages/docs/docs/cloudrun/setup.md b/packages/docs/docs/cloudrun/setup.mdindex 4212af360c..105edd7912 100644--- a/packages/docs/docs/cloudrun/setup.md+++ b/packages/docs/docs/cloudrun/setup.md@@ -234,7 +234,16 @@ values={[}><TabItem value="cli">-- `<media | still>` The deployed Cloud Run service is capable of rendering media and stills. Pass either `media` or `still` to render as needed.+<Tabs+groupId="renderType"+defaultValue="media"+values={[+{ label: 'Render Media', value: 'media', },+{ label: 'Render Still', value: 'still', },+]+}>+<TabItem value="media">+- `<serve-url | site-name>` The serve URL was returned during step 7, site deployment. If using a serve url from a Cloud Storage bucket, you can pass the site-name instead.- `<composition-id>` Pass in the [ID of the composition](/docs/composition) you'd like to render.@@ -246,12 +255,13 @@ values={[{ label: 'Render using Service Name', value: 'serviceName', },]}>+<TabItem value="cloudRunUrl">- `<cloud-run-url>` The Cloud Run URL was returned during step 6, service deployment.```bash-npx remotion cloudrun render <media | still> <serve-url | site-name> <composition-id> --cloud-run-url=<cloud-run-url>+npx remotion cloudrun render <serve-url | site-name> <composition-id> --cloud-run-url=<cloud-run-url>```</TabItem>@@ -261,7 +271,7 @@ npx remotion cloudrun render <media | still> <serve-url | site-name> <compositio- `<region>` The region the Service is in, which was returned during step 6, service deployment. This is only required if using the service name.```bash-npx remotion cloudrun render <media | still> <serve-url | site-name> <composition-id> --service-name=<service-name> --region=<region>+npx remotion cloudrun render <serve-url | site-name> <composition-id> --service-name=<service-name> --region=<region>```</TabItem>@@ -269,6 +279,50 @@ npx remotion cloudrun render <media | still> <serve-url | site-name> <compositioProgress will be printed until the video finished rendering. Congrats! You rendered your first video using Remotion Cloudrun π++</TabItem>+<TabItem value="still">++- `<serve-url | site-name>` The serve URL was returned during step 7, site deployment. If using a serve url from a Cloud Storage bucket, you can pass the site-name instead.+- `<still-id>` Pass in the [ID of the still](/docs/still) you'd like to render.++<Tabs+groupId="cliRender"+defaultValue="cloudRunUrl"+values={[+{ label: 'Render using Cloud Run Url', value: 'cloudRunUrl', },+{ label: 'Render using Service Name', value: 'serviceName', },+]+}>++<TabItem value="cloudRunUrl">++- `<cloud-run-url>` The Cloud Run URL was returned during step 6, service deployment.++```bash+npx remotion cloudrun still <serve-url | site-name> <still-id> --cloud-run-url=<cloud-run-url>+```++</TabItem>+<TabItem value="serviceName">++- `<service-name>` The Service Name was returned during step 6, service deployment.+- `<region>` The region the Service is in, which was returned during step 6, service deployment. This is only required if using the service name.++```bash+npx remotion cloudrun still <serve-url | site-name> <still-id> --service-name=<service-name> --region=<region>+```++</TabItem>+</Tabs>++Congrats! You rendered your first still using Remotion Cloudrun π+++</TabItem>+</Tabs>++</TabItem><TabItem value="node">diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.jsindex cd6d87b974..1a8682b02c 100644--- a/packages/docs/sidebars.js+++ b/packages/docs/sidebars.js@@ -43,6 +43,7 @@ module.exports = {"cloudrun/cli/sites","cloudrun/cli/services","cloudrun/cli/render",+ "cloudrun/cli/still","cloudrun/cli/permissions","cloudrun/cli/regions",],