@remotion/renderer 4.0.54 → 4.0.56
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/get-audio-channels.d.ts +3 -2
- package/dist/assets/get-audio-channels.js +6 -6
- package/dist/call-ffmpeg.d.ts +3 -2
- package/dist/call-ffmpeg.js +5 -5
- package/dist/client.d.ts +38 -38
- package/dist/combine-videos.d.ts +3 -0
- package/dist/combine-videos.js +1 -1
- package/dist/compositor/compose.d.ts +2 -1
- package/dist/compositor/compose.js +3 -3
- package/dist/compositor/compositor.js +2 -2
- package/dist/compositor/get-executable-path.d.ts +2 -1
- package/dist/compositor/get-executable-path.js +17 -5
- package/dist/create-silent-audio.d.ts +4 -1
- package/dist/create-silent-audio.js +2 -2
- package/dist/get-extension-from-codec.d.ts +2 -2
- package/dist/guess-extension-for-media.d.ts +4 -1
- package/dist/guess-extension-for-media.js +2 -2
- package/dist/index.d.ts +32 -30
- package/dist/merge-audio-track.d.ts +3 -0
- package/dist/merge-audio-track.js +8 -2
- package/dist/options/color-space.d.ts +1 -1
- package/dist/options/gl.d.ts +1 -1
- package/dist/options/index.d.ts +2 -2
- package/dist/options/render-expiry-days.d.ts +8 -0
- package/dist/options/render-expiry-days.js +14 -0
- package/dist/preprocess-audio-track.d.ts +3 -0
- package/dist/preprocess-audio-track.js +3 -3
- package/dist/presets-profile.d.ts +7 -0
- package/dist/presets-profile.js +27 -0
- package/dist/prespawn-ffmpeg.js +1 -1
- package/dist/stitch-frames-to-video.js +6 -2
- package/dist/validate-output-filename.d.ts +1 -1
- package/package.json +9 -9
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LogLevel } from '../log-level';
|
|
1
2
|
import type { AudioChannelsAndDurationResultCache, DownloadMap } from './download-map';
|
|
2
|
-
export declare const getAudioChannelsAndDurationWithoutCache: (src: string) => Promise<AudioChannelsAndDurationResultCache>;
|
|
3
|
-
export declare const getAudioChannelsAndDuration: (downloadMap: DownloadMap, src: string) => Promise<AudioChannelsAndDurationResultCache>;
|
|
3
|
+
export declare const getAudioChannelsAndDurationWithoutCache: (src: string, indent: boolean, logLevel: LogLevel) => Promise<AudioChannelsAndDurationResultCache>;
|
|
4
|
+
export declare const getAudioChannelsAndDuration: (downloadMap: DownloadMap, src: string, indent: boolean, logLevel: LogLevel) => Promise<AudioChannelsAndDurationResultCache>;
|
|
@@ -4,7 +4,7 @@ exports.getAudioChannelsAndDuration = exports.getAudioChannelsAndDurationWithout
|
|
|
4
4
|
const call_ffmpeg_1 = require("../call-ffmpeg");
|
|
5
5
|
const p_limit_1 = require("../p-limit");
|
|
6
6
|
const limit = (0, p_limit_1.pLimit)(1);
|
|
7
|
-
const getAudioChannelsAndDurationWithoutCache = async (src) => {
|
|
7
|
+
const getAudioChannelsAndDurationWithoutCache = async (src, indent, logLevel) => {
|
|
8
8
|
const args = [
|
|
9
9
|
['-v', 'error'],
|
|
10
10
|
['-show_entries', 'stream=channels:format=duration'],
|
|
@@ -13,7 +13,7 @@ const getAudioChannelsAndDurationWithoutCache = async (src) => {
|
|
|
13
13
|
]
|
|
14
14
|
.reduce((acc, val) => acc.concat(val), [])
|
|
15
15
|
.filter(Boolean);
|
|
16
|
-
const task = await (0, call_ffmpeg_1.callFf)('ffprobe', args);
|
|
16
|
+
const task = await (0, call_ffmpeg_1.callFf)('ffprobe', args, indent, logLevel);
|
|
17
17
|
const channels = task.stdout.match(/channels=([0-9]+)/);
|
|
18
18
|
const duration = task.stdout.match(/duration=([0-9.]+)/);
|
|
19
19
|
const result = {
|
|
@@ -23,15 +23,15 @@ const getAudioChannelsAndDurationWithoutCache = async (src) => {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
exports.getAudioChannelsAndDurationWithoutCache = getAudioChannelsAndDurationWithoutCache;
|
|
26
|
-
async function getAudioChannelsAndDurationUnlimited(downloadMap, src) {
|
|
26
|
+
async function getAudioChannelsAndDurationUnlimited(downloadMap, src, indent, logLevel) {
|
|
27
27
|
if (downloadMap.durationOfAssetCache[src]) {
|
|
28
28
|
return downloadMap.durationOfAssetCache[src];
|
|
29
29
|
}
|
|
30
|
-
const result = await (0, exports.getAudioChannelsAndDurationWithoutCache)(src);
|
|
30
|
+
const result = await (0, exports.getAudioChannelsAndDurationWithoutCache)(src, indent, logLevel);
|
|
31
31
|
downloadMap.durationOfAssetCache[src] = result;
|
|
32
32
|
return result;
|
|
33
33
|
}
|
|
34
|
-
const getAudioChannelsAndDuration = (downloadMap, src) => {
|
|
35
|
-
return limit(() => getAudioChannelsAndDurationUnlimited(downloadMap, src));
|
|
34
|
+
const getAudioChannelsAndDuration = (downloadMap, src, indent, logLevel) => {
|
|
35
|
+
return limit(() => getAudioChannelsAndDurationUnlimited(downloadMap, src, indent, logLevel));
|
|
36
36
|
};
|
|
37
37
|
exports.getAudioChannelsAndDuration = getAudioChannelsAndDuration;
|
package/dist/call-ffmpeg.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import execa from 'execa';
|
|
2
|
-
|
|
2
|
+
import type { LogLevel } from './log-level';
|
|
3
|
+
export declare const dynamicLibraryPathOptions: (indent: boolean, logLevel: LogLevel) => {
|
|
3
4
|
env: {
|
|
4
5
|
DYLD_LIBRARY_PATH: string;
|
|
5
6
|
RUST_BACKTRACE: string;
|
|
@@ -11,4 +12,4 @@ export declare const dynamicLibraryPathOptions: () => {
|
|
|
11
12
|
RUST_BACKTRACE: string;
|
|
12
13
|
};
|
|
13
14
|
};
|
|
14
|
-
export declare const callFf: (bin: 'ffmpeg' | 'ffprobe', args: (string | null)[], options?: execa.Options<string>) => execa.ExecaChildProcess<string>;
|
|
15
|
+
export declare const callFf: (bin: 'ffmpeg' | 'ffprobe', args: (string | null)[], indent: boolean, logLevel: LogLevel, options?: execa.Options<string>) => execa.ExecaChildProcess<string>;
|
package/dist/call-ffmpeg.js
CHANGED
|
@@ -9,8 +9,8 @@ const node_fs_1 = require("node:fs");
|
|
|
9
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
10
|
const get_executable_path_1 = require("./compositor/get-executable-path");
|
|
11
11
|
const truthy_1 = require("./truthy");
|
|
12
|
-
const dynamicLibraryPathOptions = () => {
|
|
13
|
-
const lib = node_path_1.default.join((0, get_executable_path_1.getExecutablePath)('ffmpeg-cwd'), 'remotion', 'lib');
|
|
12
|
+
const dynamicLibraryPathOptions = (indent, logLevel) => {
|
|
13
|
+
const lib = node_path_1.default.join((0, get_executable_path_1.getExecutablePath)('ffmpeg-cwd', indent, logLevel), 'remotion', 'lib');
|
|
14
14
|
return {
|
|
15
15
|
env: {
|
|
16
16
|
RUST_BACKTRACE: 'full',
|
|
@@ -29,13 +29,13 @@ const dynamicLibraryPathOptions = () => {
|
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
exports.dynamicLibraryPathOptions = dynamicLibraryPathOptions;
|
|
32
|
-
const callFf = (bin, args, options) => {
|
|
33
|
-
const executablePath = (0, get_executable_path_1.getExecutablePath)(bin);
|
|
32
|
+
const callFf = (bin, args, indent, logLevel, options) => {
|
|
33
|
+
const executablePath = (0, get_executable_path_1.getExecutablePath)(bin, indent, logLevel);
|
|
34
34
|
if (!process.env.READ_ONLY_FS) {
|
|
35
35
|
(0, node_fs_1.chmodSync)(executablePath, 0o755);
|
|
36
36
|
}
|
|
37
37
|
return (0, execa_1.default)(executablePath, args.filter(truthy_1.truthy), {
|
|
38
|
-
...(0, exports.dynamicLibraryPathOptions)(),
|
|
38
|
+
...(0, exports.dynamicLibraryPathOptions)(indent, logLevel),
|
|
39
39
|
...options,
|
|
40
40
|
});
|
|
41
41
|
};
|
package/dist/client.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
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" | "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", "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" | "gif") => number;
|
|
7
|
+
getValidCrfRanges: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => [number, number];
|
|
8
|
+
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "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"];
|
|
@@ -26,11 +26,11 @@ export declare const BrowserSafeApis: {
|
|
|
26
26
|
h264: {
|
|
27
27
|
default: import("./file-extensions").FileExtension;
|
|
28
28
|
forAudioCodec: {
|
|
29
|
-
|
|
29
|
+
mp3: {
|
|
30
30
|
possible: import("./file-extensions").FileExtension[];
|
|
31
31
|
default: import("./file-extensions").FileExtension;
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
aac: {
|
|
34
34
|
possible: import("./file-extensions").FileExtension[];
|
|
35
35
|
default: import("./file-extensions").FileExtension;
|
|
36
36
|
};
|
|
@@ -56,11 +56,11 @@ export declare const BrowserSafeApis: {
|
|
|
56
56
|
vp8: {
|
|
57
57
|
default: import("./file-extensions").FileExtension;
|
|
58
58
|
forAudioCodec: {
|
|
59
|
-
|
|
59
|
+
"pcm-16": {
|
|
60
60
|
possible: import("./file-extensions").FileExtension[];
|
|
61
61
|
default: import("./file-extensions").FileExtension;
|
|
62
62
|
};
|
|
63
|
-
|
|
63
|
+
opus: {
|
|
64
64
|
possible: import("./file-extensions").FileExtension[];
|
|
65
65
|
default: import("./file-extensions").FileExtension;
|
|
66
66
|
};
|
|
@@ -69,20 +69,20 @@ export declare const BrowserSafeApis: {
|
|
|
69
69
|
vp9: {
|
|
70
70
|
default: import("./file-extensions").FileExtension;
|
|
71
71
|
forAudioCodec: {
|
|
72
|
-
|
|
72
|
+
"pcm-16": {
|
|
73
73
|
possible: import("./file-extensions").FileExtension[];
|
|
74
74
|
default: import("./file-extensions").FileExtension;
|
|
75
75
|
};
|
|
76
|
-
|
|
76
|
+
opus: {
|
|
77
77
|
possible: import("./file-extensions").FileExtension[];
|
|
78
78
|
default: import("./file-extensions").FileExtension;
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
mp3: {
|
|
83
83
|
default: import("./file-extensions").FileExtension;
|
|
84
84
|
forAudioCodec: {
|
|
85
|
-
|
|
85
|
+
mp3: {
|
|
86
86
|
possible: import("./file-extensions").FileExtension[];
|
|
87
87
|
default: import("./file-extensions").FileExtension;
|
|
88
88
|
};
|
|
@@ -105,22 +105,22 @@ export declare const BrowserSafeApis: {
|
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
|
-
|
|
108
|
+
wav: {
|
|
109
109
|
default: import("./file-extensions").FileExtension;
|
|
110
110
|
forAudioCodec: {
|
|
111
|
-
mp3: {
|
|
112
|
-
possible: import("./file-extensions").FileExtension[];
|
|
113
|
-
default: import("./file-extensions").FileExtension;
|
|
114
|
-
};
|
|
115
111
|
"pcm-16": {
|
|
116
112
|
possible: import("./file-extensions").FileExtension[];
|
|
117
113
|
default: import("./file-extensions").FileExtension;
|
|
118
114
|
};
|
|
119
115
|
};
|
|
120
116
|
};
|
|
121
|
-
|
|
117
|
+
prores: {
|
|
122
118
|
default: import("./file-extensions").FileExtension;
|
|
123
119
|
forAudioCodec: {
|
|
120
|
+
aac: {
|
|
121
|
+
possible: import("./file-extensions").FileExtension[];
|
|
122
|
+
default: import("./file-extensions").FileExtension;
|
|
123
|
+
};
|
|
124
124
|
"pcm-16": {
|
|
125
125
|
possible: import("./file-extensions").FileExtension[];
|
|
126
126
|
default: import("./file-extensions").FileExtension;
|
|
@@ -147,37 +147,37 @@ export declare const BrowserSafeApis: {
|
|
|
147
147
|
};
|
|
148
148
|
defaultAudioCodecs: {
|
|
149
149
|
h264: {
|
|
150
|
-
compressed: "
|
|
151
|
-
lossless: "
|
|
150
|
+
compressed: "mp3" | "aac" | "pcm-16" | null;
|
|
151
|
+
lossless: "mp3" | "aac" | "pcm-16" | null;
|
|
152
152
|
};
|
|
153
153
|
h265: {
|
|
154
154
|
compressed: "aac" | "pcm-16" | null;
|
|
155
155
|
lossless: "aac" | "pcm-16" | null;
|
|
156
156
|
};
|
|
157
157
|
vp8: {
|
|
158
|
-
compressed: "
|
|
159
|
-
lossless: "
|
|
158
|
+
compressed: "pcm-16" | "opus" | null;
|
|
159
|
+
lossless: "pcm-16" | "opus" | null;
|
|
160
160
|
};
|
|
161
161
|
vp9: {
|
|
162
|
-
compressed: "
|
|
163
|
-
lossless: "
|
|
162
|
+
compressed: "pcm-16" | "opus" | null;
|
|
163
|
+
lossless: "pcm-16" | "opus" | null;
|
|
164
164
|
};
|
|
165
|
-
|
|
166
|
-
compressed: "
|
|
167
|
-
lossless: "
|
|
165
|
+
mp3: {
|
|
166
|
+
compressed: "mp3" | "pcm-16" | null;
|
|
167
|
+
lossless: "mp3" | "pcm-16" | null;
|
|
168
168
|
};
|
|
169
169
|
aac: {
|
|
170
170
|
compressed: "aac" | "pcm-16" | null;
|
|
171
171
|
lossless: "aac" | "pcm-16" | null;
|
|
172
172
|
};
|
|
173
|
-
mp3: {
|
|
174
|
-
compressed: "mp3" | "pcm-16" | null;
|
|
175
|
-
lossless: "mp3" | "pcm-16" | null;
|
|
176
|
-
};
|
|
177
173
|
wav: {
|
|
178
174
|
compressed: "pcm-16" | null;
|
|
179
175
|
lossless: "pcm-16" | null;
|
|
180
176
|
};
|
|
177
|
+
prores: {
|
|
178
|
+
compressed: "aac" | "pcm-16" | null;
|
|
179
|
+
lossless: "aac" | "pcm-16" | null;
|
|
180
|
+
};
|
|
181
181
|
"h264-mkv": {
|
|
182
182
|
compressed: "mp3" | "pcm-16" | null;
|
|
183
183
|
lossless: "mp3" | "pcm-16" | null;
|
|
@@ -187,10 +187,10 @@ export declare const BrowserSafeApis: {
|
|
|
187
187
|
lossless: null;
|
|
188
188
|
};
|
|
189
189
|
};
|
|
190
|
-
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "
|
|
191
|
-
validateOutputFilename: <T_1 extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
190
|
+
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">;
|
|
191
|
+
validateOutputFilename: <T_1 extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">({ codec, audioCodec, extension, preferLossless, }: {
|
|
192
192
|
codec: T_1;
|
|
193
|
-
audioCodec: "
|
|
193
|
+
audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
194
194
|
extension: string;
|
|
195
195
|
preferLossless: boolean;
|
|
196
196
|
}) => void;
|
|
@@ -281,7 +281,7 @@ export declare const BrowserSafeApis: {
|
|
|
281
281
|
description: () => JSX.Element;
|
|
282
282
|
docLink: string;
|
|
283
283
|
ssrName: string;
|
|
284
|
-
type: "
|
|
284
|
+
type: "default" | "bt709";
|
|
285
285
|
};
|
|
286
286
|
deleteAfterOption: {
|
|
287
287
|
name: string;
|
|
@@ -311,7 +311,7 @@ export declare const BrowserSafeApis: {
|
|
|
311
311
|
cliFlag: string;
|
|
312
312
|
docLink: string;
|
|
313
313
|
name: string;
|
|
314
|
-
type: "
|
|
314
|
+
type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
|
|
315
315
|
ssrName: string;
|
|
316
316
|
description: () => JSX.Element;
|
|
317
317
|
};
|
|
@@ -399,6 +399,6 @@ export declare const BrowserSafeApis: {
|
|
|
399
399
|
type: number | null;
|
|
400
400
|
}];
|
|
401
401
|
};
|
|
402
|
-
codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
403
|
-
codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
402
|
+
codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
|
|
403
|
+
codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
|
|
404
404
|
};
|
package/dist/combine-videos.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AudioCodec } from './audio-codec';
|
|
2
2
|
import type { Codec } from './codec';
|
|
3
|
+
import type { LogLevel } from './log-level';
|
|
3
4
|
type Options = {
|
|
4
5
|
files: string[];
|
|
5
6
|
filelistDir: string;
|
|
@@ -11,6 +12,8 @@ type Options = {
|
|
|
11
12
|
numberOfGifLoops: number | null;
|
|
12
13
|
audioCodec: AudioCodec | null;
|
|
13
14
|
audioBitrate: string | null;
|
|
15
|
+
indent: boolean;
|
|
16
|
+
logLevel: LogLevel;
|
|
14
17
|
};
|
|
15
18
|
export declare const combineVideos: (options: Options) => Promise<void>;
|
|
16
19
|
export {};
|
package/dist/combine-videos.js
CHANGED
|
@@ -49,7 +49,7 @@ const combineVideos = async (options) => {
|
|
|
49
49
|
].filter(truthy_1.truthy);
|
|
50
50
|
logger_1.Log.verbose('Combining command: ', command);
|
|
51
51
|
try {
|
|
52
|
-
const task = (0, call_ffmpeg_1.callFf)('ffmpeg', command);
|
|
52
|
+
const task = (0, call_ffmpeg_1.callFf)('ffmpeg', command, options.indent, options.logLevel);
|
|
53
53
|
(_a = task.stderr) === null || _a === void 0 ? void 0 : _a.on('data', (data) => {
|
|
54
54
|
if (onProgress) {
|
|
55
55
|
const parsed = (0, parse_ffmpeg_progress_1.parseFfmpegProgress)(data.toString('utf8'));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DownloadMap } from '../assets/download-map';
|
|
2
|
+
import type { LogLevel } from '../log-level';
|
|
2
3
|
import type { Compositor } from './compositor';
|
|
3
4
|
import type { CompositorCommand, CompositorCommandSerialized, CompositorImageFormat, Layer } from './payloads';
|
|
4
5
|
type CompositorInput = {
|
|
@@ -22,5 +23,5 @@ export declare const compose: ({ height, width, layers, output, downloadMap, ima
|
|
|
22
23
|
} & {
|
|
23
24
|
downloadMap: DownloadMap;
|
|
24
25
|
}) => Promise<void>;
|
|
25
|
-
export declare const callCompositor: (payload: string) => Promise<void>;
|
|
26
|
+
export declare const callCompositor: (payload: string, indent: boolean, logLevel: LogLevel) => Promise<void>;
|
|
26
27
|
export {};
|
|
@@ -48,13 +48,13 @@ const compose = async ({ height, width, layers, output, downloadMap, imageFormat
|
|
|
48
48
|
downloadMap.compositorCache[hash] = output;
|
|
49
49
|
};
|
|
50
50
|
exports.compose = compose;
|
|
51
|
-
const callCompositor = (payload) => {
|
|
51
|
+
const callCompositor = (payload, indent, logLevel) => {
|
|
52
52
|
return new Promise((resolve, reject) => {
|
|
53
|
-
const execPath = (0, get_executable_path_1.getExecutablePath)('compositor');
|
|
53
|
+
const execPath = (0, get_executable_path_1.getExecutablePath)('compositor', indent, logLevel);
|
|
54
54
|
if (!process.env.READ_ONLY_FS) {
|
|
55
55
|
(0, node_fs_1.chmodSync)(execPath, 0o755);
|
|
56
56
|
}
|
|
57
|
-
const child = (0, node_child_process_1.spawn)(execPath, [payload], (0, call_ffmpeg_1.dynamicLibraryPathOptions)());
|
|
57
|
+
const child = (0, node_child_process_1.spawn)(execPath, [payload], (0, call_ffmpeg_1.dynamicLibraryPathOptions)(indent, logLevel));
|
|
58
58
|
const stderrChunks = [];
|
|
59
59
|
child.stderr.on('data', (d) => stderrChunks.push(d));
|
|
60
60
|
child.on('close', (code) => {
|
|
@@ -20,12 +20,12 @@ const startLongRunningCompositor = ({ maximumFrameCacheItemsInBytes, logLevel, i
|
|
|
20
20
|
exports.startLongRunningCompositor = startLongRunningCompositor;
|
|
21
21
|
const startCompositor = (type, payload, logLevel, indent) => {
|
|
22
22
|
var _a;
|
|
23
|
-
const bin = (0, get_executable_path_1.getExecutablePath)('compositor');
|
|
23
|
+
const bin = (0, get_executable_path_1.getExecutablePath)('compositor', indent, logLevel);
|
|
24
24
|
if (!process.env.READ_ONLY_FS) {
|
|
25
25
|
(0, node_fs_1.chmodSync)(bin, 0o755);
|
|
26
26
|
}
|
|
27
27
|
const fullCommand = (0, compose_1.serializeCommand)(type, payload);
|
|
28
|
-
const child = (0, node_child_process_1.spawn)(bin, [JSON.stringify(fullCommand)], (0, call_ffmpeg_1.dynamicLibraryPathOptions)());
|
|
28
|
+
const child = (0, node_child_process_1.spawn)(bin, [JSON.stringify(fullCommand)], (0, call_ffmpeg_1.dynamicLibraryPathOptions)(indent, logLevel));
|
|
29
29
|
const stderrChunks = [];
|
|
30
30
|
let outputBuffer = Buffer.from('');
|
|
31
31
|
const separator = Buffer.from('remotion_buffer:');
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { LogLevel } from '../log-level';
|
|
2
|
+
export declare const getExecutablePath: (type: 'compositor' | 'ffmpeg' | 'ffprobe' | 'ffmpeg-cwd', indent: boolean, logLevel: LogLevel) => string;
|
|
@@ -2,12 +2,22 @@
|
|
|
2
2
|
// Adapted from @swc/core package
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.getExecutablePath = void 0;
|
|
5
|
-
|
|
5
|
+
const logger_1 = require("../logger");
|
|
6
|
+
let warned = false;
|
|
7
|
+
function isMusl({ indent, logLevel }) {
|
|
8
|
+
// @ts-expect-error bun no types
|
|
9
|
+
if (!process.report && typeof Bun !== 'undefined') {
|
|
10
|
+
if (!warned) {
|
|
11
|
+
logger_1.Log.warnAdvanced({ indent, logLevel }, 'Bun limitation: Could not determine if your Linux is using musl or glibc. Assuming glibc.');
|
|
12
|
+
}
|
|
13
|
+
warned = true;
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
6
16
|
// @ts-expect-error no types
|
|
7
17
|
const { glibcVersionRuntime } = process.report.getReport().header;
|
|
8
18
|
return !glibcVersionRuntime;
|
|
9
19
|
}
|
|
10
|
-
const getExecutablePath = (type) => {
|
|
20
|
+
const getExecutablePath = (type, indent, logLevel) => {
|
|
11
21
|
if (type === 'compositor' && process.env.COMPOSITOR_PATH) {
|
|
12
22
|
return process.env.COMPOSITOR_PATH;
|
|
13
23
|
}
|
|
@@ -35,21 +45,23 @@ const getExecutablePath = (type) => {
|
|
|
35
45
|
default:
|
|
36
46
|
throw new Error(`Unsupported architecture on macOS: ${process.arch}`);
|
|
37
47
|
}
|
|
38
|
-
case 'linux':
|
|
48
|
+
case 'linux': {
|
|
49
|
+
const musl = isMusl({ indent, logLevel });
|
|
39
50
|
switch (process.arch) {
|
|
40
51
|
case 'x64':
|
|
41
|
-
if (
|
|
52
|
+
if (musl) {
|
|
42
53
|
return require('@remotion/compositor-linux-x64-musl')[key];
|
|
43
54
|
}
|
|
44
55
|
return require('@remotion/compositor-linux-x64-gnu')[key];
|
|
45
56
|
case 'arm64':
|
|
46
|
-
if (
|
|
57
|
+
if (musl) {
|
|
47
58
|
return require('@remotion/compositor-linux-arm64-musl')[key];
|
|
48
59
|
}
|
|
49
60
|
return require('@remotion/compositor-linux-arm64-gnu')[key];
|
|
50
61
|
default:
|
|
51
62
|
throw new Error(`Unsupported architecture on Linux: ${process.arch}`);
|
|
52
63
|
}
|
|
64
|
+
}
|
|
53
65
|
default:
|
|
54
66
|
throw new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`);
|
|
55
67
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { LogLevel } from './log-level';
|
|
2
|
+
export declare const createSilentAudio: ({ numberOfSeconds, outName, indent, logLevel, }: {
|
|
2
3
|
numberOfSeconds: number;
|
|
3
4
|
outName: string;
|
|
5
|
+
indent: boolean;
|
|
6
|
+
logLevel: LogLevel;
|
|
4
7
|
}) => Promise<void>;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createSilentAudio = void 0;
|
|
4
4
|
const call_ffmpeg_1 = require("./call-ffmpeg");
|
|
5
5
|
const sample_rate_1 = require("./sample-rate");
|
|
6
|
-
const createSilentAudio = async ({ numberOfSeconds, outName, }) => {
|
|
6
|
+
const createSilentAudio = async ({ numberOfSeconds, outName, indent, logLevel, }) => {
|
|
7
7
|
await (0, call_ffmpeg_1.callFf)('ffmpeg', [
|
|
8
8
|
'-f',
|
|
9
9
|
'lavfi',
|
|
@@ -16,6 +16,6 @@ const createSilentAudio = async ({ numberOfSeconds, outName, }) => {
|
|
|
16
16
|
'-ar',
|
|
17
17
|
String(sample_rate_1.DEFAULT_SAMPLE_RATE),
|
|
18
18
|
outName,
|
|
19
|
-
]);
|
|
19
|
+
], indent, logLevel);
|
|
20
20
|
};
|
|
21
21
|
exports.createSilentAudio = createSilentAudio;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AudioCodec } from './audio-codec';
|
|
2
2
|
import type { Codec } from './codec';
|
|
3
3
|
import type { FileExtension } from './file-extensions';
|
|
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" | "gif">(codec: T, audioCodec: AudioCodec | null) => FileExtension;
|
|
5
|
+
export declare const makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif")[]>;
|
|
6
6
|
export declare const defaultCodecsForFileExtension: Record<FileExtension, Codec>;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import type { LogLevel } from './log-level';
|
|
2
|
+
export declare const guessExtensionForVideo: ({ src, indent, logLevel, }: {
|
|
2
3
|
src: string;
|
|
4
|
+
indent: boolean;
|
|
5
|
+
logLevel: LogLevel;
|
|
3
6
|
}) => Promise<"mp3" | "wav" | "mp4" | "webm">;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.guessExtensionForVideo = void 0;
|
|
4
4
|
const call_ffmpeg_1 = require("./call-ffmpeg");
|
|
5
|
-
const guessExtensionForVideo = async ({ src }) => {
|
|
6
|
-
const { stderr } = await (0, call_ffmpeg_1.callFf)('ffprobe', [src]);
|
|
5
|
+
const guessExtensionForVideo = async ({ src, indent, logLevel, }) => {
|
|
6
|
+
const { stderr } = await (0, call_ffmpeg_1.callFf)('ffprobe', [src], indent, logLevel);
|
|
7
7
|
if (stderr.includes('Audio: mp3,')) {
|
|
8
8
|
return 'mp3';
|
|
9
9
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -65,10 +65,10 @@ export declare const RenderInternals: {
|
|
|
65
65
|
width: number;
|
|
66
66
|
height: number;
|
|
67
67
|
scale: number;
|
|
68
|
-
codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
68
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
69
69
|
wantsImageSequence: boolean;
|
|
70
70
|
}) => void;
|
|
71
|
-
getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
71
|
+
getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">(codec: T, audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => import("./file-extensions").FileExtension;
|
|
72
72
|
tmpDir: (str: string) => string;
|
|
73
73
|
deleteDirectory: (directory: string) => void;
|
|
74
74
|
isServeUrl: (potentialUrl: string) => boolean;
|
|
@@ -125,7 +125,7 @@ export declare const RenderInternals: {
|
|
|
125
125
|
};
|
|
126
126
|
registerErrorSymbolicationLock: () => number;
|
|
127
127
|
unlockErrorSymbolicationLock: (id: number) => void;
|
|
128
|
-
canUseParallelEncoding: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
128
|
+
canUseParallelEncoding: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
|
|
129
129
|
mimeContentType: typeof mimeContentType;
|
|
130
130
|
mimeLookup: typeof mimeLookup;
|
|
131
131
|
validateConcurrency: ({ setting, value, checkIfValidForCurrentMachine, }: {
|
|
@@ -136,14 +136,14 @@ export declare const RenderInternals: {
|
|
|
136
136
|
validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
137
137
|
DEFAULT_BROWSER: "chrome";
|
|
138
138
|
validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
|
|
139
|
-
DEFAULT_OPENGL_RENDERER: "
|
|
140
|
-
validateOpenGlRenderer: (option: "
|
|
139
|
+
DEFAULT_OPENGL_RENDERER: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
140
|
+
validateOpenGlRenderer: (option: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
141
141
|
validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "gif"];
|
|
142
142
|
DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
143
143
|
validateJpegQuality: (q: number | undefined) => void;
|
|
144
144
|
DEFAULT_TIMEOUT: number;
|
|
145
|
-
DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "
|
|
146
|
-
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
145
|
+
DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
146
|
+
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | null | undefined) => boolean;
|
|
147
147
|
logLevels: readonly ["verbose", "info", "warn", "error"];
|
|
148
148
|
isEqualOrBelowLogLevel: (currentLevel: "verbose" | "info" | "warn" | "error", level: "verbose" | "info" | "warn" | "error") => boolean;
|
|
149
149
|
isValidLogLevel: (level: string) => boolean;
|
|
@@ -160,28 +160,30 @@ export declare const RenderInternals: {
|
|
|
160
160
|
output: string;
|
|
161
161
|
onProgress: (p: number) => void;
|
|
162
162
|
numberOfFrames: number;
|
|
163
|
-
codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
163
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
164
164
|
fps: number;
|
|
165
165
|
numberOfGifLoops: number | null;
|
|
166
|
-
audioCodec: "
|
|
166
|
+
audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
167
167
|
audioBitrate: string | null;
|
|
168
|
+
indent: boolean;
|
|
169
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
168
170
|
}) => Promise<void>;
|
|
169
171
|
getMinConcurrency: () => number;
|
|
170
172
|
getMaxConcurrency: () => number;
|
|
171
173
|
getDefaultAudioCodec: ({ codec, preferLossless, }: {
|
|
172
|
-
codec: "h264" | "h265" | "vp8" | "vp9" | "
|
|
174
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
173
175
|
preferLossless: boolean;
|
|
174
|
-
}) => "
|
|
176
|
+
}) => "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
175
177
|
validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
|
|
176
178
|
defaultFileExtensionMap: {
|
|
177
179
|
h264: {
|
|
178
180
|
default: import("./file-extensions").FileExtension;
|
|
179
181
|
forAudioCodec: {
|
|
180
|
-
|
|
182
|
+
mp3: {
|
|
181
183
|
possible: import("./file-extensions").FileExtension[];
|
|
182
184
|
default: import("./file-extensions").FileExtension;
|
|
183
185
|
};
|
|
184
|
-
|
|
186
|
+
aac: {
|
|
185
187
|
possible: import("./file-extensions").FileExtension[];
|
|
186
188
|
default: import("./file-extensions").FileExtension;
|
|
187
189
|
};
|
|
@@ -207,11 +209,11 @@ export declare const RenderInternals: {
|
|
|
207
209
|
vp8: {
|
|
208
210
|
default: import("./file-extensions").FileExtension;
|
|
209
211
|
forAudioCodec: {
|
|
210
|
-
|
|
212
|
+
"pcm-16": {
|
|
211
213
|
possible: import("./file-extensions").FileExtension[];
|
|
212
214
|
default: import("./file-extensions").FileExtension;
|
|
213
215
|
};
|
|
214
|
-
|
|
216
|
+
opus: {
|
|
215
217
|
possible: import("./file-extensions").FileExtension[];
|
|
216
218
|
default: import("./file-extensions").FileExtension;
|
|
217
219
|
};
|
|
@@ -220,20 +222,20 @@ export declare const RenderInternals: {
|
|
|
220
222
|
vp9: {
|
|
221
223
|
default: import("./file-extensions").FileExtension;
|
|
222
224
|
forAudioCodec: {
|
|
223
|
-
|
|
225
|
+
"pcm-16": {
|
|
224
226
|
possible: import("./file-extensions").FileExtension[];
|
|
225
227
|
default: import("./file-extensions").FileExtension;
|
|
226
228
|
};
|
|
227
|
-
|
|
229
|
+
opus: {
|
|
228
230
|
possible: import("./file-extensions").FileExtension[];
|
|
229
231
|
default: import("./file-extensions").FileExtension;
|
|
230
232
|
};
|
|
231
233
|
};
|
|
232
234
|
};
|
|
233
|
-
|
|
235
|
+
mp3: {
|
|
234
236
|
default: import("./file-extensions").FileExtension;
|
|
235
237
|
forAudioCodec: {
|
|
236
|
-
|
|
238
|
+
mp3: {
|
|
237
239
|
possible: import("./file-extensions").FileExtension[];
|
|
238
240
|
default: import("./file-extensions").FileExtension;
|
|
239
241
|
};
|
|
@@ -256,22 +258,22 @@ export declare const RenderInternals: {
|
|
|
256
258
|
};
|
|
257
259
|
};
|
|
258
260
|
};
|
|
259
|
-
|
|
261
|
+
wav: {
|
|
260
262
|
default: import("./file-extensions").FileExtension;
|
|
261
263
|
forAudioCodec: {
|
|
262
|
-
mp3: {
|
|
263
|
-
possible: import("./file-extensions").FileExtension[];
|
|
264
|
-
default: import("./file-extensions").FileExtension;
|
|
265
|
-
};
|
|
266
264
|
"pcm-16": {
|
|
267
265
|
possible: import("./file-extensions").FileExtension[];
|
|
268
266
|
default: import("./file-extensions").FileExtension;
|
|
269
267
|
};
|
|
270
268
|
};
|
|
271
269
|
};
|
|
272
|
-
|
|
270
|
+
prores: {
|
|
273
271
|
default: import("./file-extensions").FileExtension;
|
|
274
272
|
forAudioCodec: {
|
|
273
|
+
aac: {
|
|
274
|
+
possible: import("./file-extensions").FileExtension[];
|
|
275
|
+
default: import("./file-extensions").FileExtension;
|
|
276
|
+
};
|
|
275
277
|
"pcm-16": {
|
|
276
278
|
possible: import("./file-extensions").FileExtension[];
|
|
277
279
|
default: import("./file-extensions").FileExtension;
|
|
@@ -308,11 +310,11 @@ export declare const RenderInternals: {
|
|
|
308
310
|
readonly vp9: readonly ["opus", "pcm-16"];
|
|
309
311
|
readonly wav: readonly ["pcm-16"];
|
|
310
312
|
};
|
|
311
|
-
makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "
|
|
312
|
-
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "
|
|
313
|
-
getExecutablePath: (type: "compositor" | "ffmpeg" | "ffprobe" | "ffmpeg-cwd") => string;
|
|
314
|
-
callFf: (bin: "ffmpeg" | "ffprobe", args: (string | null)[], options?: execa.Options<string> | undefined) => execa.ExecaChildProcess<string>;
|
|
315
|
-
dynamicLibraryPathOptions: () => {
|
|
313
|
+
makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif")[]>;
|
|
314
|
+
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">;
|
|
315
|
+
getExecutablePath: (type: "compositor" | "ffmpeg" | "ffprobe" | "ffmpeg-cwd", indent: boolean, logLevel: "verbose" | "info" | "warn" | "error") => string;
|
|
316
|
+
callFf: (bin: "ffmpeg" | "ffprobe", args: (string | null)[], indent: boolean, logLevel: "verbose" | "info" | "warn" | "error", options?: execa.Options<string> | undefined) => execa.ExecaChildProcess<string>;
|
|
317
|
+
dynamicLibraryPathOptions: (indent: boolean, logLevel: "verbose" | "info" | "warn" | "error") => {
|
|
316
318
|
env: {
|
|
317
319
|
DYLD_LIBRARY_PATH: string;
|
|
318
320
|
RUST_BACKTRACE: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DownloadMap } from './assets/download-map';
|
|
2
|
+
import type { LogLevel } from './log-level';
|
|
2
3
|
import type { PreprocessedAudioTrack } from './preprocess-audio-track';
|
|
3
4
|
type Options = {
|
|
4
5
|
files: PreprocessedAudioTrack[];
|
|
@@ -6,6 +7,8 @@ type Options = {
|
|
|
6
7
|
numberOfSeconds: number;
|
|
7
8
|
downloadMap: DownloadMap;
|
|
8
9
|
remotionRoot: string;
|
|
10
|
+
indent: boolean;
|
|
11
|
+
logLevel: LogLevel;
|
|
9
12
|
};
|
|
10
13
|
export declare const mergeAudioTrack: (options: Options) => Promise<void>;
|
|
11
14
|
export {};
|
|
@@ -14,11 +14,13 @@ const delete_directory_1 = require("./delete-directory");
|
|
|
14
14
|
const p_limit_1 = require("./p-limit");
|
|
15
15
|
const tmp_dir_1 = require("./tmp-dir");
|
|
16
16
|
const truthy_1 = require("./truthy");
|
|
17
|
-
const mergeAudioTrackUnlimited = async ({ outName, files, numberOfSeconds, downloadMap, remotionRoot, }) => {
|
|
17
|
+
const mergeAudioTrackUnlimited = async ({ outName, files, numberOfSeconds, downloadMap, remotionRoot, indent, logLevel, }) => {
|
|
18
18
|
if (files.length === 0) {
|
|
19
19
|
await (0, create_silent_audio_1.createSilentAudio)({
|
|
20
20
|
outName,
|
|
21
21
|
numberOfSeconds,
|
|
22
|
+
indent,
|
|
23
|
+
logLevel,
|
|
22
24
|
});
|
|
23
25
|
return;
|
|
24
26
|
}
|
|
@@ -36,6 +38,8 @@ const mergeAudioTrackUnlimited = async ({ outName, files, numberOfSeconds, downl
|
|
|
36
38
|
outName: chunkOutname,
|
|
37
39
|
downloadMap,
|
|
38
40
|
remotionRoot,
|
|
41
|
+
indent,
|
|
42
|
+
logLevel,
|
|
39
43
|
});
|
|
40
44
|
return chunkOutname;
|
|
41
45
|
}));
|
|
@@ -51,6 +55,8 @@ const mergeAudioTrackUnlimited = async ({ outName, files, numberOfSeconds, downl
|
|
|
51
55
|
outName,
|
|
52
56
|
downloadMap,
|
|
53
57
|
remotionRoot,
|
|
58
|
+
indent,
|
|
59
|
+
logLevel,
|
|
54
60
|
});
|
|
55
61
|
return;
|
|
56
62
|
}
|
|
@@ -71,7 +77,7 @@ const mergeAudioTrackUnlimited = async ({ outName, files, numberOfSeconds, downl
|
|
|
71
77
|
]
|
|
72
78
|
.filter(truthy_1.truthy)
|
|
73
79
|
.flat(2);
|
|
74
|
-
const task = (0, call_ffmpeg_1.callFf)('ffmpeg', args);
|
|
80
|
+
const task = (0, call_ffmpeg_1.callFf)('ffmpeg', args, indent, logLevel);
|
|
75
81
|
await task;
|
|
76
82
|
cleanup();
|
|
77
83
|
};
|
package/dist/options/gl.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare const glOption: {
|
|
|
4
4
|
cliFlag: string;
|
|
5
5
|
docLink: string;
|
|
6
6
|
name: string;
|
|
7
|
-
type: "
|
|
7
|
+
type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
|
|
8
8
|
ssrName: string;
|
|
9
9
|
description: () => JSX.Element;
|
|
10
10
|
};
|
package/dist/options/index.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ export declare const allOptions: {
|
|
|
86
86
|
description: () => JSX.Element;
|
|
87
87
|
docLink: string;
|
|
88
88
|
ssrName: string;
|
|
89
|
-
type: "
|
|
89
|
+
type: "default" | "bt709";
|
|
90
90
|
};
|
|
91
91
|
deleteAfterOption: {
|
|
92
92
|
name: string;
|
|
@@ -116,7 +116,7 @@ export declare const allOptions: {
|
|
|
116
116
|
cliFlag: string;
|
|
117
117
|
docLink: string;
|
|
118
118
|
name: string;
|
|
119
|
-
type: "
|
|
119
|
+
type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
|
|
120
120
|
ssrName: string;
|
|
121
121
|
description: () => JSX.Element;
|
|
122
122
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteAfterOption = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
exports.deleteAfterOption = {
|
|
6
|
+
name: 'Render expiry days',
|
|
7
|
+
cliFlag: 'delete-after',
|
|
8
|
+
description: () => {
|
|
9
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Automatically delete the render after a certain period. Accepted values are ", (0, jsx_runtime_1.jsx)("code", { children: "1-day" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "3-days" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "7-days" }), " and", ' ', (0, jsx_runtime_1.jsx)("code", { children: "30-days" }), ".", (0, jsx_runtime_1.jsx)("br", {}), " For this to work, your bucket needs to have", ' ', (0, jsx_runtime_1.jsx)("a", { href: "/docs/lambda/autodelete", children: "lifecycles enabled" }), "."] }));
|
|
10
|
+
},
|
|
11
|
+
ssrName: 'deleteAfter',
|
|
12
|
+
docLink: 'https://www.remotion.dev/docs/autodelete',
|
|
13
|
+
type: 0,
|
|
14
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DownloadMap } from './assets/download-map';
|
|
2
2
|
import type { MediaAsset } from './assets/types';
|
|
3
|
+
import type { LogLevel } from './log-level';
|
|
3
4
|
import type { ProcessedTrack } from './stringify-ffmpeg-filter';
|
|
4
5
|
type Options = {
|
|
5
6
|
outName: string;
|
|
@@ -7,6 +8,8 @@ type Options = {
|
|
|
7
8
|
expectedFrames: number;
|
|
8
9
|
fps: number;
|
|
9
10
|
downloadMap: DownloadMap;
|
|
11
|
+
indent: boolean;
|
|
12
|
+
logLevel: LogLevel;
|
|
10
13
|
};
|
|
11
14
|
export type PreprocessedAudioTrack = {
|
|
12
15
|
outName: string;
|
|
@@ -8,8 +8,8 @@ const ffmpeg_filter_file_1 = require("./ffmpeg-filter-file");
|
|
|
8
8
|
const p_limit_1 = require("./p-limit");
|
|
9
9
|
const resolve_asset_src_1 = require("./resolve-asset-src");
|
|
10
10
|
const sample_rate_1 = require("./sample-rate");
|
|
11
|
-
const preprocessAudioTrackUnlimited = async ({ outName, asset, expectedFrames, fps, downloadMap, }) => {
|
|
12
|
-
const { channels, duration } = await (0, get_audio_channels_1.getAudioChannelsAndDuration)(downloadMap, (0, resolve_asset_src_1.resolveAssetSrc)(asset.src));
|
|
11
|
+
const preprocessAudioTrackUnlimited = async ({ outName, asset, expectedFrames, fps, downloadMap, indent, logLevel, }) => {
|
|
12
|
+
const { channels, duration } = await (0, get_audio_channels_1.getAudioChannelsAndDuration)(downloadMap, (0, resolve_asset_src_1.resolveAssetSrc)(asset.src), indent, logLevel);
|
|
13
13
|
const filter = (0, calculate_ffmpeg_filters_1.calculateFfmpegFilter)({
|
|
14
14
|
asset,
|
|
15
15
|
durationInFrames: expectedFrames,
|
|
@@ -29,7 +29,7 @@ const preprocessAudioTrackUnlimited = async ({ outName, asset, expectedFrames, f
|
|
|
29
29
|
['-ar', String(sample_rate_1.DEFAULT_SAMPLE_RATE)],
|
|
30
30
|
['-y', outName],
|
|
31
31
|
].flat(2);
|
|
32
|
-
await (0, call_ffmpeg_1.callFf)('ffmpeg', args);
|
|
32
|
+
await (0, call_ffmpeg_1.callFf)('ffmpeg', args, indent, logLevel);
|
|
33
33
|
cleanup();
|
|
34
34
|
return { outName, filter };
|
|
35
35
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Codec } from './codec';
|
|
2
|
+
export declare const x264PresetOptions: readonly ["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo"];
|
|
3
|
+
export type x264Preset = typeof x264PresetOptions[number];
|
|
4
|
+
export declare const validateSelectedCodecAndPresetCombination: ({ codec, x264Preset, }: {
|
|
5
|
+
codec: Codec;
|
|
6
|
+
x264Preset: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | undefined;
|
|
7
|
+
}) => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateSelectedCodecAndPresetCombination = exports.x264PresetOptions = void 0;
|
|
4
|
+
exports.x264PresetOptions = [
|
|
5
|
+
'ultrafast',
|
|
6
|
+
'superfast',
|
|
7
|
+
'veryfast',
|
|
8
|
+
'faster',
|
|
9
|
+
'fast',
|
|
10
|
+
'medium',
|
|
11
|
+
'slow',
|
|
12
|
+
'slower',
|
|
13
|
+
'veryslow',
|
|
14
|
+
'placebo',
|
|
15
|
+
];
|
|
16
|
+
const validateSelectedCodecAndPresetCombination = ({ codec, x264Preset, }) => {
|
|
17
|
+
if (typeof x264Preset !== 'undefined' && codec !== 'h264') {
|
|
18
|
+
throw new TypeError(`You have set a Preset profile but the codec is "${codec}". Set the codec to "h264" or remove the Preset profile.`);
|
|
19
|
+
}
|
|
20
|
+
if (x264Preset !== undefined &&
|
|
21
|
+
!exports.x264PresetOptions.includes(x264Preset)) {
|
|
22
|
+
throw new TypeError(`The Preset profile "${x264Preset}" is not valid. Valid options are ${exports.x264PresetOptions
|
|
23
|
+
.map((p) => `"${p}"`)
|
|
24
|
+
.join(', ')}`);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.validateSelectedCodecAndPresetCombination = validateSelectedCodecAndPresetCombination;
|
package/dist/prespawn-ffmpeg.js
CHANGED
|
@@ -63,7 +63,7 @@ const prespawnFfmpeg = (options) => {
|
|
|
63
63
|
const finalFfmpegString = options.ffmpegOverride
|
|
64
64
|
? options.ffmpegOverride({ type: 'pre-stitcher', args: ffmpegString })
|
|
65
65
|
: ffmpegString;
|
|
66
|
-
const task = (0, call_ffmpeg_1.callFf)('ffmpeg', finalFfmpegString);
|
|
66
|
+
const task = (0, call_ffmpeg_1.callFf)('ffmpeg', finalFfmpegString, options.indent, options.logLevel);
|
|
67
67
|
options.signal(() => {
|
|
68
68
|
task.kill();
|
|
69
69
|
});
|
|
@@ -83,6 +83,8 @@ const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, logLevel
|
|
|
83
83
|
expectedFrames,
|
|
84
84
|
fps,
|
|
85
85
|
downloadMap,
|
|
86
|
+
indent,
|
|
87
|
+
logLevel,
|
|
86
88
|
});
|
|
87
89
|
preprocessProgress[index] = 1;
|
|
88
90
|
updateProgress();
|
|
@@ -95,6 +97,8 @@ const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, logLevel
|
|
|
95
97
|
numberOfSeconds: Number((expectedFrames / fps).toFixed(3)),
|
|
96
98
|
downloadMap,
|
|
97
99
|
remotionRoot,
|
|
100
|
+
indent,
|
|
101
|
+
logLevel,
|
|
98
102
|
});
|
|
99
103
|
onProgress(1);
|
|
100
104
|
(0, delete_directory_1.deleteDirectory)(downloadMap.audioMixing);
|
|
@@ -198,7 +202,7 @@ const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec,
|
|
|
198
202
|
audioBitrate ? audioBitrate : '320k',
|
|
199
203
|
force ? '-y' : null,
|
|
200
204
|
outputLocation !== null && outputLocation !== void 0 ? outputLocation : tempFile,
|
|
201
|
-
].filter(remotion_1.Internals.truthy));
|
|
205
|
+
].filter(remotion_1.Internals.truthy), indent, logLevel);
|
|
202
206
|
cancelSignal === null || cancelSignal === void 0 ? void 0 : cancelSignal(() => {
|
|
203
207
|
ffmpegTask.kill();
|
|
204
208
|
});
|
|
@@ -281,7 +285,7 @@ const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec,
|
|
|
281
285
|
logLevel,
|
|
282
286
|
tag: 'stitchFramesToVideo()',
|
|
283
287
|
}, finalFfmpegString.join(' '));
|
|
284
|
-
const task = (0, call_ffmpeg_1.callFf)('ffmpeg', finalFfmpegString, {
|
|
288
|
+
const task = (0, call_ffmpeg_1.callFf)('ffmpeg', finalFfmpegString, indent, logLevel, {
|
|
285
289
|
cwd: dir,
|
|
286
290
|
});
|
|
287
291
|
cancelSignal === null || cancelSignal === void 0 ? void 0 : cancelSignal(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AudioCodec } from './audio-codec';
|
|
2
|
-
export declare const validateOutputFilename: <T extends "h264" | "h265" | "vp8" | "vp9" | "
|
|
2
|
+
export declare const validateOutputFilename: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">({ codec, audioCodec, extension, preferLossless, }: {
|
|
3
3
|
codec: T;
|
|
4
4
|
audioCodec: AudioCodec | null;
|
|
5
5
|
extension: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/renderer",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.56",
|
|
4
4
|
"description": "Renderer for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"extract-zip": "2.0.1",
|
|
19
19
|
"source-map": "^0.8.0-beta.0",
|
|
20
20
|
"ws": "8.7.0",
|
|
21
|
-
"remotion": "4.0.
|
|
21
|
+
"remotion": "4.0.56"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": ">=16.8.0",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"vitest": "0.31.1"
|
|
41
41
|
},
|
|
42
42
|
"optionalDependencies": {
|
|
43
|
-
"@remotion/compositor-darwin-arm64": "4.0.
|
|
44
|
-
"@remotion/compositor-darwin-x64": "4.0.
|
|
45
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
46
|
-
"@remotion/compositor-linux-
|
|
47
|
-
"@remotion/compositor-linux-
|
|
48
|
-
"@remotion/compositor-linux-x64-
|
|
49
|
-
"@remotion/compositor-win32-x64-msvc": "4.0.
|
|
43
|
+
"@remotion/compositor-darwin-arm64": "4.0.56",
|
|
44
|
+
"@remotion/compositor-darwin-x64": "4.0.56",
|
|
45
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.56",
|
|
46
|
+
"@remotion/compositor-linux-x64-musl": "4.0.56",
|
|
47
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.56",
|
|
48
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.56",
|
|
49
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.56"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
|
52
52
|
"remotion",
|