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 npx remotion studio and npx remotion render.
The configuration file has no effect when using SSR APIs.
You can control several behaviors of Remotion here.
remotion.config.tsimport {Config } from '@remotion/cli/config';Config .setConcurrency (8);Config .setPixelFormat ('yuv444p');Config .setCodec ('h265');
overrideBundlerConfig()v4.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.
remotion.config.tsConfig .overrideBundlerConfig ((currentConfiguration , {bundler }) => { return { ...currentConfiguration ,name : `remotion-${bundler }`, }; });
The shared override runs before the selected bundler's specific override.
overrideWebpackConfig()v1.1.0
See Webpack and Rspack for usage and examples.
remotion.config.tsConfig .overrideWebpackConfig ((currentConfiguration ) => { // Return a new Webpack configuration or mutate this one and return it return { ...currentConfiguration , // new configuration }; });
overrideRspackConfig()v4.0.498
Overrides the Rspack configuration. It is only called when Rspack is enabled.
remotion.config.tsConfig .overrideRspackConfig ((currentConfiguration ) => { return { ...currentConfiguration , // Rspack-specific configuration }; });
If overrideBundlerConfig() is also set, the shared override runs first.
setCachingEnabled()v2.0.0
Enable or disable Webpack caching. This flag is enabled by default, use --bundle-cache=false to disable caching.
remotion.config.tsConfig .setCachingEnabled (false);
The --bundle-cache flag takes precedence over this option.
setStudioPort()v4.0.61
Set the HTTP port for the Studio.
remotion.config.tsConfig .setStudioPort (3003);
The --port flag takes precedence over this option.
setRendererPort()v4.0.61
Set the port to be used to host the Webpack bundle.
remotion.config.tsConfig .setRendererPort (3004);
The --port flag takes precedence over this option.
setPublicDir()v3.2.13
Define the location of the public/ directory. If not defined, Remotion will assume the location is the `public` folder in your Remotion root.
remotion.config.tsConfig .setPublicDir ('./custom-public-dir');
The --public-dir flag takes precedence over this option.
setBundleOutDir()v4.0.426
Define the location of the resulting bundle. By default it is a folder called build, adjacent to the Remotion Root.
remotion.config.tsConfig .setBundleOutDir ('./custom-build-dir');
The --out-dir flag takes precedence over this option.
setBenchmarkRuns()
Specify how many times the video should be rendered during a benchmark. Default 3.
remotion.config.tsConfig .setBenchmarkRuns (5);
The --runs flag takes precedence over this option.
setBenchmarkConcurrencies()v4.0.430
Specify which concurrency values should be used while benchmarking. Multiple values can be passed separated by comma. Learn more about concurrency.
remotion.config.tsConfig .setBenchmarkConcurrencies ('1,4,8');
The --concurrencies flag takes precedence over this option.
setEntryPoint()v3.2.40
Sets the Remotion entry point, you don't have to specify it for CLI commands.
remotion.config.tsConfig .setEntryPoint ('./src/index.ts');
If you pass an entry point as a CLI argument, it will take precedence.
setLogLevel()v2.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.
remotion.config.tsConfig .setLogLevel ('verbose');
The --log flag takes precedence over this option.
addElementLibrary()v4.0.517
Adds a third-party Element Library to Remotion Studio from an externally hosted URL.
remotion.config.tsConfig .addElementLibrary ({url : 'https://example.com/elements',displayName : 'Acme Elements', });
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.
setMaxTimelineTracks()v2.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 v4.0.514, all tracks are available by default and the timeline is virtualized.
remotion.config.tsConfig .setMaxTimelineTracks (20);
setKeyboardShortcutsEnabled()v3.2.11
Enable or disable keyboard shortcuts in the Remotion Studio.
remotion.config.tsConfig .setKeyboardShortcutsEnabled (false);
The --disable-keyboard-shortcuts flag takes precedence over this option.
setKeyboardShortcuts()v4.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 for the available action IDs and defaults.
remotion.config.tsConfig .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.
Studio can also update these values from the Keyboard Shortcuts settings screen. Changes made there are written to remotion.config.ts.
setInteractivityEnabled()v4.0.487
Enable or disable interactive editing in the Remotion Studio. When disabled, the Studio keeps previewing and source navigation available, but disables preview outlines, the sequence inspector, visual controls, timeline selection and timeline editing gestures.
remotion.config.tsConfig .setInteractivityEnabled (false);
The --disable-interactivity flag takes precedence over this option.
setCanvasTabsEnabled()v4.0.530
Show or hide the tabs above the canvas in the Studio. The tabs are shown by default.
remotion.config.tsConfig .setCanvasTabsEnabled (false);
The --disable-canvas-tabs flag takes precedence over this option.
setExperimentalTracksEnabled()v4.0.534
Enable experimental timeline tracks in the Remotion Studio. Group clips from <Track>, <Series> and <TransitionSeries> on shared rows, with overlays on additional rows. Disabled by default.
remotion.config.tsConfig .setExperimentalTracksEnabled (true);
Changes apply immediately in the Studio without reloading the page.
The --experimental-tracks flag takes precedence over this option.
setDefaultPremountInSeconds()v4.0.534
Set the default premount duration in seconds for timed components in the Studio. Defaults to 0 in v4 and 2 in v5. Must be a finite, non-negative number. The duration is converted to frames using the composition FPS and rounded to the nearest frame. An explicit premountFor prop takes precedence. Does not affect rendering. In the Player, use the defaultPremountInSeconds prop instead.
remotion.config.tsConfig .setDefaultPremountInSeconds (2);
You can also change this value in the Studio settings. Changes apply immediately after saving.
The --default-premount-in-seconds flag takes precedence over this option.
setDefaultEditor()v4.0.503
Set the default editor for opening files from Remotion Studio. Available editors: vscode, cursor, windsurf, zed, vscodium, webstorm, sublime-text.
remotion.config.tsConfig .setDefaultEditor ('cursor');
See Opening files in a code editor for built-in editor IDs, custom editor configuration, and platform support.
setDefaultCodingAgent()v4.0.506
Set the default coding agent for Remotion Studio. Available coding agents: codex, cursor, copilot, claude-code.
remotion.config.tsConfig .setDefaultCodingAgent ('codex');
Available coding agents: codex, cursor, copilot, and claude-code.
The --coding-agent flag takes precedence over this option.
setAllowHtmlInCanvasEnabled()v4.0.447
When client-side rendering is enabled in the Studio, allow the experimental Chromium HTML-in-canvas API to be used for capturing frames. See HTML-in-canvas docs.
remotion.config.tsConfig .setAllowHtmlInCanvasEnabled (true);
The --allow-html-in-canvas flag takes precedence over this option.
setRspack()v4.0.502
Uses Rspack instead of Webpack as the bundler for the Studio or bundle.
remotion.config.tsConfig .setRspack (true);
The --rspack flag takes precedence over this option.
setExperimentalRspackEnabled()v4.0.426
setExperimentalRspackEnabled()Use setRspack() instead.
setExperimentalRspackEnabled() is an alias for setRspack().
setWebpackPollingInMilliseconds()v3.3.11
Enables Webpack polling instead of the file system event listeners for hot reloading. This is useful if you are inside a virtual machine or have a remote file system. Pass a value in milliseconds.
remotion.config.tsConfig .setWebpackPollingInMilliseconds (1000);
The --webpack-poll flag takes precedence over this option.
setNumberOfSharedAudioTags()v3.3.2
Set number of shared audio tags. See Using the numberOfSharedAudioTags prop for more information.
remotion.config.tsConfig .setNumberOfSharedAudioTags (5);
The --number-of-shared-audio-tags flag takes precedence over this option.
setShouldOpenBrowser()v3.3.19
If specified, Remotion will not open a browser window when starting the Studio.
remotion.config.tsConfig .setShouldOpenBrowser (false);
The --no-open flag takes precedence over this option.
setBrowserExecutable()v1.5.0
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.
remotion.config.tsConfig .setBrowserExecutable ('/usr/bin/google-chrome-stable');
The --browser-executable flag takes precedence over this option.
setDelayRenderTimeoutInMilliseconds()v2.6.3
previously named "setTimeoutInMilliseconds"
Define how long a single frame may take to resolve all delayRender() calls before it times out. Default: 30000
remotion.config.tsConfig .setDelayRenderTimeoutInMilliseconds (60000);
The --timeout flag takes precedence over this option.
setChromiumDisableWebSecurity()v2.6.5
This will most notably disable CORS in Chrome among other security features.
remotion.config.tsConfig .setChromiumDisableWebSecurity (true);
The --disable-web-security flag takes precedence over this option.
setChromiumDarkMode()v4.0.381
Whether Chromium should pretend to be in dark mode by emulating the media feature 'prefers-color-scheme: dark'. Default is false.
remotion.config.tsConfig .setChromiumDarkMode (true);
setChromiumIgnoreCertificateErrors()v2.6.5
Results in invalid SSL certificates in Chrome, such as self-signed ones, being ignored.
remotion.config.tsConfig .setChromiumIgnoreCertificateErrors (true);
The --ignore-certificate-errors flag takes precedence over this option.
setChromiumHeadlessMode()v2.6.5
If disabled, the render will open an actual Chrome window where you can see the render happen. This requires Chrome for Testing or a custom Chrome or Chromium executable. Chrome Headless Shell always runs headlessly. The default is headless mode.
remotion.config.tsConfig .setChromiumHeadlessMode (false);
setChromiumMultiProcessOnLinux()v4.0.42
Removes the --single-process flag that gets passed to Chromium on Linux by default. This will make the render faster because multiple processes can be used, but may cause issues with some Linux distributions or if window server libraries are missing.Default:
false until v4.0.136, then true from v4.0.137 on because newer Chrome versions don't allow rendering with the --single-process flag. This flag will be removed in Remotion v5.0.
remotion.config.tsConfig .setChromiumMultiProcessOnLinux (true);
setChromeMode()v4.0.248
One of headless-shell, chrome-for-testing. Default headless-shell. Use chrome-for-testing to take advantage of GPU drivers on Linux.
remotion.config.tsConfig .setChromeMode ('chrome-for-testing');
The --chrome-mode flag takes precedence over this option.
setChromiumOpenGlRenderer()
Changelog
- From Remotion v2.6.7 until v3.0.7, the default for Remotion Lambda was
swiftshader, but from v3.0.8 the default isswangle(Swiftshader on Angle) since Chrome 101 added support for it. - From Remotion v2.4.3 until v2.6.6, the default was
angle, however it turns out to have a small memory leak that could crash long Remotion renders.
Select the OpenGL renderer backend for Chromium.
Accepted values:
"angle""egl""swiftshader""swangle""vulkan"(from Remotion v4.0.41)"angle-egl"(from Remotion v4.0.51)
The default is null, letting Chrome decide, except on Lambda where the default is "swangle"
remotion.config.tsConfig .setChromiumOpenGlRenderer ('angle');
The --gl flag takes precedence over this option.
setConcurrency()
How many CPU threads to use. Minimum 1. The maximum is the amount of threads you have (In Node.JS os.cpus().length). You can also provide a percentage value (e.g. 50%).
remotion.config.tsConfig .setConcurrency (8);
The --concurrency flag takes precedence over this option.
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()v4.0.0
Determines which in which image format to render the frames. Either:
jpeg- the fastest option (default)png- slower, but supports transparencynone- don't render images, just calculate audio information
remotion.config.tsConfig .setVideoImageFormat ('png');
setStillImageFormat()v4.0.0
Determines which in which image format to render the frames. Either:
png(default)jpegpdfwebp
remotion.config.tsConfig .setStillImageFormat ('pdf');
setScale()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. Default: 1.
remotion.config.tsConfig .setScale (2);
The --scale flag takes precedence over this option.
setMuted()v3.2.1
Disables audio output. Default false.
remotion.config.tsConfig .setMuted (true);
The --muted flag takes precedence over this option.
setDisableSharedMemoryCapture()v4.0.534
Disables shared-memory capture and uses regular JPEG or PNG screenshots instead. Parallel encoding remains enabled. Default false.
remotion.config.tsConfig .setDisableSharedMemoryCapture (true);
The --disable-shared-memory-capture flag takes precedence over this option. Pass --disable-shared-memory-capture=false to override a configured opt-out.
setDisallowParallelEncoding()v4.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 for when it is enabled and how it works.
From v4.0.533, parallel encoding is no longer disabled automatically based on the available memory. Set this option if the machine runs out of memory while rendering.
remotion.config.tsConfig .setDisallowParallelEncoding (true);
The --disallow-parallel-encoding flag takes precedence over this option.
setEnforceAudioTrack()v3.2.1
Defaults to false. If true, include a silent audio track when the render contains no audio. If false, omit the audio track when no audio is present. Audio-only exports and separateAudioTo still produce an audio file, even when silent.
Set this to true for chunks that will later be concatenated, because other chunks may contain audio. muted: true takes precedence.
remotion.config.tsConfig .setEnforceAudioTrack (true);
The --enforce-audio-track flag takes precedence over this option.
setSampleRate()v4.0.448
Controls the sample rate of the output audio. The default is 48000 Hz. Match this to your source audio to avoid resampling artifacts.
remotion.config.tsConfig .setSampleRate (44100);
The --sample-rate flag takes precedence over this option.
setPreviewSampleRate()v4.0.470
Controls the sample rate used for audio playback during preview. When unset, Remotion uses 48000 Hz.
remotion.config.tsConfig .setPreviewSampleRate (44100);
The --preview-sample-rate flag takes precedence over this option.
setForSeamlessAacConcatenation()v4.0.123
If enabled, the audio is trimmed to the nearest AAC frame, which is required for seamless concatenation of AAC files. This is a requirement if you later want to combine multiple video snippets seamlessly.This option is used internally. There is currently no documentation yet for to concatenate the audio chunks.
remotion.config.tsConfig .setForSeamlessAacConcatenation (true);
The --for-seamless-aac-concatenation flag takes precedence over this option.
setFrameRange()v2.0.0
Render a subset of a video. Pass a single number to render a still, or a range (e.g. 0-9) to render a subset of frames. Pass 100- to render from frame 100 to the end.
remotion.config.tsConfig .setFrameRange (90); // To render only the 91st frame
or
remotion.config.tsConfig .setFrameRange ([0, 20]); // Render a video only containing the first 21 frames
or
remotion.config.tsConfig .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.v4.0.421
Pass multiple ordered, non-overlapping ranges to render discontinuous sections.v4.0.502
remotion.config.tsConfig .setFrameRange ([ [0, 100], [150, 200], ]);
The --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.
remotion.config.tsConfig .setJpegQuality (90);
The --jpeg-quality flag takes precedence over this option.
setDotEnvLocation()
Specify a location for a dotenv file. Default .env.
remotion.config.tsConfig .setDotEnvLocation ('.my-env');
The --env-file flag takes precedence over this option.
setEveryNthFrame()
This option may only be set when rendering GIFs. It determines how many frames are rendered, while the other ones get skipped in order to lower the FPS of the GIF. For example, if the fps is 30, and everyNthFrame is 2, the FPS of the GIF is 15.
remotion.config.tsConfig .setEveryNthFrame (2);
The --every-nth-frame flag takes precedence over this option.
setNumberOfGifLoops()
Allows you to set the number of loops as follows:null(or omitting in the CLI) plays the GIF indefinitely.0disables looping1loops the GIF once (plays twice in total)2loops the GIF twice (plays three times in total) and so on.
remotion.config.tsConfig .setNumberOfGifLoops (2);
The --number-of-gif-loops flag takes precedence over this option.
setOutputLocation()v3.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.
remotion.config.tsConfig .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.
remotion.config.tsConfig .setOverwriteOutput (false);
In version 1.x, the default behavior was inverse - Remotion would not override by default.
setPixelFormat()
Sets the pixel format in FFmpeg. See the FFmpeg docs for an explanation. Acceptable values: "yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le".
remotion.config.tsConfig .setPixelFormat ('yuv420p');
The --pixel-format flag takes precedence over this option.
setCodec()v1.4.0
Choose one of the supported codecs: h264 (default), h265, vp8, vp9, av1.
h264is the classic MP4 file as you know it.h265is the successor of H264, with smaller file sizes. Also known as HEVC. Poor browser compatibility.vp8is the codec for WebM.vp9is the next-generation codec for WebM. Lower file size, longer compression time.av1is the successor of VP9 and achieves lower file size, with longer compression time.proresis a common codec if you want to import the output into another video editing program (available from v2.1.6)mp3will export audio only as an MP3 file (available from v2.0)wavwill export audio only as an WAV file (available from v2.0)aacwill 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.
remotion.config.tsConfig .setCodec ('h265');
The --codec flag takes precedence over this option.
See also: Encoding guide
setAudioCodec()
remotion.config.tsConfig .setAudioCodec ('pcm-16');
Choose the encoding of your audio.
- The default is dependent on the chosen
codec. - Choose
pcm-16if you need uncompressed audio. - Not all video containers support all audio codecs.
- This option takes precedence if the
codecoption also specifies an audio codec.
The --audio-codec flag takes precedence over this option.
Refer to the Encoding guide to see defaults and supported combinations.
setProResProfile()v2.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". Default: "hq". See here for an explanation of possible values.
remotion.config.tsConfig .setProResProfile ('4444');
The --prores-profile flag takes precedence over this option.
setX264Preset()v4.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
remotion.config.tsConfig .setX264Preset ('fast');
The --x264-preset flag takes precedence over this option.
See also: Encoding guide, Transparent videos
setGopSize()v4.0.466
Set the maximum number of frames between two keyframes. This maps to FFmpeg's -g option. Default: Let the encoder decide.
remotion.config.tsConfig .setGopSize (239);
The --gop flag takes precedence over this option.
setImageSequence()v1.4.0
Pass this flag to output an image sequence instead of a video. The default image format is JPEG. See setImageSequence() for more details.
remotion.config.tsConfig .setImageSequence (true);
The --sequence flag takes precedence over this option.
overrideHeight()v3.2.40
Overrides the height of the composition.
remotion.config.tsConfig .overrideHeight (600);
The --height flag takes precedence over this option.
overrideWidth()v3.2.40
Overrides the width of the composition.
remotion.config.tsConfig .overrideWidth (900);
The --width flag takes precedence over this option.
overrideFps()v4.0.424
Overrides the frames per second of the composition.
remotion.config.tsConfig .overrideFps (25);
The --fps flag takes precedence over this option.
overrideDuration()v4.0.424
Overrides the duration in frames of the composition.
remotion.config.tsConfig .overrideDuration (300);
The --duration flag takes precedence over this option.
setCrf()v1.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:
h264crf range is 1-51 where crf 18 is default.h265crf range is 0-51 where crf 23 is default.vp8crf range is 4-63 where crf 9 is default.vp9crf range is 0-63 where crf 28 is default.av1crf 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.
remotion.config.tsConfig .setCrf (16);
The --crf flag takes precedence over this option.
If you enable hardware acceleration, you cannot set a crf. Use the setVideoBitrate() option instead.
setVideoBitrate()v3.2.32
Specify the target bitrate for the generated video. The syntax for FFmpeg's-b:v parameter should be used. FFmpeg may encode the video in a way that will not result in the exact video bitrate specified. Example values: 512K for 512 kbps, 1M for 1 Mbps.
remotion.config.tsConfig .setVideoBitrate ('1M');
The --video-bitrate flag takes precedence over this option.
setEncodingBufferSize()v4.0.78
The value for the -bufsize flag of FFmpeg. Should be used in conjunction with the encoding max rate flag. With the VP8, VP9 and AV1 codecs, a video bitrate must also be set.
remotion.config.tsConfig .setEncodingBufferSize ('10000k');
The --buffer-size flag takes precedence over this option.
setEncodingMaxRate()v4.0.78
The value for the -maxrate flag of FFmpeg. Should be used in conjunction with the encoding buffer size flag. With the VP8, VP9 and AV1 codecs, a video bitrate must also be set.
remotion.config.tsConfig .setEncodingMaxRate ('5000k');
The --max-rate flag takes precedence over this option.
setAudioBitrate()v3.2.32
Specify the target bitrate for the generated video. The syntax for FFmpeg's -b:a parameter should be used. FFmpeg may encode the video in a way that will not result in the exact audio bitrate specified. Example values: 512K for 512 kbps, 1M for 1 Mbps. Default: 320k
remotion.config.tsConfig .setAudioBitrate ('128K');
The --audio-bitrate flag takes precedence over this option.
setAudioLatencyHint()v4.0.303
Sets the audio latency hint for the global AudioContext context that Remotion uses to play audio.Possible values:
interactive, balanced, playback
remotion.config.tsConfig .setAudioLatencyHint ('interactive');
The --audio-latency-hint flag takes precedence over this option.
setExperimentalKeepAudioContextAlive()v4.0.508
We are currently testing this prop. We might either remove the functionality or rename the prop to a stable name.
AudioContext running while the Remotion Studio is paused.
Keeps the shared 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.
remotion.config.tsConfig .setExperimentalKeepAudioContextAlive (true);
Changing this option while the Studio is running reloads the page. The --experimental-keep-audio-context-alive flag takes precedence over this option.
setEnableFolderExpiry()v4.0.32
When deploying sites, enable or disable S3 Lifecycle policies which allow for renders to auto-delete after a certain time. Default is null, which does not change any lifecycle policies of the S3 bucket. See: Lambda autodelete.
remotion.config.tsConfig .setEnableFolderExpiry (true);
setEnableCancellation()v4.0.515
Allows a Lambda render to be cancelled by pressing Ctrl+C while running npx remotion lambda render. Enabling cancellation causes each renderer function to poll S3 once per second while it is running.
remotion.config.tsConfig .setEnableCancellation (true);
The --enable-cancellation flag takes precedence over this option.
setLambdaInsights()v4.0.115
Enable Lambda Insights in AWS CloudWatch. For this to work, you may have to update your role permission.
remotion.config.tsConfig .setLambdaInsights (true);
setDeleteAfter()v4.0.32
Automatically delete the render after a certain period. Accepted values are 1-day, 3-days, 7-days and 30-days.For this to work, your bucket needs to have lifecycles enabled.
remotion.config.tsConfig .setDeleteAfter ('3-days');
setBeepOnFinish()v4.0.84
Whether the Remotion Studio tab should beep when the render is finished.
remotion.config.tsConfig .setBeepOnFinish (true);
The --beep-on-finish flag takes precedence over this option.
setEnableCrossSiteIsolation()v4.0.306
Enable Cross-Site Isolation in the Studio (sets Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy HTTP headers, required for @remotion/whisper-web).
remotion.config.tsConfig .setEnableCrossSiteIsolation (true);
The --cross-site-isolation flag takes precedence over this option.
setAskAIEnabled()v4.0.407
If the Cmd + I shortcut of the Ask AI modal conflicts with your Studio, you can disable it using this.
remotion.config.tsConfig .setAskAIEnabled (false);
The --disable-ask-ai flag takes precedence over this option.
setForceNewStudioEnabled()v4.0.421
Forces starting a new Studio instance even if one is already running on the same port for the same project.
remotion.config.tsConfig .setForceNewStudioEnabled (true);
The --force-new flag takes precedence over this option.
setIPv4()v4.0.125
Forces Remotion to bind to an IPv4 interface for the Studio server.
remotion.config.tsConfig .setIPv4 (true);
The --ipv4 flag takes precedence over this option.
setBufferStateDelayInMilliseconds()v4.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.
remotion.config.tsConfig .setBufferStateDelayInMilliseconds (0);
setBinariesDirectory()v4.0.120
The directory where the platform-specific binaries and libraries that Remotion needs are located. Those include an ffmpeg and ffprobe binary, a Rust binary for various tasks, and various shared libraries. If the value is set to null, which is the default, then the path of a platform-specific package located at node_modules/@remotion/compositor-* is selected.This option is useful in environments where Remotion is not officially supported to run like bundled serverless functions or Electron.
remotion.config.tsConfig .setBinariesDirectory ('/path/to/custom/directory');
setPreferLosslessAudio()v4.0.123
Uses a lossless audio codec, if one is available for the codec. If you setaudioCodec, it takes priority over preferLossless.
remotion.config.tsConfig .setPreferLosslessAudio (true);
setHardwareAcceleration()v4.0.228
One of
"disable", "if-possible", or "required"
. Default "disable". Encode using a hardware-accelerated encoder if
available. If set to "required" and no hardware-accelerated encoder is
available, then the render will fail.
remotion.config.tsConfig .setHardwareAcceleration ('if-possible');
overrideFfmpegCommand()v3.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.
remotion.config.tsConfig .overrideFfmpegCommand (({args }) => { // Define the custom FFmpeg options as an array of strings constcustomFfmpegOptions = ['-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 pathargs .splice (args .length - 1, 0, ...customFfmpegOptions ); returnargs ; });
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,pre-stitcherencodes the video while frames are rendered, thenstitchermuxes the encoded video and any audio into the output file. Otherwise, the function is called once withstitcher, which performs encoding and muxing together. You can tell whether parallel encoding is enabled by adding--log=verboseto 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.
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(), 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()v4.0.398
The public license key for your company license, obtained from the License keys page on remotion.pro. If you are eligible for the free license, pass "free-license".
remotion.config.tsConfig .setPublicLicenseKey ('your-license-key');
The --public-license-key flag takes precedence over this option.
setImageSequencePattern()
Pattern for naming image sequence files. Supports [frame] for the zero-padded frame number and [ext] for the file extension.
remotion.config.tsConfig .setImageSequencePattern ('frame_[frame]_custom.[ext]');
The --image-sequence-pattern flag takes precedence over this option.
setQuality()
setQuality()Renamed to setJpegQuality in v4.0.0.
setFfmpegExecutable()
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.
remotion.config.tsConfig.setFfmpegExecutable('/path/to/custom/ffmpeg');
The command line flag --ffmpeg-executable will take precedence over this option.
setFfprobeExecutable()
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.
remotion.config.tsConfig.setFfprobeExecutable('/path/to/custom/ffprobe');
The command line flag --ffprobe-executable will take precedence over this option.
setPort()
setPort()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.
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, a server will be started to host it (
setStudioPort()). - During rendering, a HTTP server is also started in the background to serve the Webpack bundle (
setRendererPort()).
Use the options individually.
remotion.config.tsConfig .setPort (3003);
The --port flag takes precedence over this option. If set on npx remotion studio, it will set the Studio port, otherwise the renderer port.
setOutputFormat()
setOutputFormat()Removed in v4.0.0
Deprecated. Use setCodec() and setImageSequence() instead.
Either 'mp4' or 'png-sequence'.
remotion.config.tsimport {Config} from '@remotion/cli/config'; // ---cut--- Config.setOutputFormat('mp4');
The --sequence and --codec flags take precedence over this option.
The command line flag --quality will take precedence over this option.
setImageFormat()v1.4.0
setImageFormat()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 transparencynone- don't render images, just calculate audio information (available from v2.0)
remotion.config.tsimport {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():
remotion.config.tsimport {Config } from '@remotion/cli/config';Config .overrideWebpackConfig (async (currentConfiguration ) => { const {enableSass } = await import('./src/enable-sass'); returnenableSass (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:
remotion.config.tsConfig.Bundling.setCachingEnabled(false);
From v3.3.39 on, all options can be accessed directly from the Config object.
remotion.config.tsConfig .setCachingEnabled (false);
The old way is deprecated, but will work for the foreseeable future.