Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 18 additions & 5 deletions packages/cli/src/benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ const {
keyboardShortcutsOption,
pixelFormatOption,
browserExecutableOption,
everyNthFrameOption,
proResProfileOption,
userAgentOption,
disableWebSecurityOption,
ignoreCertificateErrorsOption,
} = BrowserSafeApis.options;

const getValidConcurrency = (cliConcurrency: number | string | null) => {
Expand Down Expand Up @@ -202,16 +207,11 @@ export const benchmarkCommand = async (
const {
inputProps,
envVariables,
proResProfile,
frameRange: defaultFrameRange,
everyNthFrame,
ffmpegOverride,
height,
width,
concurrency: unparsedConcurrency,
disableWebSecurity,
userAgent,
ignoreCertificateErrors,
} = getCliOptions({
isStill: false,
logLevel,
Expand All @@ -224,6 +224,19 @@ export const benchmarkCommand = async (
const browserExecutable = browserExecutableOption.getValue({
commandLine: parsedCli,
}).value;
const everyNthFrame = everyNthFrameOption.getValue({
commandLine: parsedCli,
}).value;
const proResProfile = proResProfileOption.getValue({
commandLine: parsedCli,
}).value;
const userAgent = userAgentOption.getValue({commandLine: parsedCli}).value;
const disableWebSecurity = disableWebSecurityOption.getValue({
commandLine: parsedCli,
}).value;
const ignoreCertificateErrors = ignoreCertificateErrorsOption.getValue({
commandLine: parsedCli,
}).value;

Log.verbose(
{indent: false, logLevel},
Expand Down
18 changes: 11 additions & 7 deletions packages/cli/src/compositions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ const {
experimentalClientSideRenderingOption,
keyboardShortcutsOption,
browserExecutableOption,
userAgentOption,
disableWebSecurityOption,
ignoreCertificateErrorsOption,
} = BrowserSafeApis.options;

export const listCompositionsCommand = async (
Expand Down Expand Up @@ -68,13 +71,7 @@ export const listCompositionsCommand = async (
reason,
);

const {
envVariables,
inputProps,
ignoreCertificateErrors,
userAgent,
disableWebSecurity,
} = getCliOptions({
const {envVariables, inputProps} = getCliOptions({
isStill: false,
logLevel,
indent: false,
Expand All @@ -83,6 +80,13 @@ export const listCompositionsCommand = async (
const browserExecutable = browserExecutableOption.getValue({
commandLine: parsedCli,
}).value;
const userAgent = userAgentOption.getValue({commandLine: parsedCli}).value;
const disableWebSecurity = disableWebSecurityOption.getValue({
commandLine: parsedCli,
}).value;
const ignoreCertificateErrors = ignoreCertificateErrorsOption.getValue({
commandLine: parsedCli,
}).value;
const publicPath = publicPathOption.getValue({commandLine: parsedCli}).value;
const timeoutInMilliseconds = delayRenderTimeoutInMillisecondsOption.getValue(
{
Expand Down
13 changes: 0 additions & 13 deletions packages/cli/src/config/browser-executable.ts

This file was deleted.

9 changes: 0 additions & 9 deletions packages/cli/src/config/every-nth-frame.ts

This file was deleted.

36 changes: 12 additions & 24 deletions packages/cli/src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {getBrowser} from './browser';
import {
getChromiumDisableWebSecurity,
getIgnoreCertificateErrors,
} from './chromium-flags';
import {getConcurrency} from './concurrency';
import {getDotEnvLocation} from './env-file';
import {getRange, setFrameRangeFromCli} from './frame-range';
Expand All @@ -17,7 +13,6 @@ import {
getRendererPortFromConfigFileAndCliFlag,
getStudioPort,
} from './preview-server';
import {getProResProfile} from './prores-profile';
import {getStillFrame, setStillFrame} from './still-frame';
import {getWebpackCaching} from './webpack-caching';

Expand All @@ -41,15 +36,9 @@ import {
getBufferStateDelayInMilliseconds,
setBufferStateDelayInMilliseconds,
} from './buffer-state-delay-in-milliseconds';
import {
setChromiumDisableWebSecurity,
setChromiumIgnoreCertificateErrors,
} from './chromium-flags';
import type {Concurrency} from './concurrency';
import {setConcurrency} from './concurrency';
import {getEntryPoint, setEntryPoint} from './entry-point';
import {setDotEnvLocation} from './env-file';
import {getEveryNthFrame, setEveryNthFrame} from './every-nth-frame';
import {
getFfmpegOverrideFunction,
setFfmpegOverrideFunction,
Expand All @@ -63,8 +52,6 @@ import {setOutputLocation} from './output-location';
import type {WebpackOverrideFn} from './override-webpack';
import {overrideWebpackConfig} from './override-webpack';
import {setPort, setRendererPort, setStudioPort} from './preview-server';
import {setProResProfile} from './prores-profile';
import {getChromiumUserAgent, setChromiumUserAgent} from './user-agent';
import {setWebpackCaching} from './webpack-caching';
import {
getWebpackPolling,
Expand All @@ -75,6 +62,7 @@ import {getWidth, overrideWidth} from './width';
export type {Concurrency, WebpackConfiguration, WebpackOverrideFn};

const {
concurrencyOption,
offthreadVideoCacheSizeInBytesOption,
x264Option,
audioBitrateOption,
Expand Down Expand Up @@ -122,8 +110,13 @@ const {
ipv4Option,
pixelFormatOption,
browserExecutableOption,
everyNthFrameOption,
proResProfileOption,
stillImageFormatOption,
videoImageFormatOption,
userAgentOption,
disableWebSecurityOption,
ignoreCertificateErrorsOption,
} = BrowserSafeApis.options;

declare global {
Expand Down Expand Up @@ -665,13 +658,13 @@ export const Config: FlatConfig = {
setTimeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption.setConfig,
setDelayRenderTimeoutInMilliseconds:
delayRenderTimeoutInMillisecondsOption.setConfig,
setChromiumDisableWebSecurity,
setChromiumIgnoreCertificateErrors,
setChromiumDisableWebSecurity: disableWebSecurityOption.setConfig,
setChromiumIgnoreCertificateErrors: ignoreCertificateErrorsOption.setConfig,
setChromiumHeadlessMode: headlessOption.setConfig,
setChromiumOpenGlRenderer: glOption.setConfig,
setChromiumUserAgent,
setChromiumUserAgent: userAgentOption.setConfig,
setDotEnvLocation,
setConcurrency,
setConcurrency: concurrencyOption.setConfig,
setChromiumMultiProcessOnLinux: enableMultiprocessOnLinuxOption.setConfig,
setChromiumDarkMode: darkModeOption.setConfig,
setQuality: () => {
Expand All @@ -692,7 +685,7 @@ export const Config: FlatConfig = {
setEncodingBufferSize: encodingBufferSizeOption.setConfig,
setFrameRange,
setScale: scaleOption.setConfig,
setEveryNthFrame,
setEveryNthFrame: everyNthFrameOption.setConfig,
setNumberOfGifLoops: numberOfGifLoopsOption.setConfig,
setMuted: mutedOption.setConfig,
setEnforceAudioTrack: enforceAudioOption.setConfig,
Expand All @@ -703,7 +696,7 @@ export const Config: FlatConfig = {
setCodec: videoCodecOption.setConfig,
setCrf: crfOption.setConfig,
setImageSequence,
setProResProfile,
setProResProfile: proResProfileOption.setConfig,
setX264Preset: x264Option.setConfig,
setAudioBitrate: audioBitrateOption.setConfig,
setVideoBitrate: videoBitrateOption.setConfig,
Expand Down Expand Up @@ -738,13 +731,9 @@ export const Config: FlatConfig = {
export const ConfigInternals = {
getRange,
getBrowser,
getProResProfile,
getStudioPort,
getRendererPortFromConfigFile,
getRendererPortFromConfigFileAndCliFlag,
getChromiumDisableWebSecurity,
getIgnoreCertificateErrors,
getEveryNthFrame,
getConcurrency,
getStillFrame,
getShouldOutputImageSequence,
Expand All @@ -763,7 +752,6 @@ export const ConfigInternals = {
getEntryPoint,
getWebpackPolling,
getShouldOpenBrowser,
getChromiumUserAgent,
getBufferStateDelayInMilliseconds,
getOutputCodecOrUndefined: BrowserSafeApis.getOutputCodecOrUndefined,
};
16 changes: 0 additions & 16 deletions packages/cli/src/config/pixel-format.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/cli/src/config/prores-profile.ts

This file was deleted.

25 changes: 5 additions & 20 deletions packages/cli/src/get-cli-options.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
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';
import {ConfigInternals} from './config';
import {getEnvironmentVariables} from './get-env';
import {getInputProps} from './get-input-props';
import {Log} from './log';
import {parsedCli} from './parsed-cli';

const getAndValidateFrameRange = (logLevel: LogLevel, indent: boolean) => {
const frameRange = ConfigInternals.getRange();
Expand Down Expand Up @@ -47,12 +49,6 @@ export const getAndValidateAbsoluteOutputFile = (
return absoluteOutputFile;
};

const getProResProfile = () => {
const proResProfile = ConfigInternals.getProResProfile();

return proResProfile;
};

export const getCliOptions = (options: {
isStill: boolean;
logLevel: LogLevel;
Expand All @@ -64,15 +60,9 @@ export const getCliOptions = (options: {
? true
: ConfigInternals.getShouldOutputImageSequence(frameRange);

const proResProfile = getProResProfile();

const disableWebSecurity = ConfigInternals.getChromiumDisableWebSecurity();
const ignoreCertificateErrors = ConfigInternals.getIgnoreCertificateErrors();
const userAgent = ConfigInternals.getChromiumUserAgent();

const everyNthFrame = ConfigInternals.getEveryNthFrame();

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

const height = ConfigInternals.getHeight();
const width = ConfigInternals.getWidth();
Expand All @@ -93,12 +83,7 @@ export const getCliOptions = (options: {
options.logLevel,
options.indent,
),
proResProfile,
everyNthFrame,
stillFrame: ConfigInternals.getStillFrame(),
userAgent,
disableWebSecurity,
ignoreCertificateErrors,
ffmpegOverride: ConfigInternals.getFfmpegOverrideFunction(),
height,
width,
Expand Down
25 changes: 19 additions & 6 deletions packages/cli/src/get-render-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const {
x264Option,
audioBitrateOption,
offthreadVideoCacheSizeInBytesOption,
concurrencyOption,
offthreadVideoThreadsOption,
scaleOption,
jpegQualityOption,
Expand All @@ -32,6 +33,11 @@ const {
mediaCacheSizeInBytesOption,
darkModeOption,
pixelFormatOption,
everyNthFrameOption,
proResProfileOption,
userAgentOption,
disableWebSecurityOption,
ignoreCertificateErrorsOption,
publicLicenseKeyOption,
stillImageFormatOption,
videoImageFormatOption,
Expand All @@ -44,12 +50,13 @@ export const getRenderDefaults = (): RenderDefaults => {
const logLevel = logLevelOption.getValue({commandLine: parsedCli}).value;
const defaultCodec = ConfigInternals.getOutputCodecOrUndefined();
const concurrency = RenderInternals.resolveConcurrency(
ConfigInternals.getConcurrency(),
concurrencyOption.getValue({commandLine: parsedCli}).value,
);
const pixelFormat = pixelFormatOption.getValue({
commandLine: parsedCli,
}).value;
const proResProfile = ConfigInternals.getProResProfile() ?? null;
const proResProfile =
proResProfileOption.getValue({commandLine: parsedCli}).value ?? null;

const x264Preset = x264Option.getValue({
commandLine: parsedCli,
Expand Down Expand Up @@ -126,19 +133,25 @@ export const getRenderDefaults = (): RenderDefaults => {
commandLine: parsedCli,
}).value;

const everyNthFrame = ConfigInternals.getEveryNthFrame();
const everyNthFrame = everyNthFrameOption.getValue({
commandLine: parsedCli,
}).value;
const stillImageFormat = stillImageFormatOption.getValue({
commandLine: parsedCli,
}).value;
const videoImageFormat = videoImageFormatOption.getValue({
commandLine: parsedCli,
}).value;
const disableWebSecurity = ConfigInternals.getChromiumDisableWebSecurity();
const ignoreCertificateErrors = ConfigInternals.getIgnoreCertificateErrors();
const disableWebSecurity = disableWebSecurityOption.getValue({
commandLine: parsedCli,
}).value;
const ignoreCertificateErrors = ignoreCertificateErrorsOption.getValue({
commandLine: parsedCli,
}).value;
const darkMode = darkModeOption.getValue({
commandLine: parsedCli,
}).value;
const userAgent = ConfigInternals.getChromiumUserAgent();
const userAgent = userAgentOption.getValue({commandLine: parsedCli}).value;
const metadata = ConfigInternals.getMetadata();
const outputLocation = ConfigInternals.getOutputLocation();

Expand Down
Loading
Loading