Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
95229f3
Migrate CLI flags to proper RemotionOption definitions
JonnyBurger Feb 19, 2026
104f1fd
Migrate webpack-poll, disable-keyboard-shortcuts, enable-experimental…
JonnyBurger Feb 19, 2026
17748e0
Migrate frame, sequence, scale, overwrite, crf, log, version, codec, …
JonnyBurger Feb 19, 2026
70b8ab6
Rename setOutDir to setBundleOutDir
JonnyBurger Feb 19, 2026
d0b0854
Merge duplicate env-file resolution blocks in get-env.ts
JonnyBurger Feb 19, 2026
46aca61
Fix bundle-cache: register as boolean flag with null default
JonnyBurger Feb 19, 2026
a399881
Add frame validation back to stillFrameOption
JonnyBurger Feb 19, 2026
bc798f1
Remove height, width, fps, durationInFrames, concurrency from getCliO…
JonnyBurger Feb 19, 2026
696037f
Update packages/renderer/src/options/bundle-cache.tsx
JonnyBurger Feb 19, 2026
37b0918
pass through
JonnyBurger Feb 19, 2026
77d4d90
Merge branch 'migrate-cli-flags-to-options' of https://github.com/rem…
JonnyBurger Feb 19, 2026
f6eea48
stylecheck
JonnyBurger Feb 19, 2026
b269996
Use browser-safe concurrency validation to fix webpack bundle error
JonnyBurger Feb 19, 2026
2fa1bee
Update render.ts
JonnyBurger Feb 19, 2026
64f5cde
Merge pull request #6600 from remotion-dev/migrate-cli-flags-to-options
JonnyBurger Feb 19, 2026
ee489be
`@remotion/cli`: Migrate runs, gl, repro, and muted CLI flags to opti…
JonnyBurger Feb 19, 2026
aeaf132
`@remotion/cli`: Add Config.setBenchmarkRuns() for runs option
JonnyBurger Feb 19, 2026
e1f2997
okay
JonnyBurger Feb 19, 2026
3768126
Merge pull request #6602 from remotion-dev/migrate-cli-flags-to-optio…
JonnyBurger Feb 19, 2026
c42974c
`@remotion/cli`: Move lambda/cloudrun-only boolean flags to respectiv…
JonnyBurger Feb 19, 2026
0046724
prettier
JonnyBurger Feb 19, 2026
52f13db
fix it up
JonnyBurger Feb 19, 2026
8221375
Update parsed-cli.ts
JonnyBurger Feb 19, 2026
a583c0b
Move `setImageSequencePattern` section before `See also` in config.mdx
JonnyBurger Feb 19, 2026
187c584
Merge pull request #6603 from remotion-dev/move-lambda-boolean-flags
JonnyBurger Feb 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions packages/cli/src/benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import {shouldUseNonOverlayingLogger} from './should-use-non-overlaying-logger';
import {showMultiCompositionsPicker} from './show-compositions-picker';
import {truthy} from './truthy';

const DEFAULT_RUNS = 3;

const {
audioBitrateOption,
x264Option,
Expand Down Expand Up @@ -67,6 +65,13 @@ const {
userAgentOption,
disableWebSecurityOption,
ignoreCertificateErrorsOption,
concurrencyOption,
overrideHeightOption,
overrideWidthOption,
overrideFpsOption,
overrideDurationOption,
bundleCacheOption,
runsOption,
} = BrowserSafeApis.options;

const getValidConcurrency = (cliConcurrency: number | string | null) => {
Expand Down Expand Up @@ -182,7 +187,7 @@ export const benchmarkCommand = async (
args: string[],
logLevel: LogLevel,
) => {
const runs: number = parsedCli.runs ?? DEFAULT_RUNS;
const runs = runsOption.getValue({commandLine: parsedCli}).value;

const {file, reason, remainingArgs} = findEntryPoint({
args,
Expand All @@ -209,17 +214,26 @@ export const benchmarkCommand = async (
envVariables,
frameRange: defaultFrameRange,
ffmpegOverride,
height,
width,
fps,
durationInFrames,
concurrency: unparsedConcurrency,
} = getCliOptions({
isStill: false,
logLevel,
indent: false,
});

const unparsedConcurrency = concurrencyOption.getValue({
commandLine: parsedCli,
}).value;
const height = overrideHeightOption.getValue({
commandLine: parsedCli,
}).value;
const width = overrideWidthOption.getValue({
commandLine: parsedCli,
}).value;
const fps = overrideFpsOption.getValue({commandLine: parsedCli}).value;
const durationInFrames = overrideDurationOption.getValue({
commandLine: parsedCli,
}).value;

const pixelFormat = pixelFormatOption.getValue({
commandLine: parsedCli,
}).value;
Expand Down Expand Up @@ -266,6 +280,9 @@ export const benchmarkCommand = async (
const keyboardShortcutsEnabled = keyboardShortcutsOption.getValue({
commandLine: parsedCli,
}).value;
const shouldCache = bundleCacheOption.getValue({
commandLine: parsedCli,
}).value;

if (experimentalClientSideRenderingEnabled) {
Log.warn(
Expand Down Expand Up @@ -338,6 +355,7 @@ export const benchmarkCommand = async (
experimentalClientSideRenderingEnabled,
askAIEnabled,
keyboardShortcutsEnabled,
shouldCache,
});

registerCleanupJob(`Deleting bundle`, () => cleanupBundle());
Expand Down
11 changes: 9 additions & 2 deletions packages/cli/src/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const {
askAIOption,
experimentalClientSideRenderingOption,
keyboardShortcutsOption,
outDirOption,
bundleCacheOption,
} = BrowserSafeApis.options;

export const bundleCommand = async (
Expand Down Expand Up @@ -73,6 +75,9 @@ export const bundleCommand = async (
const keyboardShortcutsEnabled = keyboardShortcutsOption.getValue({
commandLine: parsedCli,
}).value;
const shouldCache = bundleCacheOption.getValue({
commandLine: parsedCli,
}).value;

if (experimentalClientSideRenderingEnabled) {
Log.warn(
Expand All @@ -90,8 +95,9 @@ export const bundleCommand = async (
commandLine: parsedCli,
}).value;

const outputPath = parsedCli['out-dir']
? path.resolve(process.cwd(), parsedCli['out-dir'])
const outDir = outDirOption.getValue({commandLine: parsedCli}).value;
const outputPath = outDir
? path.resolve(process.cwd(), outDir)
: path.join(remotionRoot, 'build');

const gitignoreFolder = BundlerInternals.findClosestFolderWithItem(
Expand Down Expand Up @@ -160,6 +166,7 @@ export const bundleCommand = async (
experimentalClientSideRenderingEnabled,
askAIEnabled,
keyboardShortcutsEnabled,
shouldCache,
});

Log.info(
Expand Down
5 changes: 5 additions & 0 deletions packages/cli/src/compositions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const {
userAgentOption,
disableWebSecurityOption,
ignoreCertificateErrorsOption,
bundleCacheOption,
} = BrowserSafeApis.options;

export const listCompositionsCommand = async (
Expand Down Expand Up @@ -135,6 +136,9 @@ export const listCompositionsCommand = async (
const keyboardShortcutsEnabled = keyboardShortcutsOption.getValue({
commandLine: parsedCli,
}).value;
const shouldCache = bundleCacheOption.getValue({
commandLine: parsedCli,
}).value;

if (experimentalClientSideRenderingEnabled) {
Log.warn(
Expand Down Expand Up @@ -168,6 +172,7 @@ export const listCompositionsCommand = async (
experimentalClientSideRenderingEnabled,
askAIEnabled,
keyboardShortcutsEnabled,
shouldCache,
});

registerCleanupJob(`Cleanup bundle`, () => cleanupBundle());
Expand Down
44 changes: 27 additions & 17 deletions packages/cli/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,17 @@ import {
} from './buffer-state-delay-in-milliseconds';
import type {Concurrency} from './concurrency';
import {getEntryPoint, setEntryPoint} from './entry-point';
import {setDotEnvLocation} from './env-file';
import {
getFfmpegOverrideFunction,
setFfmpegOverrideFunction,
} from './ffmpeg-override';
import {setFrameRange} from './frame-range';
import {setImageSequence} from './image-sequence';
import {getMetadata, setMetadata} from './metadata';
import {getShouldOpenBrowser, setShouldOpenBrowser} from './open-browser';
import {setOutputLocation} from './output-location';
import type {WebpackOverrideFn} from './override-webpack';
import {overrideWebpackConfig} from './override-webpack';
import {setPort, setRendererPort, setStudioPort} from './preview-server';
import {setWebpackCaching} from './webpack-caching';
import {
getWebpackPolling,
setWebpackPollingInMilliseconds,
} from './webpack-poll';
import {getWebpackPolling} from './webpack-poll';

export type {Concurrency, WebpackConfiguration, WebpackOverrideFn};

Expand Down Expand Up @@ -119,6 +112,13 @@ const {
overrideWidthOption,
overrideFpsOption,
overrideDurationOption,
outDirOption,
webpackPollOption,
imageSequenceOption,
bundleCacheOption,
envFileOption,
runsOption,
noOpenOption,
} = BrowserSafeApis.options;

declare global {
Expand Down Expand Up @@ -587,10 +587,20 @@ type FlatConfig = RemotionConfigObject &
* Default: false
*/
setIPv4: (ipv4: boolean) => void;
/**
* Define the output directory for `npx remotion bundle`.
* Default: `build` in the Remotion root.
*/
setBundleOutDir: (outDir: string | null) => void;
/**
* Choose between using Chrome Headless Shell or Chrome for Testing
*/
setChromeMode: (chromeMode: ChromeMode) => void;
/**
* Set how many times the video should be rendered during a benchmark.
* Default: 3
*/
setBenchmarkRuns: (runs: number) => void;
/**
* @deprecated 'The config format has changed. Change `Config.Bundling.*()` calls to `Config.*()` in your config file.'
*/
Expand Down Expand Up @@ -653,11 +663,11 @@ export const Config: FlatConfig = {
setExperimentalClientSideRenderingEnabled:
experimentalClientSideRenderingOption.setConfig,
setNumberOfSharedAudioTags: numberOfSharedAudioTagsOption.setConfig,
setWebpackPollingInMilliseconds,
setShouldOpenBrowser,
setWebpackPollingInMilliseconds: webpackPollOption.setConfig,
setShouldOpenBrowser: noOpenOption.setConfig,
setBufferStateDelayInMilliseconds,
overrideWebpackConfig,
setCachingEnabled: setWebpackCaching,
setCachingEnabled: bundleCacheOption.setConfig,
setPort,
setStudioPort,
setRendererPort,
Expand All @@ -673,7 +683,7 @@ export const Config: FlatConfig = {
setChromiumHeadlessMode: headlessOption.setConfig,
setChromiumOpenGlRenderer: glOption.setConfig,
setChromiumUserAgent: userAgentOption.setConfig,
setDotEnvLocation,
setDotEnvLocation: envFileOption.setConfig,
setConcurrency: concurrencyOption.setConfig,
setChromiumMultiProcessOnLinux: enableMultiprocessOnLinuxOption.setConfig,
setChromiumDarkMode: darkModeOption.setConfig,
Expand Down Expand Up @@ -705,7 +715,7 @@ export const Config: FlatConfig = {
setPixelFormat: pixelFormatOption.setConfig,
setCodec: videoCodecOption.setConfig,
setCrf: crfOption.setConfig,
setImageSequence,
setImageSequence: imageSequenceOption.setConfig,
setProResProfile: proResProfileOption.setConfig,
setX264Preset: x264Option.setConfig,
setAudioBitrate: audioBitrateOption.setConfig,
Expand All @@ -718,9 +728,8 @@ export const Config: FlatConfig = {
overrideDuration: overrideDurationOption.setConfig,
overrideFfmpegCommand: setFfmpegOverrideFunction,
setAudioCodec: audioCodecOption.setConfig,
setOffthreadVideoCacheSizeInBytes: (size) => {
offthreadVideoCacheSizeInBytesOption.setConfig(size);
},
setOffthreadVideoCacheSizeInBytes:
offthreadVideoCacheSizeInBytesOption.setConfig,
setDeleteAfter: deleteAfterOption.setConfig,
setColorSpace: colorSpaceOption.setConfig,
setDisallowParallelEncoding: disallowParallelEncodingOption.setConfig,
Expand All @@ -738,6 +747,8 @@ export const Config: FlatConfig = {
setPublicLicenseKey: publicLicenseKeyOption.setConfig,
setForceNewStudioEnabled: forceNewStudioOption.setConfig,
setIPv4: ipv4Option.setConfig,
setBundleOutDir: outDirOption.setConfig,
setBenchmarkRuns: runsOption.setConfig,
};

export const ConfigInternals = {
Expand All @@ -761,7 +772,6 @@ export const ConfigInternals = {
getMetadata,
getEntryPoint,
getWebpackPolling,
getShouldOpenBrowser,
getBufferStateDelayInMilliseconds,
getOutputCodecOrUndefined: BrowserSafeApis.getOutputCodecOrUndefined,
};
15 changes: 0 additions & 15 deletions packages/cli/src/config/open-browser.ts

This file was deleted.

40 changes: 8 additions & 32 deletions packages/cli/src/get-cli-options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type {LogLevel} from '@remotion/renderer';
import {RenderInternals} from '@remotion/renderer';
import {BrowserSafeApis} from '@remotion/renderer/client';
import fs from 'node:fs';
import path from 'node:path';
Expand Down Expand Up @@ -56,36 +55,14 @@ export const getCliOptions = (options: {
}) => {
const frameRange = getAndValidateFrameRange(options.logLevel, false);

const shouldOutputImageSequence = options.isStill
? true
: ConfigInternals.getShouldOutputImageSequence(frameRange);

const concurrency = BrowserSafeApis.options.concurrencyOption.getValue({
const imageSequence = BrowserSafeApis.options.imageSequenceOption.getValue({
commandLine: parsedCli,
}).value;

const height = BrowserSafeApis.options.overrideHeightOption.getValue({
commandLine: parsedCli,
}).value;
const width = BrowserSafeApis.options.overrideWidthOption.getValue({
commandLine: parsedCli,
}).value;
const fps = BrowserSafeApis.options.overrideFpsOption.getValue({
commandLine: parsedCli,
}).value;
const durationInFrames =
BrowserSafeApis.options.overrideDurationOption.getValue({
commandLine: parsedCli,
}).value;

RenderInternals.validateConcurrency({
value: concurrency,
setting: 'concurrency',
checkIfValidForCurrentMachine: false,
});
const shouldOutputImageSequence = options.isStill
? true
: imageSequence || typeof frameRange === 'number';

return {
concurrency,
frameRange,
shouldOutputImageSequence,
inputProps: getInputProps(null, options.logLevel),
Expand All @@ -94,11 +71,10 @@ export const getCliOptions = (options: {
options.logLevel,
options.indent,
),
stillFrame: ConfigInternals.getStillFrame(),
stillFrame:
BrowserSafeApis.options.stillFrameOption.getValue({
commandLine: parsedCli,
}).value ?? 0,
ffmpegOverride: ConfigInternals.getFfmpegOverrideFunction(),
height,
width,
fps,
durationInFrames,
};
};
Loading
Loading