🎥 Make videos programmatically with React
Don't download browser on CLI start
Jonny Burger516466ea236b
diff --git a/packages/cli/src/benchmark.ts b/packages/cli/src/benchmark.tsindex b23fdb8a1b..3594797f3d 100644--- a/packages/cli/src/benchmark.ts+++ b/packages/cli/src/benchmark.ts@@ -164,7 +164,6 @@ export const benchmarkCommand = async (browserExecutable,chromiumOptions,puppeteerTimeout,- browser,scale,publicDir,proResProfile,@@ -189,7 +188,7 @@ export const benchmarkCommand = async (concurrency: unparsedConcurrency,offthreadVideoCacheSizeInBytes,colorSpace,- } = await getCliOptions({+ } = getCliOptions({isLambda: false,type: 'series',remotionRoot,@@ -205,7 +204,7 @@ export const benchmarkCommand = async ();const browserInstance = RenderInternals.internalOpenBrowser({- browser,+ browser: 'chrome',browserExecutable,chromiumOptions,forceDeviceScaleFactor: scale,diff --git a/packages/cli/src/bundle.ts b/packages/cli/src/bundle.tsindex 48b17d133c..3a0d640333 100644--- a/packages/cli/src/bundle.ts+++ b/packages/cli/src/bundle.ts@@ -44,7 +44,7 @@ export const bundleCommand = async (process.exit(1);}- const {publicDir} = await getCliOptions({+ const {publicDir} = getCliOptions({isLambda: false,type: 'get-compositions',remotionRoot,diff --git a/packages/cli/src/compositions.ts b/packages/cli/src/compositions.tsindex daecf0da1e..a2fc9bcb57 100644--- a/packages/cli/src/compositions.ts+++ b/packages/cli/src/compositions.ts@@ -44,7 +44,7 @@ export const listCompositionsCommand = async (puppeteerTimeout,publicDir,offthreadVideoCacheSizeInBytes,- } = await getCliOptions({+ } = getCliOptions({isLambda: false,type: 'get-compositions',remotionRoot,diff --git a/packages/cli/src/get-cli-options.ts b/packages/cli/src/get-cli-options.tsindex 76c33c28c0..c0b212f01f 100644--- a/packages/cli/src/get-cli-options.ts+++ b/packages/cli/src/get-cli-options.ts@@ -1,9 +1,4 @@-import type {- BrowserExecutable,- ChromiumOptions,- FrameRange,- LogLevel,-} from '@remotion/renderer';+import type {ChromiumOptions, FrameRange, LogLevel} from '@remotion/renderer';import {RenderInternals} from '@remotion/renderer';import fs from 'node:fs';import path from 'node:path';@@ -32,9 +27,6 @@ const getAndValidateFrameRange = (logLevel: LogLevel, indent: boolean) => {return frameRange;};-const getBrowser = () =>- ConfigInternals.getBrowser() ?? RenderInternals.DEFAULT_BROWSER;-export const getAndValidateAbsoluteOutputFile = (relativeOutputLocation: string,overwrite: boolean,@@ -84,32 +76,7 @@ const getx264Preset = () => {return x264Preset;};-const getAndValidateBrowser = async ({- browserExecutable,- indent,- logLevel,-}: {- browserExecutable: BrowserExecutable;- indent: boolean;- logLevel: LogLevel;-}) => {- const browser = getBrowser();- try {- await RenderInternals.ensureLocalBrowser({- preferredBrowserExecutable: browserExecutable,- indent,- logLevel,- });- } catch (err) {- Log.error('Could not download a browser for rendering frames.');- Log.error(err);- process.exit(1);- }-- return browser;-};--export const getCliOptions = async (options: {+export const getCliOptions = (options: {isLambda: boolean;type: 'still' | 'series' | 'get-compositions';remotionRoot: string;@@ -169,11 +136,6 @@ export const getCliOptions = async (options: {inputProps: getInputProps(null, options.logLevel),envVariables: getEnvironmentVariables(null, options.logLevel),jpegQuality: ConfigInternals.getJpegQuality(),- browser: await getAndValidateBrowser({- browserExecutable,- indent: false,- logLevel: options.logLevel,- }),crf,pixelFormat,proResProfile,diff --git a/packages/cli/src/gpu.ts b/packages/cli/src/gpu.tsindex 3b9c8c5448..d57f97034b 100644--- a/packages/cli/src/gpu.ts+++ b/packages/cli/src/gpu.ts@@ -7,13 +7,12 @@ import {Log} from './log';export const GPU_COMMAND = 'gpu';export const gpuCommand = async (remotionRoot: string, logLevel: LogLevel) => {- const {browserExecutable, chromiumOptions, puppeteerTimeout} =- await getCliOptions({- isLambda: false,- remotionRoot,- type: 'get-compositions',- logLevel,- });+ const {browserExecutable, chromiumOptions, puppeteerTimeout} = getCliOptions({+ isLambda: false,+ remotionRoot,+ type: 'get-compositions',+ logLevel,+ });const statuses = await RenderInternals.getChromiumGpuInformation({browserExecutable,diff --git a/packages/cli/src/render-queue/process-still.ts b/packages/cli/src/render-queue/process-still.tsindex 3a8c143399..9561c49a13 100644--- a/packages/cli/src/render-queue/process-still.ts+++ b/packages/cli/src/render-queue/process-still.ts@@ -21,19 +21,18 @@ export const processStill = async ({throw new Error('Expected still job');}- const {publicDir, browserExecutable, browser, puppeteerTimeout} =- await getCliOptions({- isLambda: false,- type: 'still',- remotionRoot,- logLevel: job.logLevel,- });+ const {publicDir, browserExecutable, puppeteerTimeout} = getCliOptions({+ isLambda: false,+ type: 'still',+ remotionRoot,+ logLevel: job.logLevel,+ });const fullEntryPoint = convertEntryPointToServeUrl(entryPoint);await renderStillFlow({remotionRoot,- browser,+ browser: 'chrome',browserExecutable,chromiumOptions: job.chromiumOptions,entryPointReason: 'same as Studio',diff --git a/packages/cli/src/render-queue/process-video.ts b/packages/cli/src/render-queue/process-video.tsindex 4bf11648aa..e75b52b587 100644--- a/packages/cli/src/render-queue/process-video.ts+++ b/packages/cli/src/render-queue/process-video.ts@@ -24,17 +24,16 @@ export const processVideoJob = async ({throw new Error('Expected video job');}- const {publicDir, browserExecutable, browser, ffmpegOverride} =- await getCliOptions({- isLambda: false,- type: 'still',- remotionRoot,- logLevel,- });+ const {publicDir, browserExecutable, ffmpegOverride} = await getCliOptions({+ isLambda: false,+ type: 'still',+ remotionRoot,+ logLevel,+ });const fullEntryPoint = convertEntryPointToServeUrl(entryPoint);await renderVideoFlow({remotionRoot,- browser,+ browser: 'chrome',browserExecutable,chromiumOptions: job.chromiumOptions,entryPointReason: 'same as Studio',diff --git a/packages/cli/src/render.tsx b/packages/cli/src/render.tsxindex e071adc1ef..14622e3bfc 100644--- a/packages/cli/src/render.tsx+++ b/packages/cli/src/render.tsx@@ -49,7 +49,6 @@ export const render = async (inputProps,envVariables,jpegQuality,- browser,browserExecutable,scale,chromiumOptions,@@ -73,7 +72,7 @@ export const render = async (offthreadVideoCacheSizeInBytes,colorSpace,repro,- } = await getCliOptions({+ } = getCliOptions({isLambda: false,type: 'series',remotionRoot,@@ -88,7 +87,7 @@ export const render = async (browserExecutable,indent: false,logLevel: ConfigInternals.Logging.getLogLevel(),- browser,+ browser: 'chrome',chromiumOptions,scale,shouldOutputImageSequence,diff --git a/packages/cli/src/still.ts b/packages/cli/src/still.tsindex da15387f99..c11267d4df 100644--- a/packages/cli/src/still.ts+++ b/packages/cli/src/still.ts@@ -39,7 +39,6 @@ export const still = async (}const {- browser,browserExecutable,chromiumOptions,envVariables,@@ -53,7 +52,7 @@ export const still = async (stillFrame,width,offthreadVideoCacheSizeInBytes,- } = await getCliOptions({+ } = getCliOptions({isLambda: false,type: 'still',remotionRoot,@@ -65,7 +64,7 @@ export const still = async (entryPointReason,fullEntryPoint,remainingArgs,- browser,+ browser: 'chrome',browserExecutable,chromiumOptions,envVariables,diff --git a/packages/cloudrun/src/cli/commands/render/index.ts b/packages/cloudrun/src/cli/commands/render/index.tsindex a5f411de4a..5814c60303 100644--- a/packages/cloudrun/src/cli/commands/render/index.ts+++ b/packages/cloudrun/src/cli/commands/render/index.ts@@ -67,7 +67,7 @@ export const renderCommand = async (enforceAudioTrack,offthreadVideoCacheSizeInBytes,colorSpace,- } = await CliInternals.getCliOptions({+ } = CliInternals.getCliOptions({type: 'series',isLambda: true,remotionRoot,diff --git a/packages/cloudrun/src/cli/commands/still.ts b/packages/cloudrun/src/cli/commands/still.tsindex c3642b8d36..334ef5ddbf 100644--- a/packages/cloudrun/src/cli/commands/still.ts+++ b/packages/cloudrun/src/cli/commands/still.ts@@ -39,7 +39,7 @@ export const stillCommand = async (width,browserExecutable,offthreadVideoCacheSizeInBytes,- } = await CliInternals.getCliOptions({+ } = CliInternals.getCliOptions({type: 'still',isLambda: true,remotionRoot,diff --git a/packages/lambda/src/cli/commands/compositions/index.ts b/packages/lambda/src/cli/commands/compositions/index.tsindex 55a46645af..d4f1deb56f 100644--- a/packages/lambda/src/cli/commands/compositions/index.ts+++ b/packages/lambda/src/cli/commands/compositions/index.ts@@ -29,7 +29,7 @@ export const compositionsCommand = async (}const {chromiumOptions, envVariables, inputProps, puppeteerTimeout} =- await CliInternals.getCliOptions({+ CliInternals.getCliOptions({type: 'get-compositions',isLambda: true,remotionRoot,diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.tsindex 05e7352a1a..a8afa6b1ee 100644--- a/packages/lambda/src/cli/commands/render/render.ts+++ b/packages/lambda/src/cli/commands/render/render.ts@@ -85,7 +85,7 @@ export const renderCommand = async (colorSpace,deleteAfter,x264Preset,- } = await CliInternals.getCliOptions({+ } = CliInternals.getCliOptions({type: 'series',isLambda: true,remotionRoot,diff --git a/packages/lambda/src/cli/commands/still.ts b/packages/lambda/src/cli/commands/still.tsindex c417ffeffa..ad59e56414 100644--- a/packages/lambda/src/cli/commands/still.ts+++ b/packages/lambda/src/cli/commands/still.ts@@ -53,7 +53,7 @@ export const stillCommand = async (width,browserExecutable,offthreadVideoCacheSizeInBytes,- } = await CliInternals.getCliOptions({+ } = CliInternals.getCliOptions({type: 'still',isLambda: true,remotionRoot,