@remotion/renderer 4.0.36 → 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.
- package/dist/browser/Connection.js +6 -8
- package/dist/browser/HTTPRequest.d.ts +1 -0
- package/dist/browser/HTTPRequest.js +2 -0
- package/dist/browser/NetworkManager.js +2 -0
- package/dist/client.d.ts +23 -23
- package/dist/get-cpu-count.js +1 -1
- package/dist/get-extension-from-codec.d.ts +2 -2
- package/dist/index.d.ts +24 -24
- package/dist/options/color-space.d.ts +1 -1
- package/dist/puppeteer-evaluate.d.ts +8 -2
- package/dist/puppeteer-evaluate.js +19 -2
- package/dist/seek-to-frame.js +4 -2
- package/dist/validate-output-filename.d.ts +1 -1
- package/package.json +9 -9
- package/dist/browser/Product.d.ts +0 -16
- package/dist/browser/Product.js +0 -17
- package/dist/browser/create-browser-fetcher.d.ts +0 -17
- package/dist/browser/create-browser-fetcher.js +0 -58
- package/dist/browser/revisions.d.ts +0 -20
- 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.
|
|
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(
|
|
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.
|
|
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(
|
|
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(
|
|
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(
|
|
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,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const BrowserSafeApis: {
|
|
3
|
-
getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
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;
|
|
4
4
|
validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "gif"];
|
|
5
5
|
validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
|
|
6
|
-
getDefaultCrfForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
7
|
-
getValidCrfRanges: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
8
|
-
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
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;
|
|
9
9
|
proResProfileOptions: readonly ["4444-xq", "4444", "hq", "standard", "light", "proxy"];
|
|
10
10
|
x264PresetOptions: readonly ["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo"];
|
|
11
11
|
validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
@@ -79,10 +79,10 @@ export declare const BrowserSafeApis: {
|
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
prores: {
|
|
83
83
|
default: import("./file-extensions").FileExtension;
|
|
84
84
|
forAudioCodec: {
|
|
85
|
-
|
|
85
|
+
aac: {
|
|
86
86
|
possible: import("./file-extensions").FileExtension[];
|
|
87
87
|
default: import("./file-extensions").FileExtension;
|
|
88
88
|
};
|
|
@@ -92,10 +92,10 @@ export declare const BrowserSafeApis: {
|
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
|
-
|
|
95
|
+
mp3: {
|
|
96
96
|
default: import("./file-extensions").FileExtension;
|
|
97
97
|
forAudioCodec: {
|
|
98
|
-
|
|
98
|
+
mp3: {
|
|
99
99
|
possible: import("./file-extensions").FileExtension[];
|
|
100
100
|
default: import("./file-extensions").FileExtension;
|
|
101
101
|
};
|
|
@@ -105,22 +105,22 @@ export declare const BrowserSafeApis: {
|
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
|
-
|
|
108
|
+
aac: {
|
|
109
109
|
default: import("./file-extensions").FileExtension;
|
|
110
110
|
forAudioCodec: {
|
|
111
|
+
aac: {
|
|
112
|
+
possible: import("./file-extensions").FileExtension[];
|
|
113
|
+
default: import("./file-extensions").FileExtension;
|
|
114
|
+
};
|
|
111
115
|
"pcm-16": {
|
|
112
116
|
possible: import("./file-extensions").FileExtension[];
|
|
113
117
|
default: import("./file-extensions").FileExtension;
|
|
114
118
|
};
|
|
115
119
|
};
|
|
116
120
|
};
|
|
117
|
-
|
|
121
|
+
wav: {
|
|
118
122
|
default: import("./file-extensions").FileExtension;
|
|
119
123
|
forAudioCodec: {
|
|
120
|
-
aac: {
|
|
121
|
-
possible: import("./file-extensions").FileExtension[];
|
|
122
|
-
default: import("./file-extensions").FileExtension;
|
|
123
|
-
};
|
|
124
124
|
"pcm-16": {
|
|
125
125
|
possible: import("./file-extensions").FileExtension[];
|
|
126
126
|
default: import("./file-extensions").FileExtension;
|
|
@@ -162,6 +162,10 @@ export declare const BrowserSafeApis: {
|
|
|
162
162
|
compressed: "pcm-16" | "opus" | null;
|
|
163
163
|
lossless: "pcm-16" | "opus" | null;
|
|
164
164
|
};
|
|
165
|
+
prores: {
|
|
166
|
+
compressed: "aac" | "pcm-16" | null;
|
|
167
|
+
lossless: "aac" | "pcm-16" | null;
|
|
168
|
+
};
|
|
165
169
|
mp3: {
|
|
166
170
|
compressed: "mp3" | "pcm-16" | null;
|
|
167
171
|
lossless: "mp3" | "pcm-16" | null;
|
|
@@ -174,10 +178,6 @@ export declare const BrowserSafeApis: {
|
|
|
174
178
|
compressed: "pcm-16" | null;
|
|
175
179
|
lossless: "pcm-16" | null;
|
|
176
180
|
};
|
|
177
|
-
prores: {
|
|
178
|
-
compressed: "aac" | "pcm-16" | null;
|
|
179
|
-
lossless: "aac" | "pcm-16" | null;
|
|
180
|
-
};
|
|
181
181
|
"h264-mkv": {
|
|
182
182
|
compressed: "mp3" | "pcm-16" | null;
|
|
183
183
|
lossless: "mp3" | "pcm-16" | null;
|
|
@@ -187,8 +187,8 @@ export declare const BrowserSafeApis: {
|
|
|
187
187
|
lossless: null;
|
|
188
188
|
};
|
|
189
189
|
};
|
|
190
|
-
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "
|
|
191
|
-
validateOutputFilename: <T_1 extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
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, }: {
|
|
192
192
|
codec: T_1;
|
|
193
193
|
audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
194
194
|
extension: string;
|
|
@@ -281,7 +281,7 @@ export declare const BrowserSafeApis: {
|
|
|
281
281
|
description: () => JSX.Element;
|
|
282
282
|
docLink: string;
|
|
283
283
|
ssrName: string;
|
|
284
|
-
type: "
|
|
284
|
+
type: "bt709" | "default";
|
|
285
285
|
};
|
|
286
286
|
deleteAfterOption: {
|
|
287
287
|
name: string;
|
|
@@ -383,6 +383,6 @@ export declare const BrowserSafeApis: {
|
|
|
383
383
|
type: number | null;
|
|
384
384
|
}];
|
|
385
385
|
};
|
|
386
|
-
codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
387
|
-
codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
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;
|
|
388
388
|
};
|
package/dist/get-cpu-count.js
CHANGED
|
@@ -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" | "
|
|
5
|
-
export declare const makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "
|
|
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
|
@@ -60,9 +60,9 @@ export declare const RenderInternals: {
|
|
|
60
60
|
width: number;
|
|
61
61
|
height: number;
|
|
62
62
|
scale: number;
|
|
63
|
-
codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
63
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
|
|
64
64
|
}) => void;
|
|
65
|
-
getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
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;
|
|
66
66
|
tmpDir: (str: string) => string;
|
|
67
67
|
deleteDirectory: (directory: string) => void;
|
|
68
68
|
isServeUrl: (potentialUrl: string) => boolean;
|
|
@@ -112,7 +112,7 @@ export declare const RenderInternals: {
|
|
|
112
112
|
};
|
|
113
113
|
registerErrorSymbolicationLock: () => number;
|
|
114
114
|
unlockErrorSymbolicationLock: (id: number) => void;
|
|
115
|
-
canUseParallelEncoding: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
115
|
+
canUseParallelEncoding: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif") => boolean;
|
|
116
116
|
mimeContentType: typeof mimeContentType;
|
|
117
117
|
mimeLookup: typeof mimeLookup;
|
|
118
118
|
validateConcurrency: ({ setting, value, checkIfValidForCurrentMachine, }: {
|
|
@@ -123,14 +123,14 @@ export declare const RenderInternals: {
|
|
|
123
123
|
validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
124
124
|
DEFAULT_BROWSER: "chrome";
|
|
125
125
|
validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
|
|
126
|
-
DEFAULT_OPENGL_RENDERER: "
|
|
127
|
-
validateOpenGlRenderer: (option: "
|
|
126
|
+
DEFAULT_OPENGL_RENDERER: "swangle" | "angle" | "egl" | "swiftshader" | null;
|
|
127
|
+
validateOpenGlRenderer: (option: "swangle" | "angle" | "egl" | "swiftshader" | null) => "swangle" | "angle" | "egl" | "swiftshader" | null;
|
|
128
128
|
validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "gif"];
|
|
129
129
|
DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
130
130
|
validateJpegQuality: (q: number | undefined) => void;
|
|
131
131
|
DEFAULT_TIMEOUT: number;
|
|
132
|
-
DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "
|
|
133
|
-
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
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;
|
|
134
134
|
logLevels: readonly ["verbose", "info", "warn", "error"];
|
|
135
135
|
isEqualOrBelowLogLevel: (currentLevel: "verbose" | "info" | "warn" | "error", level: "verbose" | "info" | "warn" | "error") => boolean;
|
|
136
136
|
isValidLogLevel: (level: string) => boolean;
|
|
@@ -147,7 +147,7 @@ export declare const RenderInternals: {
|
|
|
147
147
|
output: string;
|
|
148
148
|
onProgress: (p: number) => void;
|
|
149
149
|
numberOfFrames: number;
|
|
150
|
-
codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
150
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
|
|
151
151
|
fps: number;
|
|
152
152
|
numberOfGifLoops: number | null;
|
|
153
153
|
audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
@@ -155,7 +155,7 @@ export declare const RenderInternals: {
|
|
|
155
155
|
getMinConcurrency: () => number;
|
|
156
156
|
getMaxConcurrency: () => number;
|
|
157
157
|
getDefaultAudioCodec: ({ codec, preferLossless, }: {
|
|
158
|
-
codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
158
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "mp3" | "aac" | "wav" | "h264-mkv" | "gif";
|
|
159
159
|
preferLossless: boolean;
|
|
160
160
|
}) => "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
161
161
|
validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
|
|
@@ -216,10 +216,10 @@ export declare const RenderInternals: {
|
|
|
216
216
|
};
|
|
217
217
|
};
|
|
218
218
|
};
|
|
219
|
-
|
|
219
|
+
prores: {
|
|
220
220
|
default: import("./file-extensions").FileExtension;
|
|
221
221
|
forAudioCodec: {
|
|
222
|
-
|
|
222
|
+
aac: {
|
|
223
223
|
possible: import("./file-extensions").FileExtension[];
|
|
224
224
|
default: import("./file-extensions").FileExtension;
|
|
225
225
|
};
|
|
@@ -229,10 +229,10 @@ export declare const RenderInternals: {
|
|
|
229
229
|
};
|
|
230
230
|
};
|
|
231
231
|
};
|
|
232
|
-
|
|
232
|
+
mp3: {
|
|
233
233
|
default: import("./file-extensions").FileExtension;
|
|
234
234
|
forAudioCodec: {
|
|
235
|
-
|
|
235
|
+
mp3: {
|
|
236
236
|
possible: import("./file-extensions").FileExtension[];
|
|
237
237
|
default: import("./file-extensions").FileExtension;
|
|
238
238
|
};
|
|
@@ -242,22 +242,22 @@ export declare const RenderInternals: {
|
|
|
242
242
|
};
|
|
243
243
|
};
|
|
244
244
|
};
|
|
245
|
-
|
|
245
|
+
aac: {
|
|
246
246
|
default: import("./file-extensions").FileExtension;
|
|
247
247
|
forAudioCodec: {
|
|
248
|
+
aac: {
|
|
249
|
+
possible: import("./file-extensions").FileExtension[];
|
|
250
|
+
default: import("./file-extensions").FileExtension;
|
|
251
|
+
};
|
|
248
252
|
"pcm-16": {
|
|
249
253
|
possible: import("./file-extensions").FileExtension[];
|
|
250
254
|
default: import("./file-extensions").FileExtension;
|
|
251
255
|
};
|
|
252
256
|
};
|
|
253
257
|
};
|
|
254
|
-
|
|
258
|
+
wav: {
|
|
255
259
|
default: import("./file-extensions").FileExtension;
|
|
256
260
|
forAudioCodec: {
|
|
257
|
-
aac: {
|
|
258
|
-
possible: import("./file-extensions").FileExtension[];
|
|
259
|
-
default: import("./file-extensions").FileExtension;
|
|
260
|
-
};
|
|
261
261
|
"pcm-16": {
|
|
262
262
|
possible: import("./file-extensions").FileExtension[];
|
|
263
263
|
default: import("./file-extensions").FileExtension;
|
|
@@ -294,8 +294,8 @@ export declare const RenderInternals: {
|
|
|
294
294
|
readonly vp9: readonly ["opus", "pcm-16"];
|
|
295
295
|
readonly wav: readonly ["pcm-16"];
|
|
296
296
|
};
|
|
297
|
-
makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "
|
|
298
|
-
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "
|
|
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">;
|
|
299
299
|
getExecutablePath: (type: "compositor" | "ffmpeg" | "ffprobe" | "ffmpeg-cwd") => string;
|
|
300
300
|
callFf: (bin: "ffmpeg" | "ffprobe", args: (string | null)[], options?: execa.Options<string> | undefined) => execa.ExecaChildProcess<string>;
|
|
301
301
|
dynamicLibraryPathOptions: () => {
|
|
@@ -312,8 +312,8 @@ export declare const RenderInternals: {
|
|
|
312
312
|
};
|
|
313
313
|
validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
|
|
314
314
|
validVideoImageFormats: readonly ["png", "jpeg", "none"];
|
|
315
|
-
DEFAULT_STILL_IMAGE_FORMAT: "
|
|
316
|
-
DEFAULT_VIDEO_IMAGE_FORMAT: "
|
|
315
|
+
DEFAULT_STILL_IMAGE_FORMAT: "png" | "jpeg" | "pdf" | "webp";
|
|
316
|
+
DEFAULT_VIDEO_IMAGE_FORMAT: "none" | "png" | "jpeg";
|
|
317
317
|
DEFAULT_JPEG_QUALITY: number;
|
|
318
318
|
chalk: {
|
|
319
319
|
enabled: () => boolean;
|
|
@@ -426,7 +426,7 @@ export declare const RenderInternals: {
|
|
|
426
426
|
frame: number;
|
|
427
427
|
serializedInputPropsWithCustomSchema: string;
|
|
428
428
|
serializedResolvedPropsWithCustomSchema: string;
|
|
429
|
-
imageFormat: "
|
|
429
|
+
imageFormat: "png" | "jpeg" | "pdf" | "webp";
|
|
430
430
|
jpegQuality: number;
|
|
431
431
|
puppeteerInstance: HeadlessBrowser | null;
|
|
432
432
|
envVariables: Record<string, string>;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { Page } from './browser/BrowserPage';
|
|
2
|
-
|
|
2
|
+
type PuppeteerCatchOptions = {
|
|
3
3
|
page: Page;
|
|
4
4
|
pageFunction: Function | string;
|
|
5
5
|
frame: number | null;
|
|
6
6
|
args: unknown[];
|
|
7
|
-
}
|
|
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 {
|
package/dist/seek-to-frame.js
CHANGED
|
@@ -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) =>
|
|
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.
|
|
28
|
+
(0, puppeteer_evaluate_1.puppeteerEvaluateWithCatchAndTimeout)({
|
|
27
29
|
pageFunction: () => {
|
|
28
30
|
return Object.keys(window.remotion_delayRenderTimeouts)
|
|
29
31
|
.map((id, i) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AudioCodec } from './audio-codec';
|
|
2
|
-
export declare const validateOutputFilename: <T extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
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.
|
|
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.
|
|
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-
|
|
44
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
45
|
-
"@remotion/compositor-
|
|
46
|
-
"@remotion/compositor-linux-
|
|
47
|
-
"@remotion/compositor-linux-x64-
|
|
48
|
-
"@remotion/compositor-win32-x64-msvc": "4.0.
|
|
49
|
-
"@remotion/compositor-
|
|
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';
|
package/dist/browser/Product.js
DELETED
|
@@ -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
|
-
};
|