Skip to content

🎥 Make videos programmatically with React

add height width flags

Akshit Tyagi1b7e96308e2d
diff --git a/packages/cli/src/get-cli-options.ts b/packages/cli/src/get-cli-options.ts
index ed88cfee56..4cac017972 100644
--- a/packages/cli/src/get-cli-options.ts
+++ b/packages/cli/src/get-cli-options.ts
@@ -274,6 +274,8 @@ export const getCliOptions = async (options: {
publicDir: ConfigInternals.getPublicDir(),
ffmpegOverride: ConfigInternals.getFfmpegOverrideFunction(),
audioBitrate: ConfigInternals.getAudioBitrate(),
+ height: ConfigInternals.getHeight(),
+ width: ConfigInternals.getWidth(),
videoBitrate,
};
};
diff --git a/packages/cli/src/parse-command-line.ts b/packages/cli/src/parse-command-line.ts
index 56524de75a..1f6e40c95a 100644
--- a/packages/cli/src/parse-command-line.ts
+++ b/packages/cli/src/parse-command-line.ts
@@ -50,6 +50,8 @@ export type CommandLineOptions = {
['disable-headless']: boolean;
['disable-keyboard-shortcuts']: boolean;
muted: boolean;
+ height: number;
+ width: number;
['enforce-audio-track']: boolean;
gl: OpenGlRenderer;
['package-manager']: string;
@@ -148,6 +150,14 @@ export const parseCommandLine = () => {
Config.Puppeteer.setTimeoutInMilliseconds(parsedCli.timeout);
}
+ if (parsedCli.height) {
+ Config.Output.setHeight(parsedCli.height);
+ }
+
+ if (parsedCli.width) {
+ Config.Output.setWidth(parsedCli.width);
+ }
+
if (parsedCli.frames) {
ConfigInternals.setFrameRangeFromCli(parsedCli.frames);
}
diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts
index 85de781ef5..f0be270cb1 100644
--- a/packages/core/src/config.ts
+++ b/packages/core/src/config.ts
@@ -233,6 +233,14 @@ export type ConfigType = {
* Possible values: 4444-xq, 4444, hq, standard, light, proxy. Default: 'hq'
* See https://avpres.net/FFmpeg/im_ProRes.html for meaning of possible values.
*/
+ readonly setHeight: (newHeigh: number) => void;
+ /**
+ * Set new height.
+ */
+ readonly setWidth: (newWidth: number) => void;
+ /**
+ * Set new width.
+ */
readonly setProResProfile: (
profile:
| '4444-xq'