@remotion/renderer 4.0.37 → 4.0.39
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/DOMWorld.d.ts +1 -3
- package/dist/browser/DOMWorld.js +3 -9
- package/dist/browser/NetworkManager.js +3 -1
- package/dist/client.d.ts +23 -23
- package/dist/get-extension-from-codec.d.ts +2 -2
- package/dist/get-local-browser-executable.js +1 -1
- package/dist/index.d.ts +24 -24
- package/dist/options/color-space.d.ts +1 -1
- package/dist/options/render-expiry-days.d.ts +8 -0
- package/dist/options/render-expiry-days.js +14 -0
- package/dist/presets-profile.d.ts +7 -0
- package/dist/presets-profile.js +27 -0
- package/dist/puppeteer-evaluate.d.ts +1 -1
- package/dist/puppeteer-evaluate.js +10 -35
- package/dist/seek-to-frame.js +1 -3
- package/dist/validate-output-filename.d.ts +1 -1
- package/package.json +9 -9
|
@@ -29,12 +29,11 @@ export declare class DOMWorld {
|
|
|
29
29
|
executionContext(): Promise<ExecutionContext>;
|
|
30
30
|
evaluateHandle<HandlerType extends JSHandle = JSHandle>(pageFunction: EvaluateHandleFn, ...args: SerializableOrJSHandle[]): Promise<HandlerType>;
|
|
31
31
|
evaluate<T extends EvaluateFn>(pageFunction: T, ...args: SerializableOrJSHandle[]): Promise<UnwrapPromiseLike<EvaluateFnReturnType<T>>>;
|
|
32
|
-
waitForFunction({ browser, timeout, pageFunction, title,
|
|
32
|
+
waitForFunction({ browser, timeout, pageFunction, title, }: {
|
|
33
33
|
browser: HeadlessBrowser;
|
|
34
34
|
timeout: number | null;
|
|
35
35
|
pageFunction: Function | string;
|
|
36
36
|
title: string;
|
|
37
|
-
shouldClosePage: boolean;
|
|
38
37
|
}): Promise<JSHandle>;
|
|
39
38
|
title(): Promise<string>;
|
|
40
39
|
}
|
|
@@ -45,7 +44,6 @@ interface WaitTaskOptions {
|
|
|
45
44
|
timeout: number | null;
|
|
46
45
|
browser: HeadlessBrowser;
|
|
47
46
|
args: SerializableOrJSHandle[];
|
|
48
|
-
shouldClosePage: boolean;
|
|
49
47
|
}
|
|
50
48
|
declare class WaitTask {
|
|
51
49
|
#private;
|
package/dist/browser/DOMWorld.js
CHANGED
|
@@ -25,7 +25,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
25
25
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
26
26
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
27
27
|
};
|
|
28
|
-
var _DOMWorld_frame, _DOMWorld_contextPromise, _DOMWorld_contextResolveCallback, _DOMWorld_detached, _DOMWorld_waitTasks, _WaitTask_instances, _WaitTask_domWorld, _WaitTask_timeout, _WaitTask_predicateBody, _WaitTask_args, _WaitTask_runCount, _WaitTask_resolve, _WaitTask_reject, _WaitTask_timeoutTimer, _WaitTask_terminated, _WaitTask_browser,
|
|
28
|
+
var _DOMWorld_frame, _DOMWorld_contextPromise, _DOMWorld_contextResolveCallback, _DOMWorld_detached, _DOMWorld_waitTasks, _WaitTask_instances, _WaitTask_domWorld, _WaitTask_timeout, _WaitTask_predicateBody, _WaitTask_args, _WaitTask_runCount, _WaitTask_resolve, _WaitTask_reject, _WaitTask_timeoutTimer, _WaitTask_terminated, _WaitTask_browser, _WaitTask_cleanup;
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
exports.DOMWorld = void 0;
|
|
31
31
|
const assert_1 = require("./assert");
|
|
@@ -91,7 +91,7 @@ class DOMWorld {
|
|
|
91
91
|
const context = await this.executionContext();
|
|
92
92
|
return context.evaluate(pageFunction, ...args);
|
|
93
93
|
}
|
|
94
|
-
waitForFunction({ browser, timeout, pageFunction, title,
|
|
94
|
+
waitForFunction({ browser, timeout, pageFunction, title, }) {
|
|
95
95
|
return new WaitTask({
|
|
96
96
|
domWorld: this,
|
|
97
97
|
predicateBody: pageFunction,
|
|
@@ -99,7 +99,6 @@ class DOMWorld {
|
|
|
99
99
|
timeout,
|
|
100
100
|
args: [],
|
|
101
101
|
browser,
|
|
102
|
-
shouldClosePage,
|
|
103
102
|
}).promise;
|
|
104
103
|
}
|
|
105
104
|
title() {
|
|
@@ -124,7 +123,6 @@ class WaitTask {
|
|
|
124
123
|
_WaitTask_timeoutTimer.set(this, void 0);
|
|
125
124
|
_WaitTask_terminated.set(this, false);
|
|
126
125
|
_WaitTask_browser.set(this, void 0);
|
|
127
|
-
_WaitTask_shouldClosePage.set(this, void 0);
|
|
128
126
|
this.onBrowserClose = () => {
|
|
129
127
|
return this.terminate(new Error('Browser was closed'));
|
|
130
128
|
};
|
|
@@ -142,7 +140,6 @@ class WaitTask {
|
|
|
142
140
|
__classPrivateFieldSet(this, _WaitTask_predicateBody, getPredicateBody(options.predicateBody), "f");
|
|
143
141
|
__classPrivateFieldSet(this, _WaitTask_args, options.args, "f");
|
|
144
142
|
__classPrivateFieldSet(this, _WaitTask_runCount, 0, "f");
|
|
145
|
-
__classPrivateFieldSet(this, _WaitTask_shouldClosePage, options.shouldClosePage, "f");
|
|
146
143
|
__classPrivateFieldGet(this, _WaitTask_domWorld, "f")._waitTasks.add(this);
|
|
147
144
|
this.promise = new Promise((resolve, reject) => {
|
|
148
145
|
__classPrivateFieldSet(this, _WaitTask_resolve, resolve, "f");
|
|
@@ -153,9 +150,6 @@ class WaitTask {
|
|
|
153
150
|
if (options.timeout) {
|
|
154
151
|
const timeoutError = new Errors_1.TimeoutError(`waiting for ${options.title} failed: timeout ${options.timeout}ms exceeded`);
|
|
155
152
|
__classPrivateFieldSet(this, _WaitTask_timeoutTimer, setTimeout(() => {
|
|
156
|
-
if (__classPrivateFieldGet(this, _WaitTask_shouldClosePage, "f")) {
|
|
157
|
-
return this.terminate(timeoutError);
|
|
158
|
-
}
|
|
159
153
|
return __classPrivateFieldGet(this, _WaitTask_reject, "f").call(this, timeoutError);
|
|
160
154
|
}, options.timeout), "f");
|
|
161
155
|
}
|
|
@@ -244,7 +238,7 @@ class WaitTask {
|
|
|
244
238
|
__classPrivateFieldGet(this, _WaitTask_instances, "m", _WaitTask_cleanup).call(this);
|
|
245
239
|
}
|
|
246
240
|
}
|
|
247
|
-
_WaitTask_domWorld = new WeakMap(), _WaitTask_timeout = new WeakMap(), _WaitTask_predicateBody = new WeakMap(), _WaitTask_args = new WeakMap(), _WaitTask_runCount = new WeakMap(), _WaitTask_resolve = new WeakMap(), _WaitTask_reject = new WeakMap(), _WaitTask_timeoutTimer = new WeakMap(), _WaitTask_terminated = new WeakMap(), _WaitTask_browser = new WeakMap(),
|
|
241
|
+
_WaitTask_domWorld = new WeakMap(), _WaitTask_timeout = new WeakMap(), _WaitTask_predicateBody = new WeakMap(), _WaitTask_args = new WeakMap(), _WaitTask_runCount = new WeakMap(), _WaitTask_resolve = new WeakMap(), _WaitTask_reject = new WeakMap(), _WaitTask_timeoutTimer = new WeakMap(), _WaitTask_terminated = new WeakMap(), _WaitTask_browser = new WeakMap(), _WaitTask_instances = new WeakSet(), _WaitTask_cleanup = function _WaitTask_cleanup() {
|
|
248
242
|
if (__classPrivateFieldGet(this, _WaitTask_timeoutTimer, "f") !== undefined) {
|
|
249
243
|
clearTimeout(__classPrivateFieldGet(this, _WaitTask_timeoutTimer, "f"));
|
|
250
244
|
}
|
|
@@ -228,6 +228,8 @@ _NetworkManager_client = new WeakMap(), _NetworkManager_frameManager = new WeakM
|
|
|
228
228
|
if (!request) {
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
|
-
|
|
231
|
+
if (!event.canceled) {
|
|
232
|
+
logger_1.Log.warn(`Browser failed to load ${request._url}: ${event.errorText}`);
|
|
233
|
+
}
|
|
232
234
|
__classPrivateFieldGet(this, _NetworkManager_instances, "m", _NetworkManager_forgetRequest).call(this, request, true);
|
|
233
235
|
};
|
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" | "mp3" | "aac" | "wav" | "prores" | "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" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => number;
|
|
7
|
+
getValidCrfRanges: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => [number, number];
|
|
8
|
+
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "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
|
+
mp3: {
|
|
83
83
|
default: import("./file-extensions").FileExtension;
|
|
84
84
|
forAudioCodec: {
|
|
85
|
-
|
|
85
|
+
mp3: {
|
|
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
|
+
aac: {
|
|
96
96
|
default: import("./file-extensions").FileExtension;
|
|
97
97
|
forAudioCodec: {
|
|
98
|
-
|
|
98
|
+
aac: {
|
|
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
|
+
wav: {
|
|
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
|
-
};
|
|
115
111
|
"pcm-16": {
|
|
116
112
|
possible: import("./file-extensions").FileExtension[];
|
|
117
113
|
default: import("./file-extensions").FileExtension;
|
|
118
114
|
};
|
|
119
115
|
};
|
|
120
116
|
};
|
|
121
|
-
|
|
117
|
+
prores: {
|
|
122
118
|
default: import("./file-extensions").FileExtension;
|
|
123
119
|
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,10 +162,6 @@ 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
|
-
};
|
|
169
165
|
mp3: {
|
|
170
166
|
compressed: "mp3" | "pcm-16" | null;
|
|
171
167
|
lossless: "mp3" | "pcm-16" | null;
|
|
@@ -178,6 +174,10 @@ export declare const BrowserSafeApis: {
|
|
|
178
174
|
compressed: "pcm-16" | null;
|
|
179
175
|
lossless: "pcm-16" | null;
|
|
180
176
|
};
|
|
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" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">;
|
|
191
|
+
validateOutputFilename: <T_1 extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "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: "default" | "bt709";
|
|
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" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
|
|
387
|
+
codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
|
|
388
388
|
};
|
|
@@ -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" | "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")[]>;
|
|
6
6
|
export declare const defaultCodecsForFileExtension: Record<FileExtension, Codec>;
|
|
@@ -71,7 +71,7 @@ const getBrowserStatus = (browserExecutablePath) => {
|
|
|
71
71
|
const ensureLocalBrowser = async (preferredBrowserExecutable) => {
|
|
72
72
|
const status = getBrowserStatus(preferredBrowserExecutable);
|
|
73
73
|
if (status.type === 'no-browser') {
|
|
74
|
-
logger_1.Log.info('No local browser could be found. Downloading Thorium https://www.remotion.dev/docs/thorium-browser');
|
|
74
|
+
logger_1.Log.info('No local browser could be found. Downloading Thorium https://www.remotion.dev/docs/miscellaneous/thorium-browser');
|
|
75
75
|
await (0, BrowserFetcher_1.downloadBrowser)();
|
|
76
76
|
}
|
|
77
77
|
};
|
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" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
64
64
|
}) => void;
|
|
65
|
-
getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
65
|
+
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;
|
|
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" | "mp3" | "aac" | "wav" | "prores" | "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: "angle" | "swangle" | "egl" | "swiftshader" | null;
|
|
127
|
+
validateOpenGlRenderer: (option: "angle" | "swangle" | "egl" | "swiftshader" | null) => "angle" | "swangle" | "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" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
133
|
+
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "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" | "mp3" | "aac" | "wav" | "prores" | "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" | "mp3" | "aac" | "wav" | "prores" | "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
|
+
mp3: {
|
|
220
220
|
default: import("./file-extensions").FileExtension;
|
|
221
221
|
forAudioCodec: {
|
|
222
|
-
|
|
222
|
+
mp3: {
|
|
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
|
+
aac: {
|
|
233
233
|
default: import("./file-extensions").FileExtension;
|
|
234
234
|
forAudioCodec: {
|
|
235
|
-
|
|
235
|
+
aac: {
|
|
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
|
+
wav: {
|
|
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
|
-
};
|
|
252
248
|
"pcm-16": {
|
|
253
249
|
possible: import("./file-extensions").FileExtension[];
|
|
254
250
|
default: import("./file-extensions").FileExtension;
|
|
255
251
|
};
|
|
256
252
|
};
|
|
257
253
|
};
|
|
258
|
-
|
|
254
|
+
prores: {
|
|
259
255
|
default: import("./file-extensions").FileExtension;
|
|
260
256
|
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" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif")[]>;
|
|
298
|
+
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "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: "jpeg" | "png" | "webp" | "pdf";
|
|
316
|
+
DEFAULT_VIDEO_IMAGE_FORMAT: "jpeg" | "png" | "none";
|
|
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: "jpeg" | "png" | "webp" | "pdf";
|
|
430
430
|
jpegQuality: number;
|
|
431
431
|
puppeteerInstance: HeadlessBrowser | null;
|
|
432
432
|
envVariables: Record<string, string>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteAfterOption = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
exports.deleteAfterOption = {
|
|
6
|
+
name: 'Render expiry days',
|
|
7
|
+
cliFlag: 'delete-after',
|
|
8
|
+
description: () => {
|
|
9
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Automatically delete the render after a certain period. Accepted values are ", (0, jsx_runtime_1.jsx)("code", { children: "1-day" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "3-days" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "7-days" }), " and", ' ', (0, jsx_runtime_1.jsx)("code", { children: "30-days" }), ".", (0, jsx_runtime_1.jsx)("br", {}), " For this to work, your bucket needs to have", ' ', (0, jsx_runtime_1.jsx)("a", { href: "/docs/lambda/autodelete", children: "lifecycles enabled" }), "."] }));
|
|
10
|
+
},
|
|
11
|
+
ssrName: 'deleteAfter',
|
|
12
|
+
docLink: 'https://www.remotion.dev/docs/autodelete',
|
|
13
|
+
type: 0,
|
|
14
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,27 @@
|
|
|
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;
|
|
@@ -5,7 +5,6 @@ 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");
|
|
7
7
|
const EVALUATION_SCRIPT_URL = '__puppeteer_evaluation_script__';
|
|
8
|
-
const SOURCE_URL_REGEX = /^[\040\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/m;
|
|
9
8
|
function valueFromRemoteObject(remoteObject) {
|
|
10
9
|
if (remoteObject.unserializableValue) {
|
|
11
10
|
if (remoteObject.type === 'bigint' && typeof BigInt !== 'undefined')
|
|
@@ -26,14 +25,14 @@ function valueFromRemoteObject(remoteObject) {
|
|
|
26
25
|
}
|
|
27
26
|
return remoteObject.value;
|
|
28
27
|
}
|
|
29
|
-
function isString(obj) {
|
|
30
|
-
return typeof obj === 'string' || obj instanceof String;
|
|
31
|
-
}
|
|
32
28
|
function puppeteerEvaluateWithCatchAndTimeout({ args, frame, page, pageFunction, }) {
|
|
33
29
|
return Promise.race([
|
|
34
30
|
new Promise((_, reject) => {
|
|
35
31
|
setTimeout(() => {
|
|
36
|
-
reject(new Error(
|
|
32
|
+
reject(new Error(
|
|
33
|
+
// This means the page is not responding anymore
|
|
34
|
+
// This error message is retryable - sync it with packages/lambda/src/shared/is-flaky-error.ts
|
|
35
|
+
`Timed out evaluating page function "${pageFunction.toString()}"`));
|
|
37
36
|
}, 5000);
|
|
38
37
|
}),
|
|
39
38
|
puppeteerEvaluateWithCatch({
|
|
@@ -46,34 +45,10 @@ function puppeteerEvaluateWithCatchAndTimeout({ args, frame, page, pageFunction,
|
|
|
46
45
|
}
|
|
47
46
|
exports.puppeteerEvaluateWithCatchAndTimeout = puppeteerEvaluateWithCatchAndTimeout;
|
|
48
47
|
async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, }) {
|
|
49
|
-
var _a, _b, _c, _d, _e, _f
|
|
48
|
+
var _a, _b, _c, _d, _e, _f;
|
|
50
49
|
const contextId = (await page.mainFrame().executionContext())._contextId;
|
|
51
50
|
const client = page._client();
|
|
52
51
|
const suffix = `//# sourceURL=${EVALUATION_SCRIPT_URL}`;
|
|
53
|
-
if (isString(pageFunction)) {
|
|
54
|
-
const expression = pageFunction;
|
|
55
|
-
const expressionWithSourceUrl = SOURCE_URL_REGEX.test(expression)
|
|
56
|
-
? expression
|
|
57
|
-
: expression + '\n' + suffix;
|
|
58
|
-
const { value: { exceptionDetails: exceptDetails, result: remotObject }, size, } = await client.send('Runtime.evaluate', {
|
|
59
|
-
expression: expressionWithSourceUrl,
|
|
60
|
-
contextId,
|
|
61
|
-
returnByValue: true,
|
|
62
|
-
awaitPromise: true,
|
|
63
|
-
userGesture: true,
|
|
64
|
-
});
|
|
65
|
-
if (exceptDetails === null || exceptDetails === void 0 ? void 0 : exceptDetails.exception) {
|
|
66
|
-
const err = new symbolicateable_error_1.SymbolicateableError({
|
|
67
|
-
stack: exceptDetails.exception.description,
|
|
68
|
-
name: exceptDetails.exception.className,
|
|
69
|
-
message: (_b = (_a = exceptDetails.exception.description) === null || _a === void 0 ? void 0 : _a.split('\n')) === null || _b === void 0 ? void 0 : _b[0],
|
|
70
|
-
frame,
|
|
71
|
-
stackFrame: (0, parse_browser_error_stack_1.parseStack)(exceptDetails.exception.description.split('\n')),
|
|
72
|
-
});
|
|
73
|
-
throw err;
|
|
74
|
-
}
|
|
75
|
-
return { value: valueFromRemoteObject(remotObject), size };
|
|
76
|
-
}
|
|
77
52
|
if (typeof pageFunction !== 'function')
|
|
78
53
|
throw new Error(`Expected to get |string| or |function| as the first argument, but got "${pageFunction}" instead.`);
|
|
79
54
|
let functionText = pageFunction.toString();
|
|
@@ -120,18 +95,18 @@ async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, })
|
|
|
120
95
|
const { value: { exceptionDetails, result: remoteObject }, size, } = await callFunctionOnPromise;
|
|
121
96
|
if (exceptionDetails) {
|
|
122
97
|
const err = new symbolicateable_error_1.SymbolicateableError({
|
|
123
|
-
stack: (
|
|
124
|
-
name: (
|
|
125
|
-
message: (
|
|
98
|
+
stack: (_a = exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description,
|
|
99
|
+
name: (_b = exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className,
|
|
100
|
+
message: (_d = (_c = exceptionDetails.exception) === null || _c === void 0 ? void 0 : _c.description) === null || _d === void 0 ? void 0 : _d.split('\n')[0],
|
|
126
101
|
frame,
|
|
127
|
-
stackFrame: (0, parse_browser_error_stack_1.parseStack)(((
|
|
102
|
+
stackFrame: (0, parse_browser_error_stack_1.parseStack)(((_e = exceptionDetails.exception) === null || _e === void 0 ? void 0 : _e.description).split('\n')),
|
|
128
103
|
});
|
|
129
104
|
throw err;
|
|
130
105
|
}
|
|
131
106
|
return { size, value: valueFromRemoteObject(remoteObject) };
|
|
132
107
|
}
|
|
133
108
|
catch (error) {
|
|
134
|
-
if ((
|
|
109
|
+
if ((_f = error === null || error === void 0 ? void 0 : error.originalMessage) === null || _f === void 0 ? void 0 : _f.startsWith("Object couldn't be returned by value")) {
|
|
135
110
|
throw new Error('Could not serialize the return value of the function. Did you pass non-serializable values to defaultProps?');
|
|
136
111
|
}
|
|
137
112
|
throw error;
|
package/dist/seek-to-frame.js
CHANGED
|
@@ -17,7 +17,6 @@ const waitForReady = ({ page, timeoutInMilliseconds, frame, }) => {
|
|
|
17
17
|
title: frame === null
|
|
18
18
|
? 'the page to render the React component'
|
|
19
19
|
: `the page to render the React component at frame ${frame}`,
|
|
20
|
-
shouldClosePage: false,
|
|
21
20
|
})
|
|
22
21
|
.then((a) => {
|
|
23
22
|
return resolve(a);
|
|
@@ -63,7 +62,6 @@ const waitForReady = ({ page, timeoutInMilliseconds, frame, }) => {
|
|
|
63
62
|
timeout: null,
|
|
64
63
|
pageFunction: 'window.remotion_cancelledError !== undefined',
|
|
65
64
|
title: 'remotion_cancelledError variable to appear on the page',
|
|
66
|
-
shouldClosePage: false,
|
|
67
65
|
})
|
|
68
66
|
.then(() => {
|
|
69
67
|
return (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
@@ -114,7 +112,7 @@ const waitForReady = ({ page, timeoutInMilliseconds, frame, }) => {
|
|
|
114
112
|
exports.waitForReady = waitForReady;
|
|
115
113
|
const seekToFrame = async ({ frame, page, composition, timeoutInMilliseconds, }) => {
|
|
116
114
|
await (0, exports.waitForReady)({ page, timeoutInMilliseconds, frame: null });
|
|
117
|
-
await (0, puppeteer_evaluate_1.
|
|
115
|
+
await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatchAndTimeout)({
|
|
118
116
|
pageFunction: (f, c) => {
|
|
119
117
|
window.remotion_setFrame(f, c);
|
|
120
118
|
},
|
|
@@ -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" | "mp3" | "aac" | "wav" | "prores" | "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.39",
|
|
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.39"
|
|
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-
|
|
45
|
-
"@remotion/compositor-
|
|
46
|
-
"@remotion/compositor-linux-arm64-musl": "4.0.
|
|
47
|
-
"@remotion/compositor-linux-x64-gnu": "4.0.
|
|
48
|
-
"@remotion/compositor-
|
|
49
|
-
"@remotion/compositor-
|
|
43
|
+
"@remotion/compositor-darwin-x64": "4.0.39",
|
|
44
|
+
"@remotion/compositor-darwin-arm64": "4.0.39",
|
|
45
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.39",
|
|
46
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.39",
|
|
47
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.39",
|
|
48
|
+
"@remotion/compositor-linux-x64-musl": "4.0.39",
|
|
49
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.39"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
|
52
52
|
"remotion",
|