@remotion/renderer 4.0.25 → 4.0.27

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/dist/client.d.ts CHANGED
@@ -1,10 +1,11 @@
1
+ /// <reference types="react" />
1
2
  export declare const BrowserSafeApis: {
2
- getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">(codec: T, audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => import("./file-extensions").FileExtension;
3
+ getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif">(codec: T, audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => import("./file-extensions").FileExtension;
3
4
  validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "gif"];
4
5
  validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
5
- getDefaultCrfForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => number;
6
- getValidCrfRanges: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => [number, number];
7
- isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | undefined) => boolean;
6
+ getDefaultCrfForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif") => number;
7
+ getValidCrfRanges: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif") => [number, number];
8
+ isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif" | undefined) => boolean;
8
9
  proResProfileOptions: readonly ["4444-xq", "4444", "hq", "standard", "light", "proxy"];
9
10
  x264PresetOptions: readonly ["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo"];
10
11
  validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
@@ -78,10 +79,10 @@ export declare const BrowserSafeApis: {
78
79
  };
79
80
  };
80
81
  };
81
- mp3: {
82
+ prores: {
82
83
  default: import("./file-extensions").FileExtension;
83
84
  forAudioCodec: {
84
- mp3: {
85
+ aac: {
85
86
  possible: import("./file-extensions").FileExtension[];
86
87
  default: import("./file-extensions").FileExtension;
87
88
  };
@@ -91,10 +92,10 @@ export declare const BrowserSafeApis: {
91
92
  };
92
93
  };
93
94
  };
94
- aac: {
95
+ mp3: {
95
96
  default: import("./file-extensions").FileExtension;
96
97
  forAudioCodec: {
97
- aac: {
98
+ mp3: {
98
99
  possible: import("./file-extensions").FileExtension[];
99
100
  default: import("./file-extensions").FileExtension;
100
101
  };
@@ -104,22 +105,22 @@ export declare const BrowserSafeApis: {
104
105
  };
105
106
  };
106
107
  };
107
- wav: {
108
+ aac: {
108
109
  default: import("./file-extensions").FileExtension;
109
110
  forAudioCodec: {
111
+ aac: {
112
+ possible: import("./file-extensions").FileExtension[];
113
+ default: import("./file-extensions").FileExtension;
114
+ };
110
115
  "pcm-16": {
111
116
  possible: import("./file-extensions").FileExtension[];
112
117
  default: import("./file-extensions").FileExtension;
113
118
  };
114
119
  };
115
120
  };
116
- prores: {
121
+ wav: {
117
122
  default: import("./file-extensions").FileExtension;
118
123
  forAudioCodec: {
119
- aac: {
120
- possible: import("./file-extensions").FileExtension[];
121
- default: import("./file-extensions").FileExtension;
122
- };
123
124
  "pcm-16": {
124
125
  possible: import("./file-extensions").FileExtension[];
125
126
  default: import("./file-extensions").FileExtension;
@@ -161,6 +162,10 @@ export declare const BrowserSafeApis: {
161
162
  compressed: "pcm-16" | "opus" | null;
162
163
  lossless: "pcm-16" | "opus" | null;
163
164
  };
165
+ prores: {
166
+ compressed: "aac" | "pcm-16" | null;
167
+ lossless: "aac" | "pcm-16" | null;
168
+ };
164
169
  mp3: {
165
170
  compressed: "mp3" | "pcm-16" | null;
166
171
  lossless: "mp3" | "pcm-16" | null;
@@ -173,10 +178,6 @@ export declare const BrowserSafeApis: {
173
178
  compressed: "pcm-16" | null;
174
179
  lossless: "pcm-16" | null;
175
180
  };
176
- prores: {
177
- compressed: "aac" | "pcm-16" | null;
178
- lossless: "aac" | "pcm-16" | null;
179
- };
180
181
  "h264-mkv": {
181
182
  compressed: "mp3" | "pcm-16" | null;
182
183
  lossless: "mp3" | "pcm-16" | null;
@@ -186,8 +187,8 @@ export declare const BrowserSafeApis: {
186
187
  lossless: null;
187
188
  };
188
189
  };
189
- defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">;
190
- validateOutputFilename: <T_1 extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">({ codec, audioCodec, extension, preferLossless, }: {
190
+ defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif">;
191
+ validateOutputFilename: <T_1 extends "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif">({ codec, audioCodec, extension, preferLossless, }: {
191
192
  codec: T_1;
192
193
  audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
193
194
  extension: string;
@@ -357,6 +358,6 @@ export declare const BrowserSafeApis: {
357
358
  type: number | null;
358
359
  }];
359
360
  };
360
- codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
361
- codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
361
+ codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif") => boolean;
362
+ codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif") => boolean;
362
363
  };
@@ -33,7 +33,7 @@ export type GetCompositionsOptions = {
33
33
  logLevel?: LogLevel;
34
34
  offthreadVideoCacheSizeInBytes?: number | null;
35
35
  };
36
- export declare const internalGetCompositions: ({ browserExecutable, chromiumOptions, envVariables, indent, serializedInputPropsWithCustomSchema, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, offthreadVideoCacheSizeInBytes, }: InternalGetCompositionsOptions) => Promise<VideoConfig[]>;
36
+ export declare const internalGetCompositions: (args_0: InternalGetCompositionsOptions) => Promise<VideoConfig[]>;
37
37
  /**
38
38
  * @description Gets the compositions defined in a Remotion project based on a Webpack bundle.
39
39
  * @see [Documentation](https://www.remotion.dev/docs/renderer/get-compositions)
@@ -12,6 +12,7 @@ const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
12
12
  const seek_to_frame_1 = require("./seek-to-frame");
13
13
  const set_props_and_env_1 = require("./set-props-and-env");
14
14
  const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
15
+ const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
15
16
  const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCustomSchema, onBrowserLog, page, proxyPort, serveUrl, timeoutInMilliseconds, indent, logLevel, }) => {
16
17
  if (onBrowserLog) {
17
18
  page.on('console', (log) => {
@@ -70,7 +71,7 @@ const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCust
70
71
  };
71
72
  });
72
73
  };
73
- const internalGetCompositions = async ({ browserExecutable, chromiumOptions, envVariables, indent, serializedInputPropsWithCustomSchema, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, offthreadVideoCacheSizeInBytes, }) => {
74
+ const internalGetCompositionsRaw = async ({ browserExecutable, chromiumOptions, envVariables, indent, serializedInputPropsWithCustomSchema, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, offthreadVideoCacheSizeInBytes, }) => {
74
75
  const { page, cleanup: cleanupPage } = await (0, get_browser_instance_1.getPageAndCleanupFn)({
75
76
  passedInInstance: puppeteerInstance,
76
77
  browserExecutable,
@@ -128,7 +129,7 @@ const internalGetCompositions = async ({ browserExecutable, chromiumOptions, env
128
129
  });
129
130
  });
130
131
  };
131
- exports.internalGetCompositions = internalGetCompositions;
132
+ exports.internalGetCompositions = (0, wrap_with_error_handling_1.wrapWithErrorHandling)(internalGetCompositionsRaw);
132
133
  /**
133
134
  * @description Gets the compositions defined in a Remotion project based on a Webpack bundle.
134
135
  * @see [Documentation](https://www.remotion.dev/docs/renderer/get-compositions)
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="react" />
1
3
  import execa from 'execa';
2
4
  import { HeadlessBrowser } from './browser/Browser';
3
5
  import { SymbolicateableError } from './error-handling/symbolicateable-error';
@@ -57,9 +59,9 @@ export declare const RenderInternals: {
57
59
  width: number;
58
60
  height: number;
59
61
  scale: number;
60
- codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
62
+ codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
61
63
  }) => void;
62
- getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">(codec: T, audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => import("./file-extensions").FileExtension;
64
+ getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif">(codec: T, audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => import("./file-extensions").FileExtension;
63
65
  tmpDir: (str: string) => string;
64
66
  deleteDirectory: (directory: string) => void;
65
67
  isServeUrl: (potentialUrl: string) => boolean;
@@ -109,10 +111,14 @@ export declare const RenderInternals: {
109
111
  };
110
112
  registerErrorSymbolicationLock: () => number;
111
113
  unlockErrorSymbolicationLock: (id: number) => void;
112
- canUseParallelEncoding: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
114
+ canUseParallelEncoding: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif") => boolean;
113
115
  mimeContentType: typeof mimeContentType;
114
116
  mimeLookup: typeof mimeLookup;
115
- validateConcurrency: (value: unknown, setting: string) => void;
117
+ validateConcurrency: ({ setting, value, checkIfValidForCurrentMachine, }: {
118
+ value: unknown;
119
+ setting: string;
120
+ checkIfValidForCurrentMachine: boolean;
121
+ }) => void;
116
122
  validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
117
123
  DEFAULT_BROWSER: "chrome";
118
124
  validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
@@ -122,8 +128,8 @@ export declare const RenderInternals: {
122
128
  DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
123
129
  validateJpegQuality: (q: number | undefined) => void;
124
130
  DEFAULT_TIMEOUT: number;
125
- DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
126
- isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | undefined) => boolean;
131
+ DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
132
+ isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif" | undefined) => boolean;
127
133
  logLevels: readonly ["verbose", "info", "warn", "error"];
128
134
  isEqualOrBelowLogLevel: (currentLevel: "verbose" | "info" | "warn" | "error", level: "verbose" | "info" | "warn" | "error") => boolean;
129
135
  isValidLogLevel: (level: string) => boolean;
@@ -140,7 +146,7 @@ export declare const RenderInternals: {
140
146
  output: string;
141
147
  onProgress: (p: number) => void;
142
148
  numberOfFrames: number;
143
- codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
149
+ codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
144
150
  fps: number;
145
151
  numberOfGifLoops: number | null;
146
152
  audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
@@ -148,7 +154,7 @@ export declare const RenderInternals: {
148
154
  getMinConcurrency: () => number;
149
155
  getMaxConcurrency: () => any;
150
156
  getDefaultAudioCodec: ({ codec, preferLossless, }: {
151
- codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
157
+ codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
152
158
  preferLossless: boolean;
153
159
  }) => "mp3" | "aac" | "pcm-16" | "opus" | null;
154
160
  validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
@@ -209,10 +215,10 @@ export declare const RenderInternals: {
209
215
  };
210
216
  };
211
217
  };
212
- mp3: {
218
+ prores: {
213
219
  default: import("./file-extensions").FileExtension;
214
220
  forAudioCodec: {
215
- mp3: {
221
+ aac: {
216
222
  possible: import("./file-extensions").FileExtension[];
217
223
  default: import("./file-extensions").FileExtension;
218
224
  };
@@ -222,10 +228,10 @@ export declare const RenderInternals: {
222
228
  };
223
229
  };
224
230
  };
225
- aac: {
231
+ mp3: {
226
232
  default: import("./file-extensions").FileExtension;
227
233
  forAudioCodec: {
228
- aac: {
234
+ mp3: {
229
235
  possible: import("./file-extensions").FileExtension[];
230
236
  default: import("./file-extensions").FileExtension;
231
237
  };
@@ -235,22 +241,22 @@ export declare const RenderInternals: {
235
241
  };
236
242
  };
237
243
  };
238
- wav: {
244
+ aac: {
239
245
  default: import("./file-extensions").FileExtension;
240
246
  forAudioCodec: {
247
+ aac: {
248
+ possible: import("./file-extensions").FileExtension[];
249
+ default: import("./file-extensions").FileExtension;
250
+ };
241
251
  "pcm-16": {
242
252
  possible: import("./file-extensions").FileExtension[];
243
253
  default: import("./file-extensions").FileExtension;
244
254
  };
245
255
  };
246
256
  };
247
- prores: {
257
+ wav: {
248
258
  default: import("./file-extensions").FileExtension;
249
259
  forAudioCodec: {
250
- aac: {
251
- possible: import("./file-extensions").FileExtension[];
252
- default: import("./file-extensions").FileExtension;
253
- };
254
260
  "pcm-16": {
255
261
  possible: import("./file-extensions").FileExtension[];
256
262
  default: import("./file-extensions").FileExtension;
@@ -287,8 +293,8 @@ export declare const RenderInternals: {
287
293
  readonly vp9: readonly ["opus", "pcm-16"];
288
294
  readonly wav: readonly ["pcm-16"];
289
295
  };
290
- makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif")[]>;
291
- defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">;
296
+ makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif")[]>;
297
+ defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif">;
292
298
  getExecutablePath: (type: "compositor" | "ffmpeg" | "ffprobe" | "ffmpeg-cwd") => string;
293
299
  callFf: (bin: "ffmpeg" | "ffprobe", args: (string | null)[], options?: execa.Options<string> | undefined) => execa.ExecaChildProcess<string>;
294
300
  dynamicLibraryPathOptions: () => {
@@ -306,7 +312,7 @@ export declare const RenderInternals: {
306
312
  validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
307
313
  validVideoImageFormats: readonly ["png", "jpeg", "none"];
308
314
  DEFAULT_STILL_IMAGE_FORMAT: "png" | "jpeg" | "pdf" | "webp";
309
- DEFAULT_VIDEO_IMAGE_FORMAT: "png" | "jpeg" | "none";
315
+ DEFAULT_VIDEO_IMAGE_FORMAT: "none" | "png" | "jpeg";
310
316
  DEFAULT_JPEG_QUALITY: number;
311
317
  chalk: {
312
318
  enabled: () => boolean;
@@ -481,7 +487,7 @@ export declare const RenderInternals: {
481
487
  metadata: import("remotion").VideoConfig;
482
488
  propsSize: number;
483
489
  }>;
484
- internalGetCompositions: ({ browserExecutable, chromiumOptions, envVariables, indent, serializedInputPropsWithCustomSchema, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, offthreadVideoCacheSizeInBytes, }: {
490
+ internalGetCompositions: (args_0: {
485
491
  serializedInputPropsWithCustomSchema: string;
486
492
  envVariables: Record<string, string>;
487
493
  puppeteerInstance: HeadlessBrowser | undefined;
@@ -502,8 +508,8 @@ export declare const RenderInternals: {
502
508
  docLink: string;
503
509
  type: number | null;
504
510
  }]>) => Promise<import("remotion").VideoConfig[]>;
505
- internalRenderFrames: ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, }: import("./render-frames").InternalRenderFramesOptions) => Promise<import("./types").RenderFramesOutput>;
506
- internalRenderMedia: ({ proResProfile, x264Preset, crf, composition, serializedInputPropsWithCustomSchema, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, }: import("./render-media").InternalRenderMediaOptions) => Promise<{
511
+ internalRenderFrames: (args_0: import("./render-frames").InternalRenderFramesOptions) => Promise<import("./types").RenderFramesOutput>;
512
+ internalRenderMedia: (args_0: import("./render-media").InternalRenderMediaOptions) => Promise<{
507
513
  buffer: Buffer | null;
508
514
  slowestFrames: import("./render-media").SlowFrame[];
509
515
  }>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const audioBitrateOption: {
2
3
  name: string;
3
4
  cliFlag: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const crfOption: {
2
3
  name: string;
3
4
  cliFlag: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const enforceAudioOption: {
2
3
  name: string;
3
4
  cliFlag: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const jpegQualityOption: {
2
3
  name: string;
3
4
  cliFlag: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const muteOption: {
2
3
  name: string;
3
4
  cliFlag: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const offthreadVideoCacheSizeInBytesOption: {
2
3
  name: string;
3
4
  cliFlag: "offthreadvideo-cache-size-in-bytes";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const optionsMap: {
2
3
  readonly renderMedia: readonly [{
3
4
  name: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const scaleOption: {
2
3
  name: string;
3
4
  cliFlag: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const videoBitrate: {
2
3
  name: string;
3
4
  cliFlag: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const videoCodecOption: {
2
3
  name: string;
3
4
  cliFlag: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const webhookCustomDataOption: {
2
3
  name: string;
3
4
  cliFlag: "webhook-custom-data";
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import type { ClipRegion } from 'remotion';
2
3
  import type { Page } from './browser/BrowserPage';
3
4
  import type { StillImageFormat } from './image-format';
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import type { ClipRegion } from 'remotion';
2
3
  import type { Page } from './browser/BrowserPage';
3
4
  import type { StillImageFormat } from './image-format';
@@ -81,7 +81,7 @@ export type RenderFramesOptions = {
81
81
  serveUrl: string;
82
82
  offthreadVideoCacheSizeInBytes?: number | null;
83
83
  };
84
- export declare const internalRenderFrames: ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, }: InternalRenderFramesOptions) => Promise<RenderFramesOutput>;
84
+ export declare const internalRenderFrames: (args_0: InternalRenderFramesOptions) => Promise<RenderFramesOutput>;
85
85
  /**
86
86
  * @description Renders a series of images using Puppeteer and computes information for mixing audio.
87
87
  * @see [Documentation](https://www.remotion.dev/docs/renderer/render-frames)
@@ -35,6 +35,7 @@ const take_frame_and_compose_1 = require("./take-frame-and-compose");
35
35
  const truthy_1 = require("./truthy");
36
36
  const validate_1 = require("./validate");
37
37
  const validate_scale_1 = require("./validate-scale");
38
+ const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
38
39
  const MAX_RETRIES_PER_FRAME = 1;
39
40
  const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, jpegQuality, imageFormat, frameRange, onError, envVariables, onBrowserLog, onFrameBuffer, onDownload, pagesArray, serveUrl, composition, timeoutInMilliseconds, scale, actualConcurrency, everyNthFrame, proxyPort, cancelSignal, downloadMap, muted, makeBrowser, browserReplacer, compositor, sourcemapContext, logLevel, indent, }) => {
40
41
  if (outputDir) {
@@ -300,7 +301,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
300
301
  await Promise.all(downloadPromises);
301
302
  return result;
302
303
  };
303
- const internalRenderFrames = ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, }) => {
304
+ const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, }) => {
304
305
  (0, validate_1.validateDimension)(composition.height, 'height', 'in the `config` object passed to `renderFrames()`');
305
306
  (0, validate_1.validateDimension)(composition.width, 'width', 'in the `config` object passed to `renderFrames()`');
306
307
  (0, validate_1.validateFps)(composition.fps, 'in the `config` object of `renderFrames()`', false);
@@ -421,7 +422,7 @@ const internalRenderFrames = ({ browserExecutable, cancelSignal, chromiumOptions
421
422
  });
422
423
  });
423
424
  };
424
- exports.internalRenderFrames = internalRenderFrames;
425
+ exports.internalRenderFrames = (0, wrap_with_error_handling_1.wrapWithErrorHandling)(internalRenderFramesRaw);
425
426
  /**
426
427
  * @description Renders a series of images using Puppeteer and computes information for mixing audio.
427
428
  * @see [Documentation](https://www.remotion.dev/docs/renderer/render-frames)
@@ -131,7 +131,7 @@ type RenderMediaResult = {
131
131
  buffer: Buffer | null;
132
132
  slowestFrames: SlowFrame[];
133
133
  };
134
- export declare const internalRenderMedia: ({ proResProfile, x264Preset, crf, composition, serializedInputPropsWithCustomSchema, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, }: InternalRenderMediaOptions) => Promise<RenderMediaResult>;
134
+ export declare const internalRenderMedia: (args_0: InternalRenderMediaOptions) => Promise<RenderMediaResult>;
135
135
  /**
136
136
  *
137
137
  * @description Render a video from a composition
@@ -43,9 +43,10 @@ const validate_number_of_gif_loops_1 = require("./validate-number-of-gif-loops")
43
43
  const validate_output_filename_1 = require("./validate-output-filename");
44
44
  const validate_scale_1 = require("./validate-scale");
45
45
  const validate_videobitrate_1 = require("./validate-videobitrate");
46
+ const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
46
47
  const x264_preset_1 = require("./x264-preset");
47
48
  const SLOWEST_FRAME_COUNT = 10;
48
- const internalRenderMedia = ({ proResProfile, x264Preset, crf, composition, serializedInputPropsWithCustomSchema, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, }) => {
49
+ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, serializedInputPropsWithCustomSchema, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, }) => {
49
50
  (0, jpeg_quality_1.validateJpegQuality)(jpegQuality);
50
51
  (0, crf_1.validateQualitySettings)({ crf, codec, videoBitrate });
51
52
  (0, validate_videobitrate_1.validateBitrate)(audioBitrate, 'audioBitrate');
@@ -414,7 +415,7 @@ const internalRenderMedia = ({ proResProfile, x264Preset, crf, composition, seri
414
415
  }),
415
416
  ]);
416
417
  };
417
- exports.internalRenderMedia = internalRenderMedia;
418
+ exports.internalRenderMedia = (0, wrap_with_error_handling_1.wrapWithErrorHandling)(internalRenderMediaRaw);
418
419
  /**
419
420
  *
420
421
  * @description Render a video from a composition
@@ -50,6 +50,7 @@ const take_frame_and_compose_1 = require("./take-frame-and-compose");
50
50
  const validate_1 = require("./validate");
51
51
  const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
52
52
  const validate_scale_1 = require("./validate-scale");
53
+ const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
53
54
  const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFAULT_STILL_IMAGE_FORMAT, serveUrl, puppeteerInstance, onError, serializedInputPropsWithCustomSchema, envVariables, output, frame = 0, overwrite, browserExecutable, timeoutInMilliseconds, chromiumOptions, scale, proxyPort, cancelSignal, jpegQuality, onBrowserLog, compositor, sourceMapContext, downloadMap, logLevel, indent, serializedResolvedPropsWithCustomSchema, }) => {
54
55
  (0, validate_1.validateDimension)(composition.height, 'height', 'in the `config` object passed to `renderStill()`');
55
56
  (0, validate_1.validateDimension)(composition.width, 'width', 'in the `config` object passed to `renderStill()`');
@@ -194,7 +195,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
194
195
  await cleanup();
195
196
  return { buffer: output ? null : buffer };
196
197
  };
197
- const internalRenderStill = (options) => {
198
+ const internalRenderStillRaw = (options) => {
198
199
  const cleanup = [];
199
200
  const happyPath = new Promise((resolve, reject) => {
200
201
  const onError = (err) => reject(err);
@@ -241,7 +242,7 @@ const internalRenderStill = (options) => {
241
242
  }),
242
243
  ]);
243
244
  };
244
- exports.internalRenderStill = internalRenderStill;
245
+ exports.internalRenderStill = (0, wrap_with_error_handling_1.wrapWithErrorHandling)(internalRenderStillRaw);
245
246
  /**
246
247
  *
247
248
  * @description Render a still frame from a composition
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import type { ClipRegion } from 'remotion';
2
3
  import type { Page } from './browser/BrowserPage';
3
4
  import type { StillImageFormat } from './image-format';
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import type { ClipRegion } from 'remotion';
2
3
  import type { Page } from './browser/BrowserPage';
3
4
  import type { StillImageFormat } from './image-format';
@@ -40,6 +40,7 @@ type InternalReturnType = {
40
40
  metadata: VideoConfig;
41
41
  propsSize: number;
42
42
  };
43
+ export declare const internalSelectCompositionRaw: (options: InternalSelectCompositionsConfig) => Promise<InternalReturnType>;
43
44
  export declare const internalSelectComposition: (options: InternalSelectCompositionsConfig) => Promise<InternalReturnType>;
44
45
  /**
45
46
  * @description Gets a composition defined in a Remotion project based on a Webpack bundle.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.selectComposition = exports.internalSelectComposition = void 0;
3
+ exports.selectComposition = exports.internalSelectComposition = exports.internalSelectCompositionRaw = void 0;
4
4
  const remotion_1 = require("remotion");
5
5
  const TimeoutSettings_1 = require("./browser/TimeoutSettings");
6
6
  const handle_javascript_exception_1 = require("./error-handling/handle-javascript-exception");
@@ -12,6 +12,7 @@ const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
12
12
  const seek_to_frame_1 = require("./seek-to-frame");
13
13
  const set_props_and_env_1 = require("./set-props-and-env");
14
14
  const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
15
+ const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
15
16
  const innerSelectComposition = async ({ page, onBrowserLog, serializedInputPropsWithCustomSchema, envVariables, serveUrl, timeoutInMilliseconds, port, id, indent, logLevel, }) => {
16
17
  if (onBrowserLog) {
17
18
  page.on('console', (log) => {
@@ -82,7 +83,7 @@ const innerSelectComposition = async ({ page, onBrowserLog, serializedInputProps
82
83
  propsSize: size,
83
84
  };
84
85
  };
85
- const internalSelectComposition = async (options) => {
86
+ const internalSelectCompositionRaw = async (options) => {
86
87
  const cleanup = [];
87
88
  const { puppeteerInstance, browserExecutable, chromiumOptions, serveUrl: serveUrlOrWebpackUrl, logLevel, indent, port, envVariables, id, serializedInputPropsWithCustomSchema, onBrowserLog, server, timeoutInMilliseconds, offthreadVideoCacheSizeInBytes, } = options;
88
89
  const { page, cleanup: cleanupPage } = await (0, get_browser_instance_1.getPageAndCleanupFn)({
@@ -148,7 +149,8 @@ const internalSelectComposition = async (options) => {
148
149
  });
149
150
  });
150
151
  };
151
- exports.internalSelectComposition = internalSelectComposition;
152
+ exports.internalSelectCompositionRaw = internalSelectCompositionRaw;
153
+ exports.internalSelectComposition = (0, wrap_with_error_handling_1.wrapWithErrorHandling)(exports.internalSelectCompositionRaw);
152
154
  /**
153
155
  * @description Gets a composition defined in a Remotion project based on a Webpack bundle.
154
156
  * @see [Documentation](https://www.remotion.dev/docs/renderer/select-composition)
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
2
3
  import type { RenderAssetInfo } from './assets/download-map';
3
4
  import type { AudioCodec } from './audio-codec';
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import type { TRenderAsset } from 'remotion';
2
3
  import type { DownloadMap } from './assets/download-map';
3
4
  import type { Page } from './browser/BrowserPage';
@@ -1,3 +1,7 @@
1
- export declare const validateConcurrency: (value: unknown, setting: string) => void;
1
+ export declare const validateConcurrency: ({ setting, value, checkIfValidForCurrentMachine, }: {
2
+ value: unknown;
3
+ setting: string;
4
+ checkIfValidForCurrentMachine: boolean;
5
+ }) => void;
2
6
  export declare const getMaxConcurrency: () => any;
3
7
  export declare const getMinConcurrency: () => number;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getMinConcurrency = exports.getMaxConcurrency = exports.validateConcurrency = void 0;
4
- const validateConcurrency = (value, setting) => {
4
+ const validateConcurrency = ({ setting, value, checkIfValidForCurrentMachine, }) => {
5
5
  if (typeof value === 'undefined') {
6
6
  return;
7
7
  }
@@ -15,11 +15,13 @@ const validateConcurrency = (value, setting) => {
15
15
  if (value % 1 !== 0) {
16
16
  throw new Error(setting + ' must be an integer, but is ' + value);
17
17
  }
18
- if (value < (0, exports.getMinConcurrency)()) {
19
- throw new Error(`${setting} must be at least ${(0, exports.getMinConcurrency)()}, but is ${JSON.stringify(value)}`);
20
- }
21
- if (value > (0, exports.getMaxConcurrency)()) {
22
- throw new Error(`${setting} is set higher than the amount of CPU cores available. Available CPU cores: ${(0, exports.getMaxConcurrency)()}, value set: ${value}`);
18
+ if (checkIfValidForCurrentMachine) {
19
+ if (value < (0, exports.getMinConcurrency)()) {
20
+ throw new Error(`${setting} must be at least ${(0, exports.getMinConcurrency)()}, but is ${JSON.stringify(value)}`);
21
+ }
22
+ if (value > (0, exports.getMaxConcurrency)()) {
23
+ throw new Error(`${setting} is set higher than the amount of CPU cores available. Available CPU cores: ${(0, exports.getMaxConcurrency)()}, value set: ${value}`);
24
+ }
23
25
  }
24
26
  }
25
27
  else if (!/^\d+(\.\d+)?%$/.test(value)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "4.0.25",
3
+ "version": "4.0.27",
4
4
  "description": "Renderer for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "extract-zip": "2.0.1",
19
19
  "source-map": "^0.8.0-beta.0",
20
20
  "ws": "8.7.0",
21
- "remotion": "4.0.25"
21
+ "remotion": "4.0.27"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=16.8.0",
@@ -40,13 +40,13 @@
40
40
  "vitest": "0.31.1"
41
41
  },
42
42
  "optionalDependencies": {
43
- "@remotion/compositor-darwin-arm64": "4.0.25",
44
- "@remotion/compositor-darwin-x64": "4.0.25",
45
- "@remotion/compositor-linux-arm64-gnu": "4.0.25",
46
- "@remotion/compositor-linux-x64-gnu": "4.0.25",
47
- "@remotion/compositor-linux-arm64-musl": "4.0.25",
48
- "@remotion/compositor-win32-x64-msvc": "4.0.25",
49
- "@remotion/compositor-linux-x64-musl": "4.0.25"
43
+ "@remotion/compositor-linux-arm64-gnu": "4.0.27",
44
+ "@remotion/compositor-linux-arm64-musl": "4.0.27",
45
+ "@remotion/compositor-darwin-arm64": "4.0.27",
46
+ "@remotion/compositor-darwin-x64": "4.0.27",
47
+ "@remotion/compositor-win32-x64-msvc": "4.0.27",
48
+ "@remotion/compositor-linux-x64-musl": "4.0.27",
49
+ "@remotion/compositor-linux-x64-gnu": "4.0.27"
50
50
  },
51
51
  "keywords": [
52
52
  "remotion",
package/pure.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/pure';
package/pure.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/pure');
@@ -1,7 +0,0 @@
1
- import type { Codec } from './codec';
2
- export declare const x264PresetOptions: readonly ["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo"];
3
- export type x264Preset = typeof x264PresetOptions[number];
4
- export declare const validateSelectedCodecAndPresetCombination: ({ codec, x264Preset, }: {
5
- codec: Codec;
6
- x264Preset: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | undefined;
7
- }) => void;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateSelectedCodecAndPresetCombination = exports.x264PresetOptions = void 0;
4
- exports.x264PresetOptions = [
5
- 'ultrafast',
6
- 'superfast',
7
- 'veryfast',
8
- 'faster',
9
- 'fast',
10
- 'medium',
11
- 'slow',
12
- 'slower',
13
- 'veryslow',
14
- 'placebo',
15
- ];
16
- const validateSelectedCodecAndPresetCombination = ({ codec, x264Preset, }) => {
17
- if (typeof x264Preset !== 'undefined' && codec !== 'h264') {
18
- throw new TypeError(`You have set a Preset profile but the codec is "${codec}". Set the codec to "h264" or remove the Preset profile.`);
19
- }
20
- if (x264Preset !== undefined &&
21
- !exports.x264PresetOptions.includes(x264Preset)) {
22
- throw new TypeError(`The Preset profile "${x264Preset}" is not valid. Valid options are ${exports.x264PresetOptions
23
- .map((p) => `"${p}"`)
24
- .join(', ')}`);
25
- }
26
- };
27
- exports.validateSelectedCodecAndPresetCombination = validateSelectedCodecAndPresetCombination;