Skip to content

🎥 Make videos programmatically with React

timeout in options map

Jonny Burger45b1c32343e0
diff --git a/packages/cli/src/benchmark.ts b/packages/cli/src/benchmark.ts
index 68a884ac85..e0501bdb32 100644
--- a/packages/cli/src/benchmark.ts
+++ b/packages/cli/src/benchmark.ts
@@ -42,6 +42,7 @@ const {
numberOfGifLoopsOption,
encodingMaxRateOption,
encodingBufferSizeOption,
+ delayRenderTimeoutInMillisecondsOption,
} = BrowserSafeApis.options;
const getValidConcurrency = (cliConcurrency: number | string | null) => {
@@ -182,7 +183,6 @@ export const benchmarkCommand = async (
inputProps,
envVariables,
browserExecutable,
- puppeteerTimeout,
publicDir,
proResProfile,
frameRange: defaultFrameRange,
@@ -275,7 +275,9 @@ export const benchmarkCommand = async (
serializedInputPropsWithCustomSchema,
envVariables,
chromiumOptions,
- timeoutInMilliseconds: puppeteerTimeout,
+ timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption.getValue({
+ commandLine: parsedCli,
+ }).value,
port: getRendererPortFromConfigFileAndCliFlag(),
puppeteerInstance,
browserExecutable,
@@ -344,6 +346,10 @@ export const benchmarkCommand = async (
const encodingBufferSize = encodingBufferSizeOption.getValue({
commandLine: parsedCli,
}).value;
+ const delayRenderInMilliseconds =
+ delayRenderTimeoutInMillisecondsOption.getValue({
+ commandLine: parsedCli,
+ }).value;
for (const composition of compositions) {
const {value: videoCodec, source: codecReason} = videoCodecOption.getValue(
@@ -399,7 +405,7 @@ export const benchmarkCommand = async (
x264Preset,
jpegQuality,
chromiumOptions,
- timeoutInMilliseconds: ConfigInternals.getCurrentPuppeteerTimeout(),
+ timeoutInMilliseconds: delayRenderInMilliseconds,
scale,
port: getRendererPortFromConfigFileAndCliFlag(),
numberOfGifLoops,
diff --git a/packages/cli/src/compositions.ts b/packages/cli/src/compositions.ts
index 8401715580..e3b0f1adda 100644
--- a/packages/cli/src/compositions.ts
+++ b/packages/cli/src/compositions.ts
@@ -15,6 +15,7 @@ const {
enableMultiprocessOnLinuxOption,
offthreadVideoCacheSizeInBytesOption,
glOption,
+ delayRenderTimeoutInMillisecondsOption,
} = BrowserSafeApis.options;
export const listCompositionsCommand = async (
@@ -52,7 +53,6 @@ export const listCompositionsCommand = async (
browserExecutable,
envVariables,
inputProps,
- puppeteerTimeout,
publicDir,
headless,
ignoreCertificateErrors,
@@ -111,7 +111,9 @@ export const listCompositionsCommand = async (
staticBase: null,
indent: undefined,
}).serializedString,
- timeoutInMilliseconds: puppeteerTimeout,
+ timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption.getValue({
+ commandLine: parsedCli,
+ }).value,
port: getRendererPortFromConfigFileAndCliFlag(),
indent: false,
onBrowserLog: null,
diff --git a/packages/cli/src/config/index.ts b/packages/cli/src/config/index.ts
index 5d911bcf77..4519f20094 100644
--- a/packages/cli/src/config/index.ts
+++ b/packages/cli/src/config/index.ts
@@ -29,7 +29,6 @@ import {
} from './preview-server';
import {getProResProfile} from './prores-profile';
import {getStillFrame, setStillFrame} from './still-frame';
-import {getCurrentPuppeteerTimeout} from './timeout';
import {getWebpackCaching} from './webpack-caching';
import type {WebpackConfiguration} from '@remotion/bundler';
@@ -83,7 +82,6 @@ import {setPixelFormat} from './pixel-format';
import {setPort, setRendererPort, setStudioPort} from './preview-server';
import {setProResProfile} from './prores-profile';
import {getPublicDir, setPublicDir} from './public-dir';
-import {setPuppeteerTimeout} from './timeout';
import {getChromiumUserAgent, setChromiumUserAgent} from './user-agent';
import {setWebpackCaching} from './webpack-caching';
import {
@@ -117,6 +115,7 @@ const {
reproOption,
enableLambdaInsights,
logLevelOption,
+ delayRenderTimeoutInMillisecondsOption,
} = BrowserSafeApis.options;
declare global {
@@ -552,8 +551,9 @@ export const Config: FlatConfig = {
setEntryPoint,
setLevel: logLevelOption.setConfig,
setBrowserExecutable,
- setTimeoutInMilliseconds: setPuppeteerTimeout,
- setDelayRenderTimeoutInMilliseconds: setPuppeteerTimeout,
+ setTimeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption.setConfig,
+ setDelayRenderTimeoutInMilliseconds:
+ delayRenderTimeoutInMillisecondsOption.setConfig,
setChromiumDisableWebSecurity,
setChromiumIgnoreCertificateErrors,
setChromiumHeadlessMode,
@@ -623,7 +623,6 @@ export const ConfigInternals = {
getChromiumHeadlessMode,
getEveryNthFrame,
getConcurrency,
- getCurrentPuppeteerTimeout,
getAudioCodec,
getStillFrame,
getShouldOutputImageSequence,
diff --git a/packages/cli/src/config/timeout.ts b/packages/cli/src/config/timeout.ts
deleted file mode 100644
index 19d65630ce..0000000000
--- a/packages/cli/src/config/timeout.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import {RenderInternals} from '@remotion/renderer';
-
-let currentTimeout: number = RenderInternals.DEFAULT_TIMEOUT;
-
-export const setPuppeteerTimeout = (newPuppeteerTimeout: number) => {
- if (typeof newPuppeteerTimeout !== 'number') {
- throw new Error(
- '--timeout flag / setDelayRenderTimeoutInMilliseconds() must be a number, but got ' +
- JSON.stringify(newPuppeteerTimeout),
- );
- }
-
- currentTimeout = newPuppeteerTimeout;
-};
-
-export const getCurrentPuppeteerTimeout = (): number => {
- return currentTimeout;
-};
diff --git a/packages/cli/src/get-cli-options.ts b/packages/cli/src/get-cli-options.ts
index 6f9ea3fbcc..cceec3c833 100644
--- a/packages/cli/src/get-cli-options.ts
+++ b/packages/cli/src/get-cli-options.ts
@@ -105,7 +105,6 @@ export const getCliOptions = (options: {
});
return {
- puppeteerTimeout: ConfigInternals.getCurrentPuppeteerTimeout(),
concurrency,
frameRange,
shouldOutputImageSequence,
diff --git a/packages/cli/src/get-render-defaults.ts b/packages/cli/src/get-render-defaults.ts
index 1da6ecce9a..6142786a90 100644
--- a/packages/cli/src/get-render-defaults.ts
+++ b/packages/cli/src/get-render-defaults.ts
@@ -22,6 +22,7 @@ const {
encodingBufferSizeOption,
reproOption,
logLevelOption,
+ delayRenderTimeoutInMillisecondsOption,
} = BrowserSafeApis.options;
export const getRenderDefaults = (): RenderDefaults => {
@@ -82,9 +83,11 @@ export const getRenderDefaults = (): RenderDefaults => {
const repro = reproOption.getValue({
commandLine: parsedCli,
}).value;
+ const delayRenderTimeout = delayRenderTimeoutInMillisecondsOption.getValue({
+ commandLine: parsedCli,
+ }).value;
const everyNthFrame = ConfigInternals.getEveryNthFrame();
- const delayRenderTimeout = ConfigInternals.getCurrentPuppeteerTimeout();
const audioCodec = ConfigInternals.getAudioCodec();
const stillImageFormat = ConfigInternals.getUserPreferredStillImageFormat();
const videoImageFormat = ConfigInternals.getUserPreferredVideoImageFormat();
diff --git a/packages/cli/src/gpu.ts b/packages/cli/src/gpu.ts
index 9065f7ccdd..e047b7633e 100644
--- a/packages/cli/src/gpu.ts
+++ b/packages/cli/src/gpu.ts
@@ -8,12 +8,15 @@ import {parsedCli} from './parse-command-line';
export const GPU_COMMAND = 'gpu';
-const {enableMultiprocessOnLinuxOption, glOption} = BrowserSafeApis.options;
+const {
+ enableMultiprocessOnLinuxOption,
+ glOption,
+ delayRenderTimeoutInMillisecondsOption,
+} = BrowserSafeApis.options;
export const gpuCommand = async (remotionRoot: string, logLevel: LogLevel) => {
const {
browserExecutable,
- puppeteerTimeout,
disableWebSecurity,
headless,
ignoreCertificateErrors,
@@ -29,6 +32,9 @@ export const gpuCommand = async (remotionRoot: string, logLevel: LogLevel) => {
commandLine: parsedCli,
}).value;
const gl = glOption.getValue({commandLine: parsedCli}).value;
+ const puppeteerTimeout = delayRenderTimeoutInMillisecondsOption.getValue({
+ commandLine: parsedCli,
+ }).value;
const chromiumOptions: ChromiumOptions = {
disableWebSecurity,
diff --git a/packages/cli/src/parse-command-line.ts b/packages/cli/src/parse-command-line.ts
index 05ca45b6ff..66ba11df65 100644
--- a/packages/cli/src/parse-command-line.ts
+++ b/packages/cli/src/parse-command-line.ts
@@ -173,10 +173,6 @@ export const parseCommandLine = () => {
Config.setConcurrency(parsedCli.concurrency);
}
- if (parsedCli.timeout) {
- Config.setTimeoutInMilliseconds(parsedCli.timeout);
- }
-
if (parsedCli.height) {
Config.overrideHeight(parsedCli.height);
}
diff --git a/packages/cli/src/render-queue/process-still.ts b/packages/cli/src/render-queue/process-still.ts
index 9561c49a13..8c62117bd4 100644
--- a/packages/cli/src/render-queue/process-still.ts
+++ b/packages/cli/src/render-queue/process-still.ts
@@ -21,7 +21,7 @@ export const processStill = async ({
throw new Error('Expected still job');
}
- const {publicDir, browserExecutable, puppeteerTimeout} = getCliOptions({
+ const {publicDir, browserExecutable} = getCliOptions({
isLambda: false,
type: 'still',
remotionRoot,
@@ -44,7 +44,7 @@ export const processStill = async ({
overwrite: true,
port: getRendererPortFromConfigFile(),
publicDir,
- puppeteerTimeout,
+ puppeteerTimeout: job.delayRenderTimeout,
jpegQuality: job.jpegQuality,
remainingArgs: [],
scale: job.scale,
diff --git a/packages/cli/src/render.tsx b/packages/cli/src/render.tsx
index 17076fd12a..01b24c1ebe 100644
--- a/packages/cli/src/render.tsx
+++ b/packages/cli/src/render.tsx
@@ -29,6 +29,7 @@ const {
encodingMaxRateOption,
encodingBufferSizeOption,
reproOption,
+ delayRenderTimeoutInMillisecondsOption,
} = BrowserSafeApis.options;
export const render = async (
@@ -81,7 +82,6 @@ export const render = async (
userAgent,
disableWebSecurity,
ignoreCertificateErrors,
- puppeteerTimeout,
publicDir,
height,
width,
@@ -135,6 +135,9 @@ export const render = async (
commandLine: parsedCli,
}).value;
const repro = reproOption.getValue({commandLine: parsedCli}).value;
+ const puppeteerTimeout = delayRenderTimeoutInMillisecondsOption.getValue({
+ commandLine: parsedCli,
+ }).value;
const chromiumOptions: ChromiumOptions = {
disableWebSecurity,
diff --git a/packages/cli/src/still.ts b/packages/cli/src/still.ts
index ae87f92ce1..8da7199b58 100644
--- a/packages/cli/src/still.ts
+++ b/packages/cli/src/still.ts
@@ -16,6 +16,7 @@ const {
jpegQualityOption,
enableMultiprocessOnLinuxOption,
glOption,
+ delayRenderTimeoutInMillisecondsOption,
} = BrowserSafeApis.options;
export const still = async (
@@ -62,7 +63,6 @@ export const still = async (
inputProps,
overwrite,
publicDir,
- puppeteerTimeout,
stillFrame,
width,
disableWebSecurity,
@@ -84,6 +84,13 @@ export const still = async (
commandLine: parsedCli,
}).value;
const gl = glOption.getValue({commandLine: parsedCli}).value;
+ const offthreadVideoCacheSizeInBytes =
+ offthreadVideoCacheSizeInBytesOption.getValue({
+ commandLine: parsedCli,
+ }).value;
+ const puppeteerTimeout = delayRenderTimeoutInMillisecondsOption.getValue({
+ commandLine: parsedCli,
+ }).value;
const chromiumOptions: ChromiumOptions = {
disableWebSecurity,
@@ -128,9 +135,6 @@ export const still = async (
},
cancelSignal: null,
outputLocationFromUi: null,
- offthreadVideoCacheSizeInBytes:
- offthreadVideoCacheSizeInBytesOption.getValue({
- commandLine: parsedCli,
- }).value,
+ offthreadVideoCacheSizeInBytes,
});
};
diff --git a/packages/cloudrun/src/cli/commands/render/index.ts b/packages/cloudrun/src/cli/commands/render/index.ts
index 4bacc25e40..b9ff4e645a 100644
--- a/packages/cloudrun/src/cli/commands/render/index.ts
+++ b/packages/cloudrun/src/cli/commands/render/index.ts
@@ -31,6 +31,7 @@ const {
glOption,
encodingMaxRateOption,
encodingBufferSizeOption,
+ delayRenderTimeoutInMillisecondsOption,
} = BrowserSafeApis.options;
export const renderCommand = async (
@@ -70,7 +71,6 @@ export const renderCommand = async (
envVariables,
frameRange,
inputProps,
- puppeteerTimeout,
pixelFormat,
proResProfile,
everyNthFrame,
@@ -96,6 +96,9 @@ export const renderCommand = async (
commandLine: CliInternals.parsedCli,
}).value;
const gl = glOption.getValue({commandLine: CliInternals.parsedCli}).value;
+ const puppeteerTimeout = delayRenderTimeoutInMillisecondsOption.getValue({
+ commandLine: CliInternals.parsedCli,
+ }).value;
let composition: string = args[1];
const chromiumOptions: ChromiumOptions = {
diff --git a/packages/cloudrun/src/cli/commands/still.ts b/packages/cloudrun/src/cli/commands/still.ts
index 073878e296..b94cadb76f 100644
--- a/packages/cloudrun/src/cli/commands/still.ts
+++ b/packages/cloudrun/src/cli/commands/still.ts
@@ -19,6 +19,7 @@ const {
jpegQualityOption,
enableMultiprocessOnLinuxOption,
glOption,
+ delayRenderTimeoutInMillisecondsOption,
} = BrowserSafeApis.options;
export const stillCommand = async (
@@ -39,7 +40,6 @@ export const stillCommand = async (
const {
envVariables,
inputProps,
- puppeteerTimeout,
stillFrame,
height,
width,
@@ -70,6 +70,14 @@ export const stillCommand = async (
userAgent,
};
+ const offthreadVideoCacheSizeInBytes =
+ offthreadVideoCacheSizeInBytesOption.getValue({
+ commandLine: CliInternals.parsedCli,
+ }).value;
+ const puppeteerTimeout = delayRenderTimeoutInMillisecondsOption.getValue({
+ commandLine: CliInternals.parsedCli,
+ }).value;
+
if (!composition) {
Log.info(
{indent: false, logLevel},
@@ -84,11 +92,6 @@ export const stillCommand = async (
);
}
- const offthreadVideoCacheSizeInBytes =
- offthreadVideoCacheSizeInBytesOption.getValue({
- commandLine: CliInternals.parsedCli,
- }).value;
-
const server = RenderInternals.prepareServer({
concurrency: 1,
indent: false,
diff --git a/packages/lambda/src/api/get-render-progress.ts b/packages/lambda/src/api/get-render-progress.ts
index 5bb0bb3ed4..25eedac5a3 100644
--- a/packages/lambda/src/api/get-render-progress.ts
+++ b/packages/lambda/src/api/get-render-progress.ts
@@ -11,7 +11,7 @@ export type GetRenderProgressInput = {
bucketName: string;
renderId: string;
region: AwsRegion;
- logLevel: LogLevel;
+ logLevel?: LogLevel;
s3OutputProvider?: CustomCredentials;
};
diff --git a/packages/lambda/src/api/make-lambda-payload.ts b/packages/lambda/src/api/make-lambda-payload.ts
index efe35e3b7c..9a9be8e03c 100644
--- a/packages/lambda/src/api/make-lambda-payload.ts
+++ b/packages/lambda/src/api/make-lambda-payload.ts
@@ -201,7 +201,7 @@ export const getRenderProgressPayload = ({
renderId,
version: VERSION,
s3OutputProvider,
- logLevel,
+ logLevel: logLevel ?? 'info',
};
};
diff --git a/packages/lambda/src/cli/commands/compositions/index.ts b/packages/lambda/src/cli/commands/compositions/index.ts
index c39ece8315..b1d244acb6 100644
--- a/packages/lambda/src/cli/commands/compositions/index.ts
+++ b/packages/lambda/src/cli/commands/compositions/index.ts
@@ -12,7 +12,11 @@ import {Log} from '../../log';
export const COMPOSITIONS_COMMAND = 'compositions';
-const {enableMultiprocessOnLinuxOption, glOption} = BrowserSafeApis.options;
+const {
+ enableMultiprocessOnLinuxOption,
+ glOption,
+ delayRenderTimeoutInMillisecondsOption,
+} = BrowserSafeApis.options;
export const compositionsCommand = async (
args: string[],
@@ -38,7 +42,6 @@ export const compositionsCommand = async (
const {
envVariables,
inputProps,
- puppeteerTimeout,
headless,
ignoreCertificateErrors,
userAgent,
@@ -54,6 +57,9 @@ export const compositionsCommand = async (
commandLine: CliInternals.parsedCli,
}).value;
const gl = glOption.getValue({commandLine: CliInternals.parsedCli}).value;
+ const puppeteerTimeout = delayRenderTimeoutInMillisecondsOption.getValue({
+ commandLine: CliInternals.parsedCli,
+ }).value;
const chromiumOptions: ChromiumOptions = {
disableWebSecurity,
diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.ts
index 34e50b47c0..12a84933d9 100644
--- a/packages/lambda/src/cli/commands/render/render.ts
+++ b/packages/lambda/src/cli/commands/render/render.ts
@@ -56,6 +56,7 @@ const {
numberOfGifLoopsOption,
encodingMaxRateOption,
encodingBufferSizeOption,
+ delayRenderTimeoutInMillisecondsOption,
} = BrowserSafeApis.options;
export const renderCommand = async (
@@ -86,7 +87,6 @@ export const renderCommand = async (
inputProps,
pixelFormat,
proResProfile,
- puppeteerTimeout,
everyNthFrame,
overwrite,
height,
@@ -149,6 +149,11 @@ export const renderCommand = async (
const encodingBufferSize = encodingBufferSizeOption.getValue({
commandLine: CliInternals.parsedCli,
}).value;
+ const timeoutInMilliseconds = delayRenderTimeoutInMillisecondsOption.getValue(
+ {
+ commandLine: CliInternals.parsedCli,
+ },
+ ).value;
const chromiumOptions: ChromiumOptions = {
disableWebSecurity,
@@ -202,7 +207,7 @@ export const renderCommand = async (
port: ConfigInternals.getRendererPortFromConfigFileAndCliFlag(),
puppeteerInstance: undefined,
serveUrlOrWebpackUrl: serveUrl,
- timeoutInMilliseconds: puppeteerTimeout,
+ timeoutInMilliseconds,
logLevel,
width,
server,
@@ -264,7 +269,7 @@ export const renderCommand = async (
logLevel,
frameRange: frameRange ?? null,
outName: parsedLambdaCli['out-name'] ?? null,
- timeoutInMilliseconds: puppeteerTimeout,
+ timeoutInMilliseconds,
chromiumOptions,
scale,
numberOfGifLoops,
diff --git a/packages/lambda/src/cli/commands/still.ts b/packages/lambda/src/cli/commands/still.ts
index ee2bc8ddd0..6af7bb393d 100644
--- a/packages/lambda/src/cli/commands/still.ts
+++ b/packages/lambda/src/cli/commands/still.ts
@@ -27,8 +27,18 @@ const {
jpegQualityOption,
enableMultiprocessOnLinuxOption,
glOption,
+ delayRenderTimeoutInMillisecondsOption,
} = BrowserSafeApis.options;
+const {
+ parsedCli,
+ determineFinalStillImageFormat,
+ chalk,
+ getCliOptions,
+ formatBytes,
+ getCompositionWithDimensionOverride,
+} = CliInternals;
+
export const STILL_COMMAND = 'still';
export const stillCommand = async (
@@ -55,7 +65,6 @@ export const stillCommand = async (
const {
envVariables,
inputProps,
- puppeteerTimeout,
stillFrame,
height,
width,
@@ -64,7 +73,7 @@ export const stillCommand = async (
userAgent,
disableWebSecurity,
ignoreCertificateErrors,
- } = CliInternals.getCliOptions({
+ } = getCliOptions({
type: 'still',
isLambda: true,
remotionRoot,
@@ -75,9 +84,9 @@ export const stillCommand = async (
let composition = args[1];
const enableMultiProcessOnLinux = enableMultiprocessOnLinuxOption.getValue({
- commandLine: CliInternals.parsedCli,
+ commandLine: parsedCli,
}).value;
- const gl = glOption.getValue({commandLine: CliInternals.parsedCli}).value;
+ const gl = glOption.getValue({commandLine: parsedCli}).value;
const chromiumOptions: ChromiumOptions = {
disableWebSecurity,
enableMultiProcessOnLinux,
@@ -87,6 +96,16 @@ export const stillCommand = async (
userAgent,
};
+ const timeoutInMilliseconds = delayRenderTimeoutInMillisecondsOption.getValue(
+ {
+ commandLine: parsedCli,
+ },
+ ).value;
+ const offthreadVideoCacheSizeInBytes =
+ offthreadVideoCacheSizeInBytesOption.getValue({
+ commandLine: parsedCli,
+ }).value;
+
if (!composition) {
Log.info(
{indent: false, logLevel},
@@ -101,11 +120,6 @@ export const stillCommand = async (
);
}
- const offthreadVideoCacheSizeInBytes =
- offthreadVideoCacheSizeInBytesOption.getValue({
- commandLine: CliInternals.parsedCli,
- }).value;
-
const server = await RenderInternals.prepareServer({
concurrency: 1,
indent: false,
@@ -116,30 +130,29 @@ export const stillCommand = async (
offthreadVideoCacheSizeInBytes,
});
- const {compositionId} =
- await CliInternals.getCompositionWithDimensionOverride({
- args: args.slice(1),
- compositionIdFromUi: null,
- indent: false,
- serveUrlOrWebpackUrl: serveUrl,
- logLevel,
- browserExecutable,
- chromiumOptions,
- envVariables,
- serializedInputPropsWithCustomSchema:
- NoReactInternals.serializeJSONWithDate({
- indent: undefined,
- staticBase: null,
- data: inputProps,
- }).serializedString,
- port: ConfigInternals.getRendererPortFromConfigFileAndCliFlag(),
- puppeteerInstance: undefined,
- timeoutInMilliseconds: puppeteerTimeout,
- height,
- width,
- server,
- offthreadVideoCacheSizeInBytes,
- });
+ const {compositionId} = await getCompositionWithDimensionOverride({
+ args: args.slice(1),
+ compositionIdFromUi: null,
+ indent: false,
+ serveUrlOrWebpackUrl: serveUrl,
+ logLevel,
+ browserExecutable,
+ chromiumOptions,
+ envVariables,
+ serializedInputPropsWithCustomSchema:
+ NoReactInternals.serializeJSONWithDate({
+ indent: undefined,
+ staticBase: null,
+ data: inputProps,
+ }).serializedString,
+ port: ConfigInternals.getRendererPortFromConfigFileAndCliFlag(),
+ puppeteerInstance: undefined,
+ timeoutInMilliseconds,
+ height,
+ width,
+ server,
+ offthreadVideoCacheSizeInBytes,
+ });
composition = compositionId;
}
@@ -155,10 +168,10 @@ export const stillCommand = async (
validatePrivacy(privacy, true);
const {format: imageFormat, source: imageFormatReason} =
- CliInternals.determineFinalStillImageFormat({
+ determineFinalStillImageFormat({
downloadName,
outName: outName ?? null,
- cliFlag: CliInternals.parsedCli['image-format'] ?? null,
+ cliFlag: parsedCli['image-format'] ?? null,
isLambda: true,
fromUi: null,
configImageFormat:
@@ -174,10 +187,10 @@ export const stillCommand = async (
const deleteAfter = parsedLambdaCli[deleteAfterOption.cliFlag];
const scale = scaleOption.getValue({
- commandLine: CliInternals.parsedCli,
+ commandLine: parsedCli,
}).value;
const jpegQuality = jpegQualityOption.getValue({
- commandLine: CliInternals.parsedCli,
+ commandLine: parsedCli,
}).value;
const res = await renderStillOnLambda({
@@ -195,14 +208,14 @@ export const stillCommand = async (
logLevel,
outName,
chromiumOptions,
- timeoutInMilliseconds: puppeteerTimeout,
+ timeoutInMilliseconds,
scale,
forceHeight: height,
forceWidth: width,
onInit: ({cloudWatchLogs, renderId, lambdaInsightsUrl}) => {
Log.info(
{indent: false, logLevel},
- CliInternals.chalk.gray(`Render invoked with ID = ${renderId}`),
+ chalk.gray(`Render invoked with ID = ${renderId}`),
);
Log.verbose(
{indent: false, logLevel},
@@ -229,7 +242,7 @@ export const stillCommand = async (
{indent: false, logLevel},
'Done!',
outputPath,
- CliInternals.formatBytes(sizeInBytes),
+ formatBytes(sizeInBytes),
);
} else {
Log.info({indent: false, logLevel}, `Finished still!`);
diff --git a/packages/renderer/src/options/index.tsx b/packages/renderer/src/options/index.tsx
index 611ea9656d..651557fdbb 100644
--- a/packages/renderer/src/options/index.tsx
+++ b/packages/renderer/src/options/index.tsx
@@ -18,6 +18,7 @@ import {offthreadVideoCacheSizeInBytesOption} from './offthreadvideo-cache-size'
import type {AnyRemotionOption} from './option';
import {reproOption} from './repro';
import {scaleOption} from './scale';
+import {delayRenderTimeoutInMillisecondsOption} from './timeout';
import {videoBitrateOption} from './video-bitrate';
import {videoCodecOption} from './video-codec';
import {webhookCustomDataOption} from './webhook-custom-data';
@@ -47,6 +48,7 @@ export const allOptions = {
reproOption,
x264Option,
logLevelOption,
+ delayRenderTimeoutInMillisecondsOption,
};
export type AvailableOptions = keyof typeof allOptions;
diff --git a/packages/renderer/src/options/timeout.tsx b/packages/renderer/src/options/timeout.tsx
new file mode 100644
index 0000000000..0592cfae47
--- /dev/null
+++ b/packages/renderer/src/options/timeout.tsx
@@ -0,0 +1,58 @@
+import {DEFAULT_TIMEOUT} from '../browser/TimeoutSettings';
+import type {AnyRemotionOption} from './option';
+
+let currentTimeout: number = DEFAULT_TIMEOUT;
+
+const validate = (value: unknown) => {
+ if (typeof value !== 'number') {
+ throw new Error(
+ '--timeout flag / setDelayRenderTimeoutInMilliseconds() must be a number, but got ' +
+ JSON.stringify(value),
+ );
+ }
+};
+
+const cliFlag = 'timeout' as const;
+
+export const delayRenderTimeoutInMillisecondsOption = {
+ name: 'delayRender() timeout',
+ cliFlag,
+ description: () => (
+ <>
+ A number describing how long the render may take to resolve all{' '}
+ <a href="https://remotion.dev/docs/delay-render">
+ <code>delayRender()</code>
+ </a>{' '}
+ calls <a href="https://remotion.dev/docs/timeout">before it times out</a>.
+ Default: <code>30000</code>
+ </>
+ ),
+ ssrName: 'timeoutInMilliseconds' as const,
+ docLink: 'https://www.remotion.dev/docs/timeout',
+ type: 0 as number,
+ getValue: ({commandLine}) => {
+ if (commandLine[cliFlag] !== undefined) {
+ return {
+ source: 'cli',
+ value: commandLine[cliFlag] as number,
+ };
+ }
+
+ if (currentTimeout !== null) {
+ validate(currentTimeout);
+ return {
+ source: 'config',
+ value: currentTimeout,
+ };
+ }
+
+ return {
+ source: 'default',
+ value: DEFAULT_TIMEOUT,
+ };
+ },
+ setConfig: (value: number) => {
+ validate(value);
+ currentTimeout = value;
+ },
+} satisfies AnyRemotionOption<number>;
diff --git a/packages/studio/src/components/RenderModal/RenderModalAdvanced.tsx b/packages/studio/src/components/RenderModal/RenderModalAdvanced.tsx
index 97afd7a56c..7fe5c92a09 100644
--- a/packages/studio/src/components/RenderModal/RenderModalAdvanced.tsx
+++ b/packages/studio/src/components/RenderModal/RenderModalAdvanced.tsx
@@ -297,6 +297,7 @@ export const RenderModalAdvanced: React.FC<{
onValueChanged={setDelayRenderTimeout}
formatter={(w) => `${w}ms`}
step={1000}
+ hint="delayRenderTimeoutInMillisecondsOption"
value={delayRenderTimeout}
/>
<div style={optionRow}>