441 lines
20 KiB
TypeScript
441 lines
20 KiB
TypeScript
import type { WebpackConfiguration } from '@remotion/bundler';
|
|
import type { BrowserExecutable, ChromeMode, CodecOrUndefined, ColorSpace, Crf, DeleteAfter, FrameRange, NumberOfGifLoops, StillImageFormat, VideoImageFormat } from '@remotion/renderer';
|
|
import type { HardwareAccelerationOption } from '@remotion/renderer/client';
|
|
import type { Concurrency } from './concurrency';
|
|
import type { WebpackOverrideFn } from './override-webpack';
|
|
export type { Concurrency, WebpackConfiguration, WebpackOverrideFn };
|
|
declare global {
|
|
interface RemotionBundlingOptions {
|
|
/**
|
|
* Specify the entry point so you don't have to specify it in the
|
|
* CLI command
|
|
*/
|
|
readonly setEntryPoint: (src: string) => void;
|
|
/**
|
|
* Whether Webpack bundles should be cached to make
|
|
* subsequent renders faster. Default: true
|
|
*/
|
|
readonly setCachingEnabled: (flag: boolean) => void;
|
|
/**
|
|
* @deprecated
|
|
* Use `setStudioPort()` and `setRendererPort()` instead.
|
|
*/
|
|
readonly setPort: (port: number | undefined) => void;
|
|
/**
|
|
* Set the HTTP port used by the Studio.
|
|
* 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.
|
|
*/
|
|
readonly setStudioPort: (port: number | undefined) => void;
|
|
/**
|
|
* Set the HTTP port used to host the Webpack bundle.
|
|
* 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.
|
|
*/
|
|
readonly setRendererPort: (port: number | undefined) => void;
|
|
/**
|
|
* Define the location of the public/ directory.
|
|
* By default it is a folder named "public" inside the current working directory.
|
|
* You can set an absolute path or a relative path that will be resolved from the closest package.json location.
|
|
*/
|
|
readonly setPublicDir: (publicDir: string | null) => void;
|
|
readonly overrideWebpackConfig: (f: WebpackOverrideFn) => void;
|
|
}
|
|
interface RemotionConfigObject {
|
|
/**
|
|
* Change the maximum amount of tracks that are shown in the timeline.
|
|
* @param maxTracks The maximum amount of timeline tracks that you would like to show.
|
|
* @default 15
|
|
*/
|
|
readonly setMaxTimelineTracks: (maxTracks: number) => void;
|
|
/**
|
|
* Enable Keyboard shortcuts in the Remotion Studio.
|
|
* @param enabled Boolean whether to enable the keyboard shortcuts
|
|
* @default true
|
|
*/
|
|
readonly setKeyboardShortcutsEnabled: (enableShortcuts: boolean) => void;
|
|
/**
|
|
* Enable WIP client-side rendering in the Remotion Studio.
|
|
* See https://www.remotion.dev/docs/client-side-rendering/ for notes.
|
|
* @param enabled Boolean whether to enable client-side rendering
|
|
* @default false
|
|
*/
|
|
readonly setExperimentalClientSideRenderingEnabled: (enabled: boolean) => void;
|
|
/**
|
|
* Set number of shared audio tags. https://www.remotion.dev/docs/player/autoplay#using-the-numberofsharedaudiotags-prop
|
|
* @param numberOfAudioTags
|
|
* @default 0
|
|
*/
|
|
readonly setNumberOfSharedAudioTags: (numberOfAudioTags: number) => void;
|
|
/**
|
|
* Enable Webpack polling instead of file system listeners for hot reloading in the Studio.
|
|
* This is useful if you are using a remote directory or a virtual machine.
|
|
* @param interval
|
|
* @default null
|
|
*/
|
|
readonly setWebpackPollingInMilliseconds: (interval: number | null) => void;
|
|
/**
|
|
* Whether Remotion should open a browser when starting the Studio.
|
|
* @param should
|
|
* @default true
|
|
*/
|
|
readonly setShouldOpenBrowser: (should: boolean) => void;
|
|
/**
|
|
* Set the log level.
|
|
* Acceptable values: 'error' | 'warning' | 'info' | 'verbose' | 'trace'
|
|
* Default value: 'info'
|
|
*
|
|
* Set this to 'verbose' to get browser logs and other IO.
|
|
*/
|
|
readonly setLevel: (newLogLevel: 'trace' | 'verbose' | 'info' | 'warn' | 'error') => void;
|
|
/**
|
|
* Specify executable path for the browser to use.
|
|
* Default: null, which will make Remotion find or download a version of said browser.
|
|
*/
|
|
readonly setBrowserExecutable: (newBrowserExecutablePath: BrowserExecutable) => void;
|
|
/**
|
|
* Set how many milliseconds a frame may take to render before it times out.
|
|
* Default: `30000`
|
|
*/
|
|
readonly setDelayRenderTimeoutInMilliseconds: (newPuppeteerTimeout: number) => void;
|
|
/**
|
|
* @deprecated Renamed to `setDelayRenderTimeoutInMilliseconds`.
|
|
* Set how many milliseconds a frame may take to render before it times out.
|
|
* Default: `30000`
|
|
*/
|
|
readonly setTimeoutInMilliseconds: (newPuppeteerTimeout: number) => void;
|
|
/**
|
|
* Setting deciding whether to disable CORS and other Chrome security features.
|
|
* Default: false
|
|
*/
|
|
readonly setChromiumDisableWebSecurity: (should: boolean) => void;
|
|
/**
|
|
* Setting whether to ignore any invalid SSL certificates, such as self-signed ones.
|
|
* Default: false
|
|
*/
|
|
readonly setChromiumIgnoreCertificateErrors: (should: boolean) => void;
|
|
/**
|
|
* If false, will open an actual browser during rendering to observe progress.
|
|
* Default: true
|
|
*/
|
|
readonly setChromiumHeadlessMode: (should: boolean) => void;
|
|
/**
|
|
* Set whether to use dark mode for Chrome.
|
|
* Default: false
|
|
*/
|
|
readonly setChromiumDarkMode: (should: boolean) => void;
|
|
/**
|
|
* Set the OpenGL rendering backend for Chrome. Possible values: 'egl', 'angle', 'swiftshader', 'swangle', 'vulkan' and 'angle-egl'.
|
|
* Default: 'swangle' in Lambda, null elsewhere.
|
|
*/
|
|
readonly setChromiumOpenGlRenderer: (renderer: 'swangle' | 'angle' | 'egl' | 'swiftshader' | 'vulkan' | 'angle-egl') => void;
|
|
/**
|
|
* Set the user agent for Chrome. Only works during rendering.
|
|
* Default is the default user agent for Chrome
|
|
*/
|
|
readonly setChromiumUserAgent: (userAgent: string | null) => void;
|
|
/**
|
|
* Set a custom location for a .env file.
|
|
* Default: `.env`
|
|
*/
|
|
readonly setDotEnvLocation: (file: string) => void;
|
|
/**
|
|
* Sets how many Puppeteer instances will work on rendering your video in parallel.
|
|
* Default: `null`, meaning half of the threads available on your CPU.
|
|
*/
|
|
readonly setConcurrency: (newConcurrency: Concurrency) => void;
|
|
/**
|
|
* @deprecated Renamed to `setJpegQuality`.
|
|
*/
|
|
readonly setQuality: (q: never) => void;
|
|
/**
|
|
* @deprecated Separated into `setStillImageFormat()` and `setVideoImageFormat()`.
|
|
*/
|
|
readonly setImageFormat: (q: never) => void;
|
|
/**
|
|
* Set the JPEG quality for the frames.
|
|
* Must be between 0 and 100.
|
|
* Default: 80
|
|
*/
|
|
readonly setJpegQuality: (q: number | undefined) => void;
|
|
/** Decide the image format for still renders.
|
|
*/
|
|
readonly setStillImageFormat: (format: StillImageFormat) => void;
|
|
/** Decide in which image format to render. Can be either 'jpeg' or 'png'.
|
|
* PNG is slower, but supports transparency.
|
|
*/
|
|
readonly setVideoImageFormat: (format: VideoImageFormat) => void;
|
|
/**
|
|
* Render only a subset of a video.
|
|
* Pass in a tuple [20, 30] to only render frames 20-30 into a video.
|
|
* Pass in a single number `20` to only render a single frame as an image.
|
|
* The frame count starts at 0.
|
|
*/
|
|
readonly setFrameRange: (newFrameRange: FrameRange | null) => void;
|
|
/**
|
|
* Scales the output dimensions by a factor.
|
|
* Default: 1.
|
|
*/
|
|
readonly setScale: (newScale: number) => void;
|
|
/**
|
|
* Specify which frames should be picked for rendering a GIF
|
|
* Default: 1, which means every frame
|
|
* https://remotion.dev/docs/render-as-gif
|
|
*/
|
|
readonly setEveryNthFrame: (frame: number) => void;
|
|
/**
|
|
* Specify the number of Loop a GIF should have.
|
|
* Default: null (means GIF will loop infinite)
|
|
*/
|
|
readonly setNumberOfGifLoops: (newLoop: NumberOfGifLoops) => void;
|
|
/**
|
|
* Disable audio output.
|
|
* Default: false
|
|
*/
|
|
readonly setMuted: (muted: boolean) => void;
|
|
/**
|
|
* Don't render an audio track if it would be silent.
|
|
* Default: true
|
|
*/
|
|
readonly setEnforceAudioTrack: (enforceAudioTrack: boolean) => void;
|
|
/**
|
|
* Prepare a video for later seamless audio concatenation.
|
|
* Default: false
|
|
*/
|
|
readonly setForSeamlessAacConcatenation: (forSeamlessAacConcatenation: boolean) => void;
|
|
/**
|
|
* Set the output file location string. Default: `out/{composition}.{codec}`
|
|
*/
|
|
readonly setOutputLocation: (newOutputLocation: string) => void;
|
|
/**
|
|
* If the video file already exists, should Remotion overwrite
|
|
* the output? Default: true
|
|
*/
|
|
readonly setOverwriteOutput: (newOverwrite: boolean) => void;
|
|
/**
|
|
* Sets the pixel format in FFmpeg.
|
|
* See https://trac.ffmpeg.org/wiki/Chroma%20Subsampling for an explanation.
|
|
* You can override this using the `--pixel-format` Cli flag.
|
|
*/
|
|
readonly setPixelFormat: (format: 'yuv420p' | 'yuva420p' | 'yuv422p' | 'yuv444p' | 'yuv420p10le' | 'yuv422p10le' | 'yuv444p10le' | 'yuva444p10le') => void;
|
|
/**
|
|
* Specify the codec for stitching the frames into a video.
|
|
* Can be `h264` (default), `h265`, `vp8` or `vp9`
|
|
*/
|
|
readonly setCodec: (newCodec: CodecOrUndefined) => void;
|
|
/**
|
|
* Set the Constant Rate Factor to pass to FFmpeg.
|
|
* Lower values mean better quality, but be aware that the ranges of
|
|
* possible values greatly differs between codecs.
|
|
*/
|
|
readonly setCrf: (newCrf: Crf) => void;
|
|
/**
|
|
* Set to true if don't want a video but an image sequence as the output.
|
|
*/
|
|
readonly setImageSequence: (newImageSequence: boolean) => void;
|
|
/**
|
|
* Overrides the height of a composition
|
|
*/
|
|
readonly overrideHeight: (newHeight: number) => void;
|
|
/**
|
|
* Overrides the width of a composition
|
|
*/
|
|
readonly overrideWidth: (newWidth: number) => void;
|
|
/**
|
|
* Set the ProRes profile.
|
|
* This method is only valid if the codec has been set to 'prores'.
|
|
* Possible values: 4444-xq, 4444, hq, standard, light, proxy. Default: 'hq'
|
|
* See https://avpres.net/FFmpeg/im_ProRes.html for meaning of possible values.
|
|
*/
|
|
readonly setProResProfile: (profile: '4444-xq' | '4444' | 'hq' | 'standard' | 'light' | 'proxy' | undefined) => void;
|
|
readonly setX264Preset: (profile: 'ultrafast' | 'superfast' | 'veryfast' | 'faster' | 'fast' | 'medium' | 'slow' | 'slower' | 'veryslow' | 'placebo' | null) => void;
|
|
/**
|
|
* Override the arguments that Remotion passes to FFmpeg.
|
|
* Consult https://remotion.dev/docs/renderer/render-media#ffmpegoverride before using this feature.
|
|
*/
|
|
readonly overrideFfmpegCommand: (command: (info: {
|
|
type: 'pre-stitcher' | 'stitcher';
|
|
args: string[];
|
|
}) => string[]) => void;
|
|
/**
|
|
* Set a target audio bitrate to be passed to FFmpeg.
|
|
*/
|
|
readonly setAudioBitrate: (bitrate: string | null) => void;
|
|
/**
|
|
* Set a target video bitrate to be passed to FFmpeg.
|
|
* Mutually exclusive with setCrf().
|
|
*/
|
|
readonly setVideoBitrate: (bitrate: string | null) => void;
|
|
/**
|
|
* Set the audio latency hint that the Studio will
|
|
* use when playing back audio
|
|
* Default: 'interactive'
|
|
*/
|
|
readonly setAudioLatencyHint: (audioLatencyHint: AudioContextLatencyCategory | null) => void;
|
|
/**
|
|
* Set a maximum bitrate to be passed to FFmpeg.
|
|
*/
|
|
readonly setEncodingMaxRate: (bitrate: string | null) => void;
|
|
/**
|
|
* Set a buffer size to be passed to FFmpeg.
|
|
*/
|
|
readonly setEncodingBufferSize: (bitrate: string | null) => void;
|
|
/**
|
|
* Opt into bt709 rendering.
|
|
*/
|
|
readonly setColorSpace: (colorSpace: ColorSpace) => void;
|
|
/**
|
|
* 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
|
|
*/
|
|
readonly setDisallowParallelEncoding: (disallowParallelEncoding: boolean) => void;
|
|
/**
|
|
* Enables or disables the Ask AI Modal in Studio
|
|
*/
|
|
readonly setAskAIEnabled: (askAIEnabled: boolean) => void;
|
|
/**
|
|
* 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.
|
|
*/
|
|
readonly setChromiumMultiProcessOnLinux: (multiProcessOnLinux: boolean) => void;
|
|
/**
|
|
* Whether the Remotion Studio should play a beep sound when a render has finished.
|
|
*/
|
|
readonly setBeepOnFinish: (beepOnFinish: boolean) => void;
|
|
/**
|
|
* Enable Cross-Site Isolation in the Studio (Sets Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy HTTP headers)
|
|
*/
|
|
readonly setEnableCrossSiteIsolation: (enableCrossSiteIsolation: boolean) => void;
|
|
/**
|
|
* Collect information that you can submit to Remotion if asked for a reproduction.
|
|
*/
|
|
readonly setRepro: (enableRepro: boolean) => void;
|
|
/**
|
|
* The directory where the platform-specific binaries and libraries needed
|
|
for Remotion are located.
|
|
*/
|
|
readonly setBinariesDirectory: (directory: string | null) => void;
|
|
/**
|
|
* Prefer lossless audio encoding. Default: false
|
|
*/
|
|
readonly setPreferLosslessAudio: (lossless: boolean) => void;
|
|
/**
|
|
* Prefer lossless audio encoding. Default: false
|
|
*/
|
|
readonly setPublicPath: (publicPath: string | null) => void;
|
|
/**
|
|
* Set the pattern for naming image sequence files. Supports [frame] and [ext] replacements.
|
|
* @param pattern The pattern string, e.g. 'frame_[frame].[ext]'.
|
|
*/
|
|
readonly setImageSequencePattern: (pattern: string | null) => void;
|
|
/**
|
|
* Set the public license key for your company license.
|
|
* Obtain it from the "Usage" tab on https://remotion.pro
|
|
* Pass "free-license" if you are eligible for the free license.
|
|
*/
|
|
readonly setPublicLicenseKey: (key: string | null) => void;
|
|
}
|
|
}
|
|
type FlatConfig = RemotionConfigObject & RemotionBundlingOptions & {
|
|
/**
|
|
* Set the audio codec to use for the output video.
|
|
* See the Encoding guide in the docs for defaults and available options.
|
|
*/
|
|
setAudioCodec: (codec: 'pcm-16' | 'aac' | 'mp3' | 'opus') => void;
|
|
setOffthreadVideoCacheSizeInBytes: (size: number | null) => void;
|
|
/**
|
|
* Forces starting a new Studio instance even if one is already running on the same port for the same project.
|
|
* Default: false
|
|
*/
|
|
setForceNewStudioEnabled: (forceNew: boolean) => void;
|
|
setDeleteAfter: (day: DeleteAfter | null) => void;
|
|
/**
|
|
* Set whether S3 buckets should be allowed to expire.
|
|
*/
|
|
setEnableFolderExpiry: (value: boolean | null) => void;
|
|
/**
|
|
* Set whether Lambda Insights should be enabled when deploying a function.
|
|
*/
|
|
setLambdaInsights: (value: boolean) => void;
|
|
/**
|
|
* 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.
|
|
*/
|
|
setBufferStateDelayInMilliseconds: (delay: number | null) => void;
|
|
/**
|
|
* Metadata to be embedded into the output video file.
|
|
*/
|
|
setMetadata: (metadata: Record<string, string>) => void;
|
|
/**
|
|
*
|
|
*/
|
|
setHardwareAcceleration: (hardwareAccelerationOption: HardwareAccelerationOption) => void;
|
|
/**
|
|
* Choose between using Chrome Headless Shell or Chrome for Testing
|
|
*/
|
|
setChromeMode: (chromeMode: ChromeMode) => void;
|
|
/**
|
|
* @deprecated 'The config format has changed. Change `Config.Bundling.*()` calls to `Config.*()` in your config file.'
|
|
*/
|
|
Bundling: void;
|
|
/**
|
|
* @deprecated 'The config format has changed. Change `Config.Preview.*()` calls to `Config.*()` in your config file.'
|
|
*/
|
|
Preview: void;
|
|
/**
|
|
* @deprecated 'The config format has changed. Change `Config.Log.*()` calls to `Config.*()` in your config file.'
|
|
*/
|
|
Log: void;
|
|
/**
|
|
* @deprecated 'The config format has changed. Change `Config.Puppeteer.*()` calls to `Config.*()` in your config file.'
|
|
*/
|
|
Puppeteer: void;
|
|
/**
|
|
* @deprecated 'The config format has changed. Change `Config.Rendering.*()` calls to `Config.*()` in your config file.'
|
|
*/
|
|
Rendering: void;
|
|
/**
|
|
* @deprecated 'The config format has changed. Change `Config.Output.*()` calls to `Config.*()` in your config file.'
|
|
*/
|
|
Output: void;
|
|
};
|
|
export declare const Config: FlatConfig;
|
|
export declare const ConfigInternals: {
|
|
getRange: () => FrameRange | null;
|
|
getBrowser: () => null;
|
|
getPixelFormat: () => "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
getProResProfile: () => import("remotion")._InternalTypes["ProResProfile"] | undefined;
|
|
getBrowserExecutable: () => BrowserExecutable;
|
|
getStudioPort: () => number | undefined;
|
|
getRendererPortFromConfigFile: () => number | null;
|
|
getRendererPortFromConfigFileAndCliFlag: () => number | null;
|
|
getChromiumDisableWebSecurity: () => boolean;
|
|
getIgnoreCertificateErrors: () => boolean;
|
|
getEveryNthFrame: () => number;
|
|
getConcurrency: () => string | number | null;
|
|
getStillFrame: () => number;
|
|
getShouldOutputImageSequence: (frameRange: FrameRange | null) => boolean;
|
|
getDotEnvLocation: () => string | null;
|
|
getUserPreferredStillImageFormat: () => "png" | "jpeg" | "pdf" | "webp" | undefined;
|
|
getUserPreferredVideoImageFormat: () => "png" | "jpeg" | "none" | undefined;
|
|
getWebpackOverrideFn: () => WebpackOverrideFn;
|
|
getWebpackCaching: () => boolean;
|
|
getOutputLocation: () => string | null;
|
|
setFrameRangeFromCli: (newFrameRange: string | number) => void;
|
|
setStillFrame: (frame: number) => void;
|
|
getMaxTimelineTracks: () => number;
|
|
defaultOverrideFunction: WebpackOverrideFn;
|
|
getFfmpegOverrideFunction: () => import("@remotion/renderer").FfmpegOverrideFn;
|
|
getHeight: () => number | null;
|
|
getWidth: () => number | null;
|
|
getMetadata: () => Record<string, string>;
|
|
getEntryPoint: () => string | null;
|
|
getWebpackPolling: () => number | null;
|
|
getShouldOpenBrowser: () => boolean;
|
|
getChromiumUserAgent: () => string | null;
|
|
getBufferStateDelayInMilliseconds: () => number | null;
|
|
getOutputCodecOrUndefined: () => import("@remotion/renderer/dist/codec").CodecOrUndefined;
|
|
};
|