🎥 Make videos programmatically with React
looks good
JonnyBurger8b3cb78b695e
diff --git a/packages/docs/docs/cli/render.mdx b/packages/docs/docs/cli/render.mdxindex 6168d78a7b..c54eb2d826 100644--- a/packages/docs/docs/cli/render.mdx+++ b/packages/docs/docs/cli/render.mdx@@ -39,11 +39,11 @@ Inline JSON string isn't supported on Windows shells because it removes the `"`<Options id="width" cli />-### `--fps`+### `--fps`<AvailableFrom v="4.0.424" /><Options id="fps" cli />-### `--duration`+### `--duration`<AvailableFrom v="4.0.424" /><Options id="duration" cli />diff --git a/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdx b/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdxindex 76d9ff3858..ab093aa739 100644--- a/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdx+++ b/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdx@@ -263,6 +263,14 @@ Overrides default composition width.Overrides default composition height.+### `forceFps?`<AvailableFrom v="4.0.424" />++Overrides the default composition FPS.++### `forceDurationInFrames?`<AvailableFrom v="4.0.424" />++Overrides the default composition duration in frames.+### `logLevel?`<Options id="log" />diff --git a/packages/docs/docs/cloudrun/renderstilloncloudrun.mdx b/packages/docs/docs/cloudrun/renderstilloncloudrun.mdxindex c450960f73..45fa19a04c 100644--- a/packages/docs/docs/cloudrun/renderstilloncloudrun.mdx+++ b/packages/docs/docs/cloudrun/renderstilloncloudrun.mdx@@ -141,6 +141,14 @@ Overrides default composition width.Overrides default composition height.+### `forceFps?`<AvailableFrom v="4.0.424" />++Overrides the default composition FPS.++### `forceDurationInFrames?`<AvailableFrom v="4.0.424" />++Overrides the default composition duration in frames.+### `logLevel?`<Options id="log" />diff --git a/packages/docs/docs/config.mdx b/packages/docs/docs/config.mdxindex cb0394f61b..5782e44683 100644--- a/packages/docs/docs/config.mdx+++ b/packages/docs/docs/config.mdx@@ -632,7 +632,7 @@ Config.overrideWidth(900);The [command line flag](/docs/cli/render#--width) `--width` will take precedence over this option.-## `overrideFps()`+## `overrideFps()`<AvailableFrom v="4.0.424" /><Options id="fps" />@@ -644,7 +644,7 @@ Config.overrideFps(25);The [command line flag](/docs/cli/render#--fps) `--fps` will take precedence over this option.-## `overrideDuration()`+## `overrideDuration()`<AvailableFrom v="4.0.424" /><Options id="duration" />diff --git a/packages/docs/docs/lambda/cli/render.mdx b/packages/docs/docs/lambda/cli/render.mdxindex 8b9c394759..5f62577484 100644--- a/packages/docs/docs/lambda/cli/render.mdx+++ b/packages/docs/docs/lambda/cli/render.mdx@@ -232,11 +232,11 @@ Sets a webhook secret for the webhook (see above). [`renderMediaOnLambda() -> we<Options id="width" cli />-### `--fps`+### `--fps`<AvailableFrom v="4.0.424" /><Options id="fps" cli />-### `--duration`+### `--duration`<AvailableFrom v="4.0.424" /><Options id="duration" cli />diff --git a/packages/docs/docs/lambda/rendermediaonlambda.mdx b/packages/docs/docs/lambda/rendermediaonlambda.mdxindex d51ff97978..4bf1d0d934 100644--- a/packages/docs/docs/lambda/rendermediaonlambda.mdx+++ b/packages/docs/docs/lambda/rendermediaonlambda.mdx@@ -135,6 +135,14 @@ Overrides default composition height.Overrides default composition width.+### `forceFps?`<AvailableFrom v="4.0.424" />++Overrides the default composition FPS.++### `forceDurationInFrames?`<AvailableFrom v="4.0.424" />++Overrides the default composition duration in frames.+### `muted?`Disables audio output. See also [`renderMedia() -> muted`](/docs/renderer/render-media#muted).diff --git a/packages/docs/docs/lambda/renderstillonlambda.mdx b/packages/docs/docs/lambda/renderstillonlambda.mdxindex 7ee6070793..c0e39debe7 100644--- a/packages/docs/docs/lambda/renderstillonlambda.mdx+++ b/packages/docs/docs/lambda/renderstillonlambda.mdx@@ -153,6 +153,14 @@ Overrides the default composition height.Overrides the default composition width.+### `forceFps?`<AvailableFrom v="4.0.424" />++Overrides the default composition FPS.++### `forceDurationInFrames?`<AvailableFrom v="4.0.424" />++Overrides the default composition duration in frames.+### `scale?`<Options id="scale" />diff --git a/packages/renderer/src/options/override-duration.tsx b/packages/renderer/src/options/override-duration.tsxindex 0fe8e30ea0..a5ab031139 100644--- a/packages/renderer/src/options/override-duration.tsx+++ b/packages/renderer/src/options/override-duration.tsx@@ -1,3 +1,4 @@+import {validateDurationInFrames} from '../validate';import type {AnyRemotionOption} from './option';let currentDuration: number | null = null;@@ -14,11 +15,10 @@ export const overrideDurationOption = {getValue: ({commandLine}) => {if (commandLine[cliFlag] !== undefined) {const value = commandLine[cliFlag] as number;- if (typeof value !== 'number') {- throw new TypeError(- `--duration must be a number, got ${JSON.stringify(value)}`,- );- }+ validateDurationInFrames(value, {+ component: 'in --duration flag',+ allowFloats: false,+ });return {source: 'cli',@@ -39,12 +39,10 @@ export const overrideDurationOption = {};},setConfig: (duration) => {- if (typeof duration !== 'number') {- throw new TypeError(- `overrideDuration() must receive a number, got ${JSON.stringify(duration)}`,- );- }-+ validateDurationInFrames(duration, {+ component: 'in Config.overrideDuration()',+ allowFloats: false,+ });currentDuration = duration;},id: cliFlag,diff --git a/packages/renderer/src/options/override-fps.tsx b/packages/renderer/src/options/override-fps.tsxindex 33e9c10ab5..927125f0b3 100644--- a/packages/renderer/src/options/override-fps.tsx+++ b/packages/renderer/src/options/override-fps.tsx@@ -1,3 +1,4 @@+import {validateFps} from '../validate';import type {AnyRemotionOption} from './option';let currentFps: number | null = null;@@ -14,11 +15,7 @@ export const overrideFpsOption = {getValue: ({commandLine}) => {if (commandLine[cliFlag] !== undefined) {const value = commandLine[cliFlag] as number;- if (typeof value !== 'number') {- throw new TypeError(- `--fps must be a number, got ${JSON.stringify(value)}`,- );- }+ validateFps(value, 'in --fps flag', false);return {source: 'cli',@@ -39,12 +36,7 @@ export const overrideFpsOption = {};},setConfig: (fps) => {- if (typeof fps !== 'number') {- throw new TypeError(- `overrideFps() must receive a number, got ${JSON.stringify(fps)}`,- );- }-+ validateFps(fps, 'in Config.overrideFps()', false);currentFps = fps;},id: cliFlag,diff --git a/packages/renderer/src/options/override-height.tsx b/packages/renderer/src/options/override-height.tsxindex 21bd3adaa4..b49be4230b 100644--- a/packages/renderer/src/options/override-height.tsx+++ b/packages/renderer/src/options/override-height.tsx@@ -1,3 +1,4 @@+import {validateDimension} from '../validate';import type {AnyRemotionOption} from './option';let currentHeight: number | null = null;@@ -14,11 +15,7 @@ export const overrideHeightOption = {getValue: ({commandLine}) => {if (commandLine[cliFlag] !== undefined) {const value = commandLine[cliFlag] as number;- if (typeof value !== 'number') {- throw new TypeError(- `--height must be a number, got ${JSON.stringify(value)}`,- );- }+ validateDimension(value, 'height', 'in --height flag');return {source: 'cli',@@ -39,12 +36,7 @@ export const overrideHeightOption = {};},setConfig: (height) => {- if (typeof height !== 'number') {- throw new TypeError(- `overrideHeight() must receive a number, got ${JSON.stringify(height)}`,- );- }-+ validateDimension(height, 'height', 'in Config.overrideHeight()');currentHeight = height;},id: cliFlag,diff --git a/packages/renderer/src/options/override-width.tsx b/packages/renderer/src/options/override-width.tsxindex 52049870d1..d48d91a7dc 100644--- a/packages/renderer/src/options/override-width.tsx+++ b/packages/renderer/src/options/override-width.tsx@@ -1,3 +1,4 @@+import {validateDimension} from '../validate';import type {AnyRemotionOption} from './option';let currentWidth: number | null = null;@@ -14,11 +15,7 @@ export const overrideWidthOption = {getValue: ({commandLine}) => {if (commandLine[cliFlag] !== undefined) {const value = commandLine[cliFlag] as number;- if (typeof value !== 'number') {- throw new TypeError(- `--width must be a number, got ${JSON.stringify(value)}`,- );- }+ validateDimension(value, 'width', 'in --width flag');return {source: 'cli',@@ -39,12 +36,7 @@ export const overrideWidthOption = {};},setConfig: (width) => {- if (typeof width !== 'number') {- throw new TypeError(- `overrideWidth() must receive a number, got ${JSON.stringify(width)}`,- );- }-+ validateDimension(width, 'width', 'in Config.overrideWidth()');currentWidth = width;},id: cliFlag,