Back to Remotion

Configuration file

packages/docs/docs/config.mdx

4.0.46435.8 KB
Original Source

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 npx remotion studio and npx remotion render.

:::warning The configuration file has no effect when using SSR APIs. :::

You can control several behaviors of Remotion here.

ts
import {Config} from '@remotion/cli/config';

Config.setConcurrency(8);
Config.setPixelFormat('yuv444p');
Config.setCodec('h265');

overrideWebpackConfig()<AvailableFrom v="1.1.0" />

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

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.overrideWebpackConfig((currentConfiguration) => {
  // Return a new Webpack configuration
  return {
    ...currentConfiguration,
    // new configuration
  };
});

setCachingEnabled()<AvailableFrom v="2.0.0" />

<Options id="bundle-cache" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setCachingEnabled(false);

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

setStudioPort()<AvailableFrom v="4.0.61" />

Set the HTTP port for the Studio.

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setStudioPort(3003);

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

setRendererPort()<AvailableFrom v="4.0.61" />

Set the port to be used to host the Webpack bundle.

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setRendererPort(3004);

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

setPublicDir()<AvailableFrom v="3.2.13" />

<Options id="public-dir" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setPublicDir('./custom-public-dir');

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

setBundleOutDir()<AvailableFrom v="4.0.426" />

<Options id="out-dir" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setBundleOutDir('./custom-build-dir');

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

setBenchmarkRuns()

<Options id="runs" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setBenchmarkRuns(5);

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

setBenchmarkConcurrencies()<AvailableFrom v="4.0.430" />

<Options id="concurrencies" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setBenchmarkConcurrencies('1,4,8');

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

setEntryPoint()<AvailableFrom v="3.2.40" />

Sets the Remotion entry point, you don't have to specify it for CLI commands.

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setEntryPoint('./src/index.ts');

If you pass an entry point as a CLI argument, it will take precedence.

setLogLevel()<AvailableFrom v="2.0.1" />

previously named "setLevel"

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

  • error: Silent except error messages.
  • warn: 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.
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setLogLevel('verbose');

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

setMaxTimelineTracks()<AvailableFrom v="2.1.10" />

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

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setMaxTimelineTracks(20);

setKeyboardShortcutsEnabled()<AvailableFrom v="3.2.11" />

<Options id="disable-keyboard-shortcuts" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setKeyboardShortcutsEnabled(false);

The command line flag --disable-keyboard-shortcuts will take precedence over this option.

setExperimentalClientSideRenderingEnabled()<AvailableFrom v="4.0.387" />

<Options id="enable-experimental-client-side-rendering" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setExperimentalClientSideRenderingEnabled(true);

The command line flag --enable-experimental-client-side-rendering will take precedence over this option.

setAllowHtmlInCanvasEnabled()<AvailableFrom v="4.0.447" />

<Options id="allow-html-in-canvas" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setAllowHtmlInCanvasEnabled(true);

The command line flag --allow-html-in-canvas will take precedence over this option.

setExperimentalRspackEnabled()<AvailableFrom v="4.0.426" />

Use Rspack instead of Webpack as the bundler for the Studio. Default false.

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setExperimentalRspackEnabled(true);

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

setWebpackPollingInMilliseconds()<AvailableFrom v="3.3.11" />

<Options id="webpack-poll" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setWebpackPollingInMilliseconds(1000);

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

setNumberOfSharedAudioTags()<AvailableFrom v="3.3.2" />

<Options id="number-of-shared-audio-tags" />
ts
import {Config} from '@remotion/cli/config';

// ---cut---
Config.setNumberOfSharedAudioTags(5);

The command line flag --number-of-shared-audio-tags will take precedence over this option.

setShouldOpenBrowser()<AvailableFrom v="3.3.19" />

<Options id="no-open" />
ts
import {Config} from '@remotion/cli/config';

// ---cut---
Config.setShouldOpenBrowser(false);

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

setBrowserExecutable()<AvailableFrom v="1.5.0" />

<Options id="browser-executable" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setBrowserExecutable('/usr/bin/google-chrome-stable');

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

setDelayRenderTimeoutInMilliseconds()<AvailableFrom v="2.6.3" />

previously named "setTimeoutInMilliseconds"

Define how long a single frame may take to resolve all delayRender() calls before it times out. Default: 30000

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setDelayRenderTimeoutInMilliseconds(60000);

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

setChromiumDisableWebSecurity()<AvailableFrom v="2.6.5" />

<Options id="disable-web-security" />
tsx
import {Config} from '@remotion/cli/config';

// ---cut---

Config.setChromiumDisableWebSecurity(true);

The command line flag --disable-web-security will take precedence over this option.

setChromiumDarkMode()<AvailableFrom v="4.0.381" />

<Options id="dark-mode" />
tsx
import {Config} from '@remotion/cli/config';

// ---cut---
Config.setChromiumDarkMode(true);

setChromiumIgnoreCertificateErrors()<AvailableFrom v="2.6.5" />

<Options id="ignore-certificate-errors" />
tsx
import {Config} from '@remotion/cli/config';

// ---cut---

Config.setChromiumIgnoreCertificateErrors(true);

The command line flag --ignore-certificate-errors will take precedence over this option.

setChromiumHeadlessMode()<AvailableFrom v="2.6.5" />

<Options id="disable-headless" />
tsx
import {Config} from '@remotion/cli/config';

// ---cut---

Config.setChromiumHeadlessMode(false);

setChromiumMultiProcessOnLinux()<AvailableFrom v="4.0.42" />

<Options id="enable-multiprocess-on-linux" cli />
tsx
import {Config} from '@remotion/cli/config';

// ---cut---

Config.setChromiumMultiProcessOnLinux(true);

setChromeMode()<AvailableFrom v="4.0.248" />

<Options id="chrome-mode" cli />
tsx
import {Config} from '@remotion/cli/config';

// ---cut---

Config.setChromeMode('chrome-for-testing');

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

setChromiumOpenGlRenderer()

<Options id="gl" />
tsx
import {Config} from '@remotion/cli/config';

// ---cut---

Config.setChromiumOpenGlRenderer('angle');

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

setConcurrency()

<Options id="concurrency" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.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. :::

setVideoImageFormat()<AvailableFrom v="4.0.0" />

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

  • jpeg - the fastest option (default)
  • png - slower, but supports transparency
  • none - don't render images, just calculate audio information
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setVideoImageFormat('png');

setStillImageFormat()<AvailableFrom v="4.0.0" />

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

  • png (default)
  • jpeg
  • pdf
  • webp
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setStillImageFormat('pdf');

setScale()<AvailableFrom v="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.

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setScale(2);

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

setMuted()<AvailableFrom v="3.2.1" />

Disables audio output. Default false.

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setMuted(true);

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

setDisallowParallelEncoding()<AvailableFrom v="4.0.315" />

Disallows the renderer from doing rendering frames and encoding at the same time. This makes the rendering process more memory-efficient, but possibly slower. Default false.

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setDisallowParallelEncoding(true);

The command line flag --disallow-parallel-encoding will take precedence over this option.

setEnforceAudioTrack()<AvailableFrom v="3.2.1" />

Render a silent audio track if there would be none otherwise. Default false.

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setEnforceAudioTrack(true);

The command line flag --enforce-audio-track will take precedence over this option.

setSampleRate()<AvailableFrom v="4.0.448" />

<Options id="sample-rate" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setSampleRate(44100);

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

setForSeamlessAacConcatenation()<AvailableFrom v="4.0.123" />

<Options id="for-seamless-aac-concatenation" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setForSeamlessAacConcatenation(true);

The command line flag --for-seamless-aac-concatenation will take precedence over this option.

setFrameRange()<AvailableFrom v="2.0.0" />

<Options id="frames" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setFrameRange(90); // To render only the 91st frame

or

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setFrameRange([0, 20]); // Render a video only containing the first 21 frames

or

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setFrameRange([100, null]); // Render from frame 100 to the end of the composition

Pass [number, null] to render from a frame to the end of the composition.<AvailableFrom v="4.0.421" inline />

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

setJpegQuality()

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

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setJpegQuality(90);

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

setDotEnvLocation()

<Options id="env-file" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setDotEnvLocation('.my-env');

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

setEveryNthFrame()

<Options id="every-nth-frame" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setEveryNthFrame(2);

The command line flag --every-nth-frame will take precedence over this option.

setNumberOfGifLoops()

<Options id="number-of-gif-loops" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setNumberOfGifLoops(2);

The command line flag --number-of-gif-loops will take precedence over this option.

setOutputLocation()<AvailableFrom v="3.1.6" />

Set the output location of the video or still, relative to the current working directory. The default is out/{composition}.{container}. For example, out/HelloWorld.mp4.

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setOutputLocation('out/video.mp4');

If you pass another argument to the render command, it will take precedence: npx remotion render src/index.ts HelloWorld out/video.mp4.

setOverwriteOutput()

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

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setOverwriteOutput(false);

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

setPixelFormat()

<Options id="pixel-format" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setPixelFormat('yuv420p');

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

setCodec()<AvailableFrom v="1.4.0" />

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

  • 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.
  • av1 is the successor of VP9 and achieves lower file size, with 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)

AV1 is not available on Remotion Lambda or Linux ARM64 GNU. See the Encoding guide for details.

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setCodec('h265');

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

See also: Encoding guide

setAudioCodec()

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setAudioCodec('pcm-16');

Choose the encoding of your audio.

  • The default is dependent on the chosen codec.
  • Choose pcm-16 if you need uncompressed audio.
  • Not all video containers support all audio codecs.
  • This option takes precedence if the codec option also specifies an audio codec.

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

Refer to the Encoding guide to see defaults and supported combinations.

setProResProfile()<AvailableFrom v="2.1.6" />

<Options id="prores-profile" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setProResProfile('4444');

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

setX264Preset()<AvailableFrom v="4.2.2" />

Set the Preset profile. This option is only valid if the codec has been set to h264. Possible values: superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo, Default: medium

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setX264Preset('fast');

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

See also: Encoding guide, Transparent videos

setImageSequence()<AvailableFrom v="1.4.0" />

<Options id="sequence" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setImageSequence(true);

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

overrideHeight()<AvailableFrom v="3.2.40" />

<Options id="height" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.overrideHeight(600);

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

overrideWidth()<AvailableFrom v="3.2.40" />

<Options id="width" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.overrideWidth(900);

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

overrideFps()<AvailableFrom v="4.0.424" />

<Options id="fps" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.overrideFps(25);

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

overrideDuration()<AvailableFrom v="4.0.424" />

<Options id="duration" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.overrideDuration(300);

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

setCrf()<AvailableFrom v="1.4.0" />

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 1-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.
  • av1 crf range is 0-63 where crf 30 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.

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setCrf(16);

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

:::note If you enable hardware acceleration, you cannot set a crf. Use the setVideoBitrate() option instead. :::

setVideoBitrate()<AvailableFrom v="3.2.32" />

<Options id="video-bitrate" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setVideoBitrate('1M');

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

setEncodingBufferSize()<AvailableFrom v="4.0.78" />

<Options id="buffer-size" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setEncodingBufferSize('10000k');

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

setEncodingMaxRate()<AvailableFrom v="4.0.78" />

<Options id="max-rate" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setEncodingMaxRate('5000k');

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

setAudioBitrate()<AvailableFrom v="3.2.32" />

<Options id="audio-bitrate" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setAudioBitrate('128K');

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

setAudioLatencyHint()<AvailableFrom v="4.0.303" />

<Options id="audio-latency-hint" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setAudioLatencyHint('interactive');

The --audio-latency-hint command line flag will take precedence over this option.

setEnableFolderExpiry()<AvailableFrom v="4.0.32" />

<Options id="enable-folder-expiry" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setEnableFolderExpiry(true);

setLambdaInsights()<AvailableFrom v="4.0.115" />

<Options id="enable-lambda-insights" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setLambdaInsights(true);

setDeleteAfter()<AvailableFrom v="4.0.32" />

<Options id="delete-after" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setDeleteAfter('3-days');

setBeepOnFinish()<AvailableFrom v="4.0.84" />

<Options id="beep-on-finish" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setBeepOnFinish(true);

The command line flag --beep-on-finish will take precedence over this option.

setEnableCrossSiteIsolation()<AvailableFrom v="4.0.306" />

<Options id="cross-site-isolation" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setEnableCrossSiteIsolation(true);

The command line flag --cross-site-isolation will take precedence over this option.

setAskAIEnabled()<AvailableFrom v="4.0.407" />

<Options id="disable-ask-ai" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setAskAIEnabled(false);

The command line flag --disable-ask-ai will take precedence over this option.

setForceNewStudioEnabled()<AvailableFrom v="4.0.421" />

<Options id="force-new" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setForceNewStudioEnabled(true);

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

setIPv4()<AvailableFrom v="4.0.125" />

<Options id="ipv4" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setIPv4(true);

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

setBufferStateDelayInMilliseconds()<AvailableFrom v="4.0.111" />

Set the amount of milliseconds after which the Player in the Studio will display a buffering UI after the Player has entered a buffer state. Default 300.

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setBufferStateDelayInMilliseconds(0);

setBinariesDirectory()<AvailableFrom v="4.0.120" />

<Options id="binaries-directory" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setBinariesDirectory('/path/to/custom/directory');

setPreferLosslessAudio()<AvailableFrom v="4.0.123" />

<Options id="prefer-lossless" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setPreferLosslessAudio(true);

setHardwareAcceleration()<AvailableFrom v="4.0.228" />

<Options id="hardware-acceleration" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setHardwareAcceleration('if-possible');

overrideFfmpegCommand()<AvailableFrom v="3.2.22" />

Modifies the FFmpeg command that Remotion uses under the hood. It works reducer-style, meaning that you pass a function that takes a command as an argument and returns a new command.

tsx
import {Config} from '@remotion/cli/config';
// ---cut---
Config.overrideFfmpegCommand(({args}) => {
  // Define the custom FFmpeg options as an array of strings
  const customFfmpegOptions = ['-profile:v', 'main', '-video_track_timescale', '90000', '-color_primaries', 'bt709', '-color_trc', 'bt709', '-strict', 'experimental'];
  // The customFfmpegOptions are inserted before the last element to ensure
  // they appear before the ffmpeg's output path
  args.splice(args.length - 1, 0, ...customFfmpegOptions);
  return args;
});

The function you pass must accept an object as it's only parameter which contains the following properties:

  • type: Either "stitcher" or "pre-stitcher". If enough memory and CPU is available, Remotion may use a two-pass process for the video generation. pre-stitcher is the encoding phase and stitcher is the muxing phase. If the override function is only called once with stitcher, then encoding and muxing is done in the same step. You can tell whether parallel encoding is enabled by adding --log=verbose to your render command.
  • args: An array of strings that is passed as arguments to the FFmpeg command.

Your function must return a modified array of strings.

:::warning Using this feature is discouraged. Before using it, we want to make you aware of some caveats:

  • The render command can change with any new Remotion version, even when it is a patch upgrade. This might break your usage of this feature.
  • Depending on the selected codec, available CPU and RAM, Remotion may or may not use "parallel encoding" which will result in multiple FFmpeg commands being executed. Your function must be able to handle being called multiple times.
  • The FFmpeg binary provided by Remotion supports only a small subset of FFmpeg commands, therefore not every passed option will be applied.
  • This feature is not available when using Remotion Lambda.

Before you use this hack, reach out to the Remotion team on Discord and ask us if we are open to implement the feature you need in a clean way - we often do implement new features quickly based on users feedback. :::

setPublicLicenseKey()<AvailableFrom v="4.0.398" />

<Options id="public-license-key" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setPublicLicenseKey('your-license-key');

The command line flag --public-license-key will take precedence over this option.

setImageSequencePattern()

<Options id="image-sequence-pattern" />
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setImageSequencePattern('frame_[frame]_custom.[ext]');

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

setQuality()

Renamed to setJpegQuality in v4.0.0.

setFfmpegExecutable()

removed in v4.0

Allows you to use a custom FFmpeg binary. Must be an absolute path. By default, this is null and the FFmpeg in PATH will be used.

ts
Config.setFfmpegExecutable('/path/to/custom/ffmpeg');

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

setFfprobeExecutable()

removed in v4.0

Allows you to use a custom ffprobe binary. Must be an absolute path. By default, this is null and the ffprobe in PATH will be used.

ts
Config.setFfprobeExecutable('/path/to/custom/ffprobe');

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

setPort()

deprecated in v4.0.61 - use setStudioPort() and setRendererPort() instead.

Define on which port Remotion should start it's HTTP servers.
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.

:::warning Setting this option will break rendering in the Remotion Studio, because this option controls two settings at the same time:

Use the options individually. :::

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setPort(3003);

The command line flag --port will take precedence over this option. If set on npx remotion studio, it will set the Studio port, otherwise the renderer port.

setOutputFormat()

Removed in v4.0.0 Deprecated. Use setCodec() and setImageSequence() instead.

Either 'mp4' or 'png-sequence'.

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.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.

setImageFormat()<AvailableFrom v="1.4.0" />

Removed in v4.0

Replaced in v4.0 with setVideoImageFormat() and setStillImageFormat()

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)
ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setImageFormat('png');

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

Importing ES Modules

The config file gets executed in a CommonJS environment. If you want to import ES modules to override the Webpack config, you can pass an async function to Config.overrideWebpackConfig():

ts
// @filename: src/enable-sass.ts
import {WebpackOverrideFn} from '@remotion/bundler';
export const enableSass: WebpackOverrideFn = (c) => c;

// @filename: remotion.config.ts
// ---cut---
import {Config} from '@remotion/cli/config';

Config.overrideWebpackConfig(async (currentConfiguration) => {
  const {enableSass} = await import('./src/enable-sass');
  return enableSass(currentConfiguration);
});

Old config file format

In v3.3.39, a new config file format was introduced which flattens the options so they can more easily be discovered using TypeScript autocompletion.

Previously, each config option was two levels deep:

ts
Config.Bundling.setCachingEnabled(false);

From v3.3.39 on, all options can be accessed directly from the Config object.

ts
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setCachingEnabled(false);

The old way is deprecated, but will work for the foreseeable future.

See also