remotion 3.3.43 → 3.3.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,11 +7,11 @@
7
7
  </a>
8
8
  </p>
9
9
 
10
- [![Discord Shield](https://discordapp.com/api/guilds/809501355504959528/widget.png?style=shield)](https://remotion.dev/discord)
11
- [![NPM Version](https://img.shields.io/npm/v/remotion.svg?style=flat)](https://www.npmjs.org/package/remotion)
12
- [![NPM Downloads](https://img.shields.io/npm/dm/remotion.svg?style=flat)](https://npmcharts.com/compare/remotion?minimal=true)
13
- [![Install Size](https://packagephobia.now.sh/badge?p=remotion)](https://packagephobia.now.sh/result?p=remotion)
14
- <a href="https://twitter.com/remotion"><img src="https://img.shields.io/twitter/follow/remotion?label=Twitter&style=social" alt="Twitter"></a>
10
+ [![Discord Shield](https://img.shields.io/discord/809501355504959528?color=000000&label=Discord&logo=fdgssdf)](https://remotion.dev/discord)
11
+ [![NPM Version](https://img.shields.io/npm/v/remotion.svg?style=flat&color=black)](https://www.npmjs.org/package/remotion)
12
+ [![NPM Downloads](https://img.shields.io/npm/dm/remotion.svg?style=flat&color=black&label=Downloads)](https://npmcharts.com/compare/remotion?minimal=true)
13
+ [![Open Bounties](https://img.shields.io/endpoint?url=https%3A%2F%2Fconsole.algora.io%2Fapi%2Fshields%2Fremotion%2Fbounties%3Fstatus%3Dopen&style=flat&color=black&labelColor=grey&label=Open+Bounties)](https://github.com/remotion-dev/remotion/issues?q=is%3Aopen+label%3A%22%F0%9F%92%8E+Bounty%22+sort%3Aupdated-desc)
14
+ <a href="https://twitter.com/remotion"><img src="https://img.shields.io/twitter/follow/remotion?label=Twitter&color=black" alt="Twitter"></a>
15
15
 
16
16
  Remotion is a framework for **creating videos programmatically using React.**
17
17
 
@@ -49,19 +49,29 @@ const CompositionManagerProvider = ({ children }) => {
49
49
  // Wontfix, expected to have
50
50
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
51
51
  const [compositions, setCompositions] = (0, react_1.useState)([]);
52
+ const currentcompositionsRef = (0, react_1.useRef)(compositions);
52
53
  const [currentComposition, setCurrentComposition] = (0, react_1.useState)(null);
53
54
  const [assets, setAssets] = (0, react_1.useState)([]);
54
55
  const [folders, setFolders] = (0, react_1.useState)([]);
55
56
  const [sequences, setSequences] = (0, react_1.useState)([]);
56
57
  const [currentCompositionMetadata, setCurrentCompositionMetadata] = (0, react_1.useState)(null);
57
- const registerComposition = (0, react_1.useCallback)((comp) => {
58
+ const updateCompositions = (0, react_1.useCallback)(
59
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
60
+ (updateComps) => {
58
61
  setCompositions((comps) => {
62
+ const updated = updateComps(comps);
63
+ currentcompositionsRef.current = updated;
64
+ return updated;
65
+ });
66
+ }, []);
67
+ const registerComposition = (0, react_1.useCallback)((comp) => {
68
+ updateCompositions((comps) => {
59
69
  if (comps.find((c) => c.id === comp.id)) {
60
70
  throw new Error(`Multiple composition with id ${comp.id} are registered.`);
61
71
  }
62
72
  return [...comps, comp].slice().sort((a, b) => a.nonce - b.nonce);
63
73
  });
64
- }, []);
74
+ }, [updateCompositions]);
65
75
  const registerSequence = (0, react_1.useCallback)((seq) => {
66
76
  setSequences((seqs) => {
67
77
  return [...seqs, seq];
@@ -111,9 +121,9 @@ const CompositionManagerProvider = ({ children }) => {
111
121
  }, [assets]);
112
122
  (0, react_1.useImperativeHandle)(exports.compositionsRef, () => {
113
123
  return {
114
- getCompositions: () => compositions,
124
+ getCompositions: () => currentcompositionsRef.current,
115
125
  };
116
- }, [compositions]);
126
+ }, []);
117
127
  const contextValue = (0, react_1.useMemo)(() => {
118
128
  return {
119
129
  compositions,
@@ -0,0 +1,5 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
3
+ export declare const Satori: React.FC<PropsWithChildren>;
4
+ export declare const SatoriForRendering: React.FC<PropsWithChildren>;
5
+ export declare const SatoriForDevelopment: React.FC<PropsWithChildren>;
package/dist/Satori.js ADDED
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.SatoriForDevelopment = exports.SatoriForRendering = exports.Satori = void 0;
30
+ const jsx_runtime_1 = require("react/jsx-runtime");
31
+ const react_1 = __importStar(require("react"));
32
+ const satori_1 = __importDefault(require("satori"));
33
+ const _1 = require(".");
34
+ const get_environment_1 = require("./get-environment");
35
+ const NativeLayers_1 = require("./NativeLayers");
36
+ const use_video_config_1 = require("./use-video-config");
37
+ const Satori = ({ children }) => {
38
+ if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
39
+ return (0, jsx_runtime_1.jsx)(exports.SatoriForRendering, { children: children });
40
+ }
41
+ return (0, jsx_runtime_1.jsx)(exports.SatoriForDevelopment, { children: children });
42
+ };
43
+ exports.Satori = Satori;
44
+ const SatoriForRendering = ({ children }) => {
45
+ const { width, height } = (0, use_video_config_1.useVideoConfig)();
46
+ const { setSatoriStack } = (0, react_1.useContext)(NativeLayers_1.NativeLayersContext);
47
+ (0, react_1.useLayoutEffect)(() => {
48
+ const handle = (0, _1.delayRender)();
49
+ (0, satori_1.default)(children, {
50
+ width,
51
+ height,
52
+ fonts: [],
53
+ })
54
+ .then((svg) => {
55
+ (0, _1.continueRender)(handle);
56
+ setSatoriStack(svg);
57
+ console.log({ svg });
58
+ })
59
+ .catch((err) => {
60
+ console.log(err);
61
+ });
62
+ }, [children, height, setSatoriStack, width]);
63
+ return (0, jsx_runtime_1.jsx)(_1.Experimental.Null, {});
64
+ };
65
+ exports.SatoriForRendering = SatoriForRendering;
66
+ const SatoriForDevelopment = ({ children, }) => {
67
+ const [markup, setMarkup] = react_1.default.useState(null);
68
+ const { width, height } = (0, use_video_config_1.useVideoConfig)();
69
+ (0, react_1.useEffect)(() => {
70
+ (0, satori_1.default)(children, {
71
+ width,
72
+ height,
73
+ fonts: [],
74
+ })
75
+ .then((svg) => {
76
+ setMarkup(svg);
77
+ console.log({ svg });
78
+ })
79
+ .catch((err) => {
80
+ console.log(err);
81
+ });
82
+ }, [children, height, width]);
83
+ if (!markup) {
84
+ return null;
85
+ }
86
+ return ((0, jsx_runtime_1.jsx)("div", {
87
+ // eslint-disable-next-line react/no-danger
88
+ dangerouslySetInnerHTML: {
89
+ __html: markup,
90
+ } }));
91
+ };
92
+ exports.SatoriForDevelopment = SatoriForDevelopment;
@@ -12,6 +12,7 @@ export declare type LayoutAndStyle = {
12
12
  } | {
13
13
  layout?: 'absolute-fill';
14
14
  style?: React.CSSProperties;
15
+ className?: string;
15
16
  };
16
17
  export declare type SequenceProps = {
17
18
  children: React.ReactNode;
@@ -0,0 +1 @@
1
+ export declare function cancelRender(err: unknown): never;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cancelRender = void 0;
4
+ const isErrorLike = (err) => {
5
+ if (err === null) {
6
+ return false;
7
+ }
8
+ if (typeof err !== 'object') {
9
+ return false;
10
+ }
11
+ if (!('stack' in err)) {
12
+ return false;
13
+ }
14
+ // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
15
+ // @ts-ignore we just asserted
16
+ if (typeof err.stack !== 'string') {
17
+ return false;
18
+ }
19
+ if (!('message' in err)) {
20
+ return false;
21
+ }
22
+ // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
23
+ // @ts-ignore we just asserted
24
+ if (typeof err.message !== 'string') {
25
+ return false;
26
+ }
27
+ return true;
28
+ };
29
+ function cancelRender(err) {
30
+ let error;
31
+ if (isErrorLike(err)) {
32
+ error = err;
33
+ }
34
+ else if (typeof err === 'string') {
35
+ error = Error(err);
36
+ }
37
+ else {
38
+ error = Error('Rendering was cancelled');
39
+ }
40
+ window.remotion_cancelledError = error.stack;
41
+ throw error;
42
+ }
43
+ exports.cancelRender = cancelRender;
package/dist/config.d.ts CHANGED
@@ -3,74 +3,26 @@
3
3
  * For the moment the type definitions are going to stay here
4
4
  */
5
5
  declare type Concurrency = number | null;
6
- import type { Configuration } from 'webpack';
7
- declare type WebpackConfiguration = Configuration;
8
- declare type WebpackOverrideFn = (currentConfiguration: WebpackConfiguration) => WebpackConfiguration;
9
6
  declare type BrowserExecutable = string | null;
10
7
  declare type FrameRange = number | [number, number];
11
8
  declare type FfmpegExecutable = string | null;
12
9
  declare type Loop = number | null;
13
10
  declare type CodecOrUndefined = 'h264' | 'h265' | 'vp8' | 'vp9' | 'mp3' | 'aac' | 'wav' | 'prores' | 'h264-mkv' | 'gif' | undefined;
14
11
  declare type Crf = number | undefined;
15
- declare type FlatConfig = ObjectConfig['Bundling'] & ObjectConfig['Log'] & ObjectConfig['Preview'] & ObjectConfig['Puppeteer'] & ObjectConfig['Output'] & ObjectConfig['Rendering'] & {
12
+ declare type FlatConfig = RemotionConfigObject['Bundling'] & RemotionConfigObject['Log'] & RemotionConfigObject['Preview'] & RemotionConfigObject['Puppeteer'] & RemotionConfigObject['Output'] & RemotionConfigObject['Rendering'] & {
16
13
  /**
17
14
  * Set the audio codec to use for the output video.
18
15
  * See the Encoding guide in the docs for defaults and available options.
19
16
  */
20
17
  setAudioCodec: (codec: 'pcm-16' | 'aac' | 'mp3' | 'opus') => void;
21
18
  };
22
- declare type ObjectConfig = {
23
- /**
24
- * @deprecated New flat config format: You can now replace `Config.Preview.` with `Config.`
25
- */
26
- readonly Preview: {
27
- /**
28
- * Change the maximum amount of tracks that are shown in the timeline.
29
- * @param maxTracks The maximum amount of timeline tracks that you would like to show.
30
- * @default 15
31
- */
32
- readonly setMaxTimelineTracks: (maxTracks: number) => void;
33
- /**
34
- * Enable Keyboard shortcuts in the Remotion Preview.
35
- * @param enabled Boolean whether to enable the keyboard shortcuts
36
- * @default true
37
- */
38
- readonly setKeyboardShortcutsEnabled: (enableShortcuts: boolean) => void;
39
- /**
40
- * Set number of shared audio tags. https://www.remotion.dev/docs/player/autoplay#use-the-numberofsharedaudiotags-property
41
- * @param numberOfAudioTags
42
- * @default 0
43
- */
44
- readonly setNumberOfSharedAudioTags: (numberOfAudioTags: number) => void;
45
- /**
46
- * Enable Webpack polling instead of file system listeners for hot reloading in the preview.
47
- * This is useful if you are using a remote directory or a virtual machine.
48
- * @param interval
49
- * @default null
50
- */
51
- readonly setWebpackPollingInMilliseconds: (interval: number | null) => void;
52
- /**
53
- * Whether Remotion should open a browser when starting the Preview.
54
- * @param should
55
- * @default true
56
- */
57
- readonly setShouldOpenBrowser: (should: boolean) => void;
58
- };
59
- /**
60
- * @deprecated New flat config format: You can now replace `Config.Bundling.` with `Config.`
61
- */
62
- readonly Bundling: {
19
+ declare global {
20
+ interface RemotionBundlingOptions {
63
21
  /**
64
22
  * Specify the entry point so you don't have to specify it in the
65
23
  * CLI command
66
24
  */
67
25
  readonly setEntryPoint: (src: string) => void;
68
- /**
69
- * Pass in a function which takes the current Webpack config
70
- * and return a modified Webpack configuration.
71
- * Docs: http://remotion.dev/docs/webpack
72
- */
73
- readonly overrideWebpackConfig: (fn: WebpackOverrideFn) => void;
74
26
  /**
75
27
  * Whether Webpack bundles should be cached to make
76
28
  * subsequent renders faster. Default: true
@@ -88,204 +40,246 @@ declare type ObjectConfig = {
88
40
  * You can set an absolute path or a relative path that will be resolved from the closest package.json location.
89
41
  */
90
42
  readonly setPublicDir: (publicDir: string | null) => void;
91
- };
92
- /**
93
- * @deprecated New flat config format: You can now replace `Config.Log.` with `Config.`
94
- */
95
- readonly Log: {
96
- /**
97
- * Set the log level.
98
- * Acceptable values: 'error' | 'warning' | 'info' | 'verbose'
99
- * Default value: 'info'
100
- *
101
- * Set this to 'verbose' to get browser logs and other IO.
102
- */
103
- readonly setLevel: (newLogLevel: 'verbose' | 'info' | 'warn' | 'error') => void;
104
- };
105
- /**
106
- * @deprecated New flat config format: You can now replace `Config.Puppeteer.` with `Config.`
107
- */
108
- readonly Puppeteer: {
109
- /**
110
- * Specify executable path for the browser to use.
111
- * Default: null, which will make Remotion find or download a version of said browser.
112
- */
113
- readonly setBrowserExecutable: (newBrowserExecutablePath: BrowserExecutable) => void;
114
- /**
115
- * Set how many milliseconds a frame may take to render before it times out.
116
- * Default: `30000`
117
- */
118
- readonly setDelayRenderTimeoutInMilliseconds: (newPuppeteerTimeout: number) => void;
119
- /**
120
- * @deprecated Renamed to `setDelayRenderTimeoutInMilliseconds`.
121
- * Set how many milliseconds a frame may take to render before it times out.
122
- * Default: `30000`
123
- */
124
- readonly setTimeoutInMilliseconds: (newPuppeteerTimeout: number) => void;
125
- /**
126
- * Setting deciding whether to disable CORS and other Chrome security features.
127
- * Default: false
128
- */
129
- readonly setChromiumDisableWebSecurity: (should: boolean) => void;
130
- /**
131
- * Setting whether to ignore any invalid SSL certificates, such as self-signed ones.
132
- * Default: false
133
- */
134
- readonly setChromiumIgnoreCertificateErrors: (should: boolean) => void;
135
- /**
136
- * If false, will open an actual browser during rendering to observe progress.
137
- * Default: true
138
- */
139
- readonly setChromiumHeadlessMode: (should: boolean) => void;
140
- /**
141
- * Set the OpenGL rendering backend for Chrome. Possible values: 'egl', 'angle', 'swiftshader' and 'swangle'.
142
- * Default: 'swangle' in Lambda, null elsewhere.
143
- */
144
- readonly setChromiumOpenGlRenderer: (renderer: 'swangle' | 'angle' | 'egl' | 'swiftshader') => void;
145
- };
146
- /**
147
- * @deprecated New flat config format: You can now replace `Config.Rendering.` with `Config.`
148
- */
149
- readonly Rendering: {
150
- /**
151
- * Set a custom location for a .env file.
152
- * Default: `.env`
153
- */
154
- readonly setDotEnvLocation: (file: string) => void;
155
- /**
156
- * Sets how many Puppeteer instances will work on rendering your video in parallel.
157
- * Default: `null`, meaning half of the threads available on your CPU.
158
- */
159
- readonly setConcurrency: (newConcurrency: Concurrency) => void;
160
- /**
161
- * Set the JPEG quality for the frames.
162
- * Must be between 0 and 100.
163
- * Must be between 0 and 100.
164
- * Default: 80
165
- */
166
- readonly setQuality: (q: number | undefined) => void;
167
- /** Decide in which image format to render. Can be either 'jpeg' or 'png'.
168
- * PNG is slower, but supports transparency.
169
- */
170
- readonly setImageFormat: (format: 'png' | 'jpeg' | 'none') => void;
171
- /**
172
- * Render only a subset of a video.
173
- * Pass in a tuple [20, 30] to only render frames 20-30 into a video.
174
- * Pass in a single number `20` to only render a single frame as an image.
175
- * The frame count starts at 0.
176
- */
177
- readonly setFrameRange: (newFrameRange: FrameRange | null) => void;
178
- /**
179
- * Specify local ffmpeg executable.
180
- * Default: null, which will use ffmpeg available in PATH.
181
- */
182
- readonly setFfmpegExecutable: (ffmpegPath: FfmpegExecutable) => void;
183
- /**
184
- * Specify local ffprobe executable.
185
- * Default: null, which will use ffprobe available in PATH.
186
- */
187
- readonly setFfprobeExecutable: (ffprobePath: FfmpegExecutable) => void;
188
- /**
189
- * Scales the output dimensions by a factor.
190
- * Default: 1.
191
- */
192
- readonly setScale: (newScale: number) => void;
193
- /**
194
- * Specify which frames should be picked for rendering a GIF
195
- * Default: 1, which means every frame
196
- * https://remotion.dev/docs/render-as-gif
197
- */
198
- readonly setEveryNthFrame: (frame: number) => void;
199
- /**
200
- * Specify the number of Loop a GIF should have.
201
- * Default: null (means GIF will loop infinite)
202
- */
203
- readonly setNumberOfGifLoops: (newLoop: Loop) => void;
204
- /**
205
- * Disable audio output.
206
- * Default: false
207
- */
208
- readonly setMuted: (muted: boolean) => void;
209
- /**
210
- * Don't render an audio track if it would be silent.
211
- * Default: true
212
- */
213
- readonly setEnforceAudioTrack: (enforceAudioTrack: boolean) => void;
214
- };
215
- /**
216
- * @deprecated New flat config format: You can now replace `Config.Output.` with `Config.`
217
- */
218
- readonly Output: {
219
- /**
220
- * Set the output file location string. Default: `out/{composition}.{codec}`
221
- */
222
- readonly setOutputLocation: (newOutputLocation: string) => void;
223
- /**
224
- * If the video file already exists, should Remotion overwrite
225
- * the output? Default: true
226
- */
227
- readonly setOverwriteOutput: (newOverwrite: boolean) => void;
228
- /**
229
- * Sets the pixel format in FFMPEG.
230
- * See https://trac.ffmpeg.org/wiki/Chroma%20Subsampling for an explanation.
231
- * You can override this using the `--pixel-format` Cli flag.
232
- */
233
- readonly setPixelFormat: (format: 'yuv420p' | 'yuva420p' | 'yuv422p' | 'yuv444p' | 'yuv420p10le' | 'yuv422p10le' | 'yuv444p10le' | 'yuva444p10le') => void;
234
- /**
235
- * @deprecated Use setCodec() and setImageSequence() instead.
236
- * Specify what kind of output you, either `mp4` or `png-sequence`.
237
- */
238
- readonly setOutputFormat: (newLegacyFormat: 'mp4' | 'png-sequence') => void;
239
- /**
240
- * Specify the codec for stitching the frames into a video.
241
- * Can be `h264` (default), `h265`, `vp8` or `vp9`
242
- */
243
- readonly setCodec: (newCodec: CodecOrUndefined) => void;
244
- /**
245
- * Set the Constant Rate Factor to pass to FFMPEG.
246
- * Lower values mean better quality, but be aware that the ranges of
247
- * possible values greatly differs between codecs.
248
- */
249
- readonly setCrf: (newCrf: Crf) => void;
250
- /**
251
- * Set to true if don't want a video but an image sequence as the output.
252
- */
253
- readonly setImageSequence: (newImageSequence: boolean) => void;
254
- /**
255
- * Overrides the height of a composition
256
- */
257
- readonly overrideHeight: (newHeight: number) => void;
258
- /**
259
- * Overrides the width of a composition
260
- */
261
- readonly overrideWidth: (newWidth: number) => void;
262
- /**
263
- * Set the ProRes profile.
264
- * This method is only valid if the codec has been set to 'prores'.
265
- * Possible values: 4444-xq, 4444, hq, standard, light, proxy. Default: 'hq'
266
- * See https://avpres.net/FFmpeg/im_ProRes.html for meaning of possible values.
267
- */
268
- readonly setProResProfile: (profile: '4444-xq' | '4444' | 'hq' | 'standard' | 'light' | 'proxy' | undefined) => void;
269
- /**
270
- * Override the arguments that Remotion passes to FFMPEG.
271
- * Consult https://remotion.dev/docs/renderer/render-media#ffmpegoverride before using this feature.
272
- */
273
- readonly overrideFfmpegCommand: (command: (info: {
274
- type: 'pre-stitcher' | 'stitcher';
275
- args: string[];
276
- }) => string[]) => void;
277
- /**
278
- * Set a target audio bitrate to be passed to FFMPEG.
279
- */
280
- readonly setAudioBitrate: (bitrate: string | null) => void;
281
- /**
282
- * Set a target video bitrate to be passed to FFMPEG.
283
- * Mutually exclusive with setCrf().
284
- */
285
- readonly setVideoBitrate: (bitrate: string | null) => void;
286
- };
287
- };
288
- export declare type ConfigType = ObjectConfig & FlatConfig;
289
- export type { Concurrency, WebpackConfiguration, WebpackOverrideFn };
43
+ }
44
+ interface RemotionConfigObject {
45
+ /**
46
+ * @deprecated New flat config format: You can now replace `Config.Preview.` with `Config.`
47
+ */
48
+ readonly Preview: {
49
+ /**
50
+ * Change the maximum amount of tracks that are shown in the timeline.
51
+ * @param maxTracks The maximum amount of timeline tracks that you would like to show.
52
+ * @default 15
53
+ */
54
+ readonly setMaxTimelineTracks: (maxTracks: number) => void;
55
+ /**
56
+ * Enable Keyboard shortcuts in the Remotion Preview.
57
+ * @param enabled Boolean whether to enable the keyboard shortcuts
58
+ * @default true
59
+ */
60
+ readonly setKeyboardShortcutsEnabled: (enableShortcuts: boolean) => void;
61
+ /**
62
+ * Set number of shared audio tags. https://www.remotion.dev/docs/player/autoplay#use-the-numberofsharedaudiotags-property
63
+ * @param numberOfAudioTags
64
+ * @default 0
65
+ */
66
+ readonly setNumberOfSharedAudioTags: (numberOfAudioTags: number) => void;
67
+ /**
68
+ * Enable Webpack polling instead of file system listeners for hot reloading in the preview.
69
+ * This is useful if you are using a remote directory or a virtual machine.
70
+ * @param interval
71
+ * @default null
72
+ */
73
+ readonly setWebpackPollingInMilliseconds: (interval: number | null) => void;
74
+ /**
75
+ * Whether Remotion should open a browser when starting the Preview.
76
+ * @param should
77
+ * @default true
78
+ */
79
+ readonly setShouldOpenBrowser: (should: boolean) => void;
80
+ };
81
+ /**
82
+ * @deprecated New flat config format: You can now replace `Config.Bundling.` with `Config.`
83
+ */
84
+ readonly Bundling: RemotionBundlingOptions;
85
+ /**
86
+ * @deprecated New flat config format: You can now replace `Config.Log.` with `Config.`
87
+ */
88
+ readonly Log: {
89
+ /**
90
+ * Set the log level.
91
+ * Acceptable values: 'error' | 'warning' | 'info' | 'verbose'
92
+ * Default value: 'info'
93
+ *
94
+ * Set this to 'verbose' to get browser logs and other IO.
95
+ */
96
+ readonly setLevel: (newLogLevel: 'verbose' | 'info' | 'warn' | 'error') => void;
97
+ };
98
+ /**
99
+ * @deprecated New flat config format: You can now replace `Config.Puppeteer.` with `Config.`
100
+ */
101
+ readonly Puppeteer: {
102
+ /**
103
+ * Specify executable path for the browser to use.
104
+ * Default: null, which will make Remotion find or download a version of said browser.
105
+ */
106
+ readonly setBrowserExecutable: (newBrowserExecutablePath: BrowserExecutable) => void;
107
+ /**
108
+ * Set how many milliseconds a frame may take to render before it times out.
109
+ * Default: `30000`
110
+ */
111
+ readonly setDelayRenderTimeoutInMilliseconds: (newPuppeteerTimeout: number) => void;
112
+ /**
113
+ * @deprecated Renamed to `setDelayRenderTimeoutInMilliseconds`.
114
+ * Set how many milliseconds a frame may take to render before it times out.
115
+ * Default: `30000`
116
+ */
117
+ readonly setTimeoutInMilliseconds: (newPuppeteerTimeout: number) => void;
118
+ /**
119
+ * Setting deciding whether to disable CORS and other Chrome security features.
120
+ * Default: false
121
+ */
122
+ readonly setChromiumDisableWebSecurity: (should: boolean) => void;
123
+ /**
124
+ * Setting whether to ignore any invalid SSL certificates, such as self-signed ones.
125
+ * Default: false
126
+ */
127
+ readonly setChromiumIgnoreCertificateErrors: (should: boolean) => void;
128
+ /**
129
+ * If false, will open an actual browser during rendering to observe progress.
130
+ * Default: true
131
+ */
132
+ readonly setChromiumHeadlessMode: (should: boolean) => void;
133
+ /**
134
+ * Set the OpenGL rendering backend for Chrome. Possible values: 'egl', 'angle', 'swiftshader' and 'swangle'.
135
+ * Default: 'swangle' in Lambda, null elsewhere.
136
+ */
137
+ readonly setChromiumOpenGlRenderer: (renderer: 'swangle' | 'angle' | 'egl' | 'swiftshader') => void;
138
+ };
139
+ /**
140
+ * @deprecated New flat config format: You can now replace `Config.Rendering.` with `Config.`
141
+ */
142
+ readonly Rendering: {
143
+ /**
144
+ * Set a custom location for a .env file.
145
+ * Default: `.env`
146
+ */
147
+ readonly setDotEnvLocation: (file: string) => void;
148
+ /**
149
+ * Sets how many Puppeteer instances will work on rendering your video in parallel.
150
+ * Default: `null`, meaning half of the threads available on your CPU.
151
+ */
152
+ readonly setConcurrency: (newConcurrency: Concurrency) => void;
153
+ /**
154
+ * Set the JPEG quality for the frames.
155
+ * Must be between 0 and 100.
156
+ * Must be between 0 and 100.
157
+ * Default: 80
158
+ */
159
+ readonly setQuality: (q: number | undefined) => void;
160
+ /** Decide in which image format to render. Can be either 'jpeg' or 'png'.
161
+ * PNG is slower, but supports transparency.
162
+ */
163
+ readonly setImageFormat: (format: 'png' | 'jpeg' | 'none') => void;
164
+ /**
165
+ * Render only a subset of a video.
166
+ * Pass in a tuple [20, 30] to only render frames 20-30 into a video.
167
+ * Pass in a single number `20` to only render a single frame as an image.
168
+ * The frame count starts at 0.
169
+ */
170
+ readonly setFrameRange: (newFrameRange: FrameRange | null) => void;
171
+ /**
172
+ * Specify local ffmpeg executable.
173
+ * Default: null, which will use ffmpeg available in PATH.
174
+ */
175
+ readonly setFfmpegExecutable: (ffmpegPath: FfmpegExecutable) => void;
176
+ /**
177
+ * Specify local ffprobe executable.
178
+ * Default: null, which will use ffprobe available in PATH.
179
+ */
180
+ readonly setFfprobeExecutable: (ffprobePath: FfmpegExecutable) => void;
181
+ /**
182
+ * Scales the output dimensions by a factor.
183
+ * Default: 1.
184
+ */
185
+ readonly setScale: (newScale: number) => void;
186
+ /**
187
+ * Specify which frames should be picked for rendering a GIF
188
+ * Default: 1, which means every frame
189
+ * https://remotion.dev/docs/render-as-gif
190
+ */
191
+ readonly setEveryNthFrame: (frame: number) => void;
192
+ /**
193
+ * Specify the number of Loop a GIF should have.
194
+ * Default: null (means GIF will loop infinite)
195
+ */
196
+ readonly setNumberOfGifLoops: (newLoop: Loop) => void;
197
+ /**
198
+ * Disable audio output.
199
+ * Default: false
200
+ */
201
+ readonly setMuted: (muted: boolean) => void;
202
+ /**
203
+ * Don't render an audio track if it would be silent.
204
+ * Default: true
205
+ */
206
+ readonly setEnforceAudioTrack: (enforceAudioTrack: boolean) => void;
207
+ };
208
+ /**
209
+ * @deprecated New flat config format: You can now replace `Config.Output.` with `Config.`
210
+ */
211
+ readonly Output: {
212
+ /**
213
+ * Set the output file location string. Default: `out/{composition}.{codec}`
214
+ */
215
+ readonly setOutputLocation: (newOutputLocation: string) => void;
216
+ /**
217
+ * If the video file already exists, should Remotion overwrite
218
+ * the output? Default: true
219
+ */
220
+ readonly setOverwriteOutput: (newOverwrite: boolean) => void;
221
+ /**
222
+ * Sets the pixel format in FFMPEG.
223
+ * See https://trac.ffmpeg.org/wiki/Chroma%20Subsampling for an explanation.
224
+ * You can override this using the `--pixel-format` Cli flag.
225
+ */
226
+ readonly setPixelFormat: (format: 'yuv420p' | 'yuva420p' | 'yuv422p' | 'yuv444p' | 'yuv420p10le' | 'yuv422p10le' | 'yuv444p10le' | 'yuva444p10le') => void;
227
+ /**
228
+ * @deprecated Use setCodec() and setImageSequence() instead.
229
+ * Specify what kind of output you, either `mp4` or `png-sequence`.
230
+ */
231
+ readonly setOutputFormat: (newLegacyFormat: 'mp4' | 'png-sequence') => void;
232
+ /**
233
+ * Specify the codec for stitching the frames into a video.
234
+ * Can be `h264` (default), `h265`, `vp8` or `vp9`
235
+ */
236
+ readonly setCodec: (newCodec: CodecOrUndefined) => void;
237
+ /**
238
+ * Set the Constant Rate Factor to pass to FFMPEG.
239
+ * Lower values mean better quality, but be aware that the ranges of
240
+ * possible values greatly differs between codecs.
241
+ */
242
+ readonly setCrf: (newCrf: Crf) => void;
243
+ /**
244
+ * Set to true if don't want a video but an image sequence as the output.
245
+ */
246
+ readonly setImageSequence: (newImageSequence: boolean) => void;
247
+ /**
248
+ * Overrides the height of a composition
249
+ */
250
+ readonly overrideHeight: (newHeight: number) => void;
251
+ /**
252
+ * Overrides the width of a composition
253
+ */
254
+ readonly overrideWidth: (newWidth: number) => void;
255
+ /**
256
+ * Set the ProRes profile.
257
+ * This method is only valid if the codec has been set to 'prores'.
258
+ * Possible values: 4444-xq, 4444, hq, standard, light, proxy. Default: 'hq'
259
+ * See https://avpres.net/FFmpeg/im_ProRes.html for meaning of possible values.
260
+ */
261
+ readonly setProResProfile: (profile: '4444-xq' | '4444' | 'hq' | 'standard' | 'light' | 'proxy' | undefined) => void;
262
+ /**
263
+ * Override the arguments that Remotion passes to FFMPEG.
264
+ * Consult https://remotion.dev/docs/renderer/render-media#ffmpegoverride before using this feature.
265
+ */
266
+ readonly overrideFfmpegCommand: (command: (info: {
267
+ type: 'pre-stitcher' | 'stitcher';
268
+ args: string[];
269
+ }) => string[]) => void;
270
+ /**
271
+ * Set a target audio bitrate to be passed to FFMPEG.
272
+ */
273
+ readonly setAudioBitrate: (bitrate: string | null) => void;
274
+ /**
275
+ * Set a target video bitrate to be passed to FFMPEG.
276
+ * Mutually exclusive with setCrf().
277
+ */
278
+ readonly setVideoBitrate: (bitrate: string | null) => void;
279
+ };
280
+ }
281
+ }
282
+ export declare type ConfigType = RemotionConfigObject & FlatConfig;
283
+ export type { Concurrency };
290
284
  export declare const Config: ConfigType;
291
285
  export declare const enableLegacyRemotionConfig: () => void;
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import type { ClipRegion } from './NativeLayers';
5
5
  declare global {
6
6
  interface Window {
7
7
  ready: boolean;
8
+ remotion_cancelledError: string | undefined;
8
9
  getStaticCompositions: () => TCompMetadata[];
9
10
  setBundleMode: (bundleMode: BundleState) => void;
10
11
  remotion_staticBase: string;
@@ -47,11 +48,12 @@ export declare type BundleState = {
47
48
  };
48
49
  export * from './AbsoluteFill';
49
50
  export * from './audio';
51
+ export { cancelRender } from './cancel-render';
50
52
  export * from './Composition';
51
53
  export { SmallTCompMetadata, TAsset, TCompMetadata } from './CompositionManager';
52
54
  export { Config, ConfigType } from './config';
53
55
  export { getInputProps } from './config/input-props';
54
- export * from './delay-render';
56
+ export { continueRender, delayRender } from './delay-render';
55
57
  export * from './easing';
56
58
  export * from './Folder';
57
59
  export * from './freeze';
@@ -87,3 +89,4 @@ export declare const Experimental: {
87
89
  Null: import("react").FC<{}>;
88
90
  useIsPlayer: () => boolean;
89
91
  };
92
+ export declare type WebpackOverrideFn = "The 'WebpackOverrideFn' has been moved to '@remotion/bundler'. Update your imports and install '@remotion/bundler' if necessary.";
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Experimental = exports.useCurrentFrame = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.random = exports.prefetch = exports.Loop = exports.interpolateColors = exports.getStaticFiles = exports.getInputProps = exports.Config = void 0;
17
+ exports.Experimental = exports.useCurrentFrame = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.random = exports.prefetch = exports.Loop = exports.interpolateColors = exports.getStaticFiles = exports.delayRender = exports.continueRender = exports.getInputProps = exports.Config = exports.cancelRender = void 0;
18
18
  require("./asset-types");
19
19
  const Clipper_1 = require("./Clipper");
20
20
  const is_player_1 = require("./is-player");
@@ -23,12 +23,16 @@ const Null_1 = require("./Null");
23
23
  (0, multiple_versions_warning_1.checkMultipleRemotionVersions)();
24
24
  __exportStar(require("./AbsoluteFill"), exports);
25
25
  __exportStar(require("./audio"), exports);
26
+ var cancel_render_1 = require("./cancel-render");
27
+ Object.defineProperty(exports, "cancelRender", { enumerable: true, get: function () { return cancel_render_1.cancelRender; } });
26
28
  __exportStar(require("./Composition"), exports);
27
29
  var config_1 = require("./config");
28
30
  Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return config_1.Config; } });
29
31
  var input_props_1 = require("./config/input-props");
30
32
  Object.defineProperty(exports, "getInputProps", { enumerable: true, get: function () { return input_props_1.getInputProps; } });
31
- __exportStar(require("./delay-render"), exports);
33
+ var delay_render_1 = require("./delay-render");
34
+ Object.defineProperty(exports, "continueRender", { enumerable: true, get: function () { return delay_render_1.continueRender; } });
35
+ Object.defineProperty(exports, "delayRender", { enumerable: true, get: function () { return delay_render_1.delayRender; } });
32
36
  __exportStar(require("./easing"), exports);
33
37
  __exportStar(require("./Folder"), exports);
34
38
  __exportStar(require("./freeze"), exports);
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { Configuration } from 'webpack';
3
2
  import type { CompProps } from './Composition';
4
3
  import type { CompositionManagerContext, TAsset, TCompMetadata, TComposition, TSequence } from './CompositionManager';
5
4
  import * as CSSUtils from './default-css';
@@ -96,6 +95,4 @@ export declare const Internals: {
96
95
  useIsPlayer: () => boolean;
97
96
  useRemotionEnvironment: () => RemotionEnvironment;
98
97
  };
99
- declare type WebpackConfiguration = Configuration;
100
- declare type WebpackOverrideFn = (currentConfiguration: WebpackConfiguration) => WebpackConfiguration;
101
- export type { TComposition, Timeline, TCompMetadata, TSequence, WebpackOverrideFn, WebpackConfiguration, TAsset, TimelineContextValue, SetTimelineContextValue, CompProps, CompositionManagerContext, MediaVolumeContextValue, SetMediaVolumeContextValue, RemotionEnvironment, };
98
+ export type { TComposition, Timeline, TCompMetadata, TSequence, TAsset, TimelineContextValue, SetTimelineContextValue, CompProps, CompositionManagerContext, MediaVolumeContextValue, SetMediaVolumeContextValue, RemotionEnvironment, };
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "3.3.43";
1
+ export declare const VERSION = "3.3.45";
package/dist/version.js CHANGED
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // Automatically generated on publish
5
- exports.VERSION = '3.3.43';
5
+ exports.VERSION = '3.3.45';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "3.3.43",
3
+ "version": "3.3.45",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -41,8 +41,7 @@
41
41
  "react-test-renderer": "^18.0.0",
42
42
  "rimraf": "^3.0.2",
43
43
  "typescript": "^4.7.0",
44
- "vitest": "0.24.3",
45
- "webpack": "5.74.0"
44
+ "vitest": "0.24.3"
46
45
  },
47
46
  "keywords": [
48
47
  "remotion",
@@ -65,5 +64,5 @@
65
64
  ]
66
65
  }
67
66
  },
68
- "gitHead": "3585e437a30ba001e983539728eb1914172b729c"
67
+ "gitHead": "75c028236b43ff2fd0f3f3772f9f79cfde069e36"
69
68
  }