Skip to content

🎥 Make videos programmatically with React

add option explainer

Jonny Burger486836d67fd5
diff --git a/packages/renderer/src/client.ts b/packages/renderer/src/client.ts
index f827ed2644..02f93261ff 100644
--- a/packages/renderer/src/client.ts
+++ b/packages/renderer/src/client.ts
@@ -11,6 +11,7 @@ import {
getFileExtensionFromCodec,
} from './get-extension-from-codec';
import {isAudioCodec} from './is-audio-codec';
+import {scaleOption} from './options/scale';
import {DEFAULT_PIXEL_FORMAT, validPixelFormats} from './pixel-format';
import {proResProfileOptions} from './prores-profile';
@@ -28,4 +29,7 @@ export const BrowserSafeApis = {
defaultFileExtensionMap,
defaultAudioCodecs,
defaultCodecsForFileExtension,
+ options: {
+ scaleOption,
+ },
};
diff --git a/packages/renderer/src/options/option.ts b/packages/renderer/src/options/option.ts
new file mode 100644
index 0000000000..7b64cf46b7
--- /dev/null
+++ b/packages/renderer/src/options/option.ts
@@ -0,0 +1,8 @@
+import type React from 'react';
+
+export type RemotionOption = {
+ name: string;
+ cliFlag: string;
+ ssrName: string;
+ description: React.ReactNode;
+};
diff --git a/packages/renderer/src/options/scale.tsx b/packages/renderer/src/options/scale.tsx
new file mode 100644
index 0000000000..89363f56f0
--- /dev/null
+++ b/packages/renderer/src/options/scale.tsx
@@ -0,0 +1,14 @@
+import type {RemotionOption} from './option';
+
+export const scaleOption: RemotionOption = {
+ name: 'scale',
+ cliFlag: '--scale',
+ description: (
+ <>
+ Scales the output by a factor. For example, a 1280x720px frame will become
+ a 1920x1080px frame with a scale factor of <code>1.5</code>. Vector
+ elements like fonts and HTML markups will be rendered with extra details.
+ </>
+ ),
+ ssrName: 'scale',
+};