@remotion/renderer 4.0.0-alpha6 → 4.0.0-alpha8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audio-codec.d.ts +1 -1
- package/dist/browser/BrowserRunner.js +7 -20
- package/dist/browser/LaunchOptions.d.ts +1 -2
- package/dist/browser/Launcher.js +3 -11
- package/dist/call-ffmpeg.js +3 -1
- package/dist/chalk/index.d.ts +54 -0
- package/dist/chalk/index.js +135 -0
- package/dist/chalk/is-color-supported.d.ts +1 -0
- package/dist/chalk/is-color-supported.js +37 -0
- package/dist/client.d.ts +45 -57
- package/dist/compositor/compose.js +5 -3
- package/dist/compositor/compositor.d.ts +2 -2
- package/dist/compositor/compositor.js +8 -5
- package/dist/compositor/get-executable-path.js +1 -10
- package/dist/create-ffmpeg-complex-filter.d.ts +1 -4
- package/dist/file-extensions.js +1 -7
- package/dist/get-compositions.d.ts +4 -0
- package/dist/get-compositions.js +2 -1
- package/dist/get-extension-from-codec.d.ts +2 -2
- package/dist/index.d.ts +111 -48
- package/dist/index.js +9 -0
- package/dist/logger.d.ts +22 -0
- package/dist/logger.js +61 -0
- package/dist/offthread-video-server.d.ts +2 -1
- package/dist/offthread-video-server.js +2 -2
- package/dist/open-browser.d.ts +1 -1
- package/dist/open-browser.js +1 -1
- package/dist/prepare-server.d.ts +2 -1
- package/dist/prepare-server.js +3 -1
- package/dist/prespawn-ffmpeg.d.ts +1 -0
- package/dist/prespawn-ffmpeg.js +37 -14
- package/dist/provide-screenshot.d.ts +1 -0
- package/dist/puppeteer-screenshot.d.ts +1 -0
- package/dist/render-frames.d.ts +4 -0
- package/dist/render-frames.js +4 -2
- package/dist/render-media.d.ts +4 -1
- package/dist/render-media.js +38 -17
- package/dist/render-still.d.ts +4 -0
- package/dist/render-still.js +3 -1
- package/dist/screenshot-dom-element.d.ts +1 -0
- package/dist/screenshot-task.d.ts +1 -0
- package/dist/serve-static.d.ts +1 -0
- package/dist/serve-static.js +1 -0
- package/dist/stitch-frames-to-video.d.ts +2 -0
- package/dist/stitch-frames-to-video.js +49 -26
- package/dist/take-frame-and-compose.d.ts +1 -0
- package/dist/validate-output-filename.d.ts +1 -1
- package/package.json +9 -9
- package/dist/assets/get-video-stream-duration.d.ts +0 -9
- package/dist/assets/get-video-stream-duration.js +0 -71
- package/dist/calculate-sar-dar-pixels.d.ts +0 -9
- package/dist/calculate-sar-dar-pixels.js +0 -19
- package/dist/determine-resize-params.d.ts +0 -1
- package/dist/determine-resize-params.js +0 -10
- package/dist/determine-vcodec-ffmpeg-flags.d.ts +0 -2
- package/dist/determine-vcodec-ffmpeg-flags.js +0 -13
- package/dist/ensure-ffmpeg.d.ts +0 -18
- package/dist/ensure-ffmpeg.js +0 -58
- package/dist/ensure-presentation-timestamp.d.ts +0 -15
- package/dist/ensure-presentation-timestamp.js +0 -88
- package/dist/extract-frame-from-video.d.ts +0 -17
- package/dist/extract-frame-from-video.js +0 -191
- package/dist/ffmpeg-executable.d.ts +0 -1
- package/dist/ffmpeg-executable.js +0 -2
- package/dist/ffmpeg-flags.d.ts +0 -31
- package/dist/ffmpeg-flags.js +0 -245
- package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -1
- package/dist/frame-to-ffmpeg-timestamp.js +0 -8
- package/dist/get-can-extract-frames-fast.d.ts +0 -14
- package/dist/get-can-extract-frames-fast.js +0 -71
- package/dist/get-frame-of-video-slow.d.ts +0 -15
- package/dist/get-frame-of-video-slow.js +0 -72
- package/dist/get-video-info.d.ts +0 -8
- package/dist/get-video-info.js +0 -59
- package/dist/is-beyond-last-frame.d.ts +0 -3
- package/dist/is-beyond-last-frame.js +0 -12
- package/dist/last-frame-from-video-cache.d.ts +0 -18
- package/dist/last-frame-from-video-cache.js +0 -55
- package/dist/legacy-webpack-config.d.ts +0 -9
- package/dist/legacy-webpack-config.js +0 -13
- package/dist/quality.d.ts +0 -1
- package/dist/quality.js +0 -21
- package/dist/try-to-extract-frame-of-video-fast.d.ts +0 -13
- package/dist/try-to-extract-frame-of-video-fast.js +0 -55
- package/dist/validate-ffmpeg.d.ts +0 -7
- package/dist/validate-ffmpeg.js +0 -77
- package/dist/warn-about-ffmpeg-version.d.ts +0 -5
- package/dist/warn-about-ffmpeg-version.js +0 -37
|
@@ -9,6 +9,7 @@ const node_fs_1 = require("node:fs");
|
|
|
9
9
|
const node_os_1 = __importDefault(require("node:os"));
|
|
10
10
|
const call_ffmpeg_1 = require("../call-ffmpeg");
|
|
11
11
|
const get_concurrency_1 = require("../get-concurrency");
|
|
12
|
+
const logger_1 = require("../logger");
|
|
12
13
|
const compose_1 = require("./compose");
|
|
13
14
|
const get_executable_path_1 = require("./get-executable-path");
|
|
14
15
|
const make_nonce_1 = require("./make-nonce");
|
|
@@ -22,18 +23,20 @@ const getIdealMaximumFrameCacheItems = () => {
|
|
|
22
23
|
return Math.max(100, Math.min(max, 1000));
|
|
23
24
|
};
|
|
24
25
|
exports.getIdealMaximumFrameCacheItems = getIdealMaximumFrameCacheItems;
|
|
25
|
-
const startLongRunningCompositor = (maximumFrameCacheItems, verbose) => {
|
|
26
|
+
const startLongRunningCompositor = (maximumFrameCacheItems, verbose, indent) => {
|
|
26
27
|
return (0, exports.startCompositor)('StartLongRunningProcess', {
|
|
27
28
|
concurrency: (0, get_concurrency_1.getActualConcurrency)(null),
|
|
28
29
|
maximum_frame_cache_items: maximumFrameCacheItems,
|
|
29
30
|
verbose,
|
|
30
|
-
});
|
|
31
|
+
}, indent);
|
|
31
32
|
};
|
|
32
33
|
exports.startLongRunningCompositor = startLongRunningCompositor;
|
|
33
|
-
const startCompositor = (type, payload) => {
|
|
34
|
+
const startCompositor = (type, payload, indent) => {
|
|
34
35
|
var _a;
|
|
35
36
|
const bin = (0, get_executable_path_1.getExecutablePath)('compositor');
|
|
36
|
-
(
|
|
37
|
+
if (!process.env.READ_ONLY_FS) {
|
|
38
|
+
(0, node_fs_1.chmodSync)(bin, 0o755);
|
|
39
|
+
}
|
|
37
40
|
const fullCommand = (0, compose_1.serializeCommand)(type, payload);
|
|
38
41
|
const child = (0, node_child_process_1.spawn)(bin, [JSON.stringify(fullCommand)], (0, call_ffmpeg_1.dynamicLibraryPathOptions)());
|
|
39
42
|
const stderrChunks = [];
|
|
@@ -42,7 +45,7 @@ const startCompositor = (type, payload) => {
|
|
|
42
45
|
const waiters = new Map();
|
|
43
46
|
const onMessage = (statusType, nonce, data) => {
|
|
44
47
|
if (nonce === '0') {
|
|
45
|
-
|
|
48
|
+
logger_1.Log.verboseAdvanced({ indent, logLevel: (0, logger_1.getLogLevel)(), tag: 'COMPOSITOR' }, data.toString('utf8'));
|
|
46
49
|
}
|
|
47
50
|
if (waiters.has(nonce)) {
|
|
48
51
|
if (statusType === 'error') {
|
|
@@ -8,17 +8,8 @@ function isMusl() {
|
|
|
8
8
|
return !glibcVersionRuntime;
|
|
9
9
|
}
|
|
10
10
|
const getExecutablePath = (type) => {
|
|
11
|
-
if (type === 'ffmpeg' && process.env.FFMPEG_BIN_PATH) {
|
|
12
|
-
return '/opt/ffmpeg/remotion/bin/ffmpeg';
|
|
13
|
-
}
|
|
14
|
-
if (type === 'ffprobe' && process.env.FFPROBE_BIN_PATH) {
|
|
15
|
-
return '/opt/ffmpeg/remotion/bin/ffprobe';
|
|
16
|
-
}
|
|
17
|
-
if (type === 'ffmpeg-cwd' && process.env.FFMPEG_CWD) {
|
|
18
|
-
return '/opt/ffmpeg';
|
|
19
|
-
}
|
|
20
11
|
if (type === 'compositor' && process.env.COMPOSITOR_PATH) {
|
|
21
|
-
return
|
|
12
|
+
return process.env.COMPOSITOR_PATH;
|
|
22
13
|
}
|
|
23
14
|
const key = type === 'compositor'
|
|
24
15
|
? 'binaryPath'
|
|
@@ -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
|
}>;
|
package/dist/file-extensions.js
CHANGED
|
@@ -23,13 +23,7 @@ exports.defaultFileExtensionMap = {
|
|
|
23
23
|
},
|
|
24
24
|
gif: {
|
|
25
25
|
default: 'gif',
|
|
26
|
-
forAudioCodec: {
|
|
27
|
-
// This is just to make the types happy, GIF does not support any audio
|
|
28
|
-
'pcm-16': { possible: [], default: 'wav' },
|
|
29
|
-
aac: { possible: [], default: 'wav' },
|
|
30
|
-
mp3: { possible: [], default: 'wav' },
|
|
31
|
-
opus: { possible: [], default: 'wav' },
|
|
32
|
-
},
|
|
26
|
+
forAudioCodec: {},
|
|
33
27
|
},
|
|
34
28
|
h264: {
|
|
35
29
|
default: 'mp4',
|
package/dist/get-compositions.js
CHANGED
|
@@ -68,7 +68,7 @@ const getCompositions = async (serveUrlOrWebpackUrl, config) => {
|
|
|
68
68
|
chromiumOptions: (_c = config === null || config === void 0 ? void 0 : config.chromiumOptions) !== null && _c !== void 0 ? _c : {},
|
|
69
69
|
});
|
|
70
70
|
return new Promise((resolve, reject) => {
|
|
71
|
-
var _a, _b;
|
|
71
|
+
var _a, _b, _c;
|
|
72
72
|
const onError = (err) => reject(err);
|
|
73
73
|
const cleanupPageError = (0, handle_javascript_exception_1.handleJavascriptException)({
|
|
74
74
|
page,
|
|
@@ -85,6 +85,7 @@ const getCompositions = async (serveUrlOrWebpackUrl, config) => {
|
|
|
85
85
|
remotionRoot: (0, find_closest_package_json_1.findRemotionRoot)(),
|
|
86
86
|
concurrency: 1,
|
|
87
87
|
verbose: (_b = config === null || config === void 0 ? void 0 : config.verbose) !== null && _b !== void 0 ? _b : false,
|
|
88
|
+
indent: (_c = config === null || config === void 0 ? void 0 : config.indent) !== null && _c !== void 0 ? _c : false,
|
|
88
89
|
})
|
|
89
90
|
.then(({ serveUrl, closeServer, offthreadPort }) => {
|
|
90
91
|
close = closeServer;
|
|
@@ -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 "
|
|
5
|
-
export declare const makeFileExtensionMap: () => Record<string, ("
|
|
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>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import execa from 'execa';
|
|
2
3
|
import { SymbolicateableError } from './error-handling/symbolicateable-error';
|
|
3
4
|
import { mimeContentType, mimeLookup } from './mime-types';
|
|
@@ -42,6 +43,7 @@ export declare const RenderInternals: {
|
|
|
42
43
|
remotionRoot: string;
|
|
43
44
|
concurrency: number;
|
|
44
45
|
verbose: boolean;
|
|
46
|
+
indent: boolean;
|
|
45
47
|
}) => Promise<{
|
|
46
48
|
port: number;
|
|
47
49
|
close: () => Promise<void>;
|
|
@@ -50,9 +52,9 @@ export declare const RenderInternals: {
|
|
|
50
52
|
width: number;
|
|
51
53
|
height: number;
|
|
52
54
|
scale: number;
|
|
53
|
-
codec: "
|
|
55
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
54
56
|
}) => void;
|
|
55
|
-
getFileExtensionFromCodec: <T extends "
|
|
57
|
+
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;
|
|
56
58
|
tmpDir: (str: string) => string;
|
|
57
59
|
deleteDirectory: (directory: string) => void;
|
|
58
60
|
isServeUrl: (potentialUrl: string) => boolean;
|
|
@@ -102,23 +104,23 @@ export declare const RenderInternals: {
|
|
|
102
104
|
};
|
|
103
105
|
registerErrorSymbolicationLock: () => number;
|
|
104
106
|
unlockErrorSymbolicationLock: (id: number) => void;
|
|
105
|
-
canUseParallelEncoding: (codec: "
|
|
107
|
+
canUseParallelEncoding: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
|
|
106
108
|
mimeContentType: typeof mimeContentType;
|
|
107
109
|
mimeLookup: typeof mimeLookup;
|
|
108
110
|
validateConcurrency: (value: unknown, setting: string) => void;
|
|
109
111
|
validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
110
112
|
DEFAULT_BROWSER: import("./browser").Browser;
|
|
111
113
|
validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
|
|
112
|
-
DEFAULT_OPENGL_RENDERER: "
|
|
113
|
-
validateOpenGlRenderer: (option: "
|
|
114
|
+
DEFAULT_OPENGL_RENDERER: "angle" | "swangle" | "egl" | "swiftshader" | null;
|
|
115
|
+
validateOpenGlRenderer: (option: "angle" | "swangle" | "egl" | "swiftshader" | null) => "angle" | "swangle" | "egl" | "swiftshader" | null;
|
|
114
116
|
validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "gif"];
|
|
115
117
|
DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
116
118
|
validateJpegQuality: (q: number | undefined) => void;
|
|
117
119
|
DEFAULT_TIMEOUT: number;
|
|
118
|
-
DEFAULT_CODEC: "
|
|
119
|
-
isAudioCodec: (codec: "
|
|
120
|
+
DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
121
|
+
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | undefined) => boolean;
|
|
120
122
|
logLevels: readonly ["verbose", "info", "warn", "error"];
|
|
121
|
-
isEqualOrBelowLogLevel: (currentLevel: "
|
|
123
|
+
isEqualOrBelowLogLevel: (currentLevel: "error" | "verbose" | "info" | "warn", level: "error" | "verbose" | "info" | "warn") => boolean;
|
|
122
124
|
isValidLogLevel: (level: string) => boolean;
|
|
123
125
|
perf: typeof perf;
|
|
124
126
|
makeDownloadMap: () => import("./assets/download-map").DownloadMap;
|
|
@@ -135,92 +137,92 @@ export declare const RenderInternals: {
|
|
|
135
137
|
output: string;
|
|
136
138
|
onProgress: (p: number) => void;
|
|
137
139
|
numberOfFrames: number;
|
|
138
|
-
codec: "
|
|
140
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
139
141
|
fps: number;
|
|
140
142
|
numberOfGifLoops: number | null;
|
|
141
|
-
audioCodec: "
|
|
143
|
+
audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
142
144
|
}) => Promise<void>;
|
|
143
145
|
getMinConcurrency: () => number;
|
|
144
146
|
getMaxConcurrency: () => any;
|
|
145
147
|
getDefaultAudioCodec: ({ codec, preferLossless, }: {
|
|
146
|
-
codec: "
|
|
148
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
147
149
|
preferLossless: boolean;
|
|
148
|
-
}) => "
|
|
150
|
+
}) => "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
149
151
|
validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
|
|
150
152
|
defaultFileExtensionMap: {
|
|
151
|
-
|
|
153
|
+
h264: {
|
|
152
154
|
default: import("./file-extensions").FileExtension;
|
|
153
155
|
forAudioCodec: {
|
|
154
|
-
|
|
156
|
+
aac: {
|
|
155
157
|
possible: import("./file-extensions").FileExtension[];
|
|
156
158
|
default: import("./file-extensions").FileExtension;
|
|
157
159
|
};
|
|
158
|
-
|
|
160
|
+
"pcm-16": {
|
|
159
161
|
possible: import("./file-extensions").FileExtension[];
|
|
160
162
|
default: import("./file-extensions").FileExtension;
|
|
161
163
|
};
|
|
162
164
|
};
|
|
163
165
|
};
|
|
164
|
-
|
|
166
|
+
h265: {
|
|
165
167
|
default: import("./file-extensions").FileExtension;
|
|
166
168
|
forAudioCodec: {
|
|
167
|
-
|
|
169
|
+
aac: {
|
|
168
170
|
possible: import("./file-extensions").FileExtension[];
|
|
169
171
|
default: import("./file-extensions").FileExtension;
|
|
170
172
|
};
|
|
171
|
-
|
|
173
|
+
"pcm-16": {
|
|
172
174
|
possible: import("./file-extensions").FileExtension[];
|
|
173
175
|
default: import("./file-extensions").FileExtension;
|
|
174
176
|
};
|
|
175
177
|
};
|
|
176
178
|
};
|
|
177
|
-
|
|
179
|
+
vp8: {
|
|
178
180
|
default: import("./file-extensions").FileExtension;
|
|
179
181
|
forAudioCodec: {
|
|
180
182
|
"pcm-16": {
|
|
181
183
|
possible: import("./file-extensions").FileExtension[];
|
|
182
184
|
default: import("./file-extensions").FileExtension;
|
|
183
185
|
};
|
|
184
|
-
|
|
186
|
+
opus: {
|
|
185
187
|
possible: import("./file-extensions").FileExtension[];
|
|
186
188
|
default: import("./file-extensions").FileExtension;
|
|
187
189
|
};
|
|
188
190
|
};
|
|
189
191
|
};
|
|
190
|
-
|
|
192
|
+
vp9: {
|
|
191
193
|
default: import("./file-extensions").FileExtension;
|
|
192
194
|
forAudioCodec: {
|
|
193
195
|
"pcm-16": {
|
|
194
196
|
possible: import("./file-extensions").FileExtension[];
|
|
195
197
|
default: import("./file-extensions").FileExtension;
|
|
196
198
|
};
|
|
197
|
-
|
|
199
|
+
opus: {
|
|
198
200
|
possible: import("./file-extensions").FileExtension[];
|
|
199
201
|
default: import("./file-extensions").FileExtension;
|
|
200
202
|
};
|
|
201
203
|
};
|
|
202
204
|
};
|
|
203
|
-
|
|
205
|
+
mp3: {
|
|
204
206
|
default: import("./file-extensions").FileExtension;
|
|
205
207
|
forAudioCodec: {
|
|
206
|
-
|
|
208
|
+
mp3: {
|
|
207
209
|
possible: import("./file-extensions").FileExtension[];
|
|
208
210
|
default: import("./file-extensions").FileExtension;
|
|
209
211
|
};
|
|
210
|
-
|
|
212
|
+
"pcm-16": {
|
|
211
213
|
possible: import("./file-extensions").FileExtension[];
|
|
212
214
|
default: import("./file-extensions").FileExtension;
|
|
213
215
|
};
|
|
214
216
|
};
|
|
215
217
|
};
|
|
216
|
-
|
|
218
|
+
aac: {
|
|
217
219
|
default: import("./file-extensions").FileExtension;
|
|
218
220
|
forAudioCodec: {
|
|
219
|
-
|
|
221
|
+
aac: {
|
|
220
222
|
possible: import("./file-extensions").FileExtension[];
|
|
221
223
|
default: import("./file-extensions").FileExtension;
|
|
222
224
|
};
|
|
223
|
-
|
|
225
|
+
"pcm-16": {
|
|
224
226
|
possible: import("./file-extensions").FileExtension[];
|
|
225
227
|
default: import("./file-extensions").FileExtension;
|
|
226
228
|
};
|
|
@@ -238,11 +240,11 @@ export declare const RenderInternals: {
|
|
|
238
240
|
prores: {
|
|
239
241
|
default: import("./file-extensions").FileExtension;
|
|
240
242
|
forAudioCodec: {
|
|
241
|
-
|
|
243
|
+
aac: {
|
|
242
244
|
possible: import("./file-extensions").FileExtension[];
|
|
243
245
|
default: import("./file-extensions").FileExtension;
|
|
244
246
|
};
|
|
245
|
-
|
|
247
|
+
"pcm-16": {
|
|
246
248
|
possible: import("./file-extensions").FileExtension[];
|
|
247
249
|
default: import("./file-extensions").FileExtension;
|
|
248
250
|
};
|
|
@@ -260,19 +262,7 @@ export declare const RenderInternals: {
|
|
|
260
262
|
gif: {
|
|
261
263
|
default: import("./file-extensions").FileExtension;
|
|
262
264
|
forAudioCodec: {
|
|
263
|
-
|
|
264
|
-
possible: import("./file-extensions").FileExtension[];
|
|
265
|
-
default: import("./file-extensions").FileExtension;
|
|
266
|
-
};
|
|
267
|
-
aac: {
|
|
268
|
-
possible: import("./file-extensions").FileExtension[];
|
|
269
|
-
default: import("./file-extensions").FileExtension;
|
|
270
|
-
};
|
|
271
|
-
mp3: {
|
|
272
|
-
possible: import("./file-extensions").FileExtension[];
|
|
273
|
-
default: import("./file-extensions").FileExtension;
|
|
274
|
-
};
|
|
275
|
-
opus: {
|
|
265
|
+
[x: string]: {
|
|
276
266
|
possible: import("./file-extensions").FileExtension[];
|
|
277
267
|
default: import("./file-extensions").FileExtension;
|
|
278
268
|
};
|
|
@@ -283,7 +273,7 @@ export declare const RenderInternals: {
|
|
|
283
273
|
readonly h264: readonly ["aac", "pcm-16"];
|
|
284
274
|
readonly 'h264-mkv': readonly ["pcm-16"];
|
|
285
275
|
readonly aac: readonly ["aac", "pcm-16"];
|
|
286
|
-
readonly gif:
|
|
276
|
+
readonly gif: const[];
|
|
287
277
|
readonly h265: readonly ["aac", "pcm-16"];
|
|
288
278
|
readonly mp3: readonly ["mp3", "pcm-16"];
|
|
289
279
|
readonly prores: readonly ["aac", "pcm-16"];
|
|
@@ -291,8 +281,8 @@ export declare const RenderInternals: {
|
|
|
291
281
|
readonly vp9: readonly ["opus", "pcm-16"];
|
|
292
282
|
readonly wav: readonly ["pcm-16"];
|
|
293
283
|
};
|
|
294
|
-
makeFileExtensionMap: () => Record<string, ("
|
|
295
|
-
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "
|
|
284
|
+
makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif")[]>;
|
|
285
|
+
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">;
|
|
296
286
|
getExecutablePath: (type: "compositor" | "ffmpeg" | "ffprobe" | "ffmpeg-cwd") => string;
|
|
297
287
|
callFf: (bin: "ffmpeg" | "ffprobe", args: (string | null)[], options?: execa.Options<string> | undefined) => execa.ExecaChildProcess<string>;
|
|
298
288
|
dynamicLibraryPathOptions: () => {
|
|
@@ -309,6 +299,79 @@ export declare const RenderInternals: {
|
|
|
309
299
|
};
|
|
310
300
|
validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
|
|
311
301
|
validVideoImageFormats: readonly ["png", "jpeg", "none"];
|
|
312
|
-
DEFAULT_STILL_IMAGE_FORMAT: "
|
|
313
|
-
DEFAULT_VIDEO_IMAGE_FORMAT: "
|
|
302
|
+
DEFAULT_STILL_IMAGE_FORMAT: "jpeg" | "png" | "webp" | "pdf";
|
|
303
|
+
DEFAULT_VIDEO_IMAGE_FORMAT: "jpeg" | "png" | "none";
|
|
304
|
+
chalk: {
|
|
305
|
+
enabled: boolean;
|
|
306
|
+
visible: boolean;
|
|
307
|
+
styles: Record<string, {
|
|
308
|
+
codes: [number, number];
|
|
309
|
+
name: string;
|
|
310
|
+
wrap?: ((input: string, newline: boolean) => string) | undefined;
|
|
311
|
+
}>;
|
|
312
|
+
keys: Record<string, string[]>;
|
|
313
|
+
alias?: ((name: string, col: string) => void) | undefined;
|
|
314
|
+
} & {
|
|
315
|
+
reset: (str: string) => string;
|
|
316
|
+
bold: (str: string) => string;
|
|
317
|
+
dim: (str: string) => string;
|
|
318
|
+
italic: (str: string) => string;
|
|
319
|
+
underline: (str: string) => string;
|
|
320
|
+
inverse: (str: string) => string;
|
|
321
|
+
hidden: (str: string) => string;
|
|
322
|
+
strikethrough: (str: string) => string;
|
|
323
|
+
black: (str: string) => string;
|
|
324
|
+
red: (str: string) => string;
|
|
325
|
+
green: (str: string) => string;
|
|
326
|
+
yellow: (str: string) => string;
|
|
327
|
+
blue: (str: string) => string;
|
|
328
|
+
magenta: (str: string) => string;
|
|
329
|
+
white: (str: string) => string;
|
|
330
|
+
gray: (str: string) => string;
|
|
331
|
+
bgBlack: (str: string) => string;
|
|
332
|
+
bgRed: (str: string) => string;
|
|
333
|
+
bgGreen: (str: string) => string;
|
|
334
|
+
bgYellow: (str: string) => string;
|
|
335
|
+
bgBlue: (str: string) => string;
|
|
336
|
+
bgMagenta: (str: string) => string;
|
|
337
|
+
bgWhite: (str: string) => string;
|
|
338
|
+
blackBright: (str: string) => string;
|
|
339
|
+
redBright: (str: string) => string;
|
|
340
|
+
greenBright: (str: string) => string;
|
|
341
|
+
yellowBright: (str: string) => string;
|
|
342
|
+
blueBright: (str: string) => string;
|
|
343
|
+
magentaBright: (str: string) => string;
|
|
344
|
+
whiteBright: (str: string) => string;
|
|
345
|
+
bgBlackBright: (str: string) => string;
|
|
346
|
+
bgRedBright: (str: string) => string;
|
|
347
|
+
bgGreenBright: (str: string) => string;
|
|
348
|
+
bgYellowBright: (str: string) => string;
|
|
349
|
+
bgBlueBright: (str: string) => string;
|
|
350
|
+
bgMagentaBright: (str: string) => string;
|
|
351
|
+
bgWhiteBright: (str: string) => string;
|
|
352
|
+
};
|
|
353
|
+
Log: {
|
|
354
|
+
verbose: (message?: any, ...optionalParams: any[]) => void;
|
|
355
|
+
verboseAdvanced: (options: {
|
|
356
|
+
indent: boolean;
|
|
357
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
358
|
+
} & {
|
|
359
|
+
tag?: string | undefined;
|
|
360
|
+
}, message?: any, ...optionalParams: any[]) => void;
|
|
361
|
+
info: (message?: any, ...optionalParams: any[]) => void;
|
|
362
|
+
infoAdvanced: (options: {
|
|
363
|
+
indent: boolean;
|
|
364
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
365
|
+
}, message?: any, ...optionalParams: any[]) => void;
|
|
366
|
+
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
367
|
+
warnAdvanced: (options: {
|
|
368
|
+
indent: boolean;
|
|
369
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
370
|
+
}, message?: any, ...optionalParams: any[]) => void;
|
|
371
|
+
error: (message?: any, ...optionalParams: any[]) => void;
|
|
372
|
+
};
|
|
373
|
+
getLogLevel: () => "error" | "verbose" | "info" | "warn";
|
|
374
|
+
setLogLevel: (newLogLevel: "error" | "verbose" | "info" | "warn") => void;
|
|
375
|
+
INDENT_TOKEN: string;
|
|
376
|
+
isColorSupported: boolean;
|
|
314
377
|
};
|
package/dist/index.js
CHANGED
|
@@ -35,6 +35,8 @@ const browser_1 = require("./browser");
|
|
|
35
35
|
const TimeoutSettings_1 = require("./browser/TimeoutSettings");
|
|
36
36
|
const call_ffmpeg_1 = require("./call-ffmpeg");
|
|
37
37
|
const can_use_parallel_encoding_1 = require("./can-use-parallel-encoding");
|
|
38
|
+
const chalk_1 = require("./chalk");
|
|
39
|
+
const is_color_supported_1 = require("./chalk/is-color-supported");
|
|
38
40
|
const check_apple_silicon_1 = require("./check-apple-silicon");
|
|
39
41
|
const codec_1 = require("./codec");
|
|
40
42
|
const combine_videos_1 = require("./combine-videos");
|
|
@@ -59,6 +61,7 @@ const is_audio_codec_1 = require("./is-audio-codec");
|
|
|
59
61
|
const is_serve_url_1 = require("./is-serve-url");
|
|
60
62
|
const jpeg_quality_1 = require("./jpeg-quality");
|
|
61
63
|
const log_level_1 = require("./log-level");
|
|
64
|
+
const logger_1 = require("./logger");
|
|
62
65
|
const mime_types_1 = require("./mime-types");
|
|
63
66
|
const open_browser_1 = require("./open-browser");
|
|
64
67
|
const parse_browser_error_stack_1 = require("./parse-browser-error-stack");
|
|
@@ -157,6 +160,12 @@ exports.RenderInternals = {
|
|
|
157
160
|
validVideoImageFormats: image_format_1.validVideoImageFormats,
|
|
158
161
|
DEFAULT_STILL_IMAGE_FORMAT: image_format_1.DEFAULT_STILL_IMAGE_FORMAT,
|
|
159
162
|
DEFAULT_VIDEO_IMAGE_FORMAT: image_format_1.DEFAULT_VIDEO_IMAGE_FORMAT,
|
|
163
|
+
chalk: chalk_1.chalk,
|
|
164
|
+
Log: logger_1.Log,
|
|
165
|
+
getLogLevel: logger_1.getLogLevel,
|
|
166
|
+
setLogLevel: logger_1.setLogLevel,
|
|
167
|
+
INDENT_TOKEN: logger_1.INDENT_TOKEN,
|
|
168
|
+
isColorSupported: is_color_supported_1.isColorSupported,
|
|
160
169
|
};
|
|
161
170
|
// Warn of potential performance issues with Apple Silicon (M1 chip under Rosetta)
|
|
162
171
|
(0, check_apple_silicon_1.checkNodeVersionAndWarnAboutRosetta)();
|
package/dist/logger.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { LogLevel } from './log-level';
|
|
2
|
+
export declare const INDENT_TOKEN: string;
|
|
3
|
+
declare type LogOptions = {
|
|
4
|
+
indent: boolean;
|
|
5
|
+
logLevel: LogLevel;
|
|
6
|
+
};
|
|
7
|
+
declare type VerboseLogOptions = LogOptions & {
|
|
8
|
+
tag?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const verboseTag: (str: string) => string;
|
|
11
|
+
export declare const Log: {
|
|
12
|
+
verbose: (message?: any, ...optionalParams: any[]) => void;
|
|
13
|
+
verboseAdvanced: (options: VerboseLogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
14
|
+
info: (message?: any, ...optionalParams: any[]) => void;
|
|
15
|
+
infoAdvanced: (options: LogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
16
|
+
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
17
|
+
warnAdvanced: (options: LogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
18
|
+
error: (message?: any, ...optionalParams: any[]) => void;
|
|
19
|
+
};
|
|
20
|
+
export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn";
|
|
21
|
+
export declare const setLogLevel: (newLogLevel: LogLevel) => void;
|
|
22
|
+
export {};
|
package/dist/logger.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setLogLevel = exports.getLogLevel = exports.Log = exports.verboseTag = exports.INDENT_TOKEN = void 0;
|
|
4
|
+
const chalk_1 = require("./chalk");
|
|
5
|
+
const is_color_supported_1 = require("./chalk/is-color-supported");
|
|
6
|
+
const log_level_1 = require("./log-level");
|
|
7
|
+
const truthy_1 = require("./truthy");
|
|
8
|
+
exports.INDENT_TOKEN = chalk_1.chalk.gray('│');
|
|
9
|
+
const verboseTag = (str) => {
|
|
10
|
+
return is_color_supported_1.isColorSupported
|
|
11
|
+
? chalk_1.chalk.bgBlack(` ${str.toUpperCase()} `)
|
|
12
|
+
: `[${str.toUpperCase()}]`;
|
|
13
|
+
};
|
|
14
|
+
exports.verboseTag = verboseTag;
|
|
15
|
+
exports.Log = {
|
|
16
|
+
verbose: (...args) => {
|
|
17
|
+
exports.Log.verboseAdvanced({ indent: false, logLevel: (0, exports.getLogLevel)() }, ...args);
|
|
18
|
+
},
|
|
19
|
+
verboseAdvanced: (options, ...args) => {
|
|
20
|
+
if ((0, log_level_1.isEqualOrBelowLogLevel)(options.logLevel, 'verbose')) {
|
|
21
|
+
return console.log(...[
|
|
22
|
+
options.indent ? exports.INDENT_TOKEN : null,
|
|
23
|
+
options.tag ? (0, exports.verboseTag)(options.tag) : null,
|
|
24
|
+
...args.map((a) => chalk_1.chalk.gray(a)),
|
|
25
|
+
].filter(truthy_1.truthy));
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
info: (...args) => {
|
|
29
|
+
exports.Log.infoAdvanced({ indent: false, logLevel: (0, exports.getLogLevel)() }, ...args);
|
|
30
|
+
},
|
|
31
|
+
infoAdvanced: (options, ...args) => {
|
|
32
|
+
if ((0, log_level_1.isEqualOrBelowLogLevel)(options.logLevel, 'info')) {
|
|
33
|
+
return console.log(...[options.indent ? exports.INDENT_TOKEN : null, ...args].filter(truthy_1.truthy));
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
warn: (...args) => {
|
|
37
|
+
exports.Log.warnAdvanced({ indent: false, logLevel: (0, exports.getLogLevel)() }, ...args);
|
|
38
|
+
},
|
|
39
|
+
warnAdvanced: (options, ...args) => {
|
|
40
|
+
if ((0, log_level_1.isEqualOrBelowLogLevel)(options.logLevel, 'warn')) {
|
|
41
|
+
return console.warn(...[
|
|
42
|
+
options.indent ? chalk_1.chalk.yellow(exports.INDENT_TOKEN) : null,
|
|
43
|
+
...args.map((a) => chalk_1.chalk.yellow(a)),
|
|
44
|
+
].filter(truthy_1.truthy));
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
error: (...args) => {
|
|
48
|
+
if ((0, log_level_1.isEqualOrBelowLogLevel)((0, exports.getLogLevel)(), 'error')) {
|
|
49
|
+
return console.error(...args.map((a) => chalk_1.chalk.red(a)));
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
let logLevel = 'info';
|
|
54
|
+
const getLogLevel = () => {
|
|
55
|
+
return logLevel;
|
|
56
|
+
};
|
|
57
|
+
exports.getLogLevel = getLogLevel;
|
|
58
|
+
const setLogLevel = (newLogLevel) => {
|
|
59
|
+
logLevel = newLogLevel;
|
|
60
|
+
};
|
|
61
|
+
exports.setLogLevel = setLogLevel;
|
|
@@ -6,12 +6,13 @@ export declare const extractUrlAndSourceFromUrl: (url: string) => {
|
|
|
6
6
|
time: number;
|
|
7
7
|
transparent: boolean;
|
|
8
8
|
};
|
|
9
|
-
export declare const startOffthreadVideoServer: ({ onDownload, onError, downloadMap, concurrency, verbose, }: {
|
|
9
|
+
export declare const startOffthreadVideoServer: ({ onDownload, onError, downloadMap, concurrency, verbose, indent, }: {
|
|
10
10
|
onDownload: RenderMediaOnDownload;
|
|
11
11
|
onError: (err: Error) => void;
|
|
12
12
|
downloadMap: DownloadMap;
|
|
13
13
|
concurrency: number;
|
|
14
14
|
verbose: boolean;
|
|
15
|
+
indent: boolean;
|
|
15
16
|
}) => {
|
|
16
17
|
listener: RequestListener;
|
|
17
18
|
close: () => Promise<void>;
|
|
@@ -27,12 +27,12 @@ const extractUrlAndSourceFromUrl = (url) => {
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
exports.extractUrlAndSourceFromUrl = extractUrlAndSourceFromUrl;
|
|
30
|
-
const startOffthreadVideoServer = ({ onDownload, onError, downloadMap, concurrency, verbose, }) => {
|
|
30
|
+
const startOffthreadVideoServer = ({ onDownload, onError, downloadMap, concurrency, verbose, indent, }) => {
|
|
31
31
|
const compositor = (0, compositor_1.startCompositor)('StartLongRunningProcess', {
|
|
32
32
|
concurrency,
|
|
33
33
|
maximum_frame_cache_items: (0, compositor_1.getIdealMaximumFrameCacheItems)(),
|
|
34
34
|
verbose,
|
|
35
|
-
});
|
|
35
|
+
}, indent);
|
|
36
36
|
return {
|
|
37
37
|
close: () => {
|
|
38
38
|
compositor.finishCommands();
|
package/dist/open-browser.d.ts
CHANGED
|
@@ -21,6 +21,6 @@ export declare const openBrowser: (browser: Browser, options?: {
|
|
|
21
21
|
chromiumOptions?: ChromiumOptions;
|
|
22
22
|
forceDeviceScaleFactor?: number;
|
|
23
23
|
viewport?: Viewport;
|
|
24
|
-
|
|
24
|
+
indent?: boolean;
|
|
25
25
|
}) => Promise<PuppeteerBrowser>;
|
|
26
26
|
export {};
|
package/dist/open-browser.js
CHANGED
|
@@ -43,7 +43,7 @@ const openBrowser = async (browser, options) => {
|
|
|
43
43
|
executablePath,
|
|
44
44
|
product: browser,
|
|
45
45
|
dumpio: (_e = options === null || options === void 0 ? void 0 : options.shouldDumpIo) !== null && _e !== void 0 ? _e : false,
|
|
46
|
-
|
|
46
|
+
indent: (_f = options === null || options === void 0 ? void 0 : options.indent) !== null && _f !== void 0 ? _f : false,
|
|
47
47
|
args: [
|
|
48
48
|
'about:blank',
|
|
49
49
|
'--allow-pre-commit-input',
|
package/dist/prepare-server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
|
|
2
2
|
import type { DownloadMap } from './assets/download-map';
|
|
3
|
-
export declare const prepareServer: ({ onDownload, onError, webpackConfigOrServeUrl, port, downloadMap, remotionRoot, concurrency, verbose, }: {
|
|
3
|
+
export declare const prepareServer: ({ onDownload, onError, webpackConfigOrServeUrl, port, downloadMap, remotionRoot, concurrency, verbose, indent, }: {
|
|
4
4
|
webpackConfigOrServeUrl: string;
|
|
5
5
|
onDownload: RenderMediaOnDownload;
|
|
6
6
|
onError: (err: Error) => void;
|
|
@@ -9,6 +9,7 @@ export declare const prepareServer: ({ onDownload, onError, webpackConfigOrServe
|
|
|
9
9
|
remotionRoot: string;
|
|
10
10
|
concurrency: number;
|
|
11
11
|
verbose: boolean;
|
|
12
|
+
indent: boolean;
|
|
12
13
|
}) => Promise<{
|
|
13
14
|
serveUrl: string;
|
|
14
15
|
closeServer: (force: boolean) => Promise<unknown>;
|
package/dist/prepare-server.js
CHANGED
|
@@ -9,7 +9,7 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
9
9
|
const is_serve_url_1 = require("./is-serve-url");
|
|
10
10
|
const serve_static_1 = require("./serve-static");
|
|
11
11
|
const wait_for_symbolication_error_to_be_done_1 = require("./wait-for-symbolication-error-to-be-done");
|
|
12
|
-
const prepareServer = async ({ onDownload, onError, webpackConfigOrServeUrl, port, downloadMap, remotionRoot, concurrency, verbose, }) => {
|
|
12
|
+
const prepareServer = async ({ onDownload, onError, webpackConfigOrServeUrl, port, downloadMap, remotionRoot, concurrency, verbose, indent, }) => {
|
|
13
13
|
if ((0, is_serve_url_1.isServeUrl)(webpackConfigOrServeUrl)) {
|
|
14
14
|
const { port: offthreadPort, close: closeProxy } = await (0, serve_static_1.serveStatic)(null, {
|
|
15
15
|
onDownload,
|
|
@@ -19,6 +19,7 @@ const prepareServer = async ({ onDownload, onError, webpackConfigOrServeUrl, por
|
|
|
19
19
|
remotionRoot,
|
|
20
20
|
concurrency,
|
|
21
21
|
verbose,
|
|
22
|
+
indent,
|
|
22
23
|
});
|
|
23
24
|
return Promise.resolve({
|
|
24
25
|
serveUrl: webpackConfigOrServeUrl,
|
|
@@ -42,6 +43,7 @@ const prepareServer = async ({ onDownload, onError, webpackConfigOrServeUrl, por
|
|
|
42
43
|
remotionRoot,
|
|
43
44
|
concurrency,
|
|
44
45
|
verbose,
|
|
46
|
+
indent,
|
|
45
47
|
});
|
|
46
48
|
return Promise.resolve({
|
|
47
49
|
closeServer: async (force) => {
|