Skip to main content

Configuration file

To configure Remotion, create a remotion.config.ts file in the root of your Remotion project.

These options will apply to CLI commands such as npm start and npm run build, but have no effect in the Node.JS API.

You can control several behaviors of Remotion here.

import {Config} from 'remotion';
Config.Rendering.Concurrency(8);
Config.Output.setPixelFormat('yuv444p');
Config.Output.setCodec('h265');

Bundling#

overrideWebpackConfig()#

Available from Version 1.1.

Allows you to insert your custom Webpack config. See the page about custom Webpack configs for more information.

Config.Bundling.overrideWebpackConfig((currentConfiguration) => {
// Return a new Webpack configuration
});

setCachingEnabled()#

Available from Version 2.0.

Enable or disable webpack caching. Default is true which will make the Webpack step in the first run a bit slower but will massively speed up subsequent runs. We recommend to keep this option enabled in all cases and encourage to report issues on Github if you encounter some.

Config.Bundling.setCachingEnabled(false);

The command line flag --bundle-cache will take precedence over this option.

setPort()#

Define on which port Remotion should start it's HTTP servers during preview and rendering. By default, Remotion will try to find a free port. If you specify a port, but it's not available, Remotion will throw an error.

Config.Bundling.setPort(3003);

The command line flag --port will take precedence over this option.

Log#

setLevel()#

Available from Version 2.0.1

Increase or decrease the amount of log messages in the CLI. Acceptable values:

  • error: Silent except error messages.
  • warning: Only showing errors and warnings.
  • info (default): Default output - besides errors and warnings, prints progress and output location.
  • verbose: All of the above, plus browser logs and other debug info.
Config.Log.setLevel('verbose');

The command line flag --log will take precedence over this option.

Preview#

Available from Version 2.1.10.

setMaxTimelineTracks()#

Set how many tracks are being displayed in the timeline at most. This does not affect your video, just the amount of tracks shown when previewing. Default 15.

Config.Preview.setMaxTimelineTracks(20);

Puppeteer#

setBrowserExecutable()#

Available from Version 1.5.

Set a custom Chrome or Chromium executable path. By default Remotion will try to find an existing version of Chrome on your system and if not found, it will download one. This flag is useful if you don't have Chrome installed in a standard location and you want to prevent downloading an additional browser or need support for the H264 codec.

Config.Puppeteer.setBrowserExecutable('/usr/bin/google-chrome-stable');

The command line flag --browser-executable will take precedence over this option.

Rendering#

setConcurrency()#

Sets how many Puppeteer instances will work on rendering your video in parallel. Default: null, meaning half of the threads available on your CPU.

Config.Rendering.setConcurrency(8)

The command line flag --concurrency will take precedence over this option.

tip

Try to set your concurrency to os.cpus().length to all the threads available on your CPU for faster rendering. The drawback is that other parts of your system might slow down.

setImageFormat()#

Available from Version 1.4.

Determines which in which image format to render the frames. Either:

  • jpeg - the fastest option (default from v1.1)
  • png - slower, but supports transparency
  • none - don't render images, just calculate audio information (available from v2.0)
Config.Rendering.setImageFormat('png')

The command line flag --image-format will take precedence over this option.

setFrameRange()#

Available from Version 2.0.

Pass a number to render a still frame or a tuple to render a subset of a video. The frame sequence is zero-indexed.

Config.Rendering.setFrameRange(90); // To render only the 91st frame

or

Config.Rendering.setFrameRange([0, 20]); // Render a video only containing the first 21 frames

The command line flag --frames will take precedence over this option.

setQuality()#

The JPEG quality of each frame. Must be a number between 0 and 100. Will not work if you render PNG frames. Default: 80.

Config.Rendering.setQuality(90);

The command line flag --quality will take precedence over this option.

setDotEnvLocation()#

Set a custom location for a .env file. You can specify an absolute path or a relative path in which case it gets resolved based on the current working directory.

Config.Rendering.setDotEnvLocation('.my-env')

The command line flag --env-file will take precedence over this option.

Output#

setOverwriteOutput()#

Set this to false to prevent overwriting Remotion outputs when they already exists.

Config.Output.setOverwriteOutput(false)

The command line flag --overwrite will take precedence over this option.

info

In version 1.x, the default behavior was inverse - Remotion would not override by default.

setPixelFormat()#

Controls the pixel format in FFMPEG. Read more about it here. Acceptable values: yuv420p, yuv422p, yuv444p, yuv420p10le, yuv422p10le, yuv444p10le. Since v1.4, yuva420p is also supported for transparent WebM videos. Since v2.1.7, yuva444p10le is also supported for transparent ProRes videos Default value: yuv420p

Config.Output.setPixelFormat('yuv420p')

The command line flag --pixel-format will take precedence over this option.

setCodec()#

Available from Version 1.4.

Choose one of the supported codecs: h264 (default), h265, vp8, vp9.

  • h264 is the classic MP4 file as you know it.
  • h265 is the successor of H264, with smaller file sizes. Also known as HEVC. Poor browser compatibility.
  • vp8 is the codec for WebM.
  • vp9 is the next-generation codec for WebM. Lower file size, longer compression time.
  • prores is a common codec if you want to import the output into another video editing program (available from v2.1.6)
  • mp3 will export audio only as an MP3 file (available from v2.0)
  • wav will export audio only as an WAV file (available from v2.0)
  • aac will export audio only as an AAC file (available from v2.0)
Config.Output.setCodec('h265');

The command line flag --codec will take precedence over this option.

See also: Encoding guide

setProResProfile()#

Available from Version 2.1.6.

Set the ProRes profile. This option is only valid if the codec has been set to prores. Possible values: 4444-xq, 4444, hq, standard, light, proxy. See here for explanation of possible values. Default: hq

Config.Output.setProResProfile('4444');

The command line flag --prores-profile will take precedence over this option.

See also: Encoding guide, Transparent videos

setImageSequence()#

Available from Version 1.4.

Set to true if you want to output an image sequence instead of a video.

Config.Output.setImageSequence(true);

The command line flag --sequence will take precedence over this option.

setOutputFormat()#

Deprecated. Use setCodec() and setImageSequence() instead.

Either 'mp4' or 'png-sequence'.

Config.Output.setOutputFormat('mp4');

The command line flags --sequence and --codec will take precedence over this option.

The command line flag --quality will take precedence over this option.

setCrf()#

Available from Version 1.4.

The "Constant Rate Factor" (CRF) of the output. Use this setting to tell FFMPEG how to trade off size and quality.

Ranges for CRF scale, by codec:

  • h264 crf range is 0-51 where crf 18 is default.
  • h265 crf range is 0-51 where crf 23 is default.
  • vp8 crf range is 4-63 where crf 9 is default.
  • vp9 crf range is 0-63 where crf 28 is default.

The lowest value is lossless, and the highest value is the worst quality possible. Higher values decrease the filesize at the cost of quality.

The range is exponential, so increasing the CRF value +6 results in roughly half the bitrate / file size, while -6 leads to roughly twice the bitrate.

Choose the highest CRF value that still provides an acceptable quality. If the output looks good, then try a higher value. If it looks bad, choose a lower value.

Config.Output.setCrf(16);

The command line flag --crf will take precedence over this option.

See also#