🎥 Make videos programmatically with React
Migrate `--every-nth-frame` and `--prores-profile` to options system
Jonny Burger6b3d8370a789
diff --git a/packages/cli/src/benchmark.ts b/packages/cli/src/benchmark.tsindex 5f27032ff2..044962d0c3 100644--- a/packages/cli/src/benchmark.ts+++ b/packages/cli/src/benchmark.ts@@ -62,6 +62,8 @@ const {keyboardShortcutsOption,pixelFormatOption,browserExecutableOption,+ everyNthFrameOption,+ proResProfileOption,} = BrowserSafeApis.options;const getValidConcurrency = (cliConcurrency: number | string | null) => {@@ -202,9 +204,7 @@ export const benchmarkCommand = async (const {inputProps,envVariables,- proResProfile,frameRange: defaultFrameRange,- everyNthFrame,ffmpegOverride,height,width,@@ -224,6 +224,12 @@ 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;Log.verbose({indent: false, logLevel},diff --git a/packages/cli/src/config/browser-executable.ts b/packages/cli/src/config/browser-executable.tsdeleted file mode 100644index f5a3c79602..0000000000--- a/packages/cli/src/config/browser-executable.ts+++ /dev/null@@ -1,13 +0,0 @@-import type {BrowserExecutable} from '@remotion/renderer';--let currentBrowserExecutablePath: BrowserExecutable = null;--export const setBrowserExecutable = (- newBrowserExecutablePath: BrowserExecutable,-) => {- currentBrowserExecutablePath = newBrowserExecutablePath;-};--export const getBrowserExecutable = () => {- return currentBrowserExecutablePath;-};diff --git a/packages/cli/src/config/every-nth-frame.ts b/packages/cli/src/config/every-nth-frame.tsdeleted file mode 100644index 8002d50a5e..0000000000--- a/packages/cli/src/config/every-nth-frame.ts+++ /dev/null@@ -1,9 +0,0 @@-let everyNthFrame = 1;--export const setEveryNthFrame = (frame: number) => {- everyNthFrame = frame;-};--export const getEveryNthFrame = () => {- return everyNthFrame;-};diff --git a/packages/cli/src/config/index.ts b/packages/cli/src/config/index.tsindex 4bd93e4720..1b269b7810 100644--- a/packages/cli/src/config/index.ts+++ b/packages/cli/src/config/index.ts@@ -17,7 +17,6 @@ import {getRendererPortFromConfigFileAndCliFlag,getStudioPort,} from './preview-server';-import {getProResProfile} from './prores-profile';import {getStillFrame, setStillFrame} from './still-frame';import {getWebpackCaching} from './webpack-caching';@@ -49,7 +48,6 @@ 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,@@ -63,7 +61,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 {@@ -122,6 +119,8 @@ const {ipv4Option,pixelFormatOption,browserExecutableOption,+ everyNthFrameOption,+ proResProfileOption,stillImageFormatOption,videoImageFormatOption,} = BrowserSafeApis.options;@@ -692,7 +691,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,@@ -703,7 +702,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,@@ -738,13 +737,11 @@ export const Config: FlatConfig = {export const ConfigInternals = {getRange,getBrowser,- getProResProfile,getStudioPort,getRendererPortFromConfigFile,getRendererPortFromConfigFileAndCliFlag,getChromiumDisableWebSecurity,getIgnoreCertificateErrors,- getEveryNthFrame,getConcurrency,getStillFrame,getShouldOutputImageSequence,diff --git a/packages/cli/src/config/pixel-format.ts b/packages/cli/src/config/pixel-format.tsdeleted file mode 100644index 8587bf12d5..0000000000--- a/packages/cli/src/config/pixel-format.ts+++ /dev/null@@ -1,16 +0,0 @@-import type {PixelFormat} from '@remotion/renderer';-import {RenderInternals} from '@remotion/renderer';--let currentPixelFormat: PixelFormat = RenderInternals.DEFAULT_PIXEL_FORMAT;--export const setPixelFormat = (format: PixelFormat) => {- if (!RenderInternals.validPixelFormats.includes(format)) {- throw new TypeError(`Value ${format} is not valid as a pixel format.`);- }-- currentPixelFormat = format;-};--export const getPixelFormat = () => {- return currentPixelFormat;-};diff --git a/packages/cli/src/config/prores-profile.ts b/packages/cli/src/config/prores-profile.tsdeleted file mode 100644index 63dfdc817d..0000000000--- a/packages/cli/src/config/prores-profile.ts+++ /dev/null@@ -1,15 +0,0 @@-import type {_InternalTypes} from 'remotion';--let proResProfile: _InternalTypes['ProResProfile'] | undefined;--export const getProResProfile = ():- | _InternalTypes['ProResProfile']- | undefined => {- return proResProfile;-};--export const setProResProfile = (- profile: _InternalTypes['ProResProfile'] | undefined,-) => {- proResProfile = profile;-};diff --git a/packages/cli/src/get-cli-options.ts b/packages/cli/src/get-cli-options.tsindex 6e54d4e276..30049fa1a2 100644--- a/packages/cli/src/get-cli-options.ts+++ b/packages/cli/src/get-cli-options.ts@@ -47,12 +47,6 @@ export const getAndValidateAbsoluteOutputFile = (return absoluteOutputFile;};-const getProResProfile = () => {- const proResProfile = ConfigInternals.getProResProfile();-- return proResProfile;-};-export const getCliOptions = (options: {isStill: boolean;logLevel: LogLevel;@@ -64,14 +58,10 @@ 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 height = ConfigInternals.getHeight();@@ -93,8 +83,6 @@ export const getCliOptions = (options: {options.logLevel,options.indent,),- proResProfile,- everyNthFrame,stillFrame: ConfigInternals.getStillFrame(),userAgent,disableWebSecurity,diff --git a/packages/cli/src/get-render-defaults.ts b/packages/cli/src/get-render-defaults.tsindex 1283dae671..992c240108 100644--- a/packages/cli/src/get-render-defaults.ts+++ b/packages/cli/src/get-render-defaults.ts@@ -32,6 +32,8 @@ const {mediaCacheSizeInBytesOption,darkModeOption,pixelFormatOption,+ everyNthFrameOption,+ proResProfileOption,publicLicenseKeyOption,stillImageFormatOption,videoImageFormatOption,@@ -49,7 +51,8 @@ export const getRenderDefaults = (): RenderDefaults => {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,@@ -126,7 +129,9 @@ 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;diff --git a/packages/cli/src/parse-command-line.ts b/packages/cli/src/parse-command-line.tsindex 9223bbd815..5edeb55f58 100644--- a/packages/cli/src/parse-command-line.ts+++ b/packages/cli/src/parse-command-line.ts@@ -7,9 +7,7 @@ import type {} from '@remotion/renderer';import type {TypeOfOption} from '@remotion/renderer/client';import {BrowserSafeApis} from '@remotion/renderer/client';-import type {_InternalTypes} from 'remotion';import {Config, ConfigInternals} from './config';-import {Log} from './log';import {parsedCli} from './parsed-cli';const {@@ -38,6 +36,8 @@ const {ipv4Option,pixelFormatOption,browserExecutableOption,+ everyNthFrameOption,+ proResProfileOption,} = BrowserSafeApis.options;export type CommandLineOptions = {@@ -46,14 +46,14 @@ export type CommandLineOptions = {>;[pixelFormatOption.cliFlag]: TypeOfOption<typeof pixelFormatOption>;['image-format']: VideoImageFormat | StillImageFormat;- ['prores-profile']: _InternalTypes['ProResProfile'];+ [proResProfileOption.cliFlag]: TypeOfOption<typeof proResProfileOption>;[x264Option.cliFlag]: TypeOfOption<typeof x264Option>;['bundle-cache']: string;['env-file']: string;['ignore-certificate-errors']: string;[darkModeOption.cliFlag]: TypeOfOption<typeof darkModeOption>;['disable-web-security']: string;- ['every-nth-frame']: number;+ [everyNthFrameOption.cliFlag]: TypeOfOption<typeof everyNthFrameOption>;[numberOfGifLoopsOption.cliFlag]: TypeOfOption<typeof numberOfGifLoopsOption>;[numberOfSharedAudioTagsOption.cliFlag]: TypeOfOption<typeof numberOfSharedAudioTagsOption@@ -179,16 +179,6 @@ export const parseCommandLine = () => {Config.setImageSequence(true);}- if (parsedCli['every-nth-frame']) {- Config.setEveryNthFrame(parsedCli['every-nth-frame']);- }-- if (parsedCli['prores-profile']) {- Config.setProResProfile(- String(parsedCli['prores-profile']) as _InternalTypes['ProResProfile'],- );- }-if (parsedCli['license-key'] &&parsedCli['license-key'].startsWith('rm_pub_')@@ -200,27 +190,6 @@ export const parseCommandLine = () => {Config.setPublicLicenseKey(parsedCli['public-license-key']);}- if (typeof parsedCli.quality !== 'undefined') {- Log.warn(- {indent: false, logLevel: 'info'},- 'The --quality flag has been renamed to --jpeg-quality instead.',- );- Config.setJpegQuality(parsedCli.quality);- }-- if (typeof parsedCli.scale !== 'undefined') {- Config.setScale(parsedCli.scale);- }-- if (- typeof parsedCli['enable-experimental-client-side-rendering'] !==- 'undefined'- ) {- Config.setExperimentalClientSideRenderingEnabled(- parsedCli['enable-experimental-client-side-rendering'],- );- }-if (typeof parsedCli['webpack-poll'] !== 'undefined') {Config.setWebpackPollingInMilliseconds(parsedCli['webpack-poll']);}diff --git a/packages/cli/src/render.tsx b/packages/cli/src/render.tsxindex a76148e526..d2842eb3ab 100644--- a/packages/cli/src/render.tsx+++ b/packages/cli/src/render.tsx@@ -50,6 +50,8 @@ const {keyboardShortcutsOption,pixelFormatOption,browserExecutableOption,+ everyNthFrameOption,+ proResProfileOption,} = BrowserSafeApis.options;export const render = async (@@ -95,14 +97,12 @@ export const render = async (shouldOutputImageSequence,inputProps,envVariables,- everyNthFrame,userAgent,disableWebSecurity,ignoreCertificateErrors,height,width,ffmpegOverride,- proResProfile,} = getCliOptions({isStill: false,logLevel,@@ -115,6 +115,12 @@ export const render = async (const browserExecutable = browserExecutableOption.getValue({commandLine: parsedCli,}).value;+ const everyNthFrame = everyNthFrameOption.getValue({+ commandLine: parsedCli,+ }).value;+ const proResProfile = proResProfileOption.getValue({+ commandLine: parsedCli,+ }).value;const x264Preset = x264Option.getValue({commandLine: parsedCli}).value;const audioBitrate = audioBitrateOption.getValue({commandLine: parsedCli,diff --git a/packages/cloudrun/src/cli/commands/render/index.ts b/packages/cloudrun/src/cli/commands/render/index.tsindex 395d9d2fb5..83439871ea 100644--- a/packages/cloudrun/src/cli/commands/render/index.ts+++ b/packages/cloudrun/src/cli/commands/render/index.ts@@ -40,6 +40,8 @@ const {darkModeOption,pixelFormatOption,browserExecutableOption,+ everyNthFrameOption,+ proResProfileOption,} = BrowserSafeApis.options;export const renderCommand = async (@@ -83,8 +85,6 @@ export const renderCommand = async (envVariables,frameRange,inputProps,- proResProfile,- everyNthFrame,height,width,disableWebSecurity,@@ -102,6 +102,12 @@ export const renderCommand = async (const browserExecutable = browserExecutableOption.getValue({commandLine: CliInternals.parsedCli,}).value;+ const everyNthFrame = everyNthFrameOption.getValue({+ commandLine: CliInternals.parsedCli,+ }).value;+ const proResProfile = proResProfileOption.getValue({+ commandLine: CliInternals.parsedCli,+ }).value;const offthreadVideoCacheSizeInBytes =offthreadVideoCacheSizeInBytesOption.getValue({commandLine: CliInternals.parsedCli,diff --git a/packages/docs/docs/cli/render.mdx b/packages/docs/docs/cli/render.mdxindex 77a4cc4d36..8d1b1c4aa0 100644--- a/packages/docs/docs/cli/render.mdx+++ b/packages/docs/docs/cli/render.mdx@@ -116,7 +116,7 @@ Sets the output file path, as an alternative to the `output-location` positional### `--prores-profile`<AvailableFrom v="2.1.6" />-[Set the ProRes profile](/docs/config#setproresprofile). This option is only valid if the [`codec`](#--codec) has been set to `prores`. Possible values: `4444-xq`, `4444`, `hq`, `standard`, `light`, `proxy`. See [here](https://video.stackexchange.com/a/14715) for explanation of possible values. Default: `hq`.+<Options id="prores-profile" />### `--x264-preset`<AvailableFrom v="4.2.2" />@@ -148,7 +148,7 @@ If you enable [hardware acceleration](/docs/hardware-acceleration), you cannot s### `--every-nth-frame`<AvailableFrom v="3.1.0" />-[Render only every nth frame.](/docs/config#seteverynthframe) This option may only be set when rendering GIFs. This allows you to lower the FPS of the GIF.+<Options id="every-nth-frame" />For example only every second frame, every third frame and so on. Only works for rendering GIFs. [See here for more details.](/docs/render-as-gif#reducing-frame-rate)diff --git a/packages/docs/docs/cloudrun/cli/render.mdx b/packages/docs/docs/cloudrun/cli/render.mdxindex ad6a27ecc1..9965b9561d 100644--- a/packages/docs/docs/cloudrun/cli/render.mdx+++ b/packages/docs/docs/cloudrun/cli/render.mdx@@ -163,7 +163,7 @@ You will be responsible for ensuring that the render ID is unique, otherwise it### `--prores-profile`-[Set the ProRes profile](/docs/config#setproresprofile). This option is only valid if the [`codec`](#--codec) has been set to `prores`. Possible values: `4444-xq`, `4444`, `hq`, `standard`, `light`, `proxy`. See [here](https://video.stackexchange.com/a/14715) for explanation of possible values. Default: `hq`.+<Options id="prores-profile" />### `--x264-preset`@@ -179,7 +179,7 @@ You will be responsible for ensuring that the render ID is unique, otherwise it### `--every-nth-frame`-[Render only every nth frame.](/docs/config#seteverynthframe) This option may only be set when rendering GIFs. This allows you to lower the FPS of the GIF.+<Options id="every-nth-frame" />For example only every second frame, every third frame and so on. Only works for rendering GIFs. [See here for more details.](/docs/render-as-gif)diff --git a/packages/docs/docs/config.mdx b/packages/docs/docs/config.mdxindex f36e664acf..c1816de003 100644--- a/packages/docs/docs/config.mdx+++ b/packages/docs/docs/config.mdx@@ -467,9 +467,7 @@ The [command line flag](/docs/cli/render#--env-file) `--env-file` will take prec## `setEveryNthFrame()`-This option may only be set when rendering GIFs. [It determines how many frames are rendered, while the other ones gets skipped in order to lower the FPS of the GIF.](/docs/render-as-gif)--For example, if the `fps` is 30, and `everyNthFrame` is 2, the FPS of the GIF is `15`.+<Options id="every-nth-frame" />```ts twoslash title="remotion.config.ts"import {Config} from '@remotion/cli/config';@@ -573,10 +571,7 @@ Refer to the [Encoding guide](/docs/encoding) to see defaults and supported comb## `setProResProfile()`<AvailableFrom v="2.1.6" />-Set the ProRes profile. This option is only valid if the codec has been set to `prores`.-Possible values: `4444-xq`, `4444`, `hq`, `standard`, `light`, `proxy`.-See [here](https://video.stackexchange.com/a/14715) for explanation of possible values.-Default: `hq`+<Options id="prores-profile" />```ts twoslash title="remotion.config.ts"import {Config} from '@remotion/cli/config';diff --git a/packages/docs/docs/lambda/cli/render.mdx b/packages/docs/docs/lambda/cli/render.mdxindex 9b41b953d9..eddc8ed12f 100644--- a/packages/docs/docs/lambda/cli/render.mdx+++ b/packages/docs/docs/lambda/cli/render.mdx@@ -162,7 +162,7 @@ Renamed to `jpegQuality` in `v4.0.0`.### `--prores-profile`-[Set the ProRes profile](/docs/config#setproresprofile). This option is only valid if the [`codec`](#--codec) has been set to `prores`. Possible values: `4444-xq`, `4444`, `hq`, `standard`, `light`, `proxy`. See [here](https://video.stackexchange.com/a/14715) for explanation of possible values. Default: `hq`.+<Options id="prores-profile" />### `--x264-preset`@@ -194,7 +194,7 @@ Specify a location for a dotenv file - Default `.env`. [Read about how environme### `--every-nth-frame`<AvailableFrom v="3.1.0" />-[Render only every nth frame.](/docs/config#seteverynthframe) This option may only be set when rendering GIFs. This allows you to lower the FPS of the GIF.+<Options id="every-nth-frame" />For example only every second frame, every third frame and so on. Only works for rendering GIFs. [See here for more details.](/docs/render-as-gif)diff --git a/packages/example/remotion.config.ts b/packages/example/remotion.config.tsindex 912bffef8b..56b0ff0906 100644--- a/packages/example/remotion.config.ts+++ b/packages/example/remotion.config.ts@@ -8,5 +8,3 @@ Config.overrideWebpackConfig(async (config) => {});return webpackOverride(config);});--Config.setExperimentalClientSideRenderingEnabled(true);diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.tsindex 2922e30398..a7d7153e0e 100644--- a/packages/lambda/src/cli/commands/render/render.ts+++ b/packages/lambda/src/cli/commands/render/render.ts@@ -58,6 +58,8 @@ const {darkModeOption,pixelFormatOption,browserExecutableOption,+ everyNthFrameOption,+ proResProfileOption,} = BrowserSafeApis.options;export const renderCommand = async ({@@ -92,8 +94,6 @@ export const renderCommand = async ({envVariables,frameRange,inputProps,- proResProfile,- everyNthFrame,height,width,ignoreCertificateErrors,@@ -111,6 +111,12 @@ export const renderCommand = async ({const browserExecutable = browserExecutableOption.getValue({commandLine: CliInternals.parsedCli,}).value;+ const everyNthFrame = everyNthFrameOption.getValue({+ commandLine: CliInternals.parsedCli,+ }).value;+ const proResProfile = proResProfileOption.getValue({+ commandLine: CliInternals.parsedCli,+ }).value;const x264Preset = x264Option.getValue({commandLine: CliInternals.parsedCli,}).value;diff --git a/packages/renderer/src/client.ts b/packages/renderer/src/client.tsindex 7379e62551..3737bd2754 100644--- a/packages/renderer/src/client.ts+++ b/packages/renderer/src/client.ts@@ -36,6 +36,7 @@ import {import {validateOutputFilename} from './validate-output-filename';export {AvailableOptions, TypeOfOption} from './options';export {HardwareAccelerationOption} from './options/hardware-acceleration';+export {ProResProfile} from './options/prores-profile';export const BrowserSafeApis = {getFileExtensionFromCodec,diff --git a/packages/renderer/src/options/every-nth-frame.tsx b/packages/renderer/src/options/every-nth-frame.tsxnew file mode 100644index 0000000000..9670e43363--- /dev/null+++ b/packages/renderer/src/options/every-nth-frame.tsx@@ -0,0 +1,47 @@+import type {AnyRemotionOption} from './option';++const DEFAULT_EVERY_NTH_FRAME = 1;++let everyNthFrame = DEFAULT_EVERY_NTH_FRAME;++const cliFlag = 'every-nth-frame' as const;++export const everyNthFrameOption = {+ name: 'Every nth frame',+ cliFlag,+ description: () => (+ <>+ This option may only be set when rendering GIFs. It determines how many+ frames are rendered, while the other ones get skipped in order to lower+ the FPS of the GIF. For example, if the <code>fps</code> is 30, and{' '}+ <code>everyNthFrame</code> is 2, the FPS of the GIF is <code>15</code>.+ </>+ ),+ ssrName: 'everyNthFrame' as const,+ docLink: 'https://www.remotion.dev/docs/config#seteverynthframe',+ type: DEFAULT_EVERY_NTH_FRAME as number,+ getValue: ({commandLine}) => {+ if (commandLine[cliFlag] !== undefined) {+ return {+ source: 'cli',+ value: commandLine[cliFlag] as number,+ };+ }++ if (everyNthFrame !== DEFAULT_EVERY_NTH_FRAME) {+ return {+ source: 'config',+ value: everyNthFrame,+ };+ }++ return {+ source: 'default',+ value: DEFAULT_EVERY_NTH_FRAME,+ };+ },+ setConfig: (value) => {+ everyNthFrame = value;+ },+ id: cliFlag,+} satisfies AnyRemotionOption<number>;diff --git a/packages/renderer/src/options/index.tsx b/packages/renderer/src/options/index.tsxindex cae1339aa9..cc0d038d37 100644--- a/packages/renderer/src/options/index.tsx+++ b/packages/renderer/src/options/index.tsx@@ -18,6 +18,7 @@ import {enableMultiprocessOnLinuxOption} from './enable-multiprocess-on-linux';import {encodingBufferSizeOption} from './encoding-buffer-size';import {encodingMaxRateOption} from './encoding-max-rate';import {enforceAudioOption} from './enforce-audio';+import {everyNthFrameOption} from './every-nth-frame';import {experimentalClientSideRenderingOption} from './experimental-client-side-rendering';import {folderExpiryOption} from './folder-expiry';import {forSeamlessAacConcatenationOption} from './for-seamless-aac-concatenation';@@ -44,6 +45,7 @@ import type {AnyRemotionOption} from './option';import {overwriteOption} from './overwrite';import {pixelFormatOption} from './pixel-format';import {preferLosslessAudioOption} from './prefer-lossless';+import {proResProfileOption} from './prores-profile';import {publicDirOption} from './public-dir';import {publicLicenseKeyOption} from './public-license-key';import {publicPathOption} from './public-path';@@ -69,6 +71,7 @@ export const allOptions = {videoBitrateOption,audioBitrateOption,enforceAudioOption,+ everyNthFrameOption,mutedOption,videoCodecOption,offthreadVideoCacheSizeInBytesOption,@@ -88,6 +91,7 @@ export const allOptions = {reproOption,pixelFormatOption,preferLosslessOption: preferLosslessAudioOption,+ proResProfileOption,x264Option,logLevelOption,delayRenderTimeoutInMillisecondsOption,diff --git a/packages/renderer/src/options/prores-profile.tsx b/packages/renderer/src/options/prores-profile.tsxnew file mode 100644index 0000000000..0a57be5a27--- /dev/null+++ b/packages/renderer/src/options/prores-profile.tsx@@ -0,0 +1,64 @@+import type {AnyRemotionOption} from './option';++export type ProResProfile =+ | '4444-xq'+ | '4444'+ | 'hq'+ | 'standard'+ | 'light'+ | 'proxy';++const validProResProfiles: ProResProfile[] = [+ '4444-xq',+ '4444',+ 'hq',+ 'standard',+ 'light',+ 'proxy',+];++let proResProfile: ProResProfile | undefined;++const cliFlag = 'prores-profile' as const;++export const proResProfileOption = {+ name: 'ProRes profile',+ cliFlag,+ description: () => (+ <>+ Set the ProRes profile. This option is only valid if the codec has been+ set to <code>prores</code>. Possible values:{' '}+ {validProResProfiles.map((p) => `"${p}"`).join(', ')}. Default:{' '}+ <code>"hq"</code>. See{' '}+ <a href="https://video.stackexchange.com/a/14715">here</a> for an+ explanation of possible values.+ </>+ ),+ ssrName: 'proResProfile' as const,+ docLink: 'https://www.remotion.dev/docs/config#setproresprofile',+ type: undefined as ProResProfile | undefined,+ getValue: ({commandLine}) => {+ if (commandLine[cliFlag] !== undefined) {+ return {+ source: 'cli',+ value: String(commandLine[cliFlag]) as ProResProfile,+ };+ }++ if (proResProfile !== undefined) {+ return {+ source: 'config',+ value: proResProfile,+ };+ }++ return {+ source: 'default',+ value: undefined,+ };+ },+ setConfig: (value) => {+ proResProfile = value;+ },+ id: cliFlag,+} satisfies AnyRemotionOption<ProResProfile | undefined>;