Skip to content

🎥 Make videos programmatically with React

`@remotion/cloudrun`: Use options system for image-format and audio-codec in render command

Jonny Burger574adf47acc9
diff --git a/packages/cloudrun/src/cli/commands/render/index.ts b/packages/cloudrun/src/cli/commands/render/index.ts
index 4498621acf..02fa58da03 100644
--- a/packages/cloudrun/src/cli/commands/render/index.ts
+++ b/packages/cloudrun/src/cli/commands/render/index.ts
@@ -69,9 +69,13 @@ export const renderCommand = async (
},
);
- const imageFormat = parsedCloudrunCli['image-format'];
+ const imageFormat = BrowserSafeApis.options.videoImageFormatOption.getValue({
+ commandLine: CliInternals.parsedCli,
+ }).value;
- const audioCodec = parsedCloudrunCli['audio-codec'];
+ const audioCodec = BrowserSafeApis.options.audioCodecOption.getValue({
+ commandLine: CliInternals.parsedCli,
+ }).value;
const {
envVariables,
@@ -311,7 +315,7 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
outName,
updateRenderProgress,
jpegQuality,
- audioCodec,
+ audioCodec: audioCodec ?? undefined,
audioBitrate,
videoBitrate,
encodingMaxRate,
@@ -320,7 +324,7 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
x264Preset,
crf,
pixelFormat,
- imageFormat,
+ imageFormat: imageFormat ?? undefined,
scale,
everyNthFrame,
numberOfGifLoops,