Skip to content

🎥 Make videos programmatically with React

add documentation

Jonny Burgerd0cf757167f1
diff --git a/packages/core/src/config/index.ts b/packages/core/src/config/index.ts
index 66b81601e0..6f8e7111dd 100644
--- a/packages/core/src/config/index.ts
+++ b/packages/core/src/config/index.ts
@@ -135,8 +135,8 @@ export const Config = {
*/
setFfmpegExecutable,
/**
- * Specify scale for puppeteer.
- * Default: null, which will use scale as 1.
+ * Scales the output dimensions by a factor.
+ * Default: 1.
*/
setScale,
},
diff --git a/packages/core/src/config/scale.ts b/packages/core/src/config/scale.ts
index 7caed6ea05..736a817329 100644
--- a/packages/core/src/config/scale.ts
+++ b/packages/core/src/config/scale.ts
@@ -1,6 +1,6 @@
export type Scale = number;
-let currentScale: Scale;
+let currentScale: Scale = 1;
export const setScale = (newScale: Scale) => {
if (typeof newScale !== 'number') {
diff --git a/packages/docs/docs/composition.md b/packages/docs/docs/composition.md
index 412402fb22..9366be3ce0 100644
--- a/packages/docs/docs/composition.md
+++ b/packages/docs/docs/composition.md
@@ -31,8 +31,6 @@ If you use `lazyComponent`, Remotion will use React Suspense to load the compone
If you use `lazyComponent`, you need to use a default export for your component. This is a restriction of React Suspense.
:::
-- `scale` _optional_: Specify device scale factor (can be thought of as dpr). Defaults to 1
-
- `defaultProps` _optional_: Give your component default props that will be shown in the preview. You can override these props during render using a CLI flag.
:::tip
diff --git a/packages/docs/docs/render-frames.md b/packages/docs/docs/render-frames.md
index 21901558a9..5980c2d348 100644
--- a/packages/docs/docs/render-frames.md
+++ b/packages/docs/docs/render-frames.md
@@ -28,6 +28,7 @@ const renderFrames: (options: {
dumpBrowserLogs?: boolean;
puppeteerInstance?: puppeteer.Browser;
onError?: (info: {error: Error; frame: number | null}) => void;
+ scale?: number;
}): Promise<RenderFramesOutput>;
```
@@ -93,6 +94,12 @@ _optional_
A `number` specifying how many frames should be rendered in parallel or `null` to let Remotion decide based on the CPU of the host machine. Default is half of the CPU threads available.
+### `scale?`
+
+_number - default: 1 - available from v2.6.7_
+
+Scales the output frames by the factor you pass in. For example, a 1280x720px frame will become a 1920x1080px frame with a scale factor of `2`. Vector elements like fonts and HTML markups will be rendered with extra details.
+
### `quality?`
_optional_
diff --git a/packages/docs/docs/render-still.md b/packages/docs/docs/render-still.md
index 9beb2bae28..3970b73f08 100644
--- a/packages/docs/docs/render-still.md
+++ b/packages/docs/docs/render-still.md
@@ -87,6 +87,12 @@ _optional - default: "png"_
Which output format the image should have, either `png` or `jpeg`.
+### `scale?`
+
+_number - default: 1 - available from v2.6.7_
+
+Scales the output frames by the factor you pass in. For example, a 1280x720px frame will become a 1920x1080px frame with a scale factor of `2`. Vector elements like fonts and HTML markups will be rendered with extra details.
+
### `quality?`
_optional - default: `undefined`_
diff --git a/packages/example/src/Video.tsx b/packages/example/src/Video.tsx
index f976a690ac..6f959b1c06 100644
--- a/packages/example/src/Video.tsx
+++ b/packages/example/src/Video.tsx
@@ -89,7 +89,6 @@ export const Index: React.FC = () => {
width={1080}
height={1920}
fps={30}
- scale={3}
durationInFrames={7 * 30}
/>
<Composition