Skip to content

🎥 Make videos programmatically with React

cool

Jonny Burger9cb8c121e45c
diff --git a/packages/cli/src/parse-command-line.ts b/packages/cli/src/parse-command-line.ts
index 45ffe501b5..056c586734 100644
--- a/packages/cli/src/parse-command-line.ts
+++ b/packages/cli/src/parse-command-line.ts
@@ -41,8 +41,10 @@ type CommandLineOptions = {
['public-dir']: string;
['audio-bitrate']: string;
['video-bitrate']: string;
- ['buf-size']: string;
- ['max-rate']: string;
+ [BrowserSafeApis.options.encodingBufferSizeOption
+ .cliFlag]: typeof BrowserSafeApis.options.encodingBufferSizeOption.type;
+ [BrowserSafeApis.options.encodingMaxRateOption
+ .cliFlag]: typeof BrowserSafeApis.options.encodingMaxRateOption.type;
['audio-codec']: AudioCodec;
crf: number;
force: boolean;
@@ -265,8 +267,8 @@ export const parseCommandLine = () => {
Config.setVideoBitrate(parsedCli['video-bitrate']);
}
- if (typeof parsedCli['buf-size'] !== 'undefined') {
- Config.setEncodingBufferSize(parsedCli['buf-size']);
+ if (typeof parsedCli['buffer-size'] !== 'undefined') {
+ Config.setEncodingBufferSize(parsedCli['buffer-size']);
}
if (typeof parsedCli['max-rate'] !== 'undefined') {
diff --git a/packages/renderer/src/options/encoding-buffer-size.tsx b/packages/renderer/src/options/encoding-buffer-size.tsx
new file mode 100644
index 0000000000..372c27b502
--- /dev/null
+++ b/packages/renderer/src/options/encoding-buffer-size.tsx
@@ -0,0 +1,16 @@
+import type {AnyRemotionOption} from './option';
+
+export const encodingBufferSizeOption = {
+ name: 'FFmpeg -bufsize flag',
+ cliFlag: 'buffer-size' as const,
+ description: () => (
+ <>
+ The value for the <code>-bufsize</code> flag of FFmpeg. Should be used in
+ conjunction with the encoding max rate flag.
+ </>
+ ),
+ ssrName: 'encodingBufferSize' as const,
+ docLink:
+ 'https://www.remotion.dev/docs/renderer/render-media#encodingbuffersize',
+ type: '' as string | null,
+} satisfies AnyRemotionOption;
diff --git a/packages/renderer/src/options/encoding-max-rate.tsx b/packages/renderer/src/options/encoding-max-rate.tsx
new file mode 100644
index 0000000000..445e89609d
--- /dev/null
+++ b/packages/renderer/src/options/encoding-max-rate.tsx
@@ -0,0 +1,16 @@
+import type {AnyRemotionOption} from './option';
+
+export const encodingMaxRateOption = {
+ name: 'FFmpeg -maxrate flag',
+ cliFlag: 'max-rate' as const,
+ description: () => (
+ <>
+ The value for the <code>-maxrate</code> flag of FFmpeg. Should be used in
+ conjunction with the encoding buffer size flag.
+ </>
+ ),
+ ssrName: 'encodingMaxRate' as const,
+ docLink:
+ 'https://www.remotion.dev/docs/renderer/render-media#encodingmaxrate',
+ type: '' as string | null,
+} satisfies AnyRemotionOption;
diff --git a/packages/renderer/src/options/index.tsx b/packages/renderer/src/options/index.tsx
index 7b791e88ab..33241f7dad 100644
--- a/packages/renderer/src/options/index.tsx
+++ b/packages/renderer/src/options/index.tsx
@@ -4,6 +4,8 @@ import {crfOption} from './crf';
import {deleteAfterOption} from './delete-after';
import {enableLambdaInsights} from './enable-lambda-insights';
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 {folderExpiryOption} from './folder-expiry';
import {glOption} from './gl';
@@ -32,4 +34,6 @@ export const allOptions = {
enableMultiprocessOnLinuxOption,
glOption,
enableLambdaInsights,
+ encodingMaxRateOption,
+ encodingBufferSizeOption,
};