🎥 Make videos programmatically with React
scaling docs
Jonny Burger33e127217ae5
diff --git a/packages/docs/docs/cli.md b/packages/docs/docs/cli.mdindex e47332639b..a94d7951f6 100644--- a/packages/docs/docs/cli.md+++ b/packages/docs/docs/cli.md@@ -136,7 +136,7 @@ _available for `still`, `render` commands__available for `render` and `still` command._-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 `1.5`. Vector elements like fonts and HTML markups will be rendered with extra details. `scale` must be greater than 0 and less than equal to 16. Default: `1`.+[Scales the output frames by the factor you pass in.](/docs/scaling) For example, a 1280x720px frame will become a 1920x1080px frame with a scale factor of `1.5`. Vector elements like fonts and HTML markups will be rendered with extra details. `scale` must be greater than 0 and less than equal to 16. Default: `1`.### `--frames`diff --git a/packages/docs/docs/config.md b/packages/docs/docs/config.mdindex 9bae8be15a..a3582b4470 100644--- a/packages/docs/docs/config.md+++ b/packages/docs/docs/config.md@@ -220,7 +220,7 @@ The [command line flag](/docs/cli#--image-format) `--image-format` will take pre_Available from Version 2.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 `1.5`. Vector elements like fonts and HTML markups will be rendered with extra details. Default: `1`.+[Scales the output frames by the factor you pass in.](/docs/scaling) For example, a 1280x720px frame will become a 1920x1080px frame with a scale factor of `1.5`. Vector elements like fonts and HTML markups will be rendered with extra details. Default: `1`.```ts twoslashimport { Config } from "remotion";diff --git a/packages/docs/docs/render-frames.md b/packages/docs/docs/render-frames.mdindex 759a09ff2b..33708e6cc7 100644--- a/packages/docs/docs/render-frames.md+++ b/packages/docs/docs/render-frames.md@@ -98,7 +98,7 @@ A `number` specifying how many frames should be rendered in parallel or `null` t_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 `1.5`. Vector elements like fonts and HTML markups will be rendered with extra details.+[Scales the output frames by the factor you pass in.](/docs/scaling) For example, a 1280x720px frame will become a 1920x1080px frame with a scale factor of `1.5`. Vector elements like fonts and HTML markups will be rendered with extra details.### `quality?`diff --git a/packages/docs/docs/render-still.md b/packages/docs/docs/render-still.mdindex 3bdb17f484..92b12a9639 100644--- a/packages/docs/docs/render-still.md+++ b/packages/docs/docs/render-still.md@@ -91,7 +91,7 @@ Which output format the image should have, either `png` or `jpeg`._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 `1.5`. Vector elements like fonts and HTML markups will be rendered with extra details.+[Scales the output frames by the factor you pass in.](/docs/scaling) For example, a 1280x720px frame will become a 1920x1080px frame with a scale factor of `1.5`. Vector elements like fonts and HTML markups will be rendered with extra details.### `quality?`diff --git a/packages/docs/docs/scaling.md b/packages/docs/docs/scaling.mdnew file mode 100644index 0000000000..e285899415--- /dev/null+++ b/packages/docs/docs/scaling.md@@ -0,0 +1,38 @@+---+id: scaling+title: Output scaling+---++_Available from v2.6.7._++Output scaling is useful if you would like to render the video in multiple resolutions in the same aspect ratio.++**Example**: Your video canvas is in Full HD (`1920x1080`), but would like to render your video to be in 4k (`3860x2160` or `2x`).++Remotion can support this higher resolution by setting the [`deviceScaleFactor`](https://puppeteer.github.io/puppeteer/docs/puppeteer.viewport.devicescalefactor) of Puppeteer and upscale certain elements.++## How to scale++- In the CLI, during a render of a video or a still, pass the [`--scale`](/docs/cli#--scale) flag. For example: `--scale=2`++<!-- TODO: Update for lambda --->++- In the Node.JS functions [`renderStill()`](/docs/render-still#scale) and [`renderFrames()`](/docs/render-frames#scale), you can pass a `scale` option.++- In the [config file](/docs/config), you can pass the scale using the following statement:++ ```ts twoslash+ import { Config } from "remotion";+ // ---cut---+ Config.Rendering.setScale(2);+ ```++## Allowed values++The highest scale possible is `16` (sixteen times higher dimensions on each size or 256 times more pixels).++Values between and 1 are allowed. For example, `0.5` will half each dimension.++The scale must result in a value that will result in even pixels. A value of `1.00000001` for a composition with a width of `1920` pixels is now allowed.++If you would like to downscale a composition from `1920` to `1280` pixels, pass a scale of `2/3` to avoid rounding errors. This does not currently work as a CLI flag.diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.jsindex 0015a2a8d5..dea3f2610e 100644--- a/packages/docs/sidebars.js+++ b/packages/docs/sidebars.js@@ -51,6 +51,7 @@ module.exports = {"env-variables","third-party","stills",+ "scaling",],},"cli",