@remotion/renderer 4.0.35 → 4.0.37

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.
Files changed (40) hide show
  1. package/dist/browser/Connection.js +6 -8
  2. package/dist/browser/HTTPRequest.d.ts +1 -0
  3. package/dist/browser/HTTPRequest.js +2 -0
  4. package/dist/browser/NetworkManager.js +2 -0
  5. package/dist/client.d.ts +24 -23
  6. package/dist/create-ffmpeg-complex-filter.d.ts +1 -4
  7. package/dist/get-cpu-count.js +1 -1
  8. package/dist/get-extension-from-codec.d.ts +2 -2
  9. package/dist/index.d.ts +22 -20
  10. package/dist/options/audio-bitrate.d.ts +1 -0
  11. package/dist/options/color-space.d.ts +2 -1
  12. package/dist/options/crf.d.ts +1 -0
  13. package/dist/options/delete-after.d.ts +1 -0
  14. package/dist/options/enforce-audio.d.ts +1 -0
  15. package/dist/options/folder-expiry.d.ts +1 -0
  16. package/dist/options/jpeg-quality.d.ts +1 -0
  17. package/dist/options/mute.d.ts +1 -0
  18. package/dist/options/offthreadvideo-cache-size.d.ts +1 -0
  19. package/dist/options/options-map.d.ts +1 -0
  20. package/dist/options/scale.d.ts +1 -0
  21. package/dist/options/video-bitrate.d.ts +1 -0
  22. package/dist/options/video-codec.d.ts +1 -0
  23. package/dist/options/webhook-custom-data.d.ts +1 -0
  24. package/dist/provide-screenshot.d.ts +1 -0
  25. package/dist/puppeteer-evaluate.d.ts +8 -2
  26. package/dist/puppeteer-evaluate.js +19 -2
  27. package/dist/puppeteer-screenshot.d.ts +1 -0
  28. package/dist/screenshot-dom-element.d.ts +1 -0
  29. package/dist/screenshot-task.d.ts +1 -0
  30. package/dist/seek-to-frame.js +4 -2
  31. package/dist/stitch-frames-to-video.d.ts +1 -0
  32. package/dist/take-frame-and-compose.d.ts +1 -0
  33. package/dist/validate-output-filename.d.ts +1 -1
  34. package/package.json +9 -9
  35. package/dist/browser/Product.d.ts +0 -16
  36. package/dist/browser/Product.js +0 -17
  37. package/dist/browser/create-browser-fetcher.d.ts +0 -17
  38. package/dist/browser/create-browser-fetcher.js +0 -58
  39. package/dist/browser/revisions.d.ts +0 -20
  40. package/dist/browser/revisions.js +0 -21
@@ -66,7 +66,6 @@ class Connection extends EventEmitter_1.EventEmitter {
66
66
  __classPrivateFieldGet(this, _Connection_callbacks, "f").set(id, {
67
67
  resolve,
68
68
  reject,
69
- error: new Errors_1.ProtocolError(),
70
69
  method,
71
70
  returnSize: true,
72
71
  });
@@ -136,7 +135,7 @@ _Connection_transport = new WeakMap(), _Connection_lastId = new WeakMap(), _Conn
136
135
  if (callback) {
137
136
  __classPrivateFieldGet(this, _Connection_callbacks, "f").delete(object.id);
138
137
  if (object.error) {
139
- callback.reject(createProtocolError(callback.error, callback.method, object));
138
+ callback.reject(createProtocolError(callback.method, object));
140
139
  }
141
140
  else if (callback.returnSize) {
142
141
  callback.resolve({ value: object.result, size: message.length });
@@ -156,7 +155,7 @@ _Connection_transport = new WeakMap(), _Connection_lastId = new WeakMap(), _Conn
156
155
  __classPrivateFieldGet(this, _Connection_transport, "f").onmessage = undefined;
157
156
  __classPrivateFieldGet(this, _Connection_transport, "f").onclose = undefined;
158
157
  for (const callback of __classPrivateFieldGet(this, _Connection_callbacks, "f").values()) {
159
- callback.reject(rewriteError(callback.error, `Protocol error (${callback.method}): Target closed. https://www.remotion.dev/docs/target-closed`));
158
+ callback.reject(rewriteError(new Errors_1.ProtocolError(), `Protocol error (${callback.method}): Target closed. https://www.remotion.dev/docs/target-closed`));
160
159
  }
161
160
  __classPrivateFieldGet(this, _Connection_callbacks, "f").clear();
162
161
  for (const session of __classPrivateFieldGet(this, _Connection_sessions, "f").values()) {
@@ -197,7 +196,6 @@ class CDPSession extends EventEmitter_1.EventEmitter {
197
196
  __classPrivateFieldGet(this, _CDPSession_callbacks, "f").set(id, {
198
197
  resolve,
199
198
  reject,
200
- error: new Errors_1.ProtocolError(),
201
199
  method,
202
200
  returnSize: true,
203
201
  });
@@ -208,7 +206,7 @@ class CDPSession extends EventEmitter_1.EventEmitter {
208
206
  if (object.id && callback) {
209
207
  __classPrivateFieldGet(this, _CDPSession_callbacks, "f").delete(object.id);
210
208
  if (object.error) {
211
- callback.reject(createProtocolError(callback.error, callback.method, object));
209
+ callback.reject(createProtocolError(callback.method, object));
212
210
  }
213
211
  else if (callback.returnSize) {
214
212
  callback.resolve({ value: object.result, size });
@@ -225,7 +223,7 @@ class CDPSession extends EventEmitter_1.EventEmitter {
225
223
  _onClosed() {
226
224
  __classPrivateFieldSet(this, _CDPSession_connection, undefined, "f");
227
225
  for (const callback of __classPrivateFieldGet(this, _CDPSession_callbacks, "f").values()) {
228
- callback.reject(rewriteError(callback.error, `Protocol error (${callback.method}): Target closed. https://www.remotion.dev/docs/target-closed`));
226
+ callback.reject(rewriteError(new Errors_1.ProtocolError(), `Protocol error (${callback.method}): Target closed. https://www.remotion.dev/docs/target-closed`));
229
227
  }
230
228
  __classPrivateFieldGet(this, _CDPSession_callbacks, "f").clear();
231
229
  this.emit(exports.CDPSessionEmittedEvents.Disconnected);
@@ -236,12 +234,12 @@ class CDPSession extends EventEmitter_1.EventEmitter {
236
234
  }
237
235
  exports.CDPSession = CDPSession;
238
236
  _CDPSession_sessionId = new WeakMap(), _CDPSession_targetType = new WeakMap(), _CDPSession_callbacks = new WeakMap(), _CDPSession_connection = new WeakMap();
239
- function createProtocolError(error, method, object) {
237
+ function createProtocolError(method, object) {
240
238
  let message = `Protocol error (${method}): ${object.error.message}`;
241
239
  if ('data' in object.error) {
242
240
  message += ` ${object.error.data}`;
243
241
  }
244
- return rewriteError(error, message, object.error.message);
242
+ return rewriteError(new Errors_1.ProtocolError(), message, object.error.message);
245
243
  }
246
244
  function rewriteError(error, message, originalMessage) {
247
245
  error.message = message;
@@ -20,6 +20,7 @@ export declare class HTTPRequest {
20
20
  #private;
21
21
  _requestId: string;
22
22
  _response: HTTPResponse | null;
23
+ _url: string | null;
23
24
  _fromMemoryCache: boolean;
24
25
  constructor(frame: Frame | null, event: RequestWillBeSentEvent);
25
26
  response(): HTTPResponse | null;
@@ -16,12 +16,14 @@ exports.HTTPRequest = void 0;
16
16
  class HTTPRequest {
17
17
  constructor(frame, event) {
18
18
  this._response = null;
19
+ this._url = null;
19
20
  this._fromMemoryCache = false;
20
21
  _HTTPRequest_isNavigationRequest.set(this, void 0);
21
22
  _HTTPRequest_frame.set(this, void 0);
22
23
  this._requestId = event.requestId;
23
24
  __classPrivateFieldSet(this, _HTTPRequest_isNavigationRequest, event.requestId === event.loaderId && event.type === 'Document', "f");
24
25
  __classPrivateFieldSet(this, _HTTPRequest_frame, frame, "f");
26
+ this._url = event.request.url;
25
27
  }
26
28
  response() {
27
29
  return this._response;
@@ -28,6 +28,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
28
28
  var _NetworkManager_instances, _NetworkManager_client, _NetworkManager_frameManager, _NetworkManager_networkEventManager, _NetworkManager_onRequestWillBeSent, _NetworkManager_onRequestPaused, _NetworkManager_patchRequestEventHeaders, _NetworkManager_onRequest, _NetworkManager_onRequestServedFromCache, _NetworkManager_handleRequestRedirect, _NetworkManager_emitResponseEvent, _NetworkManager_onResponseReceived, _NetworkManager_onResponseReceivedExtraInfo, _NetworkManager_forgetRequest, _NetworkManager_onLoadingFinished, _NetworkManager_emitLoadingFinished, _NetworkManager_onLoadingFailed, _NetworkManager_emitLoadingFailed;
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.NetworkManager = exports.NetworkManagerEmittedEvents = void 0;
31
+ const logger_1 = require("../logger");
31
32
  const EventEmitter_1 = require("./EventEmitter");
32
33
  const HTTPRequest_1 = require("./HTTPRequest");
33
34
  const HTTPResponse_1 = require("./HTTPResponse");
@@ -227,5 +228,6 @@ _NetworkManager_client = new WeakMap(), _NetworkManager_frameManager = new WeakM
227
228
  if (!request) {
228
229
  return;
229
230
  }
231
+ logger_1.Log.warn(`Browser failed to load ${request._url}: ${event.errorText}`);
230
232
  __classPrivateFieldGet(this, _NetworkManager_instances, "m", _NetworkManager_forgetRequest).call(this, request, true);
231
233
  };
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;
@@ -280,7 +281,7 @@ export declare const BrowserSafeApis: {
280
281
  description: () => JSX.Element;
281
282
  docLink: string;
282
283
  ssrName: string;
283
- type: "default" | "bt709";
284
+ type: "bt709" | "default";
284
285
  };
285
286
  deleteAfterOption: {
286
287
  name: string;
@@ -382,6 +383,6 @@ export declare const BrowserSafeApis: {
382
383
  type: number | null;
383
384
  }];
384
385
  };
385
- codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
386
- codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
386
+ codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif") => boolean;
387
+ codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif") => boolean;
387
388
  };
@@ -4,9 +4,6 @@ export declare const createFfmpegComplexFilter: ({ filters, downloadMap, }: {
4
4
  filters: PreprocessedAudioTrack[];
5
5
  downloadMap: DownloadMap;
6
6
  }) => Promise<{
7
- complexFilterFlag: [
8
- string,
9
- string
10
- ] | null;
7
+ complexFilterFlag: [string, string] | null;
11
8
  cleanup: () => void;
12
9
  }>;
@@ -9,7 +9,7 @@ const node_os_1 = require("node:os");
9
9
  // We also get it from nproc and use the minimum of the two.
10
10
  const getConcurrencyFromNProc = () => {
11
11
  try {
12
- return parseInt((0, node_child_process_1.execSync)('nproc').toString().trim(), 10);
12
+ return parseInt((0, node_child_process_1.execSync)('nproc', { stdio: 'pipe' }).toString().trim(), 10);
13
13
  }
14
14
  catch (error) {
15
15
  return null;
@@ -1,6 +1,6 @@
1
1
  import type { AudioCodec } from './audio-codec';
2
2
  import type { Codec } from './codec';
3
3
  import type { FileExtension } from './file-extensions';
4
- export declare const getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">(codec: T, audioCodec: AudioCodec | null) => FileExtension;
5
- export declare const makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif")[]>;
4
+ export declare const getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif">(codec: T, audioCodec: AudioCodec | null) => FileExtension;
5
+ export declare const makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif")[]>;
6
6
  export declare const defaultCodecsForFileExtension: Record<FileExtension, Codec>;
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';
@@ -58,9 +60,9 @@ export declare const RenderInternals: {
58
60
  width: number;
59
61
  height: number;
60
62
  scale: number;
61
- codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
63
+ codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
62
64
  }) => void;
63
- 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;
65
+ 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;
64
66
  tmpDir: (str: string) => string;
65
67
  deleteDirectory: (directory: string) => void;
66
68
  isServeUrl: (potentialUrl: string) => boolean;
@@ -110,7 +112,7 @@ export declare const RenderInternals: {
110
112
  };
111
113
  registerErrorSymbolicationLock: () => number;
112
114
  unlockErrorSymbolicationLock: (id: number) => void;
113
- canUseParallelEncoding: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
115
+ canUseParallelEncoding: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif") => boolean;
114
116
  mimeContentType: typeof mimeContentType;
115
117
  mimeLookup: typeof mimeLookup;
116
118
  validateConcurrency: ({ setting, value, checkIfValidForCurrentMachine, }: {
@@ -127,8 +129,8 @@ export declare const RenderInternals: {
127
129
  DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
128
130
  validateJpegQuality: (q: number | undefined) => void;
129
131
  DEFAULT_TIMEOUT: number;
130
- DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
131
- isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | undefined) => boolean;
132
+ DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
133
+ isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif" | undefined) => boolean;
132
134
  logLevels: readonly ["verbose", "info", "warn", "error"];
133
135
  isEqualOrBelowLogLevel: (currentLevel: "verbose" | "info" | "warn" | "error", level: "verbose" | "info" | "warn" | "error") => boolean;
134
136
  isValidLogLevel: (level: string) => boolean;
@@ -145,7 +147,7 @@ export declare const RenderInternals: {
145
147
  output: string;
146
148
  onProgress: (p: number) => void;
147
149
  numberOfFrames: number;
148
- codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
150
+ codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
149
151
  fps: number;
150
152
  numberOfGifLoops: number | null;
151
153
  audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
@@ -153,7 +155,7 @@ export declare const RenderInternals: {
153
155
  getMinConcurrency: () => number;
154
156
  getMaxConcurrency: () => number;
155
157
  getDefaultAudioCodec: ({ codec, preferLossless, }: {
156
- codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
158
+ codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
157
159
  preferLossless: boolean;
158
160
  }) => "mp3" | "aac" | "pcm-16" | "opus" | null;
159
161
  validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
@@ -214,10 +216,10 @@ export declare const RenderInternals: {
214
216
  };
215
217
  };
216
218
  };
217
- mp3: {
219
+ prores: {
218
220
  default: import("./file-extensions").FileExtension;
219
221
  forAudioCodec: {
220
- mp3: {
222
+ aac: {
221
223
  possible: import("./file-extensions").FileExtension[];
222
224
  default: import("./file-extensions").FileExtension;
223
225
  };
@@ -227,10 +229,10 @@ export declare const RenderInternals: {
227
229
  };
228
230
  };
229
231
  };
230
- aac: {
232
+ mp3: {
231
233
  default: import("./file-extensions").FileExtension;
232
234
  forAudioCodec: {
233
- aac: {
235
+ mp3: {
234
236
  possible: import("./file-extensions").FileExtension[];
235
237
  default: import("./file-extensions").FileExtension;
236
238
  };
@@ -240,22 +242,22 @@ export declare const RenderInternals: {
240
242
  };
241
243
  };
242
244
  };
243
- wav: {
245
+ aac: {
244
246
  default: import("./file-extensions").FileExtension;
245
247
  forAudioCodec: {
248
+ aac: {
249
+ possible: import("./file-extensions").FileExtension[];
250
+ default: import("./file-extensions").FileExtension;
251
+ };
246
252
  "pcm-16": {
247
253
  possible: import("./file-extensions").FileExtension[];
248
254
  default: import("./file-extensions").FileExtension;
249
255
  };
250
256
  };
251
257
  };
252
- prores: {
258
+ wav: {
253
259
  default: import("./file-extensions").FileExtension;
254
260
  forAudioCodec: {
255
- aac: {
256
- possible: import("./file-extensions").FileExtension[];
257
- default: import("./file-extensions").FileExtension;
258
- };
259
261
  "pcm-16": {
260
262
  possible: import("./file-extensions").FileExtension[];
261
263
  default: import("./file-extensions").FileExtension;
@@ -292,8 +294,8 @@ export declare const RenderInternals: {
292
294
  readonly vp9: readonly ["opus", "pcm-16"];
293
295
  readonly wav: readonly ["pcm-16"];
294
296
  };
295
- makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif")[]>;
296
- defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">;
297
+ makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif")[]>;
298
+ defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif">;
297
299
  getExecutablePath: (type: "compositor" | "ffmpeg" | "ffprobe" | "ffmpeg-cwd") => string;
298
300
  callFf: (bin: "ffmpeg" | "ffprobe", args: (string | null)[], options?: execa.Options<string> | undefined) => execa.ExecaChildProcess<string>;
299
301
  dynamicLibraryPathOptions: () => {
@@ -311,7 +313,7 @@ export declare const RenderInternals: {
311
313
  validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
312
314
  validVideoImageFormats: readonly ["png", "jpeg", "none"];
313
315
  DEFAULT_STILL_IMAGE_FORMAT: "png" | "jpeg" | "pdf" | "webp";
314
- DEFAULT_VIDEO_IMAGE_FORMAT: "png" | "jpeg" | "none";
316
+ DEFAULT_VIDEO_IMAGE_FORMAT: "none" | "png" | "jpeg";
315
317
  DEFAULT_JPEG_QUALITY: number;
316
318
  chalk: {
317
319
  enabled: () => boolean;
@@ -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 validColorSpaces: readonly ["default", "bt709"];
2
3
  export type ColorSpace = (typeof validColorSpaces)[number];
3
4
  export declare const colorSpaceOption: {
@@ -6,6 +7,6 @@ export declare const colorSpaceOption: {
6
7
  description: () => JSX.Element;
7
8
  docLink: string;
8
9
  ssrName: string;
9
- type: "default" | "bt709";
10
+ type: "bt709" | "default";
10
11
  };
11
12
  export declare const validateColorSpace: (option: unknown) => void;
@@ -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 deleteAfterOption: {
2
3
  name: string;
3
4
  cliFlag: "delete-after";
@@ -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 folderExpiryOption: {
2
3
  name: string;
3
4
  cliFlag: "enable-folder-expiry";
@@ -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,10 +1,16 @@
1
1
  import type { Page } from './browser/BrowserPage';
2
- export declare function puppeteerEvaluateWithCatch<ReturnType>({ page, pageFunction, frame, args, }: {
2
+ type PuppeteerCatchOptions = {
3
3
  page: Page;
4
4
  pageFunction: Function | string;
5
5
  frame: number | null;
6
6
  args: unknown[];
7
- }): Promise<{
7
+ };
8
+ export declare function puppeteerEvaluateWithCatchAndTimeout<ReturnType>({ args, frame, page, pageFunction, }: PuppeteerCatchOptions): Promise<{
8
9
  value: ReturnType;
9
10
  size: number;
10
11
  }>;
12
+ export declare function puppeteerEvaluateWithCatch<ReturnType>({ page, pageFunction, frame, args, }: PuppeteerCatchOptions): Promise<{
13
+ value: ReturnType;
14
+ size: number;
15
+ }>;
16
+ export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.puppeteerEvaluateWithCatch = void 0;
3
+ exports.puppeteerEvaluateWithCatch = exports.puppeteerEvaluateWithCatchAndTimeout = void 0;
4
4
  const JSHandle_1 = require("./browser/JSHandle");
5
5
  const symbolicateable_error_1 = require("./error-handling/symbolicateable-error");
6
6
  const parse_browser_error_stack_1 = require("./parse-browser-error-stack");
@@ -29,6 +29,22 @@ function valueFromRemoteObject(remoteObject) {
29
29
  function isString(obj) {
30
30
  return typeof obj === 'string' || obj instanceof String;
31
31
  }
32
+ function puppeteerEvaluateWithCatchAndTimeout({ args, frame, page, pageFunction, }) {
33
+ return Promise.race([
34
+ new Promise((_, reject) => {
35
+ setTimeout(() => {
36
+ reject(new Error('timeout exceeded'));
37
+ }, 5000);
38
+ }),
39
+ puppeteerEvaluateWithCatch({
40
+ args,
41
+ frame,
42
+ page,
43
+ pageFunction,
44
+ }),
45
+ ]);
46
+ }
47
+ exports.puppeteerEvaluateWithCatchAndTimeout = puppeteerEvaluateWithCatchAndTimeout;
32
48
  async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, }) {
33
49
  var _a, _b, _c, _d, _e, _f, _g, _h;
34
50
  const contextId = (await page.mainFrame().executionContext())._contextId;
@@ -95,8 +111,9 @@ async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, })
95
111
  }
96
112
  catch (error) {
97
113
  if (error instanceof TypeError &&
98
- error.message.startsWith('Converting circular structure to JSON'))
114
+ error.message.startsWith('Converting circular structure to JSON')) {
99
115
  error.message += ' Are you passing a nested JSHandle?';
116
+ }
100
117
  throw error;
101
118
  }
102
119
  try {
@@ -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';
@@ -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';
@@ -19,11 +19,13 @@ const waitForReady = ({ page, timeoutInMilliseconds, frame, }) => {
19
19
  : `the page to render the React component at frame ${frame}`,
20
20
  shouldClosePage: false,
21
21
  })
22
- .then((a) => resolve(a))
22
+ .then((a) => {
23
+ return resolve(a);
24
+ })
23
25
  .catch((err) => {
24
26
  if (err.message.includes('timeout') &&
25
27
  err.message.includes('exceeded')) {
26
- (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
28
+ (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatchAndTimeout)({
27
29
  pageFunction: () => {
28
30
  return Object.keys(window.remotion_delayRenderTimeouts)
29
31
  .map((id, i) => {
@@ -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,5 +1,5 @@
1
1
  import type { AudioCodec } from './audio-codec';
2
- export declare const validateOutputFilename: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">({ codec, audioCodec, extension, preferLossless, }: {
2
+ export declare const validateOutputFilename: <T extends "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif">({ codec, audioCodec, extension, preferLossless, }: {
3
3
  codec: T;
4
4
  audioCodec: AudioCodec | null;
5
5
  extension: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "4.0.35",
3
+ "version": "4.0.37",
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.35"
21
+ "remotion": "4.0.37"
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.35",
44
- "@remotion/compositor-darwin-x64": "4.0.35",
45
- "@remotion/compositor-linux-arm64-gnu": "4.0.35",
46
- "@remotion/compositor-linux-arm64-musl": "4.0.35",
47
- "@remotion/compositor-linux-x64-gnu": "4.0.35",
48
- "@remotion/compositor-linux-x64-musl": "4.0.35",
49
- "@remotion/compositor-win32-x64-msvc": "4.0.35"
43
+ "@remotion/compositor-darwin-arm64": "4.0.37",
44
+ "@remotion/compositor-linux-arm64-gnu": "4.0.37",
45
+ "@remotion/compositor-darwin-x64": "4.0.37",
46
+ "@remotion/compositor-linux-arm64-musl": "4.0.37",
47
+ "@remotion/compositor-linux-x64-gnu": "4.0.37",
48
+ "@remotion/compositor-win32-x64-msvc": "4.0.37",
49
+ "@remotion/compositor-linux-x64-musl": "4.0.37"
50
50
  },
51
51
  "keywords": [
52
52
  "remotion",
@@ -1,16 +0,0 @@
1
- /**
2
- * Copyright 2020 Google Inc. All rights reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export type Product = 'chrome' | 'firefox';
@@ -1,17 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright 2020 Google Inc. All rights reserved.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,17 +0,0 @@
1
- /**
2
- * Copyright 2020 Google Inc. All rights reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import type { Product } from './Product';
17
- export declare function downloadBrowser(product: Product): Promise<void>;
@@ -1,58 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright 2020 Google Inc. All rights reserved.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.downloadBrowser = void 0;
19
- const BrowserFetcher_1 = require("./BrowserFetcher");
20
- const revisions_1 = require("./revisions");
21
- const supportedProducts = {
22
- chrome: 'Chromium',
23
- firefox: 'Firefox Nightly',
24
- };
25
- function getRevision(product) {
26
- if (product === 'chrome') {
27
- return revisions_1.PUPPETEER_REVISIONS.chromium;
28
- }
29
- throw new Error(`Unsupported product ${product}`);
30
- }
31
- async function downloadBrowser(product) {
32
- const revision = getRevision(product);
33
- const revisionInfo = (0, BrowserFetcher_1.getRevisionInfo)(revision, product);
34
- await (0, BrowserFetcher_1.download)({
35
- revision: revisionInfo.revision,
36
- progressCallback: (downloadedBytes, totalBytes) => {
37
- console.log('Downloading', supportedProducts[product], toMegabytes(downloadedBytes) + '/' + toMegabytes(totalBytes));
38
- },
39
- product,
40
- platform: (0, BrowserFetcher_1.getPlatform)(product),
41
- downloadHost: (0, BrowserFetcher_1.getDownloadHost)(product),
42
- downloadsFolder: (0, BrowserFetcher_1.getDownloadsFolder)(product),
43
- });
44
- const _localRevisions = await (0, BrowserFetcher_1.localRevisions)((0, BrowserFetcher_1.getDownloadsFolder)(product), product, (0, BrowserFetcher_1.getPlatform)(product));
45
- console.log(`${supportedProducts[product]} (${revisionInfo.revision}) downloaded to ${revisionInfo.folderPath}`);
46
- await Promise.all(_localRevisions
47
- .filter((__revision) => {
48
- return __revision !== revisionInfo.revision;
49
- })
50
- .map((__revision) => {
51
- return (0, BrowserFetcher_1.removeBrowser)(__revision, (0, BrowserFetcher_1.getFolderPath)(revision, (0, BrowserFetcher_1.getDownloadsFolder)(product), (0, BrowserFetcher_1.getPlatform)(product)));
52
- }));
53
- }
54
- exports.downloadBrowser = downloadBrowser;
55
- function toMegabytes(bytes) {
56
- const mb = bytes / 1024 / 1024;
57
- return `${Math.round(mb * 10) / 10} Mb`;
58
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * Copyright 2020 Google Inc. All rights reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- type Revisions = Readonly<{
17
- readonly chromium: string;
18
- }>;
19
- export declare const PUPPETEER_REVISIONS: Revisions;
20
- export {};
@@ -1,21 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright 2020 Google Inc. All rights reserved.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.PUPPETEER_REVISIONS = void 0;
19
- exports.PUPPETEER_REVISIONS = {
20
- chromium: '1002410',
21
- };