---
image: /generated/articles-docs-config.png
id: config
title: Configuration file
crumb: 'remotion.config.ts'
---

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](/docs/renderer) APIs.
:::

You can control several behaviors of Remotion here.

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';

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

## `overrideBundlerConfig()`<AvailableFrom v="4.0.498" />

Overrides configuration shared by Webpack and Rspack.

The callback receives the current configuration and a context object containing `bundler`, which is either `'webpack'` or `'rspack'`.

Use this option only for changes that are compatible with both bundlers. Bundler-specific plugins and options should use `overrideWebpackConfig()` or `overrideRspackConfig()` instead.

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.overrideBundlerConfig((currentConfiguration, {bundler}) => {
  return {
    ...currentConfiguration,
    name: `remotion-${bundler}`,
  };
});
```

The shared override runs before the selected bundler's specific override.

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

See [Webpack and Rspack](/docs/bundlers) for usage and examples.

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.overrideWebpackConfig((currentConfiguration) => {
  // Return a new Webpack configuration or mutate this one and return it
  return {
    ...currentConfiguration,
    // new configuration
  };
});
```

## `overrideRspackConfig()`<AvailableFrom v="4.0.498" />

Overrides the Rspack configuration. It is only called when [Rspack](/docs/config#setrspack) is enabled.

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.overrideRspackConfig((currentConfiguration) => {
  return {
    ...currentConfiguration,
    // Rspack-specific configuration
  };
});
```

If `overrideBundlerConfig()` is also set, the shared override runs first.

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

<Options id="bundle-cache" />

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

The [`--bundle-cache`](/docs/options/bundle-cache) flag takes precedence over this option.

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

Set the HTTP port for the Studio.

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

The [`--port`](/docs/options/port) flag takes precedence over this option.

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

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

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

The [`--port`](/docs/options/port) flag takes precedence over this option.

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

<Options id="public-dir" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setPublicDir('./custom-public-dir');
```

The [`--public-dir`](/docs/options/public-dir) flag takes precedence over this option.

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

<Options id="out-dir" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setBundleOutDir('./custom-build-dir');
```

The [`--out-dir`](/docs/options/out-dir) flag takes precedence over this option.

## `setBenchmarkRuns()`

<Options id="runs" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setBenchmarkRuns(5);
```

The [`--runs`](/docs/options/runs) flag takes precedence over this option.

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

<Options id="concurrencies" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setBenchmarkConcurrencies('1,4,8');
```

The [`--concurrencies`](/docs/options/concurrencies) flag takes precedence over this option.

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

Sets the Remotion [entry point](/docs/terminology/entry-point), you don't have to specify it for CLI commands.

```ts twoslash title="remotion.config.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 twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setLogLevel('verbose');
```

The [`--log`](/docs/options/log) flag takes precedence over this option.

## `addElementLibrary()`<AvailableFrom v="4.0.517" />

Adds a third-party Element Library to Remotion Studio from an externally hosted URL.

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.addElementLibrary({
  url: 'https://example.com/elements',
  displayName: 'Acme Elements',
  captionStylesUrl: 'https://example.com/elements/captions',
});
```

Call `addElementLibrary()` once for each third-party Element Library. The `displayName` property is optional. If it is omitted, the URL host and path are shown instead.

When at least one library is configured, Browse Elements shows a dropdown containing Remotion Elements and every configured library. All libraries open in an embedded Studio modal.

Registering the Element Library does not install an individual Element's source code or dependencies. The URL must be an absolute HTTP or HTTPS URL. Remotion Elements remains available without adding it to the configuration.

### captionStylesUrl?<AvailableFrom v="4.0.535" />

An absolute HTTP or HTTPS URL for the library's caption styles page. When generating captions, Studio lists this library in the <kbd>Styles</kbd> tab and opens this URL instead of `url`. If omitted, the library appears only in Browse Elements.

Studio adds [`remotion-studio-context=captions`](/docs/studio-protocol/add-element-library-to-studio#iframe-context) to the iframe URL so the library can display a focused caption picker without sidebars.

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

Set how many tracks are displayed in the Studio timeline at most. This does not affect your video, only the number of tracks shown while previewing. From <AvailableFrom v="4.0.514" inline />, all tracks are available by default and the timeline is virtualized.

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

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

<Options id="disable-keyboard-shortcuts" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setKeyboardShortcutsEnabled(false);
```

The [`--disable-keyboard-shortcuts`](/docs/options/disable-keyboard-shortcuts) flag takes precedence over this option.

## `setKeyboardShortcuts()`<AvailableFrom v="4.0.523" />

Override keyboard shortcuts for Studio commands. Shortcuts that are omitted keep their default binding. Set a command to `null` to disable its shortcut. See [Keyboard shortcuts](/docs/studio/shortcuts) for the available action IDs and defaults.

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setKeyboardShortcuts({
  playPause: {key: 'q'},
  quickSwitcher: {key: 'p', commandOrControl: true},
  toggleSnapping: {key: 's', shift: true},
  selectVolumeProp: {key: 'v', shift: true},
  render: null,
});
```

The `commandOrControl` modifier uses Command on macOS and Control on other platforms. The `shift` and `alt` modifiers are also supported. Pass an array to assign multiple bindings to one command.

## `setInteractivityEnabled()`<AvailableFrom v="4.0.487" />

<Options id="disable-interactivity" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setInteractivityEnabled(false);
```

The [`--disable-interactivity`](/docs/options/disable-interactivity) flag takes precedence over this option.

## `setPreservePitchOnPlayback()`<AvailableFrom v="4.0.538" />

<Options id="preserve-pitch-on-playback" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setPreservePitchOnPlayback(false);
```

The [`--preserve-pitch-on-playback`](/docs/options/preserve-pitch-on-playback) flag takes precedence over this option.
You can also change this setting in the Studio settings dialog under Playback.

## `setCanvasTabsEnabled()`<AvailableFrom v="4.0.530" />

Show or hide the tabs above the canvas in the Studio. The tabs are shown by default.

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setCanvasTabsEnabled(false);
```

The [`--disable-canvas-tabs`](/docs/options/disable-canvas-tabs) flag takes precedence over this option.

## `setSequenceActivityLimit()`<AvailableFrom v="4.0.536" />

<Options id="sequence-activity-limit" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setSequenceActivityLimit(20);
```

The [`--sequence-activity-limit`](/docs/options/sequence-activity-limit) flag takes precedence over this option.

## `setShowLayerFrameNumbers()`<AvailableFrom v="4.0.535" />

<Options id="show-layer-frame-numbers" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setShowLayerFrameNumbers(true);
```

The [`--show-layer-frame-numbers`](/docs/options/show-layer-frame-numbers) flag takes precedence over this option.

## `setShowPremounting()`<AvailableFrom v="4.0.535" />

<Options id="show-premounting" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setShowPremounting(true);
```

The [`--show-premounting`](/docs/options/show-premounting) flag takes precedence over this option.

## `setDefaultPremountInSeconds()`<AvailableFrom v="4.0.535" />

<Options id="default-premount-in-seconds" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setDefaultPremountInSeconds(2);
```

The [`--default-premount-in-seconds`](/docs/options/default-premount-in-seconds) flag takes precedence over this option.

## `setDefaultEditor()`<AvailableFrom v="4.0.503" />

<Options id="editor" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setDefaultEditor('cursor');
```

See [Opening files in a code editor](/docs/studio/open-in-editor) for built-in editor IDs, custom editor configuration, and platform support.

## `setDefaultCodingAgent()`<AvailableFrom v="4.0.506" />

<Options id="coding-agent" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setDefaultCodingAgent('codex');
```

Available coding agents: `codex`, `cursor`, `copilot`, and `claude-code`.

The [`--coding-agent`](/docs/options/coding-agent) flag takes precedence over this option.

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

<Options id="allow-html-in-canvas" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setAllowHtmlInCanvasEnabled(true);
```

The [`--allow-html-in-canvas`](/docs/options/allow-html-in-canvas) flag takes precedence over this option.

## `setRspack()`<AvailableFrom v="4.0.502" />

<Options id="rspack" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setRspack(true);
```

The [`--rspack`](/docs/options/rspack) flag takes precedence over this option.

## ~~`setExperimentalRspackEnabled()`~~<AvailableFrom v="4.0.426" />

:::info Deprecated
Use [`setRspack()`](/docs/config#setrspack) instead.
:::

`setExperimentalRspackEnabled()` is an alias for `setRspack()`.

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

<Options id="webpack-poll" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setWebpackPollingInMilliseconds(1000);
```

The [`--webpack-poll`](/docs/options/webpack-poll) flag takes precedence over this option.

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

<Options id="number-of-shared-audio-tags" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';

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

The [`--number-of-shared-audio-tags`](/docs/options/number-of-shared-audio-tags) flag takes precedence over this option.

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

<Options id="no-open" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';

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

The [`--no-open`](/docs/options/no-open) flag takes precedence over this option.

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

<Options id="browser-executable" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setBrowserExecutable('/usr/bin/google-chrome-stable');
```

The [`--browser-executable`](/docs/options/browser-executable) flag takes 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()`](/docs/delay-render) calls [before it times out](/docs/timeout). Default: `30000`

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

The [`--timeout`](/docs/options/timeout) flag takes precedence over this option.

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

<Options id="disable-web-security" />

```tsx twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';

// ---cut---

Config.setChromiumDisableWebSecurity(true);
```

The [`--disable-web-security`](/docs/options/disable-web-security) flag takes precedence over this option.

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

<Options id="dark-mode" />

```tsx twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';

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

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

<Options id="ignore-certificate-errors" />

```tsx twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';

// ---cut---

Config.setChromiumIgnoreCertificateErrors(true);
```

The [`--ignore-certificate-errors`](/docs/options/ignore-certificate-errors) flag takes precedence over this option.

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

<Options id="disable-headless" />

```tsx twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';

// ---cut---

Config.setChromiumHeadlessMode(false);
```

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

<Options id="enable-multiprocess-on-linux" cli />

```tsx twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';

// ---cut---

Config.setChromiumMultiProcessOnLinux(true);
```

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

<Options id="chrome-mode" cli />

```tsx twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';

// ---cut---

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

The [`--chrome-mode`](/docs/options/chrome-mode) flag takes precedence over this option.

## `setChromiumOpenGlRenderer()`

<Options id="gl" />

```tsx twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';

// ---cut---

Config.setChromiumOpenGlRenderer('angle');
```

The [`--gl`](/docs/options/gl) flag takes precedence over this option.

## `setConcurrency()`

<Options id="concurrency" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setConcurrency(8);
```

The [`--concurrency`](/docs/options/concurrency) flag takes 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 twoslash title="remotion.config.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 twoslash title="remotion.config.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.](/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 twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setScale(2);
```

The [`--scale`](/docs/options/scale) flag takes precedence over this option.

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

Disables audio output. Default `false`.

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

The [`--muted`](/docs/options/muted) flag takes precedence over this option.

## `setDisableSharedMemoryCapture()`<AvailableFrom v="4.0.534" />

<Options id="disable-shared-memory-capture" />

See [Shared-memory capture](/docs/shared-memory-capture).

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setDisableSharedMemoryCapture(true);
```

The [`--disable-shared-memory-capture`](/docs/options/disable-shared-memory-capture) flag takes precedence over this option. Pass `--disable-shared-memory-capture=false` to override a configured opt-out.

## `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`.

See [parallel encoding](/docs/parallel-encoding) for when it is enabled and how it works.

From <AvailableFrom v="4.0.533" inline />, parallel encoding is no longer disabled automatically based on the available memory. Set this option if the machine runs out of memory while rendering.

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

The [`--disallow-parallel-encoding`](/docs/options/disallow-parallel-encoding) flag takes precedence over this option.

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

<Options id="enforce-audio-track" />

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

The [`--enforce-audio-track`](/docs/options/enforce-audio-track) flag takes precedence over this option.

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

<Options id="sample-rate" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setSampleRate(44100);
```

The [`--sample-rate`](/docs/options/sample-rate) flag takes precedence over this option.

## `setPreviewSampleRate()`<AvailableFrom v="4.0.470" />

<Options id="preview-sample-rate" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setPreviewSampleRate(44100);
```

The [`--preview-sample-rate`](/docs/options/preview-sample-rate) flag takes precedence over this option.

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

<Options id="for-seamless-aac-concatenation" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setForSeamlessAacConcatenation(true);
```

The [`--for-seamless-aac-concatenation`](/docs/options/for-seamless-aac-concatenation) flag takes precedence over this option.

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

<Options id="frames" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setFrameRange(90); // To render only the 91st frame
```

or

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

or

```ts twoslash title="remotion.config.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 />

Pass multiple ordered, non-overlapping ranges to render discontinuous sections.<AvailableFrom v="4.0.502" inline />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setFrameRange([
  [0, 100],
  [150, 200],
]);
```

The [`--frames`](/docs/options/frames) flag takes 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](https://github.com/chromium/chromium/blob/99314be8152e688bafbbf9a615536bdbb289ea87/headless/lib/browser/protocol/headless_handler.cc#L32).

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

The [`--jpeg-quality`](/docs/options/jpeg-quality) flag takes precedence over this option.

## `setDotEnvLocation()`

<Options id="env-file" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setDotEnvLocation('.my-env');
```

The [`--env-file`](/docs/options/env-file) flag takes precedence over this option.

## `setEveryNthFrame()`

<Options id="every-nth-frame" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setEveryNthFrame(2);
```

The [`--every-nth-frame`](/docs/options/every-nth-frame) flag takes precedence over this option.

## `setNumberOfGifLoops()`

<Options id="number-of-gif-loops" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setNumberOfGifLoops(2);
```

The [`--number-of-gif-loops`](/docs/options/number-of-gif-loops) flag takes 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 twoslash title="remotion.config.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 twoslash title="remotion.config.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 twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setPixelFormat('yuv420p');
```

The [`--pixel-format`](/docs/options/pixel-format) flag takes 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](/docs/encoding) for details.

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

The [`--codec`](/docs/options/codec) flag takes precedence over this option.

**See also**: [Encoding guide](/docs/encoding)

## `setAudioCodec()`

```ts twoslash title="remotion.config.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 [`--audio-codec`](/docs/options/audio-codec) flag takes precedence over this option.

Refer to the [Encoding guide](/docs/encoding) to see defaults and supported combinations.

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

<Options id="prores-profile" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setProResProfile('4444');
```

The [`--prores-profile`](/docs/options/prores-profile) flag takes precedence over this option.

## `setX264Preset()`<AvailableFrom v="4.0.22" />

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 twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setX264Preset('fast');
```

The [`--x264-preset`](/docs/options/x264-preset) flag takes precedence over this option.

**See also**: [Encoding guide](/docs/encoding), [Transparent videos](/docs/transparent-videos)

## `setGopSize()`<AvailableFrom v="4.0.466" />

<Options id="gop" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setGopSize(239);
```

The [`--gop`](/docs/options/gop) flag takes precedence over this option.

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

<Options id="sequence" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setImageSequence(true);
```

The [`--sequence`](/docs/options/sequence) flag takes precedence over this option.

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

<Options id="height" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.overrideHeight(600);
```

The [`--height`](/docs/options/height) flag takes precedence over this option.

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

<Options id="width" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.overrideWidth(900);
```

The [`--width`](/docs/options/width) flag takes precedence over this option.

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

<Options id="fps" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.overrideFps(25);
```

The [`--fps`](/docs/options/fps) flag takes precedence over this option.

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

<Options id="duration" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.overrideDuration(300);
```

The [`--duration`](/docs/options/duration) flag takes 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.](/docs/encoding#controlling-quality-using-the-crf-setting)

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 twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setCrf(16);
```

The [`--crf`](/docs/options/crf) flag takes precedence over this option.

:::note
If you enable [hardware acceleration](/docs/hardware-acceleration), you cannot set a `crf`. Use the [`setVideoBitrate()`](#setvideobitrate) option instead.
:::

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

<Options id="video-bitrate" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setVideoBitrate('1M');
```

The [`--video-bitrate`](/docs/options/video-bitrate) flag takes precedence over this option.

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

<Options id="buffer-size" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setEncodingBufferSize('10000k');
```

The [`--buffer-size`](/docs/options/buffer-size) flag takes precedence over this option.

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

<Options id="max-rate" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setEncodingMaxRate('5000k');
```

The [`--max-rate`](/docs/options/max-rate) flag takes precedence over this option.

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

<Options id="audio-bitrate" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setAudioBitrate('128K');
```

The [`--audio-bitrate`](/docs/options/audio-bitrate) flag takes precedence over this option.

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

<Options id="audio-latency-hint" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setAudioLatencyHint('interactive');
```

The [`--audio-latency-hint`](/docs/options/audio-latency-hint) flag takes precedence over this option.

## `setExperimentalKeepAudioContextAlive()`<AvailableFrom v="4.0.508" />

<ExperimentalBadge>
  <p>We are currently testing this prop. We might either remove the functionality or rename the prop to a stable name.</p>
</ExperimentalBadge>

<Options id="experimental-keep-audio-context-alive" />
<br />
<br />

Keeps the shared [`AudioContext`](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext) running while the Remotion Studio is paused. Pausing lowers the gain to zero rather than suspending the context, which can reduce latency when resuming playback.

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setExperimentalKeepAudioContextAlive(true);
```

Changing this option while the Studio is running reloads the page. The [`--experimental-keep-audio-context-alive`](/docs/options/experimental-keep-audio-context-alive) flag takes precedence over this option.

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

<Options id="enable-folder-expiry" />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setEnableFolderExpiry(true);
```

## `setEnableCancellation()`<AvailableFrom v="4.0.515" />

<Options id="enable-cancellation" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setEnableCancellation(true);
```

The [`--enable-cancellation`](/docs/options/enable-cancellation) flag takes precedence over this option.

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

<Options id="enable-lambda-insights" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setLambdaInsights(true);
```

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

<Options id="delete-after" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setDeleteAfter('3-days');
```

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

<Options id="beep-on-finish" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setBeepOnFinish(true);
```

The [`--beep-on-finish`](/docs/options/beep-on-finish) flag takes precedence over this option.

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

<Options id="cross-site-isolation" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setEnableCrossSiteIsolation(true);
```

The [`--cross-site-isolation`](/docs/options/cross-site-isolation) flag takes precedence over this option.

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

<Options id="disable-ask-ai" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setAskAIEnabled(false);
```

The [`--disable-ask-ai`](/docs/options/disable-ask-ai) flag takes precedence over this option.

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

<Options id="force-new" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setForceNewStudioEnabled(true);
```

The [`--force-new`](/docs/options/force-new) flag takes precedence over this option.

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

<Options id="ipv4" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setIPv4(true);
```

The [`--ipv4`](/docs/options/ipv4) flag takes 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 twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setBufferStateDelayInMilliseconds(0);
```

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

<Options id="binaries-directory" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setBinariesDirectory('/path/to/custom/directory');
```

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

<Options id="prefer-lossless" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setPreferLosslessAudio(true);
```

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

<Options id="hardware-acceleration" />
<br />
<br />

```ts twoslash title="remotion.config.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 twoslash title="remotion.config.ts"
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"`. When [parallel encoding is enabled](#setdisallowparallelencoding), `pre-stitcher` encodes the video while frames are rendered, then `stitcher` muxes the encoded video and any audio into the output file. Otherwise, the function is called once with `stitcher`, which performs encoding and muxing together. 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 and [`setDisallowParallelEncoding()`](#setdisallowparallelencoding), 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](https://remotion.dev/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" />
<br />
<br />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setPublicLicenseKey('your-license-key');
```

The [`--public-license-key`](/docs/options/public-license-key) flag takes precedence over this option.

## `setImageSequencePattern()`

<Options id="image-sequence-pattern" />

```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setImageSequencePattern('frame_[frame]_custom.[ext]');
```

The [`--image-sequence-pattern`](/docs/options/image-sequence-pattern) flag takes 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 title="remotion.config.ts"
Config.setFfmpegExecutable('/path/to/custom/ffmpeg');
```

The [command line flag](/docs/cli/render#--ffmpeg-executable) `--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 title="remotion.config.ts"
Config.setFfprobeExecutable('/path/to/custom/ffprobe');
```

The [command line flag](/docs/cli/render#--ffprobe-executable-) `--ffprobe-executable` will take precedence over this option.

## ~~`setPort()`~~

:::info Deprecated
Use [`setStudioPort()`](/docs/config#setstudioport) and [`setRendererPort()`](/docs/config#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:

- When starting the [Remotion Studio](/docs/terminology/studio), a server will be started to host it ([`setStudioPort()`](/docs/config#setstudioport)).
- During rendering, a HTTP server is also started in the background to serve the Webpack [bundle](/docs/terminology/bundle) ([`setRendererPort()`](/docs/config#setrendererport)).

Use the options individually.
:::

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

The [`--port`](/docs/options/port) flag takes 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 title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setOutputFormat('mp4');
```

The [`--sequence`](/docs/options/sequence) and [`--codec`](/docs/options/codec) flags take precedence over this option.

The [command line flag](/docs/cli) `--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 title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
// ---cut---
Config.setImageFormat('png');
```

The [command line flag](/docs/cli/render#--image-format) `--image-format` will take precedence over this option.

## Importing ES Modules

The [config file](/docs/config) 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 twoslash title="remotion.config.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 title="remotion.config.ts"
Config.Bundling.setCachingEnabled(false);
```

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

```ts twoslash title="remotion.config.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

- [Encoding guide](/docs/encoding)
