@remotion/renderer 4.0.533 → 4.0.534
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/aac-priming.js +6 -2
- package/dist/browser/BrowserFetcher.d.ts +7 -1
- package/dist/browser/BrowserFetcher.js +33 -13
- package/dist/browser/Connection.js +5 -17
- package/dist/browser/DOMWorld.js +19 -13
- package/dist/browser/devtools-commands.d.ts +13 -1
- package/dist/browser/devtools-types.d.ts +62 -0
- package/dist/browser/get-chrome-download-url.d.ts +1 -1
- package/dist/browser/get-chrome-download-url.js +19 -33
- package/dist/can-use-parallel-encoding.d.ts +0 -1
- package/dist/can-use-parallel-encoding.js +10 -10
- package/dist/client.d.ts +87 -4
- package/dist/client.js +2 -0
- package/dist/cycle-browser-tabs.js +9 -1
- package/dist/ensure-browser.js +30 -6
- package/dist/esm/client.mjs +937 -796
- package/dist/esm/index.mjs +4125 -3027
- package/dist/esm/pure.mjs +33 -9
- package/dist/file-extensions.js +4 -1
- package/dist/get-mp4-brand.d.ts +1 -0
- package/dist/get-mp4-brand.js +21 -0
- package/dist/image-format.d.ts +1 -0
- package/dist/image-format.js +8 -4
- package/dist/index.d.ts +11 -1
- package/dist/index.js +4 -0
- package/dist/memory/from-macos-sysctl.d.ts +1 -0
- package/dist/memory/from-macos-sysctl.js +50 -0
- package/dist/memory/from-proc-meminfo.d.ts +1 -1
- package/dist/memory/from-proc-meminfo.js +7 -4
- package/dist/memory/get-available-memory.js +29 -21
- package/dist/mux-video-and-audio.js +8 -2
- package/dist/next-frame-to-render.d.ts +3 -7
- package/dist/next-frame-to-render.js +3 -22
- package/dist/open-browser.js +1 -0
- package/dist/options/allow-html-in-canvas.js +1 -1
- package/dist/options/api-key.js +1 -1
- package/dist/options/ask-ai.js +1 -1
- package/dist/options/audio-bitrate.js +1 -1
- package/dist/options/audio-codec.js +12 -6
- package/dist/options/beep-on-finish.js +1 -1
- package/dist/options/benchmark-concurrencies.js +1 -1
- package/dist/options/binaries-directory.js +1 -1
- package/dist/options/browser-executable.js +1 -1
- package/dist/options/browser.js +1 -1
- package/dist/options/bundle-cache.js +1 -1
- package/dist/options/canvas-tabs.js +1 -1
- package/dist/options/chrome-mode.js +1 -1
- package/dist/options/color-space.js +1 -1
- package/dist/options/concurrency.js +1 -1
- package/dist/options/config.js +1 -1
- package/dist/options/crf.js +1 -1
- package/dist/options/cross-site-isolation.js +1 -1
- package/dist/options/dark-mode.js +1 -1
- package/dist/options/default-coding-agent.js +1 -1
- package/dist/options/default-editor.js +1 -1
- package/dist/options/delete-after.js +1 -1
- package/dist/options/disable-git-source.js +1 -1
- package/dist/options/disable-shared-memory-capture.d.ts +16 -0
- package/dist/options/disable-shared-memory-capture.js +29 -0
- package/dist/options/disable-web-security.js +1 -1
- package/dist/options/disallow-parallel-encoding.js +1 -1
- package/dist/options/enable-cancellation.js +1 -1
- package/dist/options/enable-lambda-insights.js +1 -1
- package/dist/options/enable-multiprocess-on-linux.js +1 -1
- package/dist/options/encoding-buffer-size.js +1 -1
- package/dist/options/encoding-max-rate.js +1 -1
- package/dist/options/enforce-audio.js +1 -1
- package/dist/options/env-file.js +1 -1
- package/dist/options/every-nth-frame.js +1 -1
- package/dist/options/experimental-keep-audio-context-alive.js +1 -1
- package/dist/options/experimental-tracks.d.ts +18 -0
- package/dist/options/experimental-tracks.js +42 -0
- package/dist/options/folder-expiry.js +1 -1
- package/dist/options/for-seamless-aac-concatenation.js +1 -1
- package/dist/options/force-new-studio.js +1 -1
- package/dist/options/frames.js +1 -1
- package/dist/options/gl.js +1 -1
- package/dist/options/gop-size.js +1 -1
- package/dist/options/hardware-acceleration.js +1 -1
- package/dist/options/headless.js +1 -1
- package/dist/options/ignore-certificate-errors.js +1 -1
- package/dist/options/image-sequence-pattern.d.ts +1 -1
- package/dist/options/image-sequence-pattern.js +1 -1
- package/dist/options/image-sequence.js +1 -1
- package/dist/options/index.d.ts +36 -2
- package/dist/options/index.js +4 -0
- package/dist/options/interactivity.js +1 -1
- package/dist/options/ipv4.js +1 -1
- package/dist/options/is-production.js +1 -1
- package/dist/options/jpeg-quality.js +5 -2
- package/dist/options/keyboard-shortcuts.js +1 -1
- package/dist/options/latency-hint.js +1 -1
- package/dist/options/license-key.js +1 -1
- package/dist/options/log-level.js +1 -1
- package/dist/options/metadata.js +1 -1
- package/dist/options/mute.js +1 -1
- package/dist/options/no-open.js +1 -1
- package/dist/options/number-of-gif-loops.js +1 -1
- package/dist/options/number-of-shared-audio-tags.js +1 -1
- package/dist/options/offthreadvideo-cache-size.js +1 -1
- package/dist/options/offthreadvideo-threads.js +1 -1
- package/dist/options/on-browser-download.js +1 -1
- package/dist/options/options-map.d.ts +49 -1
- package/dist/options/options-map.js +4 -0
- package/dist/options/out-dir.js +1 -1
- package/dist/options/override-duration.js +1 -1
- package/dist/options/override-fps.js +1 -1
- package/dist/options/override-height.js +1 -1
- package/dist/options/override-width.js +1 -1
- package/dist/options/overwrite.js +1 -1
- package/dist/options/package-manager.js +1 -1
- package/dist/options/pixel-format.js +1 -1
- package/dist/options/port.js +1 -1
- package/dist/options/prefer-lossless.js +1 -1
- package/dist/options/preview-sample-rate.js +1 -1
- package/dist/options/props.js +1 -1
- package/dist/options/prores-profile.js +1 -1
- package/dist/options/public-dir.js +1 -1
- package/dist/options/public-license-key.js +1 -1
- package/dist/options/public-path.js +1 -1
- package/dist/options/repro.js +1 -1
- package/dist/options/rspack.d.ts +1 -1
- package/dist/options/rspack.js +1 -1
- package/dist/options/runs.js +1 -1
- package/dist/options/sample-rate.js +1 -1
- package/dist/options/scale.js +1 -1
- package/dist/options/separate-audio.js +1 -1
- package/dist/options/skip-skills.js +1 -1
- package/dist/options/still-frame.js +1 -1
- package/dist/options/still-image-format.js +1 -1
- package/dist/options/throw-if-site-exists.js +1 -1
- package/dist/options/timeout.js +1 -1
- package/dist/options/user-agent.js +1 -1
- package/dist/options/version-flag.js +1 -1
- package/dist/options/video-bitrate.js +1 -1
- package/dist/options/video-cache-size.js +1 -1
- package/dist/options/video-codec.js +4 -3
- package/dist/options/video-image-format.js +6 -2
- package/dist/options/webhook-custom-data.js +1 -1
- package/dist/options/webpack-poll.js +1 -1
- package/dist/options/x264-preset.js +1 -1
- package/dist/prespawn-ffmpeg.d.ts +20 -0
- package/dist/prespawn-ffmpeg.js +152 -29
- package/dist/probe-shared-memory-capture.d.ts +8 -0
- package/dist/probe-shared-memory-capture.js +111 -0
- package/dist/puppeteer-screenshot.d.ts +3 -1
- package/dist/puppeteer-screenshot.js +1 -0
- package/dist/pure.d.ts +1 -1
- package/dist/remotion-shared-memory-ffmpeg.d.ts +26 -0
- package/dist/remotion-shared-memory-ffmpeg.js +312 -0
- package/dist/remotion-shared-memory.d.ts +49 -0
- package/dist/remotion-shared-memory.js +359 -0
- package/dist/render-frame-and-retry-target-close.d.ts +5 -2
- package/dist/render-frame-and-retry-target-close.js +20 -4
- package/dist/render-frame-with-option-to-reject.d.ts +4 -1
- package/dist/render-frame-with-option-to-reject.js +206 -115
- package/dist/render-frame.d.ts +4 -5
- package/dist/render-frame.js +3 -1
- package/dist/render-frames.d.ts +3 -0
- package/dist/render-frames.js +15 -18
- package/dist/render-media.d.ts +1 -1
- package/dist/render-media.js +131 -46
- package/dist/render-still.js +1 -0
- package/dist/screenshot-background.d.ts +2 -0
- package/dist/screenshot-background.js +20 -0
- package/dist/screenshot-task.d.ts +4 -2
- package/dist/screenshot-task.js +40 -21
- package/dist/seek-to-frame.js +1 -1
- package/dist/stitch-frames-to-video.js +71 -10
- package/dist/take-frame.d.ts +11 -3
- package/dist/take-frame.js +10 -8
- package/dist/validate-output-filename.d.ts +1 -1
- package/dist/validate-output-filename.js +10 -2
- package/package.json +13 -13
package/dist/aac-priming.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAacPrimingInputArgs = exports.LIBFDK_AAC_LC_ENCODER_DELAY_IN_SAMPLES = void 0;
|
|
4
|
+
const get_mp4_brand_1 = require("./get-mp4-brand");
|
|
4
5
|
// libfdk_aac (AAC-LC) prepends 2048 samples of encoder delay ("priming") to
|
|
5
6
|
// its output. The audio is encoded to ADTS first (compressAudio, combineAudio),
|
|
6
7
|
// and ADTS cannot signal that delay, so stream-copying it into an MP4 or MOV
|
|
@@ -10,12 +11,15 @@ exports.getAacPrimingInputArgs = exports.LIBFDK_AAC_LC_ENCODER_DELAY_IN_SAMPLES
|
|
|
10
11
|
// edit list that skips the priming, like encoding straight to MP4 does.
|
|
11
12
|
exports.LIBFDK_AAC_LC_ENCODER_DELAY_IN_SAMPLES = 2048;
|
|
12
13
|
const getAacPrimingInputArgs = ({ audioCodec, sampleRate, outputExtension, }) => {
|
|
14
|
+
var _a;
|
|
13
15
|
if (audioCodec !== 'aac') {
|
|
14
16
|
return [];
|
|
15
17
|
}
|
|
16
18
|
// Only containers with edit lists can carry the shift
|
|
17
|
-
const extension = outputExtension === null || outputExtension === void 0 ? void 0 : outputExtension.toLowerCase();
|
|
18
|
-
if (extension !== 'mp4' &&
|
|
19
|
+
const extension = (_a = outputExtension === null || outputExtension === void 0 ? void 0 : outputExtension.toLowerCase()) !== null && _a !== void 0 ? _a : null;
|
|
20
|
+
if (extension !== 'mp4' &&
|
|
21
|
+
extension !== 'mov' &&
|
|
22
|
+
(0, get_mp4_brand_1.getMp4BrandForExtension)(extension) === null) {
|
|
19
23
|
return [];
|
|
20
24
|
}
|
|
21
25
|
const delayInMicroseconds = Math.round((exports.LIBFDK_AAC_LC_ENCODER_DELAY_IN_SAMPLES / sampleRate) * 1000000);
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { DownloadBrowserProgressFn } from '../options/on-browser-download';
|
|
17
|
-
import { TESTED_VERSION } from './get-chrome-download-url';
|
|
17
|
+
import { type Platform, TESTED_VERSION } from './get-chrome-download-url';
|
|
18
18
|
export { TESTED_VERSION };
|
|
19
19
|
interface BrowserFetcherRevisionInfo {
|
|
20
20
|
folderPath: string;
|
|
@@ -22,6 +22,12 @@ interface BrowserFetcherRevisionInfo {
|
|
|
22
22
|
url: string;
|
|
23
23
|
local: boolean;
|
|
24
24
|
}
|
|
25
|
+
export declare const getPlatform: () => Platform;
|
|
26
|
+
export declare const getExpectedVersion: ({ version, chromeMode, platform, }: {
|
|
27
|
+
version: string | null;
|
|
28
|
+
chromeMode: "chrome-for-testing" | "headless-shell";
|
|
29
|
+
platform: Platform;
|
|
30
|
+
}) => string;
|
|
25
31
|
export declare const readVersionFile: (chromeMode: "chrome-for-testing" | "headless-shell") => string | null;
|
|
26
32
|
export declare const downloadBrowser: ({ logLevel, indent, onProgress, version, chromeMode, }: {
|
|
27
33
|
logLevel: "error" | "info" | "trace" | "verbose" | "warn";
|
|
@@ -48,7 +48,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
48
48
|
};
|
|
49
49
|
})();
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
exports.getRevisionInfo = exports.downloadBrowser = exports.readVersionFile = exports.TESTED_VERSION = void 0;
|
|
51
|
+
exports.getRevisionInfo = exports.downloadBrowser = exports.readVersionFile = exports.getExpectedVersion = exports.getPlatform = exports.TESTED_VERSION = void 0;
|
|
52
52
|
const fs = __importStar(require("node:fs"));
|
|
53
53
|
const os = __importStar(require("node:os"));
|
|
54
54
|
const path = __importStar(require("node:path"));
|
|
@@ -82,6 +82,7 @@ const getPlatform = () => {
|
|
|
82
82
|
throw new Error('Unsupported platform: ' + platform);
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
+
exports.getPlatform = getPlatform;
|
|
85
86
|
const getDownloadsFolder = (chromeMode) => {
|
|
86
87
|
const destination = chromeMode === 'headless-shell'
|
|
87
88
|
? 'chrome-headless-shell'
|
|
@@ -92,12 +93,26 @@ const getVersionFilePath = (chromeMode) => {
|
|
|
92
93
|
const downloadsFolder = getDownloadsFolder(chromeMode);
|
|
93
94
|
return path.join(downloadsFolder, 'VERSION');
|
|
94
95
|
};
|
|
95
|
-
const getExpectedVersion = (version,
|
|
96
|
+
const getExpectedVersion = ({ version, chromeMode, platform, }) => {
|
|
96
97
|
if (version) {
|
|
97
98
|
return version;
|
|
98
99
|
}
|
|
100
|
+
// Remotion-patched builds get their own cache marker so an existing stock or
|
|
101
|
+
// older patched download of the same Chromium version is replaced once.
|
|
102
|
+
// Remotion builds include the v3 shared-memory patch; Google's CDN builds
|
|
103
|
+
// are stock Chromium.
|
|
104
|
+
const downloadUrl = (0, get_chrome_download_url_1.getChromeDownloadUrl)({
|
|
105
|
+
platform,
|
|
106
|
+
version: null,
|
|
107
|
+
chromeMode,
|
|
108
|
+
});
|
|
109
|
+
if (chromeMode === 'headless-shell' &&
|
|
110
|
+
downloadUrl.startsWith('https://remotion.media/')) {
|
|
111
|
+
return `${get_chrome_download_url_1.TESTED_VERSION}-remotion-v3`;
|
|
112
|
+
}
|
|
99
113
|
return get_chrome_download_url_1.TESTED_VERSION;
|
|
100
114
|
};
|
|
115
|
+
exports.getExpectedVersion = getExpectedVersion;
|
|
101
116
|
const readVersionFile = (chromeMode) => {
|
|
102
117
|
const versionFilePath = getVersionFilePath(chromeMode);
|
|
103
118
|
try {
|
|
@@ -113,7 +128,7 @@ const writeVersionFile = (chromeMode, version) => {
|
|
|
113
128
|
fs.writeFileSync(versionFilePath, version);
|
|
114
129
|
};
|
|
115
130
|
const downloadBrowser = async ({ logLevel, indent, onProgress, version, chromeMode, }) => {
|
|
116
|
-
const platform = getPlatform();
|
|
131
|
+
const platform = (0, exports.getPlatform)();
|
|
117
132
|
const downloadURL = (0, get_chrome_download_url_1.getChromeDownloadUrl)({ platform, version, chromeMode });
|
|
118
133
|
const fileName = downloadURL.split('/').pop();
|
|
119
134
|
if (!fileName) {
|
|
@@ -122,7 +137,7 @@ const downloadBrowser = async ({ logLevel, indent, onProgress, version, chromeMo
|
|
|
122
137
|
const downloadsFolder = getDownloadsFolder(chromeMode);
|
|
123
138
|
const archivePath = path.join(downloadsFolder, fileName);
|
|
124
139
|
const outputPath = getFolderPath(downloadsFolder, platform);
|
|
125
|
-
const expectedVersion = getExpectedVersion(version, chromeMode);
|
|
140
|
+
const expectedVersion = (0, exports.getExpectedVersion)({ version, chromeMode, platform });
|
|
126
141
|
if (await existsAsync(outputPath)) {
|
|
127
142
|
const installedVersion = (0, exports.readVersionFile)(chromeMode);
|
|
128
143
|
if (installedVersion === expectedVersion) {
|
|
@@ -181,12 +196,14 @@ const downloadBrowser = async ({ logLevel, indent, onProgress, version, chromeMo
|
|
|
181
196
|
for (const subdir of possibleSubdirs) {
|
|
182
197
|
const chromeLinuxFolder = path.join(outputPath, subdir);
|
|
183
198
|
const chromePath = path.join(chromeLinuxFolder, 'chrome');
|
|
184
|
-
if (fs.existsSync(chromePath)) {
|
|
199
|
+
if (chromeMode === 'headless-shell' && fs.existsSync(chromePath)) {
|
|
185
200
|
const chromeHeadlessShellPath = path.join(chromeLinuxFolder, 'chrome-headless-shell');
|
|
186
201
|
fs.renameSync(chromePath, chromeHeadlessShellPath);
|
|
187
202
|
}
|
|
188
203
|
if (fs.existsSync(chromeLinuxFolder)) {
|
|
189
|
-
const targetFolder = path.join(outputPath, '
|
|
204
|
+
const targetFolder = path.join(outputPath, (chromeMode === 'headless-shell'
|
|
205
|
+
? 'chrome-headless-shell-'
|
|
206
|
+
: 'chrome-') + platform);
|
|
190
207
|
if (chromeLinuxFolder !== targetFolder) {
|
|
191
208
|
fs.renameSync(chromeLinuxFolder, targetFolder);
|
|
192
209
|
}
|
|
@@ -216,7 +233,7 @@ const getFolderPath = (downloadsFolder, platform) => {
|
|
|
216
233
|
};
|
|
217
234
|
const getExecutablePath = (chromeMode) => {
|
|
218
235
|
const downloadsFolder = getDownloadsFolder(chromeMode);
|
|
219
|
-
const platform = getPlatform();
|
|
236
|
+
const platform = (0, exports.getPlatform)();
|
|
220
237
|
const folderPath = getFolderPath(downloadsFolder, platform);
|
|
221
238
|
if (chromeMode === 'chrome-for-testing') {
|
|
222
239
|
if (platform === 'mac-arm64' || platform === 'mac-x64') {
|
|
@@ -226,23 +243,26 @@ const getExecutablePath = (chromeMode) => {
|
|
|
226
243
|
return path.join(folderPath, 'chrome-win64', 'chrome.exe');
|
|
227
244
|
}
|
|
228
245
|
if (platform === 'linux64' || platform === 'linux-arm64') {
|
|
229
|
-
return path.join(folderPath,
|
|
246
|
+
return path.join(folderPath, `chrome-${platform}`, 'chrome');
|
|
230
247
|
}
|
|
231
248
|
throw new Error('unsupported platform' + platform);
|
|
232
249
|
}
|
|
233
250
|
if (chromeMode === 'headless-shell') {
|
|
234
|
-
|
|
251
|
+
const shellFolder = path.join(folderPath, `chrome-headless-shell-${platform}`);
|
|
252
|
+
const remotionExecutable = path.join(shellFolder, 'headless_shell');
|
|
253
|
+
if (fs.existsSync(remotionExecutable)) {
|
|
254
|
+
return remotionExecutable;
|
|
255
|
+
}
|
|
256
|
+
return path.join(shellFolder, platform === 'win64'
|
|
235
257
|
? 'chrome-headless-shell.exe'
|
|
236
|
-
:
|
|
237
|
-
? 'headless_shell'
|
|
238
|
-
: 'chrome-headless-shell');
|
|
258
|
+
: 'chrome-headless-shell');
|
|
239
259
|
}
|
|
240
260
|
throw new Error('unsupported chrome mode' + chromeMode);
|
|
241
261
|
};
|
|
242
262
|
const getRevisionInfo = (chromeMode) => {
|
|
243
263
|
const executablePath = getExecutablePath(chromeMode);
|
|
244
264
|
const downloadsFolder = getDownloadsFolder(chromeMode);
|
|
245
|
-
const platform = getPlatform();
|
|
265
|
+
const platform = (0, exports.getPlatform)();
|
|
246
266
|
const folderPath = getFolderPath(downloadsFolder, platform);
|
|
247
267
|
const url = (0, get_chrome_download_url_1.getChromeDownloadUrl)({ platform, version: null, chromeMode });
|
|
248
268
|
const local = fs.existsSync(folderPath);
|
|
@@ -50,14 +50,11 @@ class Connection extends EventEmitter_1.EventEmitter {
|
|
|
50
50
|
const params = paramArgs.length ? paramArgs[0] : undefined;
|
|
51
51
|
const id = this._rawSend({ method, params });
|
|
52
52
|
return new Promise((resolve, reject) => {
|
|
53
|
-
var _a;
|
|
54
53
|
this.#callbacks.set(id, {
|
|
55
54
|
resolve,
|
|
56
55
|
reject,
|
|
57
56
|
method,
|
|
58
|
-
|
|
59
|
-
stack: (_a = new Error().stack) !== null && _a !== void 0 ? _a : '',
|
|
60
|
-
fn: method + JSON.stringify(params),
|
|
57
|
+
params: params !== null && params !== void 0 ? params : null,
|
|
61
58
|
});
|
|
62
59
|
});
|
|
63
60
|
}
|
|
@@ -105,11 +102,8 @@ class Connection extends EventEmitter_1.EventEmitter {
|
|
|
105
102
|
if (object.error) {
|
|
106
103
|
callback.reject(createProtocolError(callback.method, object));
|
|
107
104
|
}
|
|
108
|
-
else if (callback.returnSize) {
|
|
109
|
-
callback.resolve({ value: object.result, size: message.length });
|
|
110
|
-
}
|
|
111
105
|
else {
|
|
112
|
-
callback.resolve(object.result);
|
|
106
|
+
callback.resolve({ value: object.result, size: message.length });
|
|
113
107
|
}
|
|
114
108
|
}
|
|
115
109
|
}
|
|
@@ -183,10 +177,9 @@ class CDPSession extends EventEmitter_1.EventEmitter {
|
|
|
183
177
|
params,
|
|
184
178
|
});
|
|
185
179
|
return new Promise((resolve, reject) => {
|
|
186
|
-
var _a;
|
|
187
180
|
if (this.#callbacks.size > 100) {
|
|
188
181
|
for (const callback of this.#callbacks.values()) {
|
|
189
|
-
logger_1.Log.info({ indent: false, logLevel: 'info' }, callback.
|
|
182
|
+
logger_1.Log.info({ indent: false, logLevel: 'info' }, callback.method + JSON.stringify(callback.params));
|
|
190
183
|
}
|
|
191
184
|
throw new Error('Leak detected: Too many callbacks');
|
|
192
185
|
}
|
|
@@ -194,9 +187,7 @@ class CDPSession extends EventEmitter_1.EventEmitter {
|
|
|
194
187
|
resolve,
|
|
195
188
|
reject,
|
|
196
189
|
method,
|
|
197
|
-
|
|
198
|
-
stack: (_a = new Error().stack) !== null && _a !== void 0 ? _a : '',
|
|
199
|
-
fn: method + JSON.stringify(params),
|
|
190
|
+
params: params !== null && params !== void 0 ? params : null,
|
|
200
191
|
});
|
|
201
192
|
});
|
|
202
193
|
}
|
|
@@ -207,11 +198,8 @@ class CDPSession extends EventEmitter_1.EventEmitter {
|
|
|
207
198
|
if (object.error) {
|
|
208
199
|
callback.reject(createProtocolError(callback.method, object));
|
|
209
200
|
}
|
|
210
|
-
else if (callback.returnSize) {
|
|
211
|
-
callback.resolve({ value: object.result, size });
|
|
212
|
-
}
|
|
213
201
|
else {
|
|
214
|
-
callback.resolve(object.result);
|
|
202
|
+
callback.resolve({ value: object.result, size });
|
|
215
203
|
}
|
|
216
204
|
}
|
|
217
205
|
else {
|
package/dist/browser/DOMWorld.js
CHANGED
|
@@ -151,10 +151,8 @@ class WaitTask {
|
|
|
151
151
|
const runCount = ++this.#runCount;
|
|
152
152
|
let success = null;
|
|
153
153
|
let error = null;
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
154
|
+
const contextPromise = this.#domWorld.executionContext();
|
|
155
|
+
const context = await contextPromise;
|
|
158
156
|
if (this.#terminated || runCount !== this.#runCount) {
|
|
159
157
|
return;
|
|
160
158
|
}
|
|
@@ -171,22 +169,30 @@ class WaitTask {
|
|
|
171
169
|
return;
|
|
172
170
|
}
|
|
173
171
|
// Ignore timeouts in pageScript - we track timeouts ourselves.
|
|
174
|
-
//
|
|
175
|
-
//
|
|
172
|
+
// Primitive results need no further CDP evaluation, but must still belong
|
|
173
|
+
// to the current execution context. Object handles are checked in the page.
|
|
176
174
|
if (!error &&
|
|
177
|
-
(
|
|
178
|
-
.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
175
|
+
(success && !success._remoteObject.objectId
|
|
176
|
+
? !(0, util_1.valueFromRemoteObject)(success._remoteObject) ||
|
|
177
|
+
!this.#domWorld._hasContext() ||
|
|
178
|
+
this.#domWorld.executionContext() !== contextPromise
|
|
179
|
+
: await this.#domWorld
|
|
180
|
+
.evaluate((s) => {
|
|
181
|
+
return !s;
|
|
182
|
+
}, success)
|
|
183
|
+
.catch(() => {
|
|
184
|
+
return true;
|
|
185
|
+
}))) {
|
|
184
186
|
if (!success) {
|
|
185
187
|
throw new Error('Assertion: result handle is not available');
|
|
186
188
|
}
|
|
187
189
|
await success.dispose();
|
|
188
190
|
return;
|
|
189
191
|
}
|
|
192
|
+
if (this.#terminated || runCount !== this.#runCount) {
|
|
193
|
+
await (success === null || success === void 0 ? void 0 : success.dispose());
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
190
196
|
if (error) {
|
|
191
197
|
if (error.message.includes('TypeError: binding is not a function')) {
|
|
192
198
|
return this.rerun();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActivateTargetRequest, AddScriptToEvaluateOnNewDocumentRequest, AddScriptToEvaluateOnNewDocumentResponse, CallFunctionOnRequest, CallFunctionOnResponse, CaptureScreenshotRequest, CaptureScreenshotResponse, CloseTargetRequest, CloseTargetResponse, CreateIsolatedWorldRequest, CreateIsolatedWorldResponse, DetachFromTargetRequest, DevtoolsRemoteObject, EnableRequest, ExceptionDetails, GetFrameTreeResponse, NavigateRequest, NavigateResponse, PrintPDFRequest, PrintPDFResponse, ReleaseObjectRequest, SetAutoAttachRequest, SetDefaultBackgroundColorOverrideRequest, SetDeviceMetricsOverrideRequest, SetLifecycleEventsEnabledRequest } from './devtools-types';
|
|
1
|
+
import type { ActivateTargetRequest, AddScriptToEvaluateOnNewDocumentRequest, AddScriptToEvaluateOnNewDocumentResponse, CallFunctionOnRequest, CallFunctionOnResponse, CaptureScreenshotRequest, CaptureScreenshotResponse, CloseTargetRequest, CloseTargetResponse, CreateIsolatedWorldRequest, CreateIsolatedWorldResponse, DetachFromTargetRequest, DevtoolsRemoteObject, EnableRequest, ExceptionDetails, GetFrameTreeResponse, NavigateRequest, NavigateResponse, PrintPDFRequest, PrintPDFResponse, RemotionCreateFramePoolRequest, RemotionCreateFramePoolResponse, RemotionReleaseFrameRequest, ReleaseObjectRequest, SetAutoAttachRequest, SetDefaultBackgroundColorOverrideRequest, SetDeviceMetricsOverrideRequest, SetLifecycleEventsEnabledRequest } from './devtools-types';
|
|
2
2
|
export interface Commands {
|
|
3
3
|
/**
|
|
4
4
|
* Does nothing.
|
|
@@ -216,6 +216,18 @@ export interface Commands {
|
|
|
216
216
|
paramsType: [CaptureScreenshotRequest?];
|
|
217
217
|
returnType: CaptureScreenshotResponse;
|
|
218
218
|
};
|
|
219
|
+
'Page.remotionCreateFramePool': {
|
|
220
|
+
paramsType: [RemotionCreateFramePoolRequest];
|
|
221
|
+
returnType: RemotionCreateFramePoolResponse;
|
|
222
|
+
};
|
|
223
|
+
'Page.remotionReleaseFrame': {
|
|
224
|
+
paramsType: [RemotionReleaseFrameRequest];
|
|
225
|
+
returnType: void;
|
|
226
|
+
};
|
|
227
|
+
'Page.remotionDestroyFramePool': {
|
|
228
|
+
paramsType: [];
|
|
229
|
+
returnType: void;
|
|
230
|
+
};
|
|
219
231
|
'Page.printToPDF': {
|
|
220
232
|
paramsType: [PrintPDFRequest];
|
|
221
233
|
returnType: PrintPDFResponse;
|
|
@@ -589,12 +589,74 @@ export interface CaptureScreenshotRequest {
|
|
|
589
589
|
* Optimize image encoding for speed, not for resulting size (defaults to false) EXPERIMENTAL
|
|
590
590
|
*/
|
|
591
591
|
optimizeForSpeed?: boolean;
|
|
592
|
+
/**
|
|
593
|
+
* Writes the captured pixels into this slot of a Remotion shared-memory
|
|
594
|
+
* frame pool instead of encoding an image. Remotion Chromium only.
|
|
595
|
+
*/
|
|
596
|
+
remotionFrameSlot?: number;
|
|
597
|
+
/**
|
|
598
|
+
* Ownership token for the shared-memory slot. Must be supplied together
|
|
599
|
+
* with `remotionFrameSlot`. Remotion Chromium only.
|
|
600
|
+
*/
|
|
601
|
+
remotionFrameId?: string;
|
|
602
|
+
/**
|
|
603
|
+
* Skips the temporary viewport resize used by the regular CDP screenshot
|
|
604
|
+
* path. Remotion Chromium only.
|
|
605
|
+
*/
|
|
606
|
+
remotionFastViewport?: boolean;
|
|
592
607
|
}
|
|
593
608
|
export interface CaptureScreenshotResponse {
|
|
594
609
|
/**
|
|
595
610
|
* Base64-encoded image data. (Encoded as a base64 string when passed over JSON)
|
|
596
611
|
*/
|
|
597
612
|
data: string;
|
|
613
|
+
remotionFrame?: RemotionRawFrame;
|
|
614
|
+
}
|
|
615
|
+
export interface RemotionRawFrame {
|
|
616
|
+
slot: number;
|
|
617
|
+
frameId: string;
|
|
618
|
+
width: number;
|
|
619
|
+
height: number;
|
|
620
|
+
stride: number;
|
|
621
|
+
byteLength: number;
|
|
622
|
+
pixelFormat: 'bgra';
|
|
623
|
+
alphaType: 'opaque' | 'straight';
|
|
624
|
+
colorSpace: 'srgb';
|
|
625
|
+
capturePath: string;
|
|
626
|
+
}
|
|
627
|
+
export type RemotionFramePoolBackend = 'posix-shm' | 'file';
|
|
628
|
+
export interface RemotionCreateFramePoolRequest {
|
|
629
|
+
slotCount: number;
|
|
630
|
+
slotCapacity: number;
|
|
631
|
+
/**
|
|
632
|
+
* Absolute path of a private directory. Chromium creates the pool as a
|
|
633
|
+
* regular file inside it when POSIX shared memory is unavailable, for
|
|
634
|
+
* example on AWS Lambda where `/dev/shm` does not exist. Ignored by
|
|
635
|
+
* Chromium builds that only support POSIX shared memory.
|
|
636
|
+
*/
|
|
637
|
+
backingDirectory?: string;
|
|
638
|
+
/**
|
|
639
|
+
* `auto` (default) prefers POSIX shared memory and falls back to
|
|
640
|
+
* `backingDirectory`; `posix-shm` and `file` require that backend.
|
|
641
|
+
*/
|
|
642
|
+
preferredBackend?: 'auto' | RemotionFramePoolBackend;
|
|
643
|
+
}
|
|
644
|
+
export interface RemotionCreateFramePoolResponse {
|
|
645
|
+
/**
|
|
646
|
+
* A POSIX shared-memory name such as `/rmshm-123`, or for the `file`
|
|
647
|
+
* backend the absolute path of the created pool file.
|
|
648
|
+
*/
|
|
649
|
+
sharedMemoryName: string;
|
|
650
|
+
slotCount: number;
|
|
651
|
+
slotCapacity: number;
|
|
652
|
+
/**
|
|
653
|
+
* Absent in Chromium builds that only support POSIX shared memory.
|
|
654
|
+
*/
|
|
655
|
+
backend?: RemotionFramePoolBackend;
|
|
656
|
+
}
|
|
657
|
+
export interface RemotionReleaseFrameRequest {
|
|
658
|
+
slot: number;
|
|
659
|
+
frameId: string;
|
|
598
660
|
}
|
|
599
661
|
export interface PrintPDFRequest {
|
|
600
662
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChromeMode } from '../options/chrome-mode';
|
|
2
|
-
export declare const TESTED_VERSION = "
|
|
2
|
+
export declare const TESTED_VERSION = "157.0.8080.0";
|
|
3
3
|
export type Platform = 'linux64' | 'linux-arm64' | 'mac-x64' | 'mac-arm64' | 'win64';
|
|
4
4
|
export declare const isAmazonLinux2023: () => boolean;
|
|
5
5
|
export declare const canUseRemotionMediaBinaries: () => boolean;
|
|
@@ -38,10 +38,7 @@ exports.getChromeDownloadUrl = getChromeDownloadUrl;
|
|
|
38
38
|
const fs = __importStar(require("node:fs"));
|
|
39
39
|
const os = __importStar(require("node:os"));
|
|
40
40
|
const logger_1 = require("../logger");
|
|
41
|
-
exports.TESTED_VERSION = '
|
|
42
|
-
// https://github.com/microsoft/playwright/blame/e76ca6cba40c26bf22c19cf37398d2b9da9ed465/packages/playwright-core/browsers.json
|
|
43
|
-
// packages/playwright-core/browsers.json
|
|
44
|
-
const PLAYWRIGHT_VERSION = '1421'; // 149.0.7790.0
|
|
41
|
+
exports.TESTED_VERSION = '157.0.8080.0';
|
|
45
42
|
const isAmazonLinux2023 = () => {
|
|
46
43
|
if (os.platform() !== 'linux') {
|
|
47
44
|
return false;
|
|
@@ -105,41 +102,30 @@ const canUseRemotionMediaBinaries = () => {
|
|
|
105
102
|
};
|
|
106
103
|
exports.canUseRemotionMediaBinaries = canUseRemotionMediaBinaries;
|
|
107
104
|
function getChromeDownloadUrl({ platform, version, chromeMode, }) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return `https://playwright.azureedge.net/builds/chromium/${version !== null && version !== void 0 ? version : PLAYWRIGHT_VERSION}/chromium-linux-arm64.zip`;
|
|
116
|
-
}
|
|
117
|
-
if (version) {
|
|
118
|
-
return `https://playwright.azureedge.net/builds/chromium/${version}/chromium-headless-shell-linux-arm64.zip`;
|
|
119
|
-
}
|
|
120
|
-
// Regular arm64 binary requires glibc 2.35+
|
|
121
|
-
if ((0, exports.canUseRemotionMediaBinaries)()) {
|
|
122
|
-
return `https://remotion.media/chromium-headless-shell-linux-arm64-${exports.TESTED_VERSION}.zip?clear`;
|
|
123
|
-
}
|
|
124
|
-
// Fall back to Playwright for older glibc (non-Amazon Linux systems)
|
|
125
|
-
return `https://playwright.azureedge.net/builds/chromium/${PLAYWRIGHT_VERSION}/chromium-headless-shell-linux-arm64.zip`;
|
|
105
|
+
// Preserve explicit Playwright revision overrides on Linux ARM64. Default
|
|
106
|
+
// downloads and Chrome version overrides use Google's CDN on every platform.
|
|
107
|
+
if (platform === 'linux-arm64' && version && /^\d+$/.test(version)) {
|
|
108
|
+
const archive = chromeMode === 'chrome-for-testing'
|
|
109
|
+
? 'chromium-linux-arm64'
|
|
110
|
+
: 'chromium-headless-shell-linux-arm64';
|
|
111
|
+
return `https://playwright.azureedge.net/builds/chromium/${version}/${archive}.zip`;
|
|
126
112
|
}
|
|
127
|
-
if (chromeMode === 'headless-shell') {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if ((0, exports.isAmazonLinux2023)() && platform === 'linux64' && !version) {
|
|
131
|
-
return `https://remotion.media/chromium-headless-shell-amazon-linux-x64-149.0.7790.0.zip?clear`;
|
|
113
|
+
if (chromeMode === 'headless-shell' && version === null) {
|
|
114
|
+
if (platform === 'mac-arm64') {
|
|
115
|
+
return `https://remotion.media/chromium-headless-shell-mac-arm64-${exports.TESTED_VERSION}.zip?clear`;
|
|
132
116
|
}
|
|
133
|
-
if (platform === 'linux64'
|
|
117
|
+
if (platform === 'linux64' || platform === 'linux-arm64') {
|
|
118
|
+
const architecture = platform === 'linux64' ? 'x64' : 'arm64';
|
|
119
|
+
if ((0, exports.isAmazonLinux2023)()) {
|
|
120
|
+
return `https://remotion.media/chromium-headless-shell-amazon-linux-${architecture}-${exports.TESTED_VERSION}.zip?clear`;
|
|
121
|
+
}
|
|
134
122
|
if ((0, exports.canUseRemotionMediaBinaries)()) {
|
|
135
|
-
return `https://remotion.media/chromium-headless-shell-linux
|
|
123
|
+
return `https://remotion.media/chromium-headless-shell-linux-${architecture}-${exports.TESTED_VERSION}.zip?clear`;
|
|
136
124
|
}
|
|
137
|
-
// Fall back to Google's CDN for older glibc
|
|
138
|
-
return `https://storage.googleapis.com/chrome-for-testing-public/${exports.TESTED_VERSION}/${platform}/chrome-headless-shell-${platform}.zip`;
|
|
139
125
|
}
|
|
140
|
-
return `https://storage.googleapis.com/chrome-for-testing-public/${version !== null && version !== void 0 ? version : exports.TESTED_VERSION}/${platform}/chrome-headless-shell-${platform}.zip`;
|
|
141
126
|
}
|
|
142
|
-
|
|
127
|
+
const archive = chromeMode === 'headless-shell' ? 'chrome-headless-shell' : 'chrome';
|
|
128
|
+
return `https://storage.googleapis.com/chrome-for-testing-public/${version !== null && version !== void 0 ? version : exports.TESTED_VERSION}/${platform}/${archive}-${platform}.zip`;
|
|
143
129
|
}
|
|
144
130
|
const logDownloadUrl = ({ url, logLevel, indent, }) => {
|
|
145
131
|
logger_1.Log.info({ indent, logLevel }, `Downloading from: ${url}`);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.canUseParallelEncoding = void 0;
|
|
4
4
|
const is_audio_codec_1 = require("./is-audio-codec");
|
|
5
5
|
const canUseParallelEncoding = (codec) => {
|
|
6
|
-
if ((0, exports.getShouldUsePartitionedRendering)()) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
6
|
if ((0, is_audio_codec_1.isAudioCodec)(codec)) {
|
|
10
7
|
return false;
|
|
11
8
|
}
|
|
12
|
-
|
|
9
|
+
// GIF encoding uses a palette generated from the entire video.
|
|
10
|
+
return (codec === 'h264' ||
|
|
11
|
+
codec === 'h264-mkv' ||
|
|
12
|
+
codec === 'h264-ts' ||
|
|
13
|
+
codec === 'h265' ||
|
|
14
|
+
codec === 'vp8' ||
|
|
15
|
+
codec === 'vp9' ||
|
|
16
|
+
codec === 'av1' ||
|
|
17
|
+
codec === 'prores');
|
|
13
18
|
};
|
|
14
19
|
exports.canUseParallelEncoding = canUseParallelEncoding;
|
|
15
|
-
const getShouldUsePartitionedRendering = () => {
|
|
16
|
-
const shouldUsePartitionedRendering = process.env.REMOTION_PARTITIONED_RENDERING === 'true';
|
|
17
|
-
return shouldUsePartitionedRendering;
|
|
18
|
-
};
|
|
19
|
-
exports.getShouldUsePartitionedRendering = getShouldUsePartitionedRendering;
|