@remotion/renderer 4.0.50 → 4.0.52
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/convert-assets-to-file-urls.d.ts +4 -1
- package/dist/assets/convert-assets-to-file-urls.js +3 -1
- package/dist/assets/download-and-map-assets-to-file.d.ts +7 -2
- package/dist/assets/download-and-map-assets-to-file.js +6 -2
- package/dist/assets/download-file.d.ts +3 -0
- package/dist/assets/download-file.js +2 -0
- package/dist/browser/BrowserFetcher.d.ts +5 -1
- package/dist/browser/BrowserFetcher.js +3 -1
- package/dist/client.d.ts +9 -2
- package/dist/client.js +2 -29
- package/dist/get-compositions.js +2 -1
- package/dist/get-local-browser-executable.d.ts +6 -1
- package/dist/get-local-browser-executable.js +2 -2
- package/dist/index.d.ts +46 -31
- package/dist/index.js +9 -7
- package/dist/is-audio-codec.d.ts +1 -1
- package/dist/offthread-video-server.js +1 -1
- package/dist/open-browser.d.ts +2 -2
- package/dist/open-browser.js +11 -11
- package/dist/options/gl.d.ts +12 -0
- package/dist/options/gl.js +36 -0
- package/dist/options/index.d.ts +122 -0
- package/dist/options/index.js +35 -0
- package/dist/provide-screenshot.d.ts +0 -1
- package/dist/puppeteer-screenshot.d.ts +0 -1
- package/dist/render-frames.d.ts +1 -0
- package/dist/render-frames.js +10 -3
- package/dist/render-media.js +5 -3
- package/dist/render-still.js +3 -1
- package/dist/screenshot-dom-element.d.ts +0 -1
- package/dist/screenshot-task.d.ts +0 -1
- package/dist/select-composition.js +2 -1
- package/dist/serve-static.js +6 -2
- package/dist/stitch-frames-to-video.d.ts +0 -1
- package/dist/stitch-frames-to-video.js +6 -5
- package/dist/take-frame-and-compose.d.ts +0 -1
- package/dist/test-gpu.d.ts +14 -0
- package/dist/test-gpu.js +40 -0
- package/dist/types.d.ts +1 -0
- package/package.json +9 -9
- package/dist/options/render-expiry-days.d.ts +0 -8
- package/dist/options/render-expiry-days.js +0 -14
- package/dist/presets-profile.d.ts +0 -7
- package/dist/presets-profile.js +0 -27
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { TRenderAsset } from 'remotion';
|
|
2
|
+
import type { LogLevel } from '../log-level';
|
|
2
3
|
import type { RenderMediaOnDownload } from './download-and-map-assets-to-file';
|
|
3
4
|
import type { DownloadMap } from './download-map';
|
|
4
|
-
export declare const convertAssetsToFileUrls: ({ assets, onDownload, downloadMap, }: {
|
|
5
|
+
export declare const convertAssetsToFileUrls: ({ assets, onDownload, downloadMap, indent, logLevel, }: {
|
|
5
6
|
assets: TRenderAsset[][];
|
|
6
7
|
onDownload: RenderMediaOnDownload;
|
|
7
8
|
downloadMap: DownloadMap;
|
|
9
|
+
indent: boolean;
|
|
10
|
+
logLevel: LogLevel;
|
|
8
11
|
}) => Promise<TRenderAsset[][]>;
|
|
@@ -9,7 +9,7 @@ const chunk = (input, size) => {
|
|
|
9
9
|
: [...arr.slice(0, -1), [...arr.slice(-1)[0], item]];
|
|
10
10
|
}, []);
|
|
11
11
|
};
|
|
12
|
-
const convertAssetsToFileUrls = async ({ assets, onDownload, downloadMap, }) => {
|
|
12
|
+
const convertAssetsToFileUrls = async ({ assets, onDownload, downloadMap, indent, logLevel, }) => {
|
|
13
13
|
const chunks = chunk(assets, 1000);
|
|
14
14
|
const results = [];
|
|
15
15
|
for (const ch of chunks) {
|
|
@@ -19,6 +19,8 @@ const convertAssetsToFileUrls = async ({ assets, onDownload, downloadMap, }) =>
|
|
|
19
19
|
renderAsset: a,
|
|
20
20
|
onDownload,
|
|
21
21
|
downloadMap,
|
|
22
|
+
indent,
|
|
23
|
+
logLevel,
|
|
22
24
|
});
|
|
23
25
|
}));
|
|
24
26
|
}));
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import type { TRenderAsset } from 'remotion';
|
|
2
|
+
import type { LogLevel } from '../log-level';
|
|
2
3
|
import type { DownloadMap } from './download-map';
|
|
3
4
|
export type RenderMediaOnDownload = (src: string) => ((progress: {
|
|
4
5
|
percent: number | null;
|
|
5
6
|
downloaded: number;
|
|
6
7
|
totalSize: number | null;
|
|
7
8
|
}) => void) | undefined | void;
|
|
8
|
-
export declare const downloadAsset: ({ src, downloadMap, }: {
|
|
9
|
+
export declare const downloadAsset: ({ src, downloadMap, indent, logLevel, }: {
|
|
9
10
|
src: string;
|
|
10
11
|
downloadMap: DownloadMap;
|
|
12
|
+
indent: boolean;
|
|
13
|
+
logLevel: LogLevel;
|
|
11
14
|
}) => Promise<string>;
|
|
12
15
|
export declare const markAllAssetsAsDownloaded: (downloadMap: DownloadMap) => void;
|
|
13
16
|
export declare const getSanitizedFilenameForAssetUrl: ({ src, downloadDir, contentDisposition, contentType, }: {
|
|
@@ -16,9 +19,11 @@ export declare const getSanitizedFilenameForAssetUrl: ({ src, downloadDir, conte
|
|
|
16
19
|
contentDisposition: string | null;
|
|
17
20
|
contentType: string | null;
|
|
18
21
|
}) => string;
|
|
19
|
-
export declare const downloadAndMapAssetsToFileUrl: ({ renderAsset, onDownload, downloadMap, }: {
|
|
22
|
+
export declare const downloadAndMapAssetsToFileUrl: ({ renderAsset, onDownload, downloadMap, logLevel, indent, }: {
|
|
20
23
|
renderAsset: TRenderAsset;
|
|
21
24
|
onDownload: RenderMediaOnDownload | null;
|
|
22
25
|
downloadMap: DownloadMap;
|
|
26
|
+
logLevel: LogLevel;
|
|
27
|
+
indent: boolean;
|
|
23
28
|
}) => Promise<TRenderAsset>;
|
|
24
29
|
export declare const attachDownloadListenerToEmitter: (downloadMap: DownloadMap, onDownload: RenderMediaOnDownload | null) => () => void;
|
|
@@ -115,7 +115,7 @@ function validateBufferEncoding(potentialEncoding, dataUrl) {
|
|
|
115
115
|
throw new TypeError(errMessage);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
const downloadAsset = async ({ src, downloadMap, }) => {
|
|
118
|
+
const downloadAsset = async ({ src, downloadMap, indent, logLevel, }) => {
|
|
119
119
|
var _a, _b, _c;
|
|
120
120
|
if ((0, compress_assets_1.isAssetCompressed)(src)) {
|
|
121
121
|
return src;
|
|
@@ -183,6 +183,8 @@ const downloadAsset = async ({ src, downloadMap, }) => {
|
|
|
183
183
|
src,
|
|
184
184
|
contentType,
|
|
185
185
|
}),
|
|
186
|
+
indent,
|
|
187
|
+
logLevel,
|
|
186
188
|
});
|
|
187
189
|
notifyAssetIsDownloaded({ src, downloadMap, downloadDir, to });
|
|
188
190
|
return to;
|
|
@@ -241,11 +243,13 @@ const getSanitizedFilenameForAssetUrl = ({ src, downloadDir, contentDisposition,
|
|
|
241
243
|
return node_path_1.default.join(downloadDir, (0, sanitize_filepath_1.sanitizeFilePath)(filename));
|
|
242
244
|
};
|
|
243
245
|
exports.getSanitizedFilenameForAssetUrl = getSanitizedFilenameForAssetUrl;
|
|
244
|
-
const downloadAndMapAssetsToFileUrl = async ({ renderAsset, onDownload, downloadMap, }) => {
|
|
246
|
+
const downloadAndMapAssetsToFileUrl = async ({ renderAsset, onDownload, downloadMap, logLevel, indent, }) => {
|
|
245
247
|
const cleanup = (0, exports.attachDownloadListenerToEmitter)(downloadMap, onDownload);
|
|
246
248
|
const newSrc = await (0, exports.downloadAsset)({
|
|
247
249
|
src: renderAsset.src,
|
|
248
250
|
downloadMap,
|
|
251
|
+
indent,
|
|
252
|
+
logLevel,
|
|
249
253
|
});
|
|
250
254
|
cleanup();
|
|
251
255
|
return {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LogLevel } from '../log-level';
|
|
1
2
|
type Response = {
|
|
2
3
|
sizeInBytes: number;
|
|
3
4
|
to: string;
|
|
@@ -10,6 +11,8 @@ type Options = {
|
|
|
10
11
|
downloaded: number;
|
|
11
12
|
totalSize: number | null;
|
|
12
13
|
}) => void) | undefined;
|
|
14
|
+
logLevel: LogLevel;
|
|
15
|
+
indent: boolean;
|
|
13
16
|
};
|
|
14
17
|
export declare const downloadFile: (options: Options, retries?: number, attempt?: number) => Promise<Response>;
|
|
15
18
|
export {};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.downloadFile = void 0;
|
|
4
4
|
const node_fs_1 = require("node:fs");
|
|
5
5
|
const ensure_output_directory_1 = require("../ensure-output-directory");
|
|
6
|
+
const logger_1 = require("../logger");
|
|
6
7
|
const read_file_1 = require("./read-file");
|
|
7
8
|
const incorrectContentLengthToken = 'Download finished with';
|
|
8
9
|
const downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
|
|
@@ -99,6 +100,7 @@ const downloadFile = async (options, retries = 2, attempt = 1) => {
|
|
|
99
100
|
if (retries === 0) {
|
|
100
101
|
throw err;
|
|
101
102
|
}
|
|
103
|
+
logger_1.Log.warnAdvanced({ indent: options.indent, logLevel: options.logLevel }, `Downloading ${options.url} failed (will retry): ${message}`);
|
|
102
104
|
const backoffInSeconds = (attempt + 1) ** 2;
|
|
103
105
|
await new Promise((resolve) => {
|
|
104
106
|
setTimeout(() => resolve(), backoffInSeconds * 1000);
|
|
@@ -13,12 +13,16 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { LogLevel } from '../log-level';
|
|
16
17
|
interface BrowserFetcherRevisionInfo {
|
|
17
18
|
folderPath: string;
|
|
18
19
|
executablePath: string;
|
|
19
20
|
url: string;
|
|
20
21
|
local: boolean;
|
|
21
22
|
}
|
|
22
|
-
export declare const downloadBrowser: (
|
|
23
|
+
export declare const downloadBrowser: (options: {
|
|
24
|
+
logLevel: LogLevel;
|
|
25
|
+
indent: boolean;
|
|
26
|
+
}) => Promise<BrowserFetcherRevisionInfo | undefined>;
|
|
23
27
|
export declare const getRevisionInfo: () => BrowserFetcherRevisionInfo;
|
|
24
28
|
export {};
|
|
@@ -89,7 +89,7 @@ const destination = '.thorium';
|
|
|
89
89
|
const getDownloadsFolder = () => {
|
|
90
90
|
return path.join((0, get_download_destination_1.getDownloadsCacheDir)(), destination);
|
|
91
91
|
};
|
|
92
|
-
const downloadBrowser = async () => {
|
|
92
|
+
const downloadBrowser = async (options) => {
|
|
93
93
|
const platform = getPlatform();
|
|
94
94
|
const downloadURL = getThoriumDownloadUrl(platform);
|
|
95
95
|
const fileName = downloadURL.split('/').pop();
|
|
@@ -123,6 +123,8 @@ const downloadBrowser = async () => {
|
|
|
123
123
|
logger_1.Log.info(`Downloading Thorium - ${toMegabytes(progress.downloaded)}/${toMegabytes(progress.totalSize)}`);
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
|
+
indent: options.indent,
|
|
127
|
+
logLevel: options.logLevel,
|
|
126
128
|
});
|
|
127
129
|
await install({ archivePath, folderPath: outputPath });
|
|
128
130
|
}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const BrowserSafeApis: {
|
|
3
2
|
getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "prores" | "aac" | "mp3" | "wav" | "h264-mkv" | "gif">(codec: T, audioCodec: "opus" | "aac" | "mp3" | "pcm-16" | null) => import("./file-extensions").FileExtension;
|
|
4
3
|
validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "gif"];
|
|
5
4
|
validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
|
|
6
5
|
getDefaultCrfForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "aac" | "mp3" | "wav" | "h264-mkv" | "gif") => number;
|
|
7
6
|
getValidCrfRanges: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "aac" | "mp3" | "wav" | "h264-mkv" | "gif") => [number, number];
|
|
8
|
-
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "aac" | "mp3" | "wav" | "h264-mkv" | "gif" | undefined) => boolean;
|
|
7
|
+
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "aac" | "mp3" | "wav" | "h264-mkv" | "gif" | null | undefined) => boolean;
|
|
9
8
|
proResProfileOptions: readonly ["4444-xq", "4444", "hq", "standard", "light", "proxy"];
|
|
10
9
|
x264PresetOptions: readonly ["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo"];
|
|
11
10
|
validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
@@ -307,6 +306,14 @@ export declare const BrowserSafeApis: {
|
|
|
307
306
|
docLink: string;
|
|
308
307
|
type: boolean;
|
|
309
308
|
};
|
|
309
|
+
glOption: {
|
|
310
|
+
cliFlag: string;
|
|
311
|
+
docLink: string;
|
|
312
|
+
name: string;
|
|
313
|
+
type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
|
|
314
|
+
ssrName: string;
|
|
315
|
+
description: () => JSX.Element;
|
|
316
|
+
};
|
|
310
317
|
};
|
|
311
318
|
validColorSpaces: readonly ["default", "bt709"];
|
|
312
319
|
optionsMap: {
|
package/dist/client.js
CHANGED
|
@@ -8,21 +8,9 @@ const crf_1 = require("./crf");
|
|
|
8
8
|
const file_extensions_1 = require("./file-extensions");
|
|
9
9
|
const get_extension_from_codec_1 = require("./get-extension-from-codec");
|
|
10
10
|
const is_audio_codec_1 = require("./is-audio-codec");
|
|
11
|
-
const
|
|
11
|
+
const options_1 = require("./options");
|
|
12
12
|
const color_space_1 = require("./options/color-space");
|
|
13
|
-
const crf_2 = require("./options/crf");
|
|
14
|
-
const delete_after_1 = require("./options/delete-after");
|
|
15
|
-
const enable_multiprocess_on_linux_1 = require("./options/enable-multiprocess-on-linux");
|
|
16
|
-
const enforce_audio_1 = require("./options/enforce-audio");
|
|
17
|
-
const folder_expiry_1 = require("./options/folder-expiry");
|
|
18
|
-
const jpeg_quality_1 = require("./options/jpeg-quality");
|
|
19
|
-
const mute_1 = require("./options/mute");
|
|
20
|
-
const offthreadvideo_cache_size_1 = require("./options/offthreadvideo-cache-size");
|
|
21
13
|
const options_map_1 = require("./options/options-map");
|
|
22
|
-
const scale_1 = require("./options/scale");
|
|
23
|
-
const video_bitrate_1 = require("./options/video-bitrate");
|
|
24
|
-
const video_codec_1 = require("./options/video-codec");
|
|
25
|
-
const webhook_custom_data_1 = require("./options/webhook-custom-data");
|
|
26
14
|
const pixel_format_1 = require("./pixel-format");
|
|
27
15
|
const prores_profile_1 = require("./prores-profile");
|
|
28
16
|
const validate_output_filename_1 = require("./validate-output-filename");
|
|
@@ -43,22 +31,7 @@ exports.BrowserSafeApis = {
|
|
|
43
31
|
defaultAudioCodecs: audio_codec_1.defaultAudioCodecs,
|
|
44
32
|
defaultCodecsForFileExtension: get_extension_from_codec_1.defaultCodecsForFileExtension,
|
|
45
33
|
validateOutputFilename: validate_output_filename_1.validateOutputFilename,
|
|
46
|
-
options:
|
|
47
|
-
scaleOption: scale_1.scaleOption,
|
|
48
|
-
crfOption: crf_2.crfOption,
|
|
49
|
-
jpegQualityOption: jpeg_quality_1.jpegQualityOption,
|
|
50
|
-
videoBitrate: video_bitrate_1.videoBitrate,
|
|
51
|
-
audioBitrateOption: audio_bitrate_1.audioBitrateOption,
|
|
52
|
-
enforceAudioOption: enforce_audio_1.enforceAudioOption,
|
|
53
|
-
muteOption: mute_1.muteOption,
|
|
54
|
-
videoCodecOption: video_codec_1.videoCodecOption,
|
|
55
|
-
offthreadVideoCacheSizeInBytesOption: offthreadvideo_cache_size_1.offthreadVideoCacheSizeInBytesOption,
|
|
56
|
-
webhookCustomDataOption: webhook_custom_data_1.webhookCustomDataOption,
|
|
57
|
-
colorSpaceOption: color_space_1.colorSpaceOption,
|
|
58
|
-
deleteAfterOption: delete_after_1.deleteAfterOption,
|
|
59
|
-
folderExpiryOption: folder_expiry_1.folderExpiryOption,
|
|
60
|
-
enableMultiprocessOnLinuxOption: enable_multiprocess_on_linux_1.enableMultiprocessOnLinuxOption,
|
|
61
|
-
},
|
|
34
|
+
options: options_1.allOptions,
|
|
62
35
|
validColorSpaces: color_space_1.validColorSpaces,
|
|
63
36
|
optionsMap: options_map_1.optionsMap,
|
|
64
37
|
codecSupportsCrf: codec_supports_media_1.codecSupportsCrf,
|
package/dist/get-compositions.js
CHANGED
|
@@ -59,7 +59,7 @@ const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCust
|
|
|
59
59
|
});
|
|
60
60
|
const res = result;
|
|
61
61
|
return res.map((r) => {
|
|
62
|
-
const { width, durationInFrames, fps, height, id } = r;
|
|
62
|
+
const { width, durationInFrames, fps, height, id, defaultCodec } = r;
|
|
63
63
|
return {
|
|
64
64
|
id,
|
|
65
65
|
width,
|
|
@@ -68,6 +68,7 @@ const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCust
|
|
|
68
68
|
durationInFrames,
|
|
69
69
|
props: remotion_1.Internals.deserializeJSONWithCustomFields(r.serializedResolvedPropsWithCustomSchema),
|
|
70
70
|
defaultProps: remotion_1.Internals.deserializeJSONWithCustomFields(r.serializedDefaultPropsWithCustomSchema),
|
|
71
|
+
defaultCodec,
|
|
71
72
|
};
|
|
72
73
|
});
|
|
73
74
|
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type { BrowserExecutable } from './browser-executable';
|
|
2
|
-
|
|
2
|
+
import type { LogLevel } from './log-level';
|
|
3
|
+
export declare const ensureLocalBrowser: ({ indent, logLevel, preferredBrowserExecutable, }: {
|
|
4
|
+
preferredBrowserExecutable: BrowserExecutable;
|
|
5
|
+
logLevel: LogLevel;
|
|
6
|
+
indent: boolean;
|
|
7
|
+
}) => Promise<void>;
|
|
3
8
|
export declare const getLocalBrowserExecutable: (preferredBrowserExecutable: BrowserExecutable) => string;
|
|
@@ -68,11 +68,11 @@ const getBrowserStatus = (browserExecutablePath) => {
|
|
|
68
68
|
}
|
|
69
69
|
return { type: 'no-browser' };
|
|
70
70
|
};
|
|
71
|
-
const ensureLocalBrowser = async (preferredBrowserExecutable) => {
|
|
71
|
+
const ensureLocalBrowser = async ({ indent, logLevel, preferredBrowserExecutable, }) => {
|
|
72
72
|
const status = getBrowserStatus(preferredBrowserExecutable);
|
|
73
73
|
if (status.type === 'no-browser') {
|
|
74
74
|
logger_1.Log.info('No local browser could be found. Downloading Thorium https://www.remotion.dev/docs/miscellaneous/thorium-browser');
|
|
75
|
-
await (0, BrowserFetcher_1.downloadBrowser)();
|
|
75
|
+
await (0, BrowserFetcher_1.downloadBrowser)({ indent, logLevel });
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
exports.ensureLocalBrowser = ensureLocalBrowser;
|
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export { CancelSignal, makeCancelSignal } from './make-cancel-signal';
|
|
|
25
25
|
export { openBrowser } from './open-browser';
|
|
26
26
|
export type { ChromiumOptions } from './open-browser';
|
|
27
27
|
export { ColorSpace } from './options/color-space';
|
|
28
|
+
export { OpenGlRenderer } from './options/gl';
|
|
28
29
|
export { AnyRemotionOption, RemotionOption, ToOptions } from './options/option';
|
|
29
30
|
export { PixelFormat } from './pixel-format';
|
|
30
31
|
export { RemotionServer } from './prepare-server';
|
|
@@ -36,11 +37,14 @@ export { selectComposition, SelectCompositionOptions, } from './select-compositi
|
|
|
36
37
|
export { stitchFramesToVideo, StitchFramesToVideoOptions, } from './stitch-frames-to-video';
|
|
37
38
|
export { SymbolicatedStackFrame } from './symbolicate-stacktrace';
|
|
38
39
|
export { OnStartData, RenderFramesOutput } from './types';
|
|
39
|
-
export { OpenGlRenderer } from './validate-opengl-renderer';
|
|
40
40
|
export { validateOutputFilename } from './validate-output-filename';
|
|
41
41
|
export { X264Preset } from './x264-preset';
|
|
42
42
|
export declare const RenderInternals: {
|
|
43
|
-
ensureLocalBrowser: (preferredBrowserExecutable:
|
|
43
|
+
ensureLocalBrowser: ({ indent, logLevel, preferredBrowserExecutable, }: {
|
|
44
|
+
preferredBrowserExecutable: import("./browser-executable").BrowserExecutable;
|
|
45
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
46
|
+
indent: boolean;
|
|
47
|
+
}) => Promise<void>;
|
|
44
48
|
getActualConcurrency: (userPreference: string | number | null) => number;
|
|
45
49
|
serveStatic: (path: string | null, options: {
|
|
46
50
|
port: number | null;
|
|
@@ -59,10 +63,10 @@ export declare const RenderInternals: {
|
|
|
59
63
|
width: number;
|
|
60
64
|
height: number;
|
|
61
65
|
scale: number;
|
|
62
|
-
codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
66
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "aac" | "mp3" | "wav" | "h264-mkv" | "gif";
|
|
63
67
|
wantsImageSequence: boolean;
|
|
64
68
|
}) => void;
|
|
65
|
-
getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
69
|
+
getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "prores" | "aac" | "mp3" | "wav" | "h264-mkv" | "gif">(codec: T, audioCodec: "opus" | "aac" | "mp3" | "pcm-16" | null) => import("./file-extensions").FileExtension;
|
|
66
70
|
tmpDir: (str: string) => string;
|
|
67
71
|
deleteDirectory: (directory: string) => void;
|
|
68
72
|
isServeUrl: (potentialUrl: string) => boolean;
|
|
@@ -77,6 +81,8 @@ export declare const RenderInternals: {
|
|
|
77
81
|
downloaded: number;
|
|
78
82
|
totalSize: number | null;
|
|
79
83
|
}) => void) | undefined;
|
|
84
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
85
|
+
indent: boolean;
|
|
80
86
|
}, retries?: number, attempt?: number) => Promise<{
|
|
81
87
|
sizeInBytes: number;
|
|
82
88
|
to: string;
|
|
@@ -117,7 +123,7 @@ export declare const RenderInternals: {
|
|
|
117
123
|
};
|
|
118
124
|
registerErrorSymbolicationLock: () => number;
|
|
119
125
|
unlockErrorSymbolicationLock: (id: number) => void;
|
|
120
|
-
canUseParallelEncoding: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
126
|
+
canUseParallelEncoding: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "aac" | "mp3" | "wav" | "h264-mkv" | "gif") => boolean;
|
|
121
127
|
mimeContentType: typeof mimeContentType;
|
|
122
128
|
mimeLookup: typeof mimeLookup;
|
|
123
129
|
validateConcurrency: ({ setting, value, checkIfValidForCurrentMachine, }: {
|
|
@@ -128,14 +134,14 @@ export declare const RenderInternals: {
|
|
|
128
134
|
validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
129
135
|
DEFAULT_BROWSER: "chrome";
|
|
130
136
|
validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
|
|
131
|
-
DEFAULT_OPENGL_RENDERER: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | null;
|
|
132
|
-
validateOpenGlRenderer: (option: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | null) => "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | null;
|
|
137
|
+
DEFAULT_OPENGL_RENDERER: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
138
|
+
validateOpenGlRenderer: (option: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
133
139
|
validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "gif"];
|
|
134
140
|
DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
135
141
|
validateJpegQuality: (q: number | undefined) => void;
|
|
136
142
|
DEFAULT_TIMEOUT: number;
|
|
137
|
-
DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "
|
|
138
|
-
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
143
|
+
DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "prores" | "aac" | "mp3" | "wav" | "h264-mkv" | "gif";
|
|
144
|
+
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "aac" | "mp3" | "wav" | "h264-mkv" | "gif" | null | undefined) => boolean;
|
|
139
145
|
logLevels: readonly ["verbose", "info", "warn", "error"];
|
|
140
146
|
isEqualOrBelowLogLevel: (currentLevel: "verbose" | "info" | "warn" | "error", level: "verbose" | "info" | "warn" | "error") => boolean;
|
|
141
147
|
isValidLogLevel: (level: string) => boolean;
|
|
@@ -152,28 +158,28 @@ export declare const RenderInternals: {
|
|
|
152
158
|
output: string;
|
|
153
159
|
onProgress: (p: number) => void;
|
|
154
160
|
numberOfFrames: number;
|
|
155
|
-
codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
161
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "aac" | "mp3" | "wav" | "h264-mkv" | "gif";
|
|
156
162
|
fps: number;
|
|
157
163
|
numberOfGifLoops: number | null;
|
|
158
|
-
audioCodec: "
|
|
164
|
+
audioCodec: "opus" | "aac" | "mp3" | "pcm-16" | null;
|
|
159
165
|
audioBitrate: string | null;
|
|
160
166
|
}) => Promise<void>;
|
|
161
167
|
getMinConcurrency: () => number;
|
|
162
168
|
getMaxConcurrency: () => number;
|
|
163
169
|
getDefaultAudioCodec: ({ codec, preferLossless, }: {
|
|
164
|
-
codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
170
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "prores" | "aac" | "mp3" | "wav" | "h264-mkv" | "gif";
|
|
165
171
|
preferLossless: boolean;
|
|
166
|
-
}) => "
|
|
172
|
+
}) => "opus" | "aac" | "mp3" | "pcm-16" | null;
|
|
167
173
|
validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
|
|
168
174
|
defaultFileExtensionMap: {
|
|
169
175
|
h264: {
|
|
170
176
|
default: import("./file-extensions").FileExtension;
|
|
171
177
|
forAudioCodec: {
|
|
172
|
-
|
|
178
|
+
aac: {
|
|
173
179
|
possible: import("./file-extensions").FileExtension[];
|
|
174
180
|
default: import("./file-extensions").FileExtension;
|
|
175
181
|
};
|
|
176
|
-
|
|
182
|
+
mp3: {
|
|
177
183
|
possible: import("./file-extensions").FileExtension[];
|
|
178
184
|
default: import("./file-extensions").FileExtension;
|
|
179
185
|
};
|
|
@@ -199,11 +205,11 @@ export declare const RenderInternals: {
|
|
|
199
205
|
vp8: {
|
|
200
206
|
default: import("./file-extensions").FileExtension;
|
|
201
207
|
forAudioCodec: {
|
|
202
|
-
|
|
208
|
+
opus: {
|
|
203
209
|
possible: import("./file-extensions").FileExtension[];
|
|
204
210
|
default: import("./file-extensions").FileExtension;
|
|
205
211
|
};
|
|
206
|
-
|
|
212
|
+
"pcm-16": {
|
|
207
213
|
possible: import("./file-extensions").FileExtension[];
|
|
208
214
|
default: import("./file-extensions").FileExtension;
|
|
209
215
|
};
|
|
@@ -212,20 +218,20 @@ export declare const RenderInternals: {
|
|
|
212
218
|
vp9: {
|
|
213
219
|
default: import("./file-extensions").FileExtension;
|
|
214
220
|
forAudioCodec: {
|
|
215
|
-
|
|
221
|
+
opus: {
|
|
216
222
|
possible: import("./file-extensions").FileExtension[];
|
|
217
223
|
default: import("./file-extensions").FileExtension;
|
|
218
224
|
};
|
|
219
|
-
|
|
225
|
+
"pcm-16": {
|
|
220
226
|
possible: import("./file-extensions").FileExtension[];
|
|
221
227
|
default: import("./file-extensions").FileExtension;
|
|
222
228
|
};
|
|
223
229
|
};
|
|
224
230
|
};
|
|
225
|
-
|
|
231
|
+
prores: {
|
|
226
232
|
default: import("./file-extensions").FileExtension;
|
|
227
233
|
forAudioCodec: {
|
|
228
|
-
|
|
234
|
+
aac: {
|
|
229
235
|
possible: import("./file-extensions").FileExtension[];
|
|
230
236
|
default: import("./file-extensions").FileExtension;
|
|
231
237
|
};
|
|
@@ -248,22 +254,22 @@ export declare const RenderInternals: {
|
|
|
248
254
|
};
|
|
249
255
|
};
|
|
250
256
|
};
|
|
251
|
-
|
|
257
|
+
mp3: {
|
|
252
258
|
default: import("./file-extensions").FileExtension;
|
|
253
259
|
forAudioCodec: {
|
|
260
|
+
mp3: {
|
|
261
|
+
possible: import("./file-extensions").FileExtension[];
|
|
262
|
+
default: import("./file-extensions").FileExtension;
|
|
263
|
+
};
|
|
254
264
|
"pcm-16": {
|
|
255
265
|
possible: import("./file-extensions").FileExtension[];
|
|
256
266
|
default: import("./file-extensions").FileExtension;
|
|
257
267
|
};
|
|
258
268
|
};
|
|
259
269
|
};
|
|
260
|
-
|
|
270
|
+
wav: {
|
|
261
271
|
default: import("./file-extensions").FileExtension;
|
|
262
272
|
forAudioCodec: {
|
|
263
|
-
aac: {
|
|
264
|
-
possible: import("./file-extensions").FileExtension[];
|
|
265
|
-
default: import("./file-extensions").FileExtension;
|
|
266
|
-
};
|
|
267
273
|
"pcm-16": {
|
|
268
274
|
possible: import("./file-extensions").FileExtension[];
|
|
269
275
|
default: import("./file-extensions").FileExtension;
|
|
@@ -300,8 +306,8 @@ export declare const RenderInternals: {
|
|
|
300
306
|
readonly vp9: readonly ["opus", "pcm-16"];
|
|
301
307
|
readonly wav: readonly ["pcm-16"];
|
|
302
308
|
};
|
|
303
|
-
makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "
|
|
304
|
-
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "
|
|
309
|
+
makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "prores" | "aac" | "mp3" | "wav" | "h264-mkv" | "gif")[]>;
|
|
310
|
+
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "prores" | "aac" | "mp3" | "wav" | "h264-mkv" | "gif">;
|
|
305
311
|
getExecutablePath: (type: "compositor" | "ffmpeg" | "ffprobe" | "ffmpeg-cwd") => string;
|
|
306
312
|
callFf: (bin: "ffmpeg" | "ffprobe", args: (string | null)[], options?: execa.Options<string> | undefined) => execa.ExecaChildProcess<string>;
|
|
307
313
|
dynamicLibraryPathOptions: () => {
|
|
@@ -319,7 +325,7 @@ export declare const RenderInternals: {
|
|
|
319
325
|
validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
|
|
320
326
|
validVideoImageFormats: readonly ["png", "jpeg", "none"];
|
|
321
327
|
DEFAULT_STILL_IMAGE_FORMAT: "png" | "jpeg" | "pdf" | "webp";
|
|
322
|
-
DEFAULT_VIDEO_IMAGE_FORMAT: "
|
|
328
|
+
DEFAULT_VIDEO_IMAGE_FORMAT: "none" | "png" | "jpeg";
|
|
323
329
|
DEFAULT_JPEG_QUALITY: number;
|
|
324
330
|
chalk: {
|
|
325
331
|
enabled: () => boolean;
|
|
@@ -520,7 +526,16 @@ export declare const RenderInternals: {
|
|
|
520
526
|
buffer: Buffer | null;
|
|
521
527
|
slowestFrames: import("./render-media").SlowFrame[];
|
|
522
528
|
}>;
|
|
523
|
-
validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader", "vulkan"];
|
|
529
|
+
validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader", "vulkan", "angle-egl"];
|
|
524
530
|
copyImageToClipboard: (src: string, logLevel: "verbose" | "info" | "warn" | "error") => Promise<void>;
|
|
525
531
|
isIpV6Supported: () => boolean;
|
|
532
|
+
getChromiumGpuInformation: ({ browserExecutable, indent, logLevel, chromiumOptions, }: {
|
|
533
|
+
browserExecutable: import("./browser-executable").BrowserExecutable;
|
|
534
|
+
indent: boolean;
|
|
535
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
536
|
+
chromiumOptions: import("./open-browser").ChromiumOptions;
|
|
537
|
+
}) => Promise<{
|
|
538
|
+
feature: string;
|
|
539
|
+
status: string;
|
|
540
|
+
}[]>;
|
|
526
541
|
};
|
package/dist/index.js
CHANGED
|
@@ -67,6 +67,7 @@ const log_level_1 = require("./log-level");
|
|
|
67
67
|
const logger_1 = require("./logger");
|
|
68
68
|
const mime_types_1 = require("./mime-types");
|
|
69
69
|
const open_browser_1 = require("./open-browser");
|
|
70
|
+
const gl_1 = require("./options/gl");
|
|
70
71
|
const parse_browser_error_stack_1 = require("./parse-browser-error-stack");
|
|
71
72
|
const perf = __importStar(require("./perf"));
|
|
72
73
|
const pixel_format_1 = require("./pixel-format");
|
|
@@ -77,13 +78,10 @@ const render_still_1 = require("./render-still");
|
|
|
77
78
|
const select_composition_1 = require("./select-composition");
|
|
78
79
|
const is_path_inside_1 = require("./serve-handler/is-path-inside");
|
|
79
80
|
const serve_static_1 = require("./serve-static");
|
|
81
|
+
const test_gpu_1 = require("./test-gpu");
|
|
80
82
|
const tmp_dir_1 = require("./tmp-dir");
|
|
81
83
|
const validate_concurrency_1 = require("./validate-concurrency");
|
|
82
84
|
const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
|
|
83
|
-
const validate_opengl_renderer_1 = require("./validate-opengl-renderer");
|
|
84
|
-
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
85
|
-
const validate_videobitrate_1 = require("./validate-videobitrate");
|
|
86
|
-
const wait_for_symbolication_error_to_be_done_1 = require("./wait-for-symbolication-error-to-be-done");
|
|
87
85
|
var handle_javascript_exception_1 = require("./error-handling/handle-javascript-exception");
|
|
88
86
|
Object.defineProperty(exports, "ErrorWithStackFrame", { enumerable: true, get: function () { return handle_javascript_exception_1.ErrorWithStackFrame; } });
|
|
89
87
|
var extract_audio_1 = require("./extract-audio");
|
|
@@ -112,6 +110,9 @@ var stitch_frames_to_video_1 = require("./stitch-frames-to-video");
|
|
|
112
110
|
Object.defineProperty(exports, "stitchFramesToVideo", { enumerable: true, get: function () { return stitch_frames_to_video_1.stitchFramesToVideo; } });
|
|
113
111
|
var validate_output_filename_1 = require("./validate-output-filename");
|
|
114
112
|
Object.defineProperty(exports, "validateOutputFilename", { enumerable: true, get: function () { return validate_output_filename_1.validateOutputFilename; } });
|
|
113
|
+
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
114
|
+
const validate_videobitrate_1 = require("./validate-videobitrate");
|
|
115
|
+
const wait_for_symbolication_error_to_be_done_1 = require("./wait-for-symbolication-error-to-be-done");
|
|
115
116
|
exports.RenderInternals = {
|
|
116
117
|
ensureLocalBrowser: get_local_browser_executable_1.ensureLocalBrowser,
|
|
117
118
|
getActualConcurrency: get_concurrency_1.getActualConcurrency,
|
|
@@ -143,8 +144,8 @@ exports.RenderInternals = {
|
|
|
143
144
|
validPixelFormats: pixel_format_1.validPixelFormats,
|
|
144
145
|
DEFAULT_BROWSER: browser_1.DEFAULT_BROWSER,
|
|
145
146
|
validateFrameRange: frame_range_1.validateFrameRange,
|
|
146
|
-
DEFAULT_OPENGL_RENDERER:
|
|
147
|
-
validateOpenGlRenderer:
|
|
147
|
+
DEFAULT_OPENGL_RENDERER: gl_1.DEFAULT_OPENGL_RENDERER,
|
|
148
|
+
validateOpenGlRenderer: gl_1.validateOpenGlRenderer,
|
|
148
149
|
validCodecs: codec_1.validCodecs,
|
|
149
150
|
DEFAULT_PIXEL_FORMAT: pixel_format_1.DEFAULT_PIXEL_FORMAT,
|
|
150
151
|
validateJpegQuality: jpeg_quality_1.validateJpegQuality,
|
|
@@ -190,9 +191,10 @@ exports.RenderInternals = {
|
|
|
190
191
|
internalGetCompositions: get_compositions_1.internalGetCompositions,
|
|
191
192
|
internalRenderFrames: render_frames_1.internalRenderFrames,
|
|
192
193
|
internalRenderMedia: render_media_1.internalRenderMedia,
|
|
193
|
-
validOpenGlRenderers:
|
|
194
|
+
validOpenGlRenderers: gl_1.validOpenGlRenderers,
|
|
194
195
|
copyImageToClipboard: copy_to_clipboard_1.copyImageToClipboard,
|
|
195
196
|
isIpV6Supported: is_ipv6_supported_1.isIpV6Supported,
|
|
197
|
+
getChromiumGpuInformation: test_gpu_1.getChromiumGpuInformation,
|
|
196
198
|
};
|
|
197
199
|
// Warn of potential performance issues with Apple Silicon (M1 chip under Rosetta)
|
|
198
200
|
(0, check_apple_silicon_1.checkNodeVersionAndWarnAboutRosetta)();
|
package/dist/is-audio-codec.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Codec } from './codec';
|
|
2
|
-
export declare const isAudioCodec: (codec: Codec | undefined) => boolean;
|
|
2
|
+
export declare const isAudioCodec: (codec: Codec | undefined | null) => boolean;
|
|
@@ -88,7 +88,7 @@ const startOffthreadVideoServer = ({ downloadMap, concurrency, logLevel, indent,
|
|
|
88
88
|
closed = true;
|
|
89
89
|
});
|
|
90
90
|
let extractStart = Date.now();
|
|
91
|
-
(0, download_and_map_assets_to_file_1.downloadAsset)({ src, downloadMap })
|
|
91
|
+
(0, download_and_map_assets_to_file_1.downloadAsset)({ src, downloadMap, indent, logLevel })
|
|
92
92
|
.then((to) => {
|
|
93
93
|
return new Promise((resolve, reject) => {
|
|
94
94
|
if (closed) {
|
package/dist/open-browser.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { Browser } from './browser';
|
|
|
2
2
|
import type { HeadlessBrowser } from './browser/Browser';
|
|
3
3
|
import type { Viewport } from './browser/PuppeteerViewport';
|
|
4
4
|
import { type LogLevel } from './log-level';
|
|
5
|
-
|
|
6
|
-
type OpenGlRenderer = (typeof
|
|
5
|
+
import type { validOpenGlRenderers } from './options/gl';
|
|
6
|
+
type OpenGlRenderer = (typeof validOpenGlRenderers)[number];
|
|
7
7
|
export type ChromiumOptions = {
|
|
8
8
|
ignoreCertificateErrors?: boolean;
|
|
9
9
|
disableWebSecurity?: boolean;
|
package/dist/open-browser.js
CHANGED
|
@@ -5,20 +5,16 @@ const node_1 = require("./browser/node");
|
|
|
5
5
|
const get_local_browser_executable_1 = require("./get-local-browser-executable");
|
|
6
6
|
const get_video_threads_flag_1 = require("./get-video-threads-flag");
|
|
7
7
|
const log_level_1 = require("./log-level");
|
|
8
|
-
const
|
|
9
|
-
const validRenderers = [
|
|
10
|
-
'swangle',
|
|
11
|
-
'angle',
|
|
12
|
-
'egl',
|
|
13
|
-
'swiftshader',
|
|
14
|
-
'vulkan',
|
|
15
|
-
];
|
|
8
|
+
const gl_1 = require("./options/gl");
|
|
16
9
|
const getOpenGlRenderer = (option) => {
|
|
17
|
-
const renderer = option !== null && option !== void 0 ? option :
|
|
18
|
-
(0,
|
|
10
|
+
const renderer = option !== null && option !== void 0 ? option : gl_1.DEFAULT_OPENGL_RENDERER;
|
|
11
|
+
(0, gl_1.validateOpenGlRenderer)(renderer);
|
|
19
12
|
if (renderer === 'swangle') {
|
|
20
13
|
return [`--use-gl=angle`, `--use-angle=swiftshader`];
|
|
21
14
|
}
|
|
15
|
+
if (renderer === 'angle-egl') {
|
|
16
|
+
return [`--use-gl=angle`, `--use-angle=gl-egl`];
|
|
17
|
+
}
|
|
22
18
|
if (renderer === 'vulkan') {
|
|
23
19
|
return [
|
|
24
20
|
'--use-angle=vulkan',
|
|
@@ -49,7 +45,11 @@ const internalOpenBrowser = async ({ browser, browserExecutable, chromiumOptions
|
|
|
49
45
|
if (browser === 'firefox') {
|
|
50
46
|
throw new TypeError('Firefox supported is not yet turned on. Stay tuned for the future.');
|
|
51
47
|
}
|
|
52
|
-
await (0, get_local_browser_executable_1.ensureLocalBrowser)(
|
|
48
|
+
await (0, get_local_browser_executable_1.ensureLocalBrowser)({
|
|
49
|
+
preferredBrowserExecutable: browserExecutable,
|
|
50
|
+
logLevel,
|
|
51
|
+
indent,
|
|
52
|
+
});
|
|
53
53
|
const executablePath = (0, get_local_browser_executable_1.getLocalBrowserExecutable)(browserExecutable);
|
|
54
54
|
const customGlRenderer = getOpenGlRenderer((_a = chromiumOptions.gl) !== null && _a !== void 0 ? _a : null);
|
|
55
55
|
const browserInstance = await node_1.puppeteer.launch({
|