@remotion/renderer 4.0.179 → 4.0.180
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 +2 -1
- package/dist/assets/convert-assets-to-file-urls.js +4 -1
- package/dist/assets/download-and-map-assets-to-file.d.ts +9 -2
- package/dist/assets/download-and-map-assets-to-file.js +16 -2
- package/dist/assets/get-audio-channels.js +23 -15
- package/dist/browser/should-log-message.js +3 -0
- package/dist/client.d.ts +70 -70
- package/dist/compositor/compositor.js +1 -1
- package/dist/create-audio.js +1 -0
- package/dist/create-ffmpeg-complex-filter.d.ts +1 -4
- package/dist/get-concurrency.d.ts +1 -1
- package/dist/get-concurrency.js +3 -3
- package/dist/get-extension-from-codec.d.ts +2 -2
- package/dist/goto-page-or-throw.d.ts +3 -0
- package/dist/goto-page-or-throw.js +16 -0
- package/dist/index.d.ts +40 -40
- package/dist/index.js +1 -1
- package/dist/offthread-video-server.js +9 -1
- package/dist/options/audio-codec.d.ts +5 -5
- package/dist/options/color-space.d.ts +3 -3
- package/dist/options/gl.d.ts +3 -3
- package/dist/options/index.d.ts +14 -14
- package/dist/options/options-map.d.ts +17 -17
- package/dist/options/video-codec.d.ts +1 -1
- package/dist/pixel-format.d.ts +1 -1
- package/dist/port-config.d.ts +1 -1
- package/dist/pure.d.ts +3 -3
- package/dist/render-frames.js +11 -7
- package/dist/render-media.js +3 -3
- package/dist/set-props-and-env.js +10 -5
- package/dist/types.d.ts +1 -0
- package/dist/validate-output-filename.d.ts +1 -1
- package/package.json +10 -10
|
@@ -3,10 +3,11 @@ import type { LogLevel } from '../log-level';
|
|
|
3
3
|
import type { FrameAndAssets } from '../render-frames';
|
|
4
4
|
import type { RenderMediaOnDownload } from './download-and-map-assets-to-file';
|
|
5
5
|
import type { DownloadMap } from './download-map';
|
|
6
|
-
export declare const convertAssetsToFileUrls: ({ assets, onDownload, downloadMap, indent, logLevel, }: {
|
|
6
|
+
export declare const convertAssetsToFileUrls: ({ assets, onDownload, downloadMap, indent, logLevel, binariesDirectory, }: {
|
|
7
7
|
assets: FrameAndAssets[];
|
|
8
8
|
onDownload: RenderMediaOnDownload;
|
|
9
9
|
downloadMap: DownloadMap;
|
|
10
10
|
indent: boolean;
|
|
11
11
|
logLevel: LogLevel;
|
|
12
|
+
binariesDirectory: string | null;
|
|
12
13
|
}) => Promise<AudioOrVideoAsset[][]>;
|
|
@@ -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, indent, logLevel, }) => {
|
|
12
|
+
const convertAssetsToFileUrls = async ({ assets, onDownload, downloadMap, indent, logLevel, binariesDirectory, }) => {
|
|
13
13
|
const chunks = chunk(assets, 1000);
|
|
14
14
|
const results = [];
|
|
15
15
|
for (const ch of chunks) {
|
|
@@ -21,6 +21,9 @@ const convertAssetsToFileUrls = async ({ assets, onDownload, downloadMap, indent
|
|
|
21
21
|
downloadMap,
|
|
22
22
|
indent,
|
|
23
23
|
logLevel,
|
|
24
|
+
binariesDirectory,
|
|
25
|
+
cancelSignalForAudioAnalysis: undefined,
|
|
26
|
+
shouldAnalyzeAudioImmediately: true,
|
|
24
27
|
});
|
|
25
28
|
});
|
|
26
29
|
return Promise.all(frameAssetPromises);
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import type { AudioOrVideoAsset } from 'remotion/no-react';
|
|
2
2
|
import type { LogLevel } from '../log-level';
|
|
3
|
+
import type { CancelSignal } from '../make-cancel-signal';
|
|
3
4
|
import type { DownloadMap } from './download-map';
|
|
4
5
|
export type RenderMediaOnDownload = (src: string) => ((progress: {
|
|
5
6
|
percent: number | null;
|
|
6
7
|
downloaded: number;
|
|
7
8
|
totalSize: number | null;
|
|
8
9
|
}) => void) | undefined | void;
|
|
9
|
-
export declare const downloadAsset: ({ src, downloadMap, indent, logLevel, }: {
|
|
10
|
+
export declare const downloadAsset: ({ src, downloadMap, indent, logLevel, shouldAnalyzeAudioImmediately, binariesDirectory, cancelSignalForAudioAnalysis, }: {
|
|
10
11
|
src: string;
|
|
11
12
|
downloadMap: DownloadMap;
|
|
12
13
|
indent: boolean;
|
|
13
14
|
logLevel: LogLevel;
|
|
15
|
+
shouldAnalyzeAudioImmediately: boolean;
|
|
16
|
+
binariesDirectory: string | null;
|
|
17
|
+
cancelSignalForAudioAnalysis: CancelSignal | undefined;
|
|
14
18
|
}) => Promise<string>;
|
|
15
19
|
export declare const markAllAssetsAsDownloaded: (downloadMap: DownloadMap) => void;
|
|
16
20
|
export declare const getSanitizedFilenameForAssetUrl: ({ src, downloadDir, contentDisposition, contentType, }: {
|
|
@@ -19,11 +23,14 @@ export declare const getSanitizedFilenameForAssetUrl: ({ src, downloadDir, conte
|
|
|
19
23
|
contentDisposition: string | null;
|
|
20
24
|
contentType: string | null;
|
|
21
25
|
}) => string;
|
|
22
|
-
export declare const downloadAndMapAssetsToFileUrl: ({ renderAsset, onDownload, downloadMap, logLevel, indent, }: {
|
|
26
|
+
export declare const downloadAndMapAssetsToFileUrl: ({ renderAsset, onDownload, downloadMap, logLevel, indent, binariesDirectory, cancelSignalForAudioAnalysis, shouldAnalyzeAudioImmediately, }: {
|
|
23
27
|
renderAsset: AudioOrVideoAsset;
|
|
24
28
|
onDownload: RenderMediaOnDownload | null;
|
|
25
29
|
downloadMap: DownloadMap;
|
|
26
30
|
logLevel: LogLevel;
|
|
27
31
|
indent: boolean;
|
|
32
|
+
shouldAnalyzeAudioImmediately: boolean;
|
|
33
|
+
binariesDirectory: string | null;
|
|
34
|
+
cancelSignalForAudioAnalysis: CancelSignal | undefined;
|
|
28
35
|
}) => Promise<AudioOrVideoAsset>;
|
|
29
36
|
export declare const attachDownloadListenerToEmitter: (downloadMap: DownloadMap, onDownload: RenderMediaOnDownload | null) => () => void;
|
|
@@ -34,6 +34,7 @@ const compress_assets_1 = require("../compress-assets");
|
|
|
34
34
|
const ensure_output_directory_1 = require("../ensure-output-directory");
|
|
35
35
|
const mime_types_1 = require("../mime-types");
|
|
36
36
|
const download_file_1 = require("./download-file");
|
|
37
|
+
const get_audio_channels_1 = require("./get-audio-channels");
|
|
37
38
|
const sanitize_filepath_1 = require("./sanitize-filepath");
|
|
38
39
|
const waitForAssetToBeDownloaded = ({ src, downloadDir, downloadMap, }) => {
|
|
39
40
|
var _a, _b;
|
|
@@ -112,7 +113,7 @@ function validateBufferEncoding(potentialEncoding, dataUrl) {
|
|
|
112
113
|
throw new TypeError(errMessage);
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
|
-
const downloadAsset = async ({ src, downloadMap, indent, logLevel, }) => {
|
|
116
|
+
const downloadAsset = async ({ src, downloadMap, indent, logLevel, shouldAnalyzeAudioImmediately, binariesDirectory, cancelSignalForAudioAnalysis, }) => {
|
|
116
117
|
var _a, _b, _c;
|
|
117
118
|
if ((0, compress_assets_1.isAssetCompressed)(src)) {
|
|
118
119
|
return src;
|
|
@@ -181,6 +182,16 @@ const downloadAsset = async ({ src, downloadMap, indent, logLevel, }) => {
|
|
|
181
182
|
logLevel,
|
|
182
183
|
});
|
|
183
184
|
notifyAssetIsDownloaded({ src, downloadMap, downloadDir, to });
|
|
185
|
+
if (shouldAnalyzeAudioImmediately) {
|
|
186
|
+
await (0, get_audio_channels_1.getAudioChannelsAndDuration)({
|
|
187
|
+
binariesDirectory,
|
|
188
|
+
downloadMap,
|
|
189
|
+
src: to,
|
|
190
|
+
indent,
|
|
191
|
+
logLevel,
|
|
192
|
+
cancelSignal: cancelSignalForAudioAnalysis,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
184
195
|
return to;
|
|
185
196
|
};
|
|
186
197
|
exports.downloadAsset = downloadAsset;
|
|
@@ -237,13 +248,16 @@ const getSanitizedFilenameForAssetUrl = ({ src, downloadDir, contentDisposition,
|
|
|
237
248
|
return node_path_1.default.join(downloadDir, (0, sanitize_filepath_1.sanitizeFilePath)(filename));
|
|
238
249
|
};
|
|
239
250
|
exports.getSanitizedFilenameForAssetUrl = getSanitizedFilenameForAssetUrl;
|
|
240
|
-
const downloadAndMapAssetsToFileUrl = async ({ renderAsset, onDownload, downloadMap, logLevel, indent, }) => {
|
|
251
|
+
const downloadAndMapAssetsToFileUrl = async ({ renderAsset, onDownload, downloadMap, logLevel, indent, binariesDirectory, cancelSignalForAudioAnalysis, shouldAnalyzeAudioImmediately, }) => {
|
|
241
252
|
const cleanup = (0, exports.attachDownloadListenerToEmitter)(downloadMap, onDownload);
|
|
242
253
|
const newSrc = await (0, exports.downloadAsset)({
|
|
243
254
|
src: renderAsset.src,
|
|
244
255
|
downloadMap,
|
|
245
256
|
indent,
|
|
246
257
|
logLevel,
|
|
258
|
+
shouldAnalyzeAudioImmediately,
|
|
259
|
+
binariesDirectory,
|
|
260
|
+
cancelSignalForAudioAnalysis,
|
|
247
261
|
});
|
|
248
262
|
cleanup();
|
|
249
263
|
return {
|
|
@@ -13,21 +13,29 @@ const getAudioChannelsAndDurationWithoutCache = async ({ src, indent, logLevel,
|
|
|
13
13
|
]
|
|
14
14
|
.reduce((acc, val) => acc.concat(val), [])
|
|
15
15
|
.filter(Boolean);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
try {
|
|
17
|
+
const task = await (0, call_ffmpeg_1.callFf)({
|
|
18
|
+
bin: 'ffprobe',
|
|
19
|
+
args,
|
|
20
|
+
indent,
|
|
21
|
+
logLevel,
|
|
22
|
+
binariesDirectory,
|
|
23
|
+
cancelSignal,
|
|
24
|
+
});
|
|
25
|
+
const channels = task.stdout.match(/channels=([0-9]+)/);
|
|
26
|
+
const duration = task.stdout.match(/duration=([0-9.]+)/);
|
|
27
|
+
const result = {
|
|
28
|
+
channels: channels ? parseInt(channels[1], 10) : 0,
|
|
29
|
+
duration: duration ? parseFloat(duration[1]) : null,
|
|
30
|
+
};
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
if (err.message.includes('This file cannot be read by `ffprobe`. Is it a valid multimedia file?')) {
|
|
35
|
+
throw new Error('This file cannot be read by `ffprobe`. Is it a valid multimedia file?');
|
|
36
|
+
}
|
|
37
|
+
throw err;
|
|
38
|
+
}
|
|
31
39
|
};
|
|
32
40
|
exports.getAudioChannelsAndDurationWithoutCache = getAudioChannelsAndDurationWithoutCache;
|
|
33
41
|
async function getAudioChannelsAndDurationUnlimited({ downloadMap, src, indent, logLevel, binariesDirectory, cancelSignal, }) {
|
|
@@ -27,6 +27,9 @@ const shouldLogBrowserMessage = (message) => {
|
|
|
27
27
|
if (message.includes('AttributionReportingCrossAppWeb cannot be enabled in this configuration')) {
|
|
28
28
|
return false;
|
|
29
29
|
}
|
|
30
|
+
if (message.includes('Trying to Produce a Memory representation from a non-existent mailbox.')) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
30
33
|
if (message.includes('Received HEADERS for invalid stream')) {
|
|
31
34
|
return false;
|
|
32
35
|
}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export { AvailableOptions, TypeOfOption } from './options';
|
|
2
2
|
export declare const BrowserSafeApis: {
|
|
3
|
-
getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
3
|
+
getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">(codec: T, audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => import("./file-extensions").FileExtension;
|
|
4
4
|
validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "h264-ts", "gif"];
|
|
5
5
|
validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
|
|
6
|
-
getDefaultCrfForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
7
|
-
getValidCrfRanges: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
8
|
-
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
6
|
+
getDefaultCrfForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => number;
|
|
7
|
+
getValidCrfRanges: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => [number, number];
|
|
8
|
+
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null | undefined) => boolean;
|
|
9
9
|
proResProfileOptions: readonly ["4444-xq", "4444", "hq", "standard", "light", "proxy"];
|
|
10
10
|
x264PresetOptions: readonly ["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo"];
|
|
11
11
|
validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
12
12
|
validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader", "vulkan", "angle-egl"];
|
|
13
|
-
validPixelFormatsForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
13
|
+
validPixelFormatsForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"] | ("yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le")[];
|
|
14
14
|
validVideoImageFormats: readonly ["png", "jpeg", "none"];
|
|
15
15
|
validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
|
|
16
|
-
DEFAULT_PIXEL_FORMAT: "yuv420p" | "
|
|
16
|
+
DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
17
17
|
DEFAULT_TIMEOUT: number;
|
|
18
18
|
DEFAULT_JPEG_QUALITY: number;
|
|
19
19
|
DEFAULT_COLOR_SPACE: "default";
|
|
@@ -35,11 +35,11 @@ export declare const BrowserSafeApis: {
|
|
|
35
35
|
h264: {
|
|
36
36
|
default: import("./file-extensions").FileExtension;
|
|
37
37
|
forAudioCodec: {
|
|
38
|
-
|
|
38
|
+
mp3: {
|
|
39
39
|
possible: import("./file-extensions").FileExtension[];
|
|
40
40
|
default: import("./file-extensions").FileExtension;
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
aac: {
|
|
43
43
|
possible: import("./file-extensions").FileExtension[];
|
|
44
44
|
default: import("./file-extensions").FileExtension;
|
|
45
45
|
};
|
|
@@ -65,11 +65,11 @@ export declare const BrowserSafeApis: {
|
|
|
65
65
|
vp8: {
|
|
66
66
|
default: import("./file-extensions").FileExtension;
|
|
67
67
|
forAudioCodec: {
|
|
68
|
-
|
|
68
|
+
"pcm-16": {
|
|
69
69
|
possible: import("./file-extensions").FileExtension[];
|
|
70
70
|
default: import("./file-extensions").FileExtension;
|
|
71
71
|
};
|
|
72
|
-
|
|
72
|
+
opus: {
|
|
73
73
|
possible: import("./file-extensions").FileExtension[];
|
|
74
74
|
default: import("./file-extensions").FileExtension;
|
|
75
75
|
};
|
|
@@ -78,20 +78,20 @@ export declare const BrowserSafeApis: {
|
|
|
78
78
|
vp9: {
|
|
79
79
|
default: import("./file-extensions").FileExtension;
|
|
80
80
|
forAudioCodec: {
|
|
81
|
-
|
|
81
|
+
"pcm-16": {
|
|
82
82
|
possible: import("./file-extensions").FileExtension[];
|
|
83
83
|
default: import("./file-extensions").FileExtension;
|
|
84
84
|
};
|
|
85
|
-
|
|
85
|
+
opus: {
|
|
86
86
|
possible: import("./file-extensions").FileExtension[];
|
|
87
87
|
default: import("./file-extensions").FileExtension;
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
};
|
|
91
|
-
|
|
91
|
+
mp3: {
|
|
92
92
|
default: import("./file-extensions").FileExtension;
|
|
93
93
|
forAudioCodec: {
|
|
94
|
-
|
|
94
|
+
mp3: {
|
|
95
95
|
possible: import("./file-extensions").FileExtension[];
|
|
96
96
|
default: import("./file-extensions").FileExtension;
|
|
97
97
|
};
|
|
@@ -114,22 +114,22 @@ export declare const BrowserSafeApis: {
|
|
|
114
114
|
};
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
|
-
|
|
117
|
+
wav: {
|
|
118
118
|
default: import("./file-extensions").FileExtension;
|
|
119
119
|
forAudioCodec: {
|
|
120
|
-
mp3: {
|
|
121
|
-
possible: import("./file-extensions").FileExtension[];
|
|
122
|
-
default: import("./file-extensions").FileExtension;
|
|
123
|
-
};
|
|
124
120
|
"pcm-16": {
|
|
125
121
|
possible: import("./file-extensions").FileExtension[];
|
|
126
122
|
default: import("./file-extensions").FileExtension;
|
|
127
123
|
};
|
|
128
124
|
};
|
|
129
125
|
};
|
|
130
|
-
|
|
126
|
+
prores: {
|
|
131
127
|
default: import("./file-extensions").FileExtension;
|
|
132
128
|
forAudioCodec: {
|
|
129
|
+
aac: {
|
|
130
|
+
possible: import("./file-extensions").FileExtension[];
|
|
131
|
+
default: import("./file-extensions").FileExtension;
|
|
132
|
+
};
|
|
133
133
|
"pcm-16": {
|
|
134
134
|
possible: import("./file-extensions").FileExtension[];
|
|
135
135
|
default: import("./file-extensions").FileExtension;
|
|
@@ -169,37 +169,37 @@ export declare const BrowserSafeApis: {
|
|
|
169
169
|
};
|
|
170
170
|
defaultAudioCodecs: {
|
|
171
171
|
h264: {
|
|
172
|
-
compressed: "
|
|
173
|
-
lossless: "
|
|
172
|
+
compressed: "mp3" | "aac" | "pcm-16" | null;
|
|
173
|
+
lossless: "mp3" | "aac" | "pcm-16" | null;
|
|
174
174
|
};
|
|
175
175
|
h265: {
|
|
176
176
|
compressed: "aac" | "pcm-16" | null;
|
|
177
177
|
lossless: "aac" | "pcm-16" | null;
|
|
178
178
|
};
|
|
179
179
|
vp8: {
|
|
180
|
-
compressed: "
|
|
181
|
-
lossless: "
|
|
180
|
+
compressed: "pcm-16" | "opus" | null;
|
|
181
|
+
lossless: "pcm-16" | "opus" | null;
|
|
182
182
|
};
|
|
183
183
|
vp9: {
|
|
184
|
-
compressed: "
|
|
185
|
-
lossless: "
|
|
184
|
+
compressed: "pcm-16" | "opus" | null;
|
|
185
|
+
lossless: "pcm-16" | "opus" | null;
|
|
186
186
|
};
|
|
187
|
-
|
|
188
|
-
compressed: "
|
|
189
|
-
lossless: "
|
|
187
|
+
mp3: {
|
|
188
|
+
compressed: "mp3" | "pcm-16" | null;
|
|
189
|
+
lossless: "mp3" | "pcm-16" | null;
|
|
190
190
|
};
|
|
191
191
|
aac: {
|
|
192
192
|
compressed: "aac" | "pcm-16" | null;
|
|
193
193
|
lossless: "aac" | "pcm-16" | null;
|
|
194
194
|
};
|
|
195
|
-
mp3: {
|
|
196
|
-
compressed: "mp3" | "pcm-16" | null;
|
|
197
|
-
lossless: "mp3" | "pcm-16" | null;
|
|
198
|
-
};
|
|
199
195
|
wav: {
|
|
200
196
|
compressed: "pcm-16" | null;
|
|
201
197
|
lossless: "pcm-16" | null;
|
|
202
198
|
};
|
|
199
|
+
prores: {
|
|
200
|
+
compressed: "aac" | "pcm-16" | null;
|
|
201
|
+
lossless: "aac" | "pcm-16" | null;
|
|
202
|
+
};
|
|
203
203
|
"h264-mkv": {
|
|
204
204
|
compressed: "mp3" | "pcm-16" | null;
|
|
205
205
|
lossless: "mp3" | "pcm-16" | null;
|
|
@@ -213,10 +213,10 @@ export declare const BrowserSafeApis: {
|
|
|
213
213
|
lossless: null;
|
|
214
214
|
};
|
|
215
215
|
};
|
|
216
|
-
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "
|
|
217
|
-
validateOutputFilename: <T_1 extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
216
|
+
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">;
|
|
217
|
+
validateOutputFilename: <T_1 extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">({ codec, audioCodecSetting, extension, preferLossless, separateAudioTo, }: {
|
|
218
218
|
codec: T_1;
|
|
219
|
-
audioCodecSetting: "
|
|
219
|
+
audioCodecSetting: "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
220
220
|
extension: string;
|
|
221
221
|
preferLossless: boolean;
|
|
222
222
|
separateAudioTo: string | null;
|
|
@@ -224,12 +224,12 @@ export declare const BrowserSafeApis: {
|
|
|
224
224
|
options: {
|
|
225
225
|
audioCodecOption: {
|
|
226
226
|
cliFlag: "audio-codec";
|
|
227
|
-
setConfig: (audioCodec: "
|
|
227
|
+
setConfig: (audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => void;
|
|
228
228
|
getValue: ({ commandLine }: {
|
|
229
229
|
commandLine: Record<string, unknown>;
|
|
230
230
|
}) => {
|
|
231
231
|
source: string;
|
|
232
|
-
value: "
|
|
232
|
+
value: "mp3" | "aac" | "pcm-16" | "opus";
|
|
233
233
|
} | {
|
|
234
234
|
source: string;
|
|
235
235
|
value: null;
|
|
@@ -238,7 +238,7 @@ export declare const BrowserSafeApis: {
|
|
|
238
238
|
docLink: string;
|
|
239
239
|
name: string;
|
|
240
240
|
ssrName: "audioCodec";
|
|
241
|
-
type: "
|
|
241
|
+
type: "mp3" | "aac" | "pcm-16" | "opus";
|
|
242
242
|
};
|
|
243
243
|
scaleOption: {
|
|
244
244
|
name: string;
|
|
@@ -357,17 +357,17 @@ export declare const BrowserSafeApis: {
|
|
|
357
357
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
358
358
|
ssrName: string;
|
|
359
359
|
docLink: string;
|
|
360
|
-
type: "h264" | "h265" | "vp8" | "vp9" | "
|
|
360
|
+
type: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
|
|
361
361
|
getValue: ({ commandLine }: {
|
|
362
362
|
commandLine: Record<string, unknown>;
|
|
363
363
|
}, { compositionCodec, configFile, downloadName, outName, uiCodec, }: {
|
|
364
364
|
outName: string | null;
|
|
365
365
|
downloadName: string | null;
|
|
366
|
-
configFile: "h264" | "h265" | "vp8" | "vp9" | "
|
|
367
|
-
uiCodec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
368
|
-
compositionCodec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
366
|
+
configFile: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
|
|
367
|
+
uiCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
|
|
368
|
+
compositionCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
|
|
369
369
|
}) => {
|
|
370
|
-
value: "h264" | "h265" | "vp8" | "vp9" | "
|
|
370
|
+
value: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
|
|
371
371
|
source: string;
|
|
372
372
|
};
|
|
373
373
|
setConfig: (newCodec: import("./codec").CodecOrUndefined) => void;
|
|
@@ -406,14 +406,14 @@ export declare const BrowserSafeApis: {
|
|
|
406
406
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
407
407
|
docLink: string;
|
|
408
408
|
ssrName: string;
|
|
409
|
-
type: "
|
|
409
|
+
type: "default" | "bt709" | "bt2020-ncl" | null;
|
|
410
410
|
getValue: ({ commandLine }: {
|
|
411
411
|
commandLine: Record<string, unknown>;
|
|
412
412
|
}) => {
|
|
413
413
|
source: string;
|
|
414
|
-
value: "
|
|
414
|
+
value: "default" | "bt709" | "bt2020-ncl";
|
|
415
415
|
};
|
|
416
|
-
setConfig: (value: "
|
|
416
|
+
setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
|
|
417
417
|
};
|
|
418
418
|
deleteAfterOption: {
|
|
419
419
|
name: string;
|
|
@@ -467,19 +467,19 @@ export declare const BrowserSafeApis: {
|
|
|
467
467
|
cliFlag: "gl";
|
|
468
468
|
docLink: string;
|
|
469
469
|
name: string;
|
|
470
|
-
type: "
|
|
470
|
+
type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
471
471
|
ssrName: string;
|
|
472
472
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
473
473
|
getValue: ({ commandLine }: {
|
|
474
474
|
commandLine: Record<string, unknown>;
|
|
475
475
|
}) => {
|
|
476
|
-
value: "
|
|
476
|
+
value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
|
|
477
477
|
source: string;
|
|
478
478
|
} | {
|
|
479
479
|
value: null;
|
|
480
480
|
source: string;
|
|
481
481
|
};
|
|
482
|
-
setConfig: (value: "
|
|
482
|
+
setConfig: (value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
|
|
483
483
|
};
|
|
484
484
|
enableLambdaInsights: {
|
|
485
485
|
name: string;
|
|
@@ -900,14 +900,14 @@ export declare const BrowserSafeApis: {
|
|
|
900
900
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
901
901
|
docLink: string;
|
|
902
902
|
ssrName: string;
|
|
903
|
-
type: "
|
|
903
|
+
type: "default" | "bt709" | "bt2020-ncl" | null;
|
|
904
904
|
getValue: ({ commandLine }: {
|
|
905
905
|
commandLine: Record<string, unknown>;
|
|
906
906
|
}) => {
|
|
907
907
|
source: string;
|
|
908
|
-
value: "
|
|
908
|
+
value: "default" | "bt709" | "bt2020-ncl";
|
|
909
909
|
};
|
|
910
|
-
setConfig: (value: "
|
|
910
|
+
setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
|
|
911
911
|
};
|
|
912
912
|
readonly codec: {
|
|
913
913
|
name: string;
|
|
@@ -915,17 +915,17 @@ export declare const BrowserSafeApis: {
|
|
|
915
915
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
916
916
|
ssrName: string;
|
|
917
917
|
docLink: string;
|
|
918
|
-
type: "h264" | "h265" | "vp8" | "vp9" | "
|
|
918
|
+
type: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
|
|
919
919
|
getValue: ({ commandLine }: {
|
|
920
920
|
commandLine: Record<string, unknown>;
|
|
921
921
|
}, { compositionCodec, configFile, downloadName, outName, uiCodec, }: {
|
|
922
922
|
outName: string | null;
|
|
923
923
|
downloadName: string | null;
|
|
924
|
-
configFile: "h264" | "h265" | "vp8" | "vp9" | "
|
|
925
|
-
uiCodec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
926
|
-
compositionCodec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
924
|
+
configFile: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
|
|
925
|
+
uiCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
|
|
926
|
+
compositionCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
|
|
927
927
|
}) => {
|
|
928
|
-
value: "h264" | "h265" | "vp8" | "vp9" | "
|
|
928
|
+
value: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
|
|
929
929
|
source: string;
|
|
930
930
|
};
|
|
931
931
|
setConfig: (newCodec: import("./codec").CodecOrUndefined) => void;
|
|
@@ -1079,12 +1079,12 @@ export declare const BrowserSafeApis: {
|
|
|
1079
1079
|
};
|
|
1080
1080
|
readonly audioCodec: {
|
|
1081
1081
|
cliFlag: "audio-codec";
|
|
1082
|
-
setConfig: (audioCodec: "
|
|
1082
|
+
setConfig: (audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => void;
|
|
1083
1083
|
getValue: ({ commandLine }: {
|
|
1084
1084
|
commandLine: Record<string, unknown>;
|
|
1085
1085
|
}) => {
|
|
1086
1086
|
source: string;
|
|
1087
|
-
value: "
|
|
1087
|
+
value: "mp3" | "aac" | "pcm-16" | "opus";
|
|
1088
1088
|
} | {
|
|
1089
1089
|
source: string;
|
|
1090
1090
|
value: null;
|
|
@@ -1093,7 +1093,7 @@ export declare const BrowserSafeApis: {
|
|
|
1093
1093
|
docLink: string;
|
|
1094
1094
|
name: string;
|
|
1095
1095
|
ssrName: "audioCodec";
|
|
1096
|
-
type: "
|
|
1096
|
+
type: "mp3" | "aac" | "pcm-16" | "opus";
|
|
1097
1097
|
};
|
|
1098
1098
|
readonly onBrowserDownload: {
|
|
1099
1099
|
name: string;
|
|
@@ -1640,14 +1640,14 @@ export declare const BrowserSafeApis: {
|
|
|
1640
1640
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1641
1641
|
docLink: string;
|
|
1642
1642
|
ssrName: string;
|
|
1643
|
-
type: "
|
|
1643
|
+
type: "default" | "bt709" | "bt2020-ncl" | null;
|
|
1644
1644
|
getValue: ({ commandLine }: {
|
|
1645
1645
|
commandLine: Record<string, unknown>;
|
|
1646
1646
|
}) => {
|
|
1647
1647
|
source: string;
|
|
1648
|
-
value: "
|
|
1648
|
+
value: "default" | "bt709" | "bt2020-ncl";
|
|
1649
1649
|
};
|
|
1650
|
-
setConfig: (value: "
|
|
1650
|
+
setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
|
|
1651
1651
|
};
|
|
1652
1652
|
readonly muted: {
|
|
1653
1653
|
name: string;
|
|
@@ -1904,14 +1904,14 @@ export declare const BrowserSafeApis: {
|
|
|
1904
1904
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1905
1905
|
docLink: string;
|
|
1906
1906
|
ssrName: string;
|
|
1907
|
-
type: "
|
|
1907
|
+
type: "default" | "bt709" | "bt2020-ncl" | null;
|
|
1908
1908
|
getValue: ({ commandLine }: {
|
|
1909
1909
|
commandLine: Record<string, unknown>;
|
|
1910
1910
|
}) => {
|
|
1911
1911
|
source: string;
|
|
1912
|
-
value: "
|
|
1912
|
+
value: "default" | "bt709" | "bt2020-ncl";
|
|
1913
1913
|
};
|
|
1914
|
-
setConfig: (value: "
|
|
1914
|
+
setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
|
|
1915
1915
|
};
|
|
1916
1916
|
readonly audioBitrate: {
|
|
1917
1917
|
name: string;
|
|
@@ -2249,9 +2249,9 @@ export declare const BrowserSafeApis: {
|
|
|
2249
2249
|
};
|
|
2250
2250
|
};
|
|
2251
2251
|
};
|
|
2252
|
-
codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
2253
|
-
codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
2252
|
+
codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => boolean;
|
|
2253
|
+
codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => boolean;
|
|
2254
2254
|
logLevels: readonly ["verbose", "info", "warn", "error"];
|
|
2255
2255
|
getOutputCodecOrUndefined: () => import("./codec").CodecOrUndefined;
|
|
2256
|
-
getExtensionFromAudioCodec: (audioCodec: "
|
|
2256
|
+
getExtensionFromAudioCodec: (audioCodec: "mp3" | "aac" | "pcm-16" | "opus") => "mp3" | "aac" | "wav" | "opus";
|
|
2257
2257
|
};
|
|
@@ -18,7 +18,7 @@ const startLongRunningCompositor = ({ maximumFrameCacheItemsInBytes, logLevel, i
|
|
|
18
18
|
return (0, exports.startCompositor)({
|
|
19
19
|
type: 'StartLongRunningProcess',
|
|
20
20
|
payload: {
|
|
21
|
-
concurrency: (0, get_concurrency_1.
|
|
21
|
+
concurrency: (0, get_concurrency_1.resolveConcurrency)(null),
|
|
22
22
|
maximum_frame_cache_size_in_bytes: maximumFrameCacheItemsInBytes,
|
|
23
23
|
verbose: (0, log_level_1.isEqualOrBelowLogLevel)(logLevel, 'verbose'),
|
|
24
24
|
},
|
package/dist/create-audio.js
CHANGED
|
@@ -22,6 +22,7 @@ const createAudio = async ({ assets, onDownload, fps, logLevel, onProgress, down
|
|
|
22
22
|
downloadMap,
|
|
23
23
|
indent,
|
|
24
24
|
logLevel,
|
|
25
|
+
binariesDirectory,
|
|
25
26
|
});
|
|
26
27
|
(0, download_and_map_assets_to_file_1.markAllAssetsAsDownloaded)(downloadMap);
|
|
27
28
|
const assetPositions = (0, calculate_asset_positions_1.calculateAssetPositions)(fileUrlAssets);
|
|
@@ -4,9 +4,6 @@ export declare const createFfmpegComplexFilter: ({ filters, downloadMap, }: {
|
|
|
4
4
|
filters: PreprocessedAudioTrack[];
|
|
5
5
|
downloadMap: DownloadMap;
|
|
6
6
|
}) => Promise<{
|
|
7
|
-
complexFilterFlag: [
|
|
8
|
-
string,
|
|
9
|
-
string
|
|
10
|
-
] | null;
|
|
7
|
+
complexFilterFlag: [string, string] | null;
|
|
11
8
|
cleanup: () => void;
|
|
12
9
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const resolveConcurrency: (userPreference: number | string | null) => number;
|
package/dist/get-concurrency.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.resolveConcurrency = void 0;
|
|
4
4
|
const get_cpu_count_1 = require("./get-cpu-count");
|
|
5
|
-
const
|
|
5
|
+
const resolveConcurrency = (userPreference) => {
|
|
6
6
|
const maxCpus = (0, get_cpu_count_1.getCpuCount)();
|
|
7
7
|
if (userPreference === null) {
|
|
8
8
|
return Math.round(Math.min(8, Math.max(1, maxCpus / 2)));
|
|
@@ -24,4 +24,4 @@ const getActualConcurrency = (userPreference) => {
|
|
|
24
24
|
}
|
|
25
25
|
return rounded;
|
|
26
26
|
};
|
|
27
|
-
exports.
|
|
27
|
+
exports.resolveConcurrency = resolveConcurrency;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Codec } from './codec';
|
|
2
2
|
import type { FileExtension } from './file-extensions';
|
|
3
3
|
import type { AudioCodec } from './options/audio-codec';
|
|
4
|
-
export declare const getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
5
|
-
export declare const makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "
|
|
4
|
+
export declare const getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">(codec: T, audioCodec: AudioCodec | null) => FileExtension;
|
|
5
|
+
export declare const makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif")[]>;
|
|
6
6
|
export declare const defaultCodecsForFileExtension: Record<FileExtension, Codec>;
|