@remotion/renderer 4.0.136 → 4.0.138
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/assets/read-file.d.ts +1 -0
- package/dist/browser/BrowserFetcher.d.ts +4 -1
- package/dist/browser/BrowserFetcher.js +34 -103
- package/dist/browser/BrowserPage.d.ts +1 -1
- package/dist/browser/BrowserPage.js +1 -1
- package/dist/browser/BrowserRunner.js +2 -2
- package/dist/browser/NodeWebSocketTransport.js +1 -1
- package/dist/browser/browser-download-progress-bar.d.ts +7 -0
- package/dist/browser/browser-download-progress-bar.js +21 -0
- package/dist/browser/should-log-message.js +6 -0
- package/dist/client.d.ts +102 -15
- package/dist/combine-video-streams.js +6 -2
- package/dist/ensure-browser.d.ts +25 -0
- package/dist/ensure-browser.js +53 -0
- package/dist/get-browser-instance.d.ts +3 -1
- package/dist/get-browser-instance.js +2 -1
- package/dist/get-compositions.js +16 -7
- package/dist/get-local-browser-executable.d.ts +0 -6
- package/dist/get-local-browser-executable.js +4 -56
- package/dist/get-local-browser.d.ts +1 -0
- package/dist/get-local-browser.js +51 -0
- package/dist/index.d.ts +80 -19
- package/dist/index.js +7 -3
- package/dist/offthread-video-server.d.ts +1 -0
- package/dist/open-browser.d.ts +3 -1
- package/dist/open-browser.js +29 -18
- package/dist/options/enable-multiprocess-on-linux.js +2 -2
- package/dist/options/gl.d.ts +3 -3
- package/dist/options/index.d.ts +16 -6
- package/dist/options/index.js +2 -0
- package/dist/options/log-level.js +1 -1
- package/dist/options/on-browser-download.d.ts +19 -0
- package/dist/options/on-browser-download.js +19 -0
- package/dist/options/options-map.d.ts +86 -9
- package/dist/options/options-map.js +10 -0
- package/dist/options/x264-preset.d.ts +2 -2
- package/dist/port-config.d.ts +1 -0
- package/dist/render-frames.js +11 -5
- package/dist/render-media.d.ts +1 -1
- package/dist/render-media.js +9 -4
- package/dist/render-still.js +9 -4
- package/dist/screenshot-task.js +2 -2
- package/dist/select-composition.js +14 -4
- package/dist/serve-handler/index.d.ts +1 -0
- package/dist/stitch-frames-to-video.d.ts +1 -0
- package/dist/test-gpu.d.ts +3 -1
- package/dist/test-gpu.js +2 -1
- package/dist/to-megabytes.d.ts +1 -0
- package/dist/to-megabytes.js +8 -0
- package/dist/ws/ws-types.d.ts +2 -0
- package/dist/ws/ws-types.js +0 -3
- package/package.json +14 -13
- package/dist/audio-codec.d.ts +0 -28
- package/dist/audio-codec.js +0 -88
- package/dist/calculate-ffmpeg-filters.d.ts +0 -12
- package/dist/calculate-ffmpeg-filters.js +0 -24
- package/dist/check-apple-silicon.d.ts +0 -1
- package/dist/check-apple-silicon.js +0 -12
- package/dist/create-combined-video.d.ts +0 -18
- package/dist/create-combined-video.js +0 -27
- package/dist/does-have-m2-bug.d.ts +0 -3
- package/dist/does-have-m2-bug.js +0 -12
- package/dist/get-extension-from-audio-codec.d.ts +0 -2
- package/dist/get-extension-from-audio-codec.js +0 -19
- package/dist/is-audio-codec.d.ts +0 -2
- package/dist/is-audio-codec.js +0 -7
- package/dist/options/prores-profile.d.ts +0 -0
- package/dist/options/prores-profile.js +0 -1
- package/dist/x264-preset.d.ts +0 -22
- package/dist/x264-preset.js +0 -54
|
@@ -14,15 +14,18 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { LogLevel } from '../log-level';
|
|
17
|
+
import type { DownloadBrowserProgressFn } from '../options/on-browser-download';
|
|
17
18
|
interface BrowserFetcherRevisionInfo {
|
|
18
19
|
folderPath: string;
|
|
19
20
|
executablePath: string;
|
|
20
21
|
url: string;
|
|
21
22
|
local: boolean;
|
|
22
23
|
}
|
|
23
|
-
export declare const downloadBrowser: (
|
|
24
|
+
export declare const downloadBrowser: ({ logLevel, indent, onProgress, version, }: {
|
|
24
25
|
logLevel: LogLevel;
|
|
25
26
|
indent: boolean;
|
|
27
|
+
onProgress: DownloadBrowserProgressFn;
|
|
28
|
+
version: string | null;
|
|
26
29
|
}) => Promise<BrowserFetcherRevisionInfo | undefined>;
|
|
27
30
|
export declare const getRevisionInfo: () => BrowserFetcherRevisionInfo;
|
|
28
31
|
export {};
|
|
@@ -42,29 +42,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
42
42
|
};
|
|
43
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
44
|
exports.getRevisionInfo = exports.downloadBrowser = void 0;
|
|
45
|
-
const childProcess = __importStar(require("node:child_process"));
|
|
46
45
|
const fs = __importStar(require("node:fs"));
|
|
47
46
|
const os = __importStar(require("node:os"));
|
|
48
47
|
const path = __importStar(require("node:path"));
|
|
49
48
|
const extract_zip_1 = __importDefault(require("extract-zip"));
|
|
50
49
|
const node_util_1 = require("node:util");
|
|
51
|
-
const assert_1 = require("./assert");
|
|
52
50
|
const download_file_1 = require("../assets/download-file");
|
|
51
|
+
const make_file_executable_1 = require("../compositor/make-file-executable");
|
|
53
52
|
const logger_1 = require("../logger");
|
|
54
53
|
const get_download_destination_1 = require("./get-download-destination");
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
'mac-arm64': 'https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.86/mac-arm64/chrome-headless-shell-mac-arm64.zip',
|
|
59
|
-
win64: 'https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.86/win64/chrome-headless-shell-win64.zip',
|
|
60
|
-
};
|
|
61
|
-
function getChromeDownloadUrl(platform) {
|
|
62
|
-
return downloadURLs[platform];
|
|
54
|
+
const TESTED_VERSION = '123.0.6312.86';
|
|
55
|
+
function getChromeDownloadUrl({ platform, version, }) {
|
|
56
|
+
return `https://storage.googleapis.com/chrome-for-testing-public/${version !== null && version !== void 0 ? version : TESTED_VERSION}/${platform}/chrome-headless-shell-${platform}.zip`;
|
|
63
57
|
}
|
|
64
|
-
const readdirAsync = fs.promises.readdir;
|
|
65
58
|
const mkdirAsync = fs.promises.mkdir;
|
|
66
59
|
const unlinkAsync = (0, node_util_1.promisify)(fs.unlink.bind(fs));
|
|
67
|
-
const chmodAsync = (0, node_util_1.promisify)(fs.chmod.bind(fs));
|
|
68
60
|
function existsAsync(filePath) {
|
|
69
61
|
return new Promise((resolve) => {
|
|
70
62
|
fs.access(filePath, (err) => {
|
|
@@ -78,22 +70,24 @@ const getPlatform = () => {
|
|
|
78
70
|
case 'darwin':
|
|
79
71
|
return os.arch() === 'arm64' ? 'mac-arm64' : 'mac-x64';
|
|
80
72
|
case 'linux':
|
|
81
|
-
return '
|
|
73
|
+
return 'linux64';
|
|
82
74
|
case 'win32':
|
|
83
75
|
return 'win64';
|
|
84
76
|
default:
|
|
85
|
-
|
|
77
|
+
throw new Error('Unsupported platform: ' + platform);
|
|
86
78
|
}
|
|
87
79
|
};
|
|
88
|
-
const destination = '
|
|
80
|
+
const destination = 'chrome-headless-shell';
|
|
89
81
|
const getDownloadsFolder = () => {
|
|
90
82
|
return path.join((0, get_download_destination_1.getDownloadsCacheDir)(), destination);
|
|
91
83
|
};
|
|
92
|
-
const downloadBrowser = async (
|
|
84
|
+
const downloadBrowser = async ({ logLevel, indent, onProgress, version, }) => {
|
|
93
85
|
const platform = getPlatform();
|
|
94
|
-
const downloadURL = getChromeDownloadUrl(platform);
|
|
86
|
+
const downloadURL = getChromeDownloadUrl({ platform, version });
|
|
95
87
|
const fileName = downloadURL.split('/').pop();
|
|
96
|
-
|
|
88
|
+
if (!fileName) {
|
|
89
|
+
throw new Error(`A malformed download URL was found: ${downloadURL}.`);
|
|
90
|
+
}
|
|
97
91
|
const downloadsFolder = getDownloadsFolder();
|
|
98
92
|
const archivePath = path.join(downloadsFolder, fileName);
|
|
99
93
|
const outputPath = getFolderPath(downloadsFolder, platform);
|
|
@@ -107,26 +101,32 @@ const downloadBrowser = async (options) => {
|
|
|
107
101
|
}
|
|
108
102
|
// Use system Chromium builds on Linux ARM devices
|
|
109
103
|
if (os.platform() !== 'darwin' && os.arch() === 'arm64') {
|
|
110
|
-
throw new Error(
|
|
111
|
-
'
|
|
112
|
-
'
|
|
113
|
-
'
|
|
104
|
+
throw new Error([
|
|
105
|
+
'Chrome Headless Shell is not available for Linux for arm64 architecture.',
|
|
106
|
+
'If you are on Ubuntu, you can install with:',
|
|
107
|
+
'sudo apt install chromium',
|
|
108
|
+
'sudo apt install chromium-browser',
|
|
109
|
+
].join('\n'));
|
|
114
110
|
}
|
|
115
111
|
try {
|
|
116
|
-
let lastProgress = 0;
|
|
117
112
|
await (0, download_file_1.downloadFile)({
|
|
118
113
|
url: downloadURL,
|
|
119
114
|
to: () => archivePath,
|
|
120
115
|
onProgress: (progress) => {
|
|
121
|
-
if (progress.
|
|
122
|
-
|
|
123
|
-
logger_1.Log.info({ indent: options.indent, logLevel: options.logLevel }, `Downloading Chrome Headless Shell - ${toMegabytes(progress.downloaded)}/${toMegabytes(progress.totalSize)}`);
|
|
116
|
+
if (progress.totalSize === null || progress.percent === null) {
|
|
117
|
+
throw new Error('Expected totalSize and percent to be defined');
|
|
124
118
|
}
|
|
119
|
+
onProgress({
|
|
120
|
+
downloadedBytes: progress.downloaded,
|
|
121
|
+
totalSizeInBytes: progress.totalSize,
|
|
122
|
+
percent: progress.percent,
|
|
123
|
+
});
|
|
125
124
|
},
|
|
126
|
-
indent
|
|
127
|
-
logLevel
|
|
125
|
+
indent,
|
|
126
|
+
logLevel,
|
|
128
127
|
});
|
|
129
|
-
|
|
128
|
+
logger_1.Log.info({ indent, logLevel });
|
|
129
|
+
await (0, extract_zip_1.default)(archivePath, { dir: outputPath });
|
|
130
130
|
}
|
|
131
131
|
finally {
|
|
132
132
|
if (await existsAsync(archivePath)) {
|
|
@@ -134,7 +134,7 @@ const downloadBrowser = async (options) => {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
const revisionInfo = (0, exports.getRevisionInfo)();
|
|
137
|
-
|
|
137
|
+
(0, make_file_executable_1.makeFileExecutableIfItIsNot)(revisionInfo.executablePath);
|
|
138
138
|
return revisionInfo;
|
|
139
139
|
};
|
|
140
140
|
exports.downloadBrowser = downloadBrowser;
|
|
@@ -145,22 +145,16 @@ const getExecutablePath = () => {
|
|
|
145
145
|
const downloadsFolder = getDownloadsFolder();
|
|
146
146
|
const platform = getPlatform();
|
|
147
147
|
const folderPath = getFolderPath(downloadsFolder, platform);
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return path.join(folderPath, `chrome-headless-shell-${platform}`, 'chrome-headless-shell');
|
|
152
|
-
}
|
|
153
|
-
if (platform === 'win64') {
|
|
154
|
-
return path.join(folderPath, `chrome-headless-shell-${platform}`, 'chrome-headless-shell.exe');
|
|
155
|
-
}
|
|
156
|
-
throw new Error('Can not download browser for platform: ' + platform);
|
|
148
|
+
return path.join(folderPath, `chrome-headless-shell-${platform}`, platform === 'win64'
|
|
149
|
+
? 'chrome-headless-shell.exe'
|
|
150
|
+
: 'chrome-headless-shell');
|
|
157
151
|
};
|
|
158
152
|
const getRevisionInfo = () => {
|
|
159
153
|
const executablePath = getExecutablePath();
|
|
160
154
|
const downloadsFolder = getDownloadsFolder();
|
|
161
155
|
const platform = getPlatform();
|
|
162
156
|
const folderPath = getFolderPath(downloadsFolder, platform);
|
|
163
|
-
const url = getChromeDownloadUrl(platform);
|
|
157
|
+
const url = getChromeDownloadUrl({ platform, version: null });
|
|
164
158
|
const local = fs.existsSync(folderPath);
|
|
165
159
|
return {
|
|
166
160
|
executablePath,
|
|
@@ -170,66 +164,3 @@ const getRevisionInfo = () => {
|
|
|
170
164
|
};
|
|
171
165
|
};
|
|
172
166
|
exports.getRevisionInfo = getRevisionInfo;
|
|
173
|
-
async function install({ archivePath, folderPath, }) {
|
|
174
|
-
if (archivePath.endsWith('.zip')) {
|
|
175
|
-
return (0, extract_zip_1.default)(archivePath, { dir: folderPath });
|
|
176
|
-
}
|
|
177
|
-
if (archivePath.endsWith('.dmg')) {
|
|
178
|
-
await mkdirAsync(folderPath);
|
|
179
|
-
return _installDMG(archivePath, folderPath);
|
|
180
|
-
}
|
|
181
|
-
throw new Error(`Unsupported archive format: ${archivePath}`);
|
|
182
|
-
}
|
|
183
|
-
function _installDMG(dmgPath, folderPath) {
|
|
184
|
-
let mountPath;
|
|
185
|
-
return new Promise((fulfill, reject) => {
|
|
186
|
-
const mountCommand = `hdiutil attach -nobrowse -noautoopen "${dmgPath}"`;
|
|
187
|
-
childProcess.exec(mountCommand, (err, stdout) => {
|
|
188
|
-
if (err) {
|
|
189
|
-
return reject(err);
|
|
190
|
-
}
|
|
191
|
-
const volumes = stdout.match(/\/Volumes\/(.*)/m);
|
|
192
|
-
if (!volumes) {
|
|
193
|
-
return reject(new Error(`Could not find volume path in ${stdout}`));
|
|
194
|
-
}
|
|
195
|
-
mountPath = volumes[0];
|
|
196
|
-
readdirAsync(mountPath)
|
|
197
|
-
.then((fileNames) => {
|
|
198
|
-
const appName = fileNames.find((item) => {
|
|
199
|
-
return typeof item === 'string' && item.endsWith('.app');
|
|
200
|
-
});
|
|
201
|
-
if (!appName) {
|
|
202
|
-
return reject(new Error(`Cannot find app in ${mountPath}`));
|
|
203
|
-
}
|
|
204
|
-
const copyPath = path.join(mountPath, appName);
|
|
205
|
-
childProcess.exec(`cp -R "${copyPath}" "${folderPath}"`, (_err) => {
|
|
206
|
-
if (_err) {
|
|
207
|
-
reject(_err);
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
fulfill();
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
})
|
|
214
|
-
.catch(reject);
|
|
215
|
-
});
|
|
216
|
-
})
|
|
217
|
-
.catch((error) => {
|
|
218
|
-
console.error(error);
|
|
219
|
-
})
|
|
220
|
-
.finally(() => {
|
|
221
|
-
if (!mountPath) {
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
const unmountCommand = `hdiutil detach "${mountPath}" -quiet`;
|
|
225
|
-
childProcess.exec(unmountCommand, (err) => {
|
|
226
|
-
if (err) {
|
|
227
|
-
console.error(`Error unmounting dmg: ${err}`);
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
function toMegabytes(bytes) {
|
|
233
|
-
const mb = bytes / 1024 / 1024;
|
|
234
|
-
return `${Math.round(mb * 10) / 10} Mb`;
|
|
235
|
-
}
|
|
@@ -8,9 +8,9 @@ import type { Frame } from './FrameManager';
|
|
|
8
8
|
import type { HTTPResponse } from './HTTPResponse';
|
|
9
9
|
import type { JSHandle } from './JSHandle';
|
|
10
10
|
import type { Viewport } from './PuppeteerViewport';
|
|
11
|
-
import type { SourceMapGetter } from './source-map-getter';
|
|
12
11
|
import type { Target } from './Target';
|
|
13
12
|
import { TaskQueue } from './TaskQueue';
|
|
13
|
+
import type { SourceMapGetter } from './source-map-getter';
|
|
14
14
|
interface WaitForOptions {
|
|
15
15
|
timeout?: number;
|
|
16
16
|
}
|
|
@@ -32,13 +32,13 @@ const no_react_1 = require("remotion/no-react");
|
|
|
32
32
|
const format_logs_1 = require("../format-logs");
|
|
33
33
|
const logger_1 = require("../logger");
|
|
34
34
|
const truthy_1 = require("../truthy");
|
|
35
|
-
const assert_1 = require("./assert");
|
|
36
35
|
const ConsoleMessage_1 = require("./ConsoleMessage");
|
|
37
36
|
const EventEmitter_1 = require("./EventEmitter");
|
|
38
37
|
const FrameManager_1 = require("./FrameManager");
|
|
39
38
|
const JSHandle_1 = require("./JSHandle");
|
|
40
39
|
const TaskQueue_1 = require("./TaskQueue");
|
|
41
40
|
const TimeoutSettings_1 = require("./TimeoutSettings");
|
|
41
|
+
const assert_1 = require("./assert");
|
|
42
42
|
const util_1 = require("./util");
|
|
43
43
|
const shouldHideWarning = (log) => {
|
|
44
44
|
// Mixed Content warnings caused by localhost should not be displayed
|
|
@@ -57,10 +57,10 @@ const readline = __importStar(require("readline"));
|
|
|
57
57
|
const delete_directory_1 = require("../delete-directory");
|
|
58
58
|
const logger_1 = require("../logger");
|
|
59
59
|
const truthy_1 = require("../truthy");
|
|
60
|
-
const assert_1 = require("./assert");
|
|
61
60
|
const Connection_1 = require("./Connection");
|
|
62
61
|
const Errors_1 = require("./Errors");
|
|
63
62
|
const NodeWebSocketTransport_1 = require("./NodeWebSocketTransport");
|
|
63
|
+
const assert_1 = require("./assert");
|
|
64
64
|
const should_log_message_1 = require("./should-log-message");
|
|
65
65
|
const util_1 = require("./util");
|
|
66
66
|
const PROCESS_ERROR_EXPLANATION = `Puppeteer was unable to kill the process which ran the browser binary.
|
|
@@ -115,7 +115,7 @@ class BrowserRunner {
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
const { output, tag } = formatted;
|
|
118
|
-
logger_1.Log.
|
|
118
|
+
logger_1.Log.error({ indent: options.indent, logLevel: options.logLevel, tag }, output);
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
}
|
|
@@ -37,7 +37,7 @@ class NodeWebSocketTransport {
|
|
|
37
37
|
const ws = new ws_types_1.ws(url, [], {
|
|
38
38
|
followRedirects: true,
|
|
39
39
|
perMessageDeflate: false,
|
|
40
|
-
maxPayload: 1024 * 1024 * 1024,
|
|
40
|
+
maxPayload: 1024 * 1024 * 1024, // 1024Mb
|
|
41
41
|
headers: {
|
|
42
42
|
'User-Agent': `Remotion CLI`,
|
|
43
43
|
},
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LogLevel } from '../log-level';
|
|
2
|
+
import type { OnBrowserDownload } from '../options/on-browser-download';
|
|
3
|
+
export declare const defaultBrowserDownloadProgress: ({ indent, logLevel, api, }: {
|
|
4
|
+
indent: boolean;
|
|
5
|
+
logLevel: LogLevel;
|
|
6
|
+
api: string;
|
|
7
|
+
}) => OnBrowserDownload;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultBrowserDownloadProgress = void 0;
|
|
4
|
+
const logger_1 = require("../logger");
|
|
5
|
+
const to_megabytes_1 = require("../to-megabytes");
|
|
6
|
+
const defaultBrowserDownloadProgress = ({ indent, logLevel, api, }) => () => {
|
|
7
|
+
logger_1.Log.info({ indent, logLevel }, 'No local browser could be found.');
|
|
8
|
+
logger_1.Log.info({ indent, logLevel }, 'Downloading Chrome Headless Shell https://www.remotion.dev/docs/miscellaneous/chrome-headless-shell');
|
|
9
|
+
logger_1.Log.info({ indent, logLevel }, `Customize this behavior by adding a onBrowserDownload function to ${api}.`);
|
|
10
|
+
return {
|
|
11
|
+
onProgress: (progress) => {
|
|
12
|
+
let lastProgress = 0;
|
|
13
|
+
if (progress.downloadedBytes > lastProgress + 10000000) {
|
|
14
|
+
lastProgress = progress.downloadedBytes;
|
|
15
|
+
logger_1.Log.info({ indent, logLevel }, `Downloading Chrome Headless Shell - ${(0, to_megabytes_1.toMegabytes)(progress.downloadedBytes)}/${(0, to_megabytes_1.toMegabytes)(progress.totalSizeInBytes)}`);
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
version: null,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
exports.defaultBrowserDownloadProgress = defaultBrowserDownloadProgress;
|
|
@@ -24,6 +24,12 @@ const shouldLogBrowserMessage = (message) => {
|
|
|
24
24
|
if (message.includes('Fontconfig error: No writable cache directories')) {
|
|
25
25
|
return false;
|
|
26
26
|
}
|
|
27
|
+
if (message.includes('AttributionReportingCrossAppWeb cannot be enabled in this configuration')) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
if (message.includes('Received HEADERS for invalid stream')) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
27
33
|
return true;
|
|
28
34
|
};
|
|
29
35
|
exports.shouldLogBrowserMessage = shouldLogBrowserMessage;
|
package/dist/client.d.ts
CHANGED
|
@@ -464,19 +464,19 @@ export declare const BrowserSafeApis: {
|
|
|
464
464
|
cliFlag: "gl";
|
|
465
465
|
docLink: string;
|
|
466
466
|
name: string;
|
|
467
|
-
type: "
|
|
467
|
+
type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
468
468
|
ssrName: string;
|
|
469
469
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
470
470
|
getValue: ({ commandLine }: {
|
|
471
471
|
commandLine: Record<string, unknown>;
|
|
472
472
|
}) => {
|
|
473
|
-
value: "
|
|
473
|
+
value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
|
|
474
474
|
source: string;
|
|
475
475
|
} | {
|
|
476
476
|
value: null;
|
|
477
477
|
source: string;
|
|
478
478
|
};
|
|
479
|
-
setConfig: (value: "
|
|
479
|
+
setConfig: (value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
|
|
480
480
|
};
|
|
481
481
|
enableLambdaInsights: {
|
|
482
482
|
name: string;
|
|
@@ -601,17 +601,17 @@ export declare const BrowserSafeApis: {
|
|
|
601
601
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
602
602
|
ssrName: "x264Preset";
|
|
603
603
|
docLink: string;
|
|
604
|
-
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
604
|
+
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
605
605
|
getValue: ({ commandLine }: {
|
|
606
606
|
commandLine: Record<string, unknown>;
|
|
607
607
|
}) => {
|
|
608
|
-
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
608
|
+
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
609
609
|
source: string;
|
|
610
610
|
} | {
|
|
611
611
|
value: null;
|
|
612
612
|
source: string;
|
|
613
613
|
};
|
|
614
|
-
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
614
|
+
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
615
615
|
};
|
|
616
616
|
logLevelOption: {
|
|
617
617
|
cliFlag: "log";
|
|
@@ -760,6 +760,16 @@ export declare const BrowserSafeApis: {
|
|
|
760
760
|
setConfig: (value: string | null) => void;
|
|
761
761
|
type: string | null;
|
|
762
762
|
};
|
|
763
|
+
onBrowserDownloadOption: {
|
|
764
|
+
name: string;
|
|
765
|
+
cliFlag: "on-browser-download";
|
|
766
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
767
|
+
ssrName: "onBrowserDownload";
|
|
768
|
+
docLink: string;
|
|
769
|
+
type: import(".").OnBrowserDownload;
|
|
770
|
+
getValue: () => never;
|
|
771
|
+
setConfig: () => never;
|
|
772
|
+
};
|
|
763
773
|
};
|
|
764
774
|
validColorSpaces: readonly ["default", "bt709", "bt2020-ncl"];
|
|
765
775
|
optionsMap: {
|
|
@@ -836,17 +846,17 @@ export declare const BrowserSafeApis: {
|
|
|
836
846
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
837
847
|
ssrName: "x264Preset";
|
|
838
848
|
docLink: string;
|
|
839
|
-
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
849
|
+
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
840
850
|
getValue: ({ commandLine }: {
|
|
841
851
|
commandLine: Record<string, unknown>;
|
|
842
852
|
}) => {
|
|
843
|
-
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
853
|
+
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
844
854
|
source: string;
|
|
845
855
|
} | {
|
|
846
856
|
value: null;
|
|
847
857
|
source: string;
|
|
848
858
|
};
|
|
849
|
-
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
859
|
+
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
850
860
|
};
|
|
851
861
|
readonly audioBitrate: {
|
|
852
862
|
name: string;
|
|
@@ -1067,6 +1077,16 @@ export declare const BrowserSafeApis: {
|
|
|
1067
1077
|
ssrName: "audioCodec";
|
|
1068
1078
|
type: "mp3" | "aac" | "pcm-16" | "opus";
|
|
1069
1079
|
};
|
|
1080
|
+
readonly onBrowserDownload: {
|
|
1081
|
+
name: string;
|
|
1082
|
+
cliFlag: "on-browser-download";
|
|
1083
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1084
|
+
ssrName: "onBrowserDownload";
|
|
1085
|
+
docLink: string;
|
|
1086
|
+
type: import(".").OnBrowserDownload;
|
|
1087
|
+
getValue: () => never;
|
|
1088
|
+
setConfig: () => never;
|
|
1089
|
+
};
|
|
1070
1090
|
};
|
|
1071
1091
|
readonly stitchFramesToVideo: {
|
|
1072
1092
|
readonly separateAudioTo: {
|
|
@@ -1167,6 +1187,16 @@ export declare const BrowserSafeApis: {
|
|
|
1167
1187
|
};
|
|
1168
1188
|
setConfig: (value: string | null) => void;
|
|
1169
1189
|
};
|
|
1190
|
+
readonly onBrowserDownload: {
|
|
1191
|
+
name: string;
|
|
1192
|
+
cliFlag: "on-browser-download";
|
|
1193
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1194
|
+
ssrName: "onBrowserDownload";
|
|
1195
|
+
docLink: string;
|
|
1196
|
+
type: import(".").OnBrowserDownload;
|
|
1197
|
+
getValue: () => never;
|
|
1198
|
+
setConfig: () => never;
|
|
1199
|
+
};
|
|
1170
1200
|
};
|
|
1171
1201
|
readonly getCompositions: {
|
|
1172
1202
|
readonly offthreadVideoCacheSizeInBytes: {
|
|
@@ -1232,6 +1262,16 @@ export declare const BrowserSafeApis: {
|
|
|
1232
1262
|
};
|
|
1233
1263
|
setConfig: (value: string | null) => void;
|
|
1234
1264
|
};
|
|
1265
|
+
readonly onBrowserDownload: {
|
|
1266
|
+
name: string;
|
|
1267
|
+
cliFlag: "on-browser-download";
|
|
1268
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1269
|
+
ssrName: "onBrowserDownload";
|
|
1270
|
+
docLink: string;
|
|
1271
|
+
type: import(".").OnBrowserDownload;
|
|
1272
|
+
getValue: () => never;
|
|
1273
|
+
setConfig: () => never;
|
|
1274
|
+
};
|
|
1235
1275
|
};
|
|
1236
1276
|
readonly selectComposition: {
|
|
1237
1277
|
readonly offthreadVideoCacheSizeInBytes: {
|
|
@@ -1297,6 +1337,16 @@ export declare const BrowserSafeApis: {
|
|
|
1297
1337
|
};
|
|
1298
1338
|
setConfig: (value: string | null) => void;
|
|
1299
1339
|
};
|
|
1340
|
+
readonly onBrowserDownload: {
|
|
1341
|
+
name: string;
|
|
1342
|
+
cliFlag: "on-browser-download";
|
|
1343
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1344
|
+
ssrName: "onBrowserDownload";
|
|
1345
|
+
docLink: string;
|
|
1346
|
+
type: import(".").OnBrowserDownload;
|
|
1347
|
+
getValue: () => never;
|
|
1348
|
+
setConfig: () => never;
|
|
1349
|
+
};
|
|
1300
1350
|
};
|
|
1301
1351
|
readonly renderFrames: {
|
|
1302
1352
|
readonly forSeamlessAacConcatenation: {
|
|
@@ -1395,6 +1445,16 @@ export declare const BrowserSafeApis: {
|
|
|
1395
1445
|
};
|
|
1396
1446
|
setConfig: (value: string | null) => void;
|
|
1397
1447
|
};
|
|
1448
|
+
readonly onBrowserDownload: {
|
|
1449
|
+
name: string;
|
|
1450
|
+
cliFlag: "on-browser-download";
|
|
1451
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1452
|
+
ssrName: "onBrowserDownload";
|
|
1453
|
+
docLink: string;
|
|
1454
|
+
type: import(".").OnBrowserDownload;
|
|
1455
|
+
getValue: () => never;
|
|
1456
|
+
setConfig: () => never;
|
|
1457
|
+
};
|
|
1398
1458
|
};
|
|
1399
1459
|
readonly renderMediaOnLambda: {
|
|
1400
1460
|
readonly offthreadVideoCacheSizeInBytes: {
|
|
@@ -1508,17 +1568,17 @@ export declare const BrowserSafeApis: {
|
|
|
1508
1568
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1509
1569
|
ssrName: "x264Preset";
|
|
1510
1570
|
docLink: string;
|
|
1511
|
-
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1571
|
+
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
1512
1572
|
getValue: ({ commandLine }: {
|
|
1513
1573
|
commandLine: Record<string, unknown>;
|
|
1514
1574
|
}) => {
|
|
1515
|
-
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1575
|
+
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
1516
1576
|
source: string;
|
|
1517
1577
|
} | {
|
|
1518
1578
|
value: null;
|
|
1519
1579
|
source: string;
|
|
1520
1580
|
};
|
|
1521
|
-
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1581
|
+
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
1522
1582
|
};
|
|
1523
1583
|
readonly encodingMaxRate: {
|
|
1524
1584
|
name: string;
|
|
@@ -1874,17 +1934,17 @@ export declare const BrowserSafeApis: {
|
|
|
1874
1934
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1875
1935
|
ssrName: "x264Preset";
|
|
1876
1936
|
docLink: string;
|
|
1877
|
-
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1937
|
+
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
1878
1938
|
getValue: ({ commandLine }: {
|
|
1879
1939
|
commandLine: Record<string, unknown>;
|
|
1880
1940
|
}) => {
|
|
1881
|
-
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1941
|
+
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
1882
1942
|
source: string;
|
|
1883
1943
|
} | {
|
|
1884
1944
|
value: null;
|
|
1885
1945
|
source: string;
|
|
1886
1946
|
};
|
|
1887
|
-
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1947
|
+
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
1888
1948
|
};
|
|
1889
1949
|
readonly encodingMaxRate: {
|
|
1890
1950
|
name: string;
|
|
@@ -2111,6 +2171,33 @@ export declare const BrowserSafeApis: {
|
|
|
2111
2171
|
setConfig: (value: number) => void;
|
|
2112
2172
|
};
|
|
2113
2173
|
};
|
|
2174
|
+
readonly ensureBrowser: {
|
|
2175
|
+
readonly logLevel: {
|
|
2176
|
+
cliFlag: "log";
|
|
2177
|
+
name: string;
|
|
2178
|
+
ssrName: string;
|
|
2179
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
2180
|
+
docLink: string;
|
|
2181
|
+
getValue: ({ commandLine }: {
|
|
2182
|
+
commandLine: Record<string, unknown>;
|
|
2183
|
+
}) => {
|
|
2184
|
+
value: "verbose" | "info" | "warn" | "error";
|
|
2185
|
+
source: string;
|
|
2186
|
+
};
|
|
2187
|
+
setConfig: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
|
|
2188
|
+
type: "verbose" | "info" | "warn" | "error";
|
|
2189
|
+
};
|
|
2190
|
+
readonly onBrowserDownload: {
|
|
2191
|
+
name: string;
|
|
2192
|
+
cliFlag: "on-browser-download";
|
|
2193
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
2194
|
+
ssrName: "onBrowserDownload";
|
|
2195
|
+
docLink: string;
|
|
2196
|
+
type: import(".").OnBrowserDownload;
|
|
2197
|
+
getValue: () => never;
|
|
2198
|
+
setConfig: () => never;
|
|
2199
|
+
};
|
|
2200
|
+
};
|
|
2114
2201
|
};
|
|
2115
2202
|
codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => boolean;
|
|
2116
2203
|
codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => boolean;
|
|
@@ -14,6 +14,7 @@ const combineVideoStreams = async ({ fps, codec, filelistDir, numberOfGifLoops,
|
|
|
14
14
|
const fileList = files.map((p) => `file '${p}'`).join('\n');
|
|
15
15
|
const fileListTxt = (0, path_1.join)(filelistDir, 'video-files.txt');
|
|
16
16
|
(0, fs_1.writeFileSync)(fileListTxt, fileList);
|
|
17
|
+
const encoder = codec === 'gif' ? 'gif' : 'copy';
|
|
17
18
|
const command = [
|
|
18
19
|
'-hide_banner',
|
|
19
20
|
'-r',
|
|
@@ -30,7 +31,9 @@ const combineVideoStreams = async ({ fps, codec, filelistDir, numberOfGifLoops,
|
|
|
30
31
|
: (0, convert_number_of_gif_loops_to_ffmpeg_1.convertNumberOfGifLoopsToFfmpegSyntax)(numberOfGifLoops),
|
|
31
32
|
'-an',
|
|
32
33
|
'-c:v',
|
|
33
|
-
|
|
34
|
+
encoder,
|
|
35
|
+
encoder === 'gif' ? '-filter_complex' : null,
|
|
36
|
+
encoder === 'gif' ? 'split[v],palettegen,[v]paletteuse' : null,
|
|
34
37
|
codec === 'h264' ? '-movflags' : null,
|
|
35
38
|
codec === 'h264' ? 'faststart' : null,
|
|
36
39
|
addRemotionMetadata ? `-metadata` : null,
|
|
@@ -38,8 +41,9 @@ const combineVideoStreams = async ({ fps, codec, filelistDir, numberOfGifLoops,
|
|
|
38
41
|
'-y',
|
|
39
42
|
output,
|
|
40
43
|
].filter(truthy_1.truthy);
|
|
44
|
+
const doesReencode = encoder !== 'copy';
|
|
41
45
|
const startTime = Date.now();
|
|
42
|
-
logger_1.Log.verbose({ indent, logLevel }, `Combining video without
|
|
46
|
+
logger_1.Log.verbose({ indent, logLevel }, `Combining video ${doesReencode ? 'with reencoding' : 'without reencoding'}, command: ${command.join(' ')}`);
|
|
43
47
|
try {
|
|
44
48
|
const task = (0, call_ffmpeg_1.callFf)({
|
|
45
49
|
args: command,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { BrowserExecutable } from './browser-executable';
|
|
2
|
+
import type { BrowserSafeApis } from './client';
|
|
3
|
+
import type { ToOptions } from './options/option';
|
|
4
|
+
export type BrowserStatus = {
|
|
5
|
+
type: 'user-defined-path';
|
|
6
|
+
path: string;
|
|
7
|
+
} | {
|
|
8
|
+
type: 'local-browser';
|
|
9
|
+
path: string;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'local-puppeteer-browser';
|
|
12
|
+
path: string;
|
|
13
|
+
} | {
|
|
14
|
+
type: 'no-browser';
|
|
15
|
+
};
|
|
16
|
+
type InternalEnsureBrowserOptions = {
|
|
17
|
+
browserExecutable: BrowserExecutable;
|
|
18
|
+
indent: boolean;
|
|
19
|
+
} & ToOptions<typeof BrowserSafeApis.optionsMap.ensureBrowser>;
|
|
20
|
+
export type EnsureBrowserOptions = Partial<{
|
|
21
|
+
browserExecutable: BrowserExecutable;
|
|
22
|
+
} & ToOptions<typeof BrowserSafeApis.optionsMap.ensureBrowser>>;
|
|
23
|
+
export declare const internalEnsureBrowser: ({ indent, logLevel, browserExecutable, onBrowserDownload, }: InternalEnsureBrowserOptions) => Promise<BrowserStatus>;
|
|
24
|
+
export declare const ensureBrowser: (options?: EnsureBrowserOptions) => Promise<BrowserStatus>;
|
|
25
|
+
export {};
|