@remotion/renderer 4.0.135 → 4.0.137
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/audio-codec.d.ts +28 -0
- package/dist/audio-codec.js +88 -0
- package/dist/browser/BrowserFetcher.d.ts +4 -1
- package/dist/browser/BrowserFetcher.js +35 -105
- package/dist/browser/browser-download-progress-bar.d.ts +7 -0
- package/dist/browser/browser-download-progress-bar.js +21 -0
- package/dist/check-apple-silicon.d.ts +1 -0
- package/dist/check-apple-silicon.js +12 -0
- package/dist/check-version-requirements.js +6 -1
- package/dist/client.d.ts +90 -3
- package/dist/compositor/get-executable-path.js +10 -1
- package/dist/create-combined-video.d.ts +18 -0
- package/dist/create-combined-video.js +27 -0
- package/dist/does-have-m2-bug.d.ts +3 -0
- package/dist/does-have-m2-bug.js +12 -0
- 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-extension-from-audio-codec.d.ts +2 -0
- package/dist/get-extension-from-audio-codec.js +19 -0
- 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 +73 -14
- package/dist/index.js +7 -3
- package/dist/is-audio-codec.d.ts +2 -0
- package/dist/is-audio-codec.js +7 -0
- package/dist/open-browser.d.ts +3 -1
- package/dist/open-browser.js +19 -8
- package/dist/options/enable-multiprocess-on-linux.js +2 -2
- package/dist/options/gl.d.ts +3 -3
- package/dist/options/index.d.ts +13 -3
- 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 +77 -0
- package/dist/options/options-map.js +10 -0
- package/dist/options/prores-profile.d.ts +0 -0
- package/dist/options/prores-profile.js +1 -0
- package/dist/render-frames.js +10 -4
- package/dist/render-media.d.ts +1 -1
- package/dist/render-media.js +9 -4
- package/dist/render-still.js +9 -4
- package/dist/select-composition.js +14 -4
- package/dist/stitch-frames-to-video.d.ts +0 -1
- 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/x264-preset.d.ts +22 -0
- package/dist/x264-preset.js +54 -0
- package/package.json +9 -9
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Codec } from './codec';
|
|
2
|
+
export declare const validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
|
|
3
|
+
export type AudioCodec = (typeof validAudioCodecs)[number];
|
|
4
|
+
export declare const supportedAudioCodecs: {
|
|
5
|
+
readonly h264: readonly ["aac", "pcm-16", "mp3"];
|
|
6
|
+
readonly 'h264-mkv': readonly ["pcm-16", "mp3"];
|
|
7
|
+
readonly aac: readonly ["aac", "pcm-16"];
|
|
8
|
+
readonly gif: readonly [];
|
|
9
|
+
readonly h265: readonly ["aac", "pcm-16"];
|
|
10
|
+
readonly mp3: readonly ["mp3", "pcm-16"];
|
|
11
|
+
readonly prores: readonly ["aac", "pcm-16"];
|
|
12
|
+
readonly vp8: readonly ["opus", "pcm-16"];
|
|
13
|
+
readonly vp9: readonly ["opus", "pcm-16"];
|
|
14
|
+
readonly wav: readonly ["pcm-16"];
|
|
15
|
+
};
|
|
16
|
+
declare const audioCodecNames: readonly ["pcm_s16le", "libfdk_aac", "libmp3lame", "libopus"];
|
|
17
|
+
type FfmpegAudioCodecName = (typeof audioCodecNames)[number];
|
|
18
|
+
export declare const mapAudioCodecToFfmpegAudioCodecName: (audioCodec: AudioCodec) => FfmpegAudioCodecName;
|
|
19
|
+
export declare const defaultAudioCodecs: {
|
|
20
|
+
[key in Codec]: {
|
|
21
|
+
[k in 'compressed' | 'lossless']: (typeof supportedAudioCodecs)[key][number] | null;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const getDefaultAudioCodec: ({ codec, preferLossless, }: {
|
|
25
|
+
codec: Codec;
|
|
26
|
+
preferLossless: boolean;
|
|
27
|
+
}) => AudioCodec | null;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDefaultAudioCodec = exports.defaultAudioCodecs = exports.mapAudioCodecToFfmpegAudioCodecName = exports.supportedAudioCodecs = exports.validAudioCodecs = void 0;
|
|
4
|
+
exports.validAudioCodecs = ['pcm-16', 'aac', 'mp3', 'opus'];
|
|
5
|
+
exports.supportedAudioCodecs = {
|
|
6
|
+
h264: ['aac', 'pcm-16', 'mp3'],
|
|
7
|
+
'h264-mkv': ['pcm-16', 'mp3'],
|
|
8
|
+
aac: ['aac', 'pcm-16'],
|
|
9
|
+
gif: [],
|
|
10
|
+
h265: ['aac', 'pcm-16'],
|
|
11
|
+
mp3: ['mp3', 'pcm-16'],
|
|
12
|
+
prores: ['aac', 'pcm-16'],
|
|
13
|
+
vp8: ['opus', 'pcm-16'],
|
|
14
|
+
vp9: ['opus', 'pcm-16'],
|
|
15
|
+
wav: ['pcm-16'],
|
|
16
|
+
};
|
|
17
|
+
const _satisfies = exports.supportedAudioCodecs;
|
|
18
|
+
if (_satisfies) {
|
|
19
|
+
// Just for type checking
|
|
20
|
+
}
|
|
21
|
+
const audioCodecNames = [
|
|
22
|
+
'pcm_s16le',
|
|
23
|
+
'libfdk_aac',
|
|
24
|
+
'libmp3lame',
|
|
25
|
+
'libopus',
|
|
26
|
+
];
|
|
27
|
+
const mapAudioCodecToFfmpegAudioCodecName = (audioCodec) => {
|
|
28
|
+
if (audioCodec === 'aac') {
|
|
29
|
+
return 'libfdk_aac';
|
|
30
|
+
}
|
|
31
|
+
if (audioCodec === 'mp3') {
|
|
32
|
+
return 'libmp3lame';
|
|
33
|
+
}
|
|
34
|
+
if (audioCodec === 'opus') {
|
|
35
|
+
return 'libopus';
|
|
36
|
+
}
|
|
37
|
+
if (audioCodec === 'pcm-16') {
|
|
38
|
+
return 'pcm_s16le';
|
|
39
|
+
}
|
|
40
|
+
throw new Error('unknown audio codec: ' + audioCodec);
|
|
41
|
+
};
|
|
42
|
+
exports.mapAudioCodecToFfmpegAudioCodecName = mapAudioCodecToFfmpegAudioCodecName;
|
|
43
|
+
exports.defaultAudioCodecs = {
|
|
44
|
+
'h264-mkv': {
|
|
45
|
+
lossless: 'pcm-16',
|
|
46
|
+
compressed: 'pcm-16',
|
|
47
|
+
},
|
|
48
|
+
aac: {
|
|
49
|
+
lossless: 'pcm-16',
|
|
50
|
+
compressed: 'aac',
|
|
51
|
+
},
|
|
52
|
+
gif: {
|
|
53
|
+
lossless: null,
|
|
54
|
+
compressed: null,
|
|
55
|
+
},
|
|
56
|
+
h264: {
|
|
57
|
+
lossless: 'pcm-16',
|
|
58
|
+
compressed: 'aac',
|
|
59
|
+
},
|
|
60
|
+
h265: {
|
|
61
|
+
lossless: 'pcm-16',
|
|
62
|
+
compressed: 'aac',
|
|
63
|
+
},
|
|
64
|
+
mp3: {
|
|
65
|
+
lossless: 'pcm-16',
|
|
66
|
+
compressed: 'mp3',
|
|
67
|
+
},
|
|
68
|
+
prores: {
|
|
69
|
+
lossless: 'pcm-16',
|
|
70
|
+
compressed: 'pcm-16',
|
|
71
|
+
},
|
|
72
|
+
vp8: {
|
|
73
|
+
lossless: 'pcm-16',
|
|
74
|
+
compressed: 'opus',
|
|
75
|
+
},
|
|
76
|
+
vp9: {
|
|
77
|
+
lossless: 'pcm-16',
|
|
78
|
+
compressed: 'opus',
|
|
79
|
+
},
|
|
80
|
+
wav: {
|
|
81
|
+
lossless: 'pcm-16',
|
|
82
|
+
compressed: 'pcm-16',
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
const getDefaultAudioCodec = ({ codec, preferLossless, }) => {
|
|
86
|
+
return exports.defaultAudioCodecs[codec][preferLossless ? 'lossless' : 'compressed'];
|
|
87
|
+
};
|
|
88
|
+
exports.getDefaultAudioCodec = getDefaultAudioCodec;
|
|
@@ -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_arm: 'https://github.com/Alex313031/Thorium-MacOS/releases/download/M116.0.5845.169/Thorium_MacOS_ARM.dmg',
|
|
59
|
-
win64: 'https://github.com/Alex313031/Thorium-Win/releases/download/M117.0.5938.157/Thorium_117.0.5938.157.zip',
|
|
60
|
-
};
|
|
61
|
-
function getThoriumDownloadUrl(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) => {
|
|
@@ -76,24 +68,26 @@ const getPlatform = () => {
|
|
|
76
68
|
const platform = os.platform();
|
|
77
69
|
switch (platform) {
|
|
78
70
|
case 'darwin':
|
|
79
|
-
return os.arch() === 'arm64' ? '
|
|
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 =
|
|
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 Thorium - ${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,23 +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
|
-
if (platform === 'linux') {
|
|
152
|
-
return path.join(folderPath, 'thorium');
|
|
153
|
-
}
|
|
154
|
-
if (platform === 'win64') {
|
|
155
|
-
return path.join(folderPath, 'BIN', 'thorium.exe');
|
|
156
|
-
}
|
|
157
|
-
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');
|
|
158
151
|
};
|
|
159
152
|
const getRevisionInfo = () => {
|
|
160
153
|
const executablePath = getExecutablePath();
|
|
161
154
|
const downloadsFolder = getDownloadsFolder();
|
|
162
155
|
const platform = getPlatform();
|
|
163
156
|
const folderPath = getFolderPath(downloadsFolder, platform);
|
|
164
|
-
const url =
|
|
157
|
+
const url = getChromeDownloadUrl({ platform, version: null });
|
|
165
158
|
const local = fs.existsSync(folderPath);
|
|
166
159
|
return {
|
|
167
160
|
executablePath,
|
|
@@ -171,66 +164,3 @@ const getRevisionInfo = () => {
|
|
|
171
164
|
};
|
|
172
165
|
};
|
|
173
166
|
exports.getRevisionInfo = getRevisionInfo;
|
|
174
|
-
async function install({ archivePath, folderPath, }) {
|
|
175
|
-
if (archivePath.endsWith('.zip')) {
|
|
176
|
-
return (0, extract_zip_1.default)(archivePath, { dir: folderPath });
|
|
177
|
-
}
|
|
178
|
-
if (archivePath.endsWith('.dmg')) {
|
|
179
|
-
await mkdirAsync(folderPath);
|
|
180
|
-
return _installDMG(archivePath, folderPath);
|
|
181
|
-
}
|
|
182
|
-
throw new Error(`Unsupported archive format: ${archivePath}`);
|
|
183
|
-
}
|
|
184
|
-
function _installDMG(dmgPath, folderPath) {
|
|
185
|
-
let mountPath;
|
|
186
|
-
return new Promise((fulfill, reject) => {
|
|
187
|
-
const mountCommand = `hdiutil attach -nobrowse -noautoopen "${dmgPath}"`;
|
|
188
|
-
childProcess.exec(mountCommand, (err, stdout) => {
|
|
189
|
-
if (err) {
|
|
190
|
-
return reject(err);
|
|
191
|
-
}
|
|
192
|
-
const volumes = stdout.match(/\/Volumes\/(.*)/m);
|
|
193
|
-
if (!volumes) {
|
|
194
|
-
return reject(new Error(`Could not find volume path in ${stdout}`));
|
|
195
|
-
}
|
|
196
|
-
mountPath = volumes[0];
|
|
197
|
-
readdirAsync(mountPath)
|
|
198
|
-
.then((fileNames) => {
|
|
199
|
-
const appName = fileNames.find((item) => {
|
|
200
|
-
return typeof item === 'string' && item.endsWith('.app');
|
|
201
|
-
});
|
|
202
|
-
if (!appName) {
|
|
203
|
-
return reject(new Error(`Cannot find app in ${mountPath}`));
|
|
204
|
-
}
|
|
205
|
-
const copyPath = path.join(mountPath, appName);
|
|
206
|
-
childProcess.exec(`cp -R "${copyPath}" "${folderPath}"`, (_err) => {
|
|
207
|
-
if (_err) {
|
|
208
|
-
reject(_err);
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
fulfill();
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
})
|
|
215
|
-
.catch(reject);
|
|
216
|
-
});
|
|
217
|
-
})
|
|
218
|
-
.catch((error) => {
|
|
219
|
-
console.error(error);
|
|
220
|
-
})
|
|
221
|
-
.finally(() => {
|
|
222
|
-
if (!mountPath) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
const unmountCommand = `hdiutil detach "${mountPath}" -quiet`;
|
|
226
|
-
childProcess.exec(unmountCommand, (err) => {
|
|
227
|
-
if (err) {
|
|
228
|
-
console.error(`Error unmounting dmg: ${err}`);
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
function toMegabytes(bytes) {
|
|
234
|
-
const mb = bytes / 1024 / 1024;
|
|
235
|
-
return `${Math.round(mb * 10) / 10} Mb`;
|
|
236
|
-
}
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkNodeVersionAndWarnAboutRosetta: () => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkNodeVersionAndWarnAboutRosetta = void 0;
|
|
4
|
+
const checkNodeVersionAndWarnAboutRosetta = () => {
|
|
5
|
+
const version = process.version.replace('v', '').split('.');
|
|
6
|
+
const majorVersion = Number(version[0]);
|
|
7
|
+
const requiredNodeVersion = 16;
|
|
8
|
+
if (majorVersion < 16) {
|
|
9
|
+
throw new Error(`Remotion requires at least Node ${requiredNodeVersion}. You currently have ${process.version}. Update your node version to ${requiredNodeVersion} to use Remotion.`);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
exports.checkNodeVersionAndWarnAboutRosetta = checkNodeVersionAndWarnAboutRosetta;
|
|
@@ -38,8 +38,13 @@ exports.gLibCErrorMessage = gLibCErrorMessage;
|
|
|
38
38
|
const checkLibCRequirement = (logLevel, indent) => {
|
|
39
39
|
const { report } = process;
|
|
40
40
|
if (report) {
|
|
41
|
+
const rep = report.getReport();
|
|
42
|
+
if (typeof rep === 'string') {
|
|
43
|
+
logger_1.Log.warn({ logLevel, indent }, 'Bun limitation: process.report.getReport() ' + rep);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
41
46
|
// @ts-expect-error no types
|
|
42
|
-
const { glibcVersionRuntime } =
|
|
47
|
+
const { glibcVersionRuntime } = rep.header;
|
|
43
48
|
if (!glibcVersionRuntime) {
|
|
44
49
|
return;
|
|
45
50
|
}
|
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: "swangle" | "angle" | "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: "swangle" | "angle" | "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: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
|
|
480
480
|
};
|
|
481
481
|
enableLambdaInsights: {
|
|
482
482
|
name: string;
|
|
@@ -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: {
|
|
@@ -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: {
|
|
@@ -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;
|
|
@@ -9,6 +9,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
9
9
|
const logger_1 = require("../logger");
|
|
10
10
|
let warned = false;
|
|
11
11
|
function isMusl({ indent, logLevel, }) {
|
|
12
|
+
var _a;
|
|
12
13
|
// @ts-expect-error bun no types
|
|
13
14
|
if (!process.report && typeof Bun !== 'undefined') {
|
|
14
15
|
if (!warned) {
|
|
@@ -17,8 +18,16 @@ function isMusl({ indent, logLevel, }) {
|
|
|
17
18
|
warned = true;
|
|
18
19
|
return false;
|
|
19
20
|
}
|
|
21
|
+
const report = (_a = process.report) === null || _a === void 0 ? void 0 : _a.getReport();
|
|
22
|
+
if (report && typeof report === 'string') {
|
|
23
|
+
if (!warned) {
|
|
24
|
+
logger_1.Log.warn({ indent, logLevel }, 'Bun limitation: Could not determine if your Windows is using musl or glibc. Assuming glibc.');
|
|
25
|
+
}
|
|
26
|
+
warned = true;
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
20
29
|
// @ts-expect-error no types
|
|
21
|
-
const { glibcVersionRuntime } =
|
|
30
|
+
const { glibcVersionRuntime } = report.header;
|
|
22
31
|
return !glibcVersionRuntime;
|
|
23
32
|
}
|
|
24
33
|
exports.isMusl = isMusl;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Codec } from './codec';
|
|
2
|
+
import type { LogLevel } from './log-level';
|
|
3
|
+
import type { CancelSignal } from './make-cancel-signal';
|
|
4
|
+
export declare const createCombinedVideo: ({ addRemotionMetadata, binariesDirectory, cancelSignal, codec, filelistDir, files, fps, indent, logLevel, numberOfGifLoops, onProgress, output, seamless, }: {
|
|
5
|
+
fps: number;
|
|
6
|
+
codec: Codec;
|
|
7
|
+
filelistDir: string;
|
|
8
|
+
numberOfGifLoops: number | null;
|
|
9
|
+
output: string;
|
|
10
|
+
indent: boolean;
|
|
11
|
+
logLevel: LogLevel;
|
|
12
|
+
onProgress: (p: number) => void;
|
|
13
|
+
files: string[];
|
|
14
|
+
addRemotionMetadata: boolean;
|
|
15
|
+
binariesDirectory: string | null;
|
|
16
|
+
cancelSignal: CancelSignal | undefined;
|
|
17
|
+
seamless: boolean;
|
|
18
|
+
}) => Promise<string | undefined>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCombinedVideo = void 0;
|
|
4
|
+
const combine_video_streams_1 = require("./combine-video-streams");
|
|
5
|
+
const combine_video_streams_seamlessly_1 = require("./combine-video-streams-seamlessly");
|
|
6
|
+
const createCombinedVideo = async ({ addRemotionMetadata, binariesDirectory, cancelSignal, codec, filelistDir, files, fps, indent, logLevel, numberOfGifLoops, onProgress, output, seamless, }) => {
|
|
7
|
+
if (seamless) {
|
|
8
|
+
return (0, combine_video_streams_seamlessly_1.combineVideoStreamsSeamlessly)({
|
|
9
|
+
files,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
await (0, combine_video_streams_1.combineVideoStreams)({
|
|
13
|
+
addRemotionMetadata,
|
|
14
|
+
binariesDirectory,
|
|
15
|
+
cancelSignal,
|
|
16
|
+
codec,
|
|
17
|
+
filelistDir,
|
|
18
|
+
files,
|
|
19
|
+
fps,
|
|
20
|
+
indent,
|
|
21
|
+
logLevel,
|
|
22
|
+
numberOfGifLoops,
|
|
23
|
+
onProgress,
|
|
24
|
+
output,
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
exports.createCombinedVideo = createCombinedVideo;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.warnAboutM2Bug = void 0;
|
|
4
|
+
const node_os_1 = require("node:os");
|
|
5
|
+
const warnAboutM2Bug = (codec, pixelFormat) => {
|
|
6
|
+
const isM2 = (0, node_os_1.cpus)().find((c) => c.model.includes('Apple M2'));
|
|
7
|
+
if (codec === 'prores' && pixelFormat === 'yuv422p10le' && isM2) {
|
|
8
|
+
console.warn();
|
|
9
|
+
console.warn('⚠️ Known issue: Apple M2 CPUs currently suffer from a bug where transparent ProRes videos have flickering. https://github.com/remotion-dev/remotion/issues/1929');
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
exports.warnAboutM2Bug = warnAboutM2Bug;
|