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 (3840x2160 or 2x).
Remotion can support this higher resolution by:
- setting the
deviceScaleFactorof the headless browser in server-side rendering. - upscaling items on the canvas in client-side rendering.
How to scale
-
In the CLI, during a render of a video or a still, pass the
--scaleflag. For example:--scale=2 -
In the Node.JS functions
renderStill(),renderFrames(),renderStillOnLambda()andrenderMediaOnLambda(),renderMediaOnCloudRun(),renderStillOnCloudRun(), you can pass ascaleoption. -
In the client-side rendering functions
renderMediaOnWeb(),renderStillOnWeb(), you can pass ascaleoption. -
In the config file, you can pass the scale using the following statement:
tsConfig .setScale (2);
Allowed values
The highest scale possible is 16 (sixteen times higher dimensions on each size or 256 times more pixels).
Positive values below 1 are allowed. For example, 0.5 will half each dimension.
Before 4.0.328, there were further limitations:
- Scaling values leading to non-integer pixels were not allowed.
- Scaling values leading to non-even numbers were not allowed when rendering with codec
h264.
Since 4.0.328, rounding is performed automatically.
Scalable elements
Elements that can be upscaled and that will enhance increased resolution are:
- Text elements
- SVG elements
- Images (if their resolution is sufficient to display in a higher resolution)
Elements that cannot be upscaled for increased resolution are:
- Videos
- Canvas and WebGL elements