@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
|
@@ -19,6 +19,7 @@ declare type PreStitcherOptions = {
|
|
|
19
19
|
ffmpegOverride: FfmpegOverrideFn;
|
|
20
20
|
signal: CancelSignal;
|
|
21
21
|
videoBitrate: string | null;
|
|
22
|
+
indent: boolean;
|
|
22
23
|
};
|
|
23
24
|
export declare const prespawnFfmpeg: (options: PreStitcherOptions) => {
|
|
24
25
|
task: import("execa").ExecaChildProcess<string>;
|
package/dist/prespawn-ffmpeg.js
CHANGED
|
@@ -4,10 +4,10 @@ exports.prespawnFfmpeg = void 0;
|
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
5
|
const call_ffmpeg_1 = require("./call-ffmpeg");
|
|
6
6
|
const codec_1 = require("./codec");
|
|
7
|
-
const get_executable_path_1 = require("./compositor/get-executable-path");
|
|
8
7
|
const crf_1 = require("./crf");
|
|
9
8
|
const get_codec_name_1 = require("./get-codec-name");
|
|
10
9
|
const get_prores_profile_name_1 = require("./get-prores-profile-name");
|
|
10
|
+
const logger_1 = require("./logger");
|
|
11
11
|
const parse_ffmpeg_progress_1 = require("./parse-ffmpeg-progress");
|
|
12
12
|
const pixel_format_1 = require("./pixel-format");
|
|
13
13
|
const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
|
|
@@ -30,16 +30,33 @@ const prespawnFfmpeg = (options) => {
|
|
|
30
30
|
throw new TypeError('encoderName is null: ' + JSON.stringify(options));
|
|
31
31
|
}
|
|
32
32
|
const supportsCrf = codec !== 'prores';
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
logger_1.Log.verboseAdvanced({
|
|
34
|
+
indent: options.indent,
|
|
35
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
36
|
+
tag: 'encoder',
|
|
37
|
+
}, 'encoder', encoderName);
|
|
38
|
+
logger_1.Log.verboseAdvanced({
|
|
39
|
+
indent: options.indent,
|
|
40
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
41
|
+
tag: 'encoder',
|
|
42
|
+
}, 'pixelFormat', pixelFormat);
|
|
43
|
+
if (supportsCrf) {
|
|
44
|
+
logger_1.Log.verboseAdvanced({
|
|
45
|
+
indent: options.indent,
|
|
46
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
47
|
+
tag: 'encoder',
|
|
48
|
+
}, 'pixelFormat', options.crf);
|
|
42
49
|
}
|
|
50
|
+
logger_1.Log.verboseAdvanced({
|
|
51
|
+
indent: options.indent,
|
|
52
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
53
|
+
tag: 'encoder',
|
|
54
|
+
}, 'codec', codec);
|
|
55
|
+
logger_1.Log.verboseAdvanced({
|
|
56
|
+
indent: options.indent,
|
|
57
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
58
|
+
tag: 'encoder',
|
|
59
|
+
}, 'proResProfileName', proResProfileName);
|
|
43
60
|
(0, pixel_format_1.validateSelectedPixelFormatAndCodecCombination)(pixelFormat, codec);
|
|
44
61
|
const ffmpegArgs = [
|
|
45
62
|
['-r', options.fps.toFixed(2)],
|
|
@@ -67,10 +84,16 @@ const prespawnFfmpeg = (options) => {
|
|
|
67
84
|
'-y',
|
|
68
85
|
options.outputLocation,
|
|
69
86
|
];
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
87
|
+
logger_1.Log.verboseAdvanced({
|
|
88
|
+
indent: options.indent,
|
|
89
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
90
|
+
tag: 'encoder',
|
|
91
|
+
}, 'Generated FFMPEG command:');
|
|
92
|
+
logger_1.Log.verboseAdvanced({
|
|
93
|
+
indent: options.indent,
|
|
94
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
95
|
+
tag: 'encoder',
|
|
96
|
+
}, ffmpegArgs.join(' '));
|
|
74
97
|
const ffmpegString = ffmpegArgs.flat(2).filter(Boolean);
|
|
75
98
|
const finalFfmpegString = options.ffmpegOverride
|
|
76
99
|
? options.ffmpegOverride({ type: 'pre-stitcher', args: ffmpegString })
|
package/dist/render-frames.d.ts
CHANGED
|
@@ -40,6 +40,10 @@ declare type RenderFramesOptions = {
|
|
|
40
40
|
* @deprecated Only for Remotion internal usage
|
|
41
41
|
*/
|
|
42
42
|
downloadMap?: DownloadMap;
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated Only for Remotion internal usage
|
|
45
|
+
*/
|
|
46
|
+
indent?: boolean;
|
|
43
47
|
muted?: boolean;
|
|
44
48
|
concurrency?: number | string | null;
|
|
45
49
|
serveUrl: string;
|
package/dist/render-frames.js
CHANGED
|
@@ -300,12 +300,13 @@ const renderFrames = (options) => {
|
|
|
300
300
|
(0, jpeg_quality_1.validateJpegQuality)(options.jpegQuality);
|
|
301
301
|
(0, validate_scale_1.validateScale)(options.scale);
|
|
302
302
|
const makeBrowser = () => {
|
|
303
|
-
var _a;
|
|
303
|
+
var _a, _b;
|
|
304
304
|
return (0, open_browser_1.openBrowser)(browser_1.DEFAULT_BROWSER, {
|
|
305
305
|
shouldDumpIo: options.dumpBrowserLogs,
|
|
306
306
|
browserExecutable: options.browserExecutable,
|
|
307
307
|
chromiumOptions: options.chromiumOptions,
|
|
308
308
|
forceDeviceScaleFactor: (_a = options.scale) !== null && _a !== void 0 ? _a : 1,
|
|
309
|
+
indent: (_b = options.indent) !== null && _b !== void 0 ? _b : false,
|
|
309
310
|
});
|
|
310
311
|
};
|
|
311
312
|
const browserInstance = (_a = options.puppeteerInstance) !== null && _a !== void 0 ? _a : makeBrowser();
|
|
@@ -314,7 +315,7 @@ const renderFrames = (options) => {
|
|
|
314
315
|
const actualConcurrency = (0, get_concurrency_1.getActualConcurrency)(concurrency !== null && concurrency !== void 0 ? concurrency : null);
|
|
315
316
|
const openedPages = [];
|
|
316
317
|
return new Promise((resolve, reject) => {
|
|
317
|
-
var _a, _b;
|
|
318
|
+
var _a, _b, _c;
|
|
318
319
|
const cleanup = [];
|
|
319
320
|
if (!options.downloadMap) {
|
|
320
321
|
cleanup.push(() => (0, download_map_1.cleanDownloadMap)(downloadMap));
|
|
@@ -339,6 +340,7 @@ const renderFrames = (options) => {
|
|
|
339
340
|
remotionRoot: (0, find_closest_package_json_1.findRemotionRoot)(),
|
|
340
341
|
concurrency: actualConcurrency,
|
|
341
342
|
verbose: (_b = options.verbose) !== null && _b !== void 0 ? _b : false,
|
|
343
|
+
indent: (_c = options.indent) !== null && _c !== void 0 ? _c : false,
|
|
342
344
|
}),
|
|
343
345
|
browserInstance,
|
|
344
346
|
]).then(([{ serveUrl, closeServer, offthreadPort }, puppeteerInstance]) => {
|
package/dist/render-media.d.ts
CHANGED
|
@@ -69,6 +69,10 @@ export declare type RenderMediaOptions = {
|
|
|
69
69
|
* @deprecated Only for Remotion internal usage
|
|
70
70
|
*/
|
|
71
71
|
onCtrlCExit?: (fn: () => void) => void;
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated Only for Remotion internal usage
|
|
74
|
+
*/
|
|
75
|
+
indent?: boolean;
|
|
72
76
|
};
|
|
73
77
|
preferLossless?: boolean;
|
|
74
78
|
muted?: boolean;
|
|
@@ -77,7 +81,6 @@ export declare type RenderMediaOptions = {
|
|
|
77
81
|
audioBitrate?: string | null;
|
|
78
82
|
videoBitrate?: string | null;
|
|
79
83
|
disallowParallelEncoding?: boolean;
|
|
80
|
-
printLog?: (...data: unknown[]) => void;
|
|
81
84
|
audioCodec?: AudioCodec | null;
|
|
82
85
|
serveUrl: string;
|
|
83
86
|
concurrency?: number | string | null;
|
package/dist/render-media.js
CHANGED
|
@@ -22,6 +22,7 @@ const get_frame_to_render_1 = require("./get-frame-to-render");
|
|
|
22
22
|
const image_format_1 = require("./image-format");
|
|
23
23
|
const is_audio_codec_1 = require("./is-audio-codec");
|
|
24
24
|
const jpeg_quality_1 = require("./jpeg-quality");
|
|
25
|
+
const logger_1 = require("./logger");
|
|
25
26
|
const make_cancel_signal_1 = require("./make-cancel-signal");
|
|
26
27
|
const overwrite_1 = require("./overwrite");
|
|
27
28
|
const perf_1 = require("./perf");
|
|
@@ -45,7 +46,7 @@ const SLOWEST_FRAME_COUNT = 10;
|
|
|
45
46
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/render-media)
|
|
46
47
|
*/
|
|
47
48
|
const renderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, dumpBrowserLogs, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, audioCodec, ...options }) => {
|
|
48
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
49
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
49
50
|
if (options.quality) {
|
|
50
51
|
throw new Error(`The "quality" option has been renamed. Please use "jpegQuality" instead.`);
|
|
51
52
|
}
|
|
@@ -92,21 +93,38 @@ const renderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat,
|
|
|
92
93
|
const parallelEncoding = !options.disallowParallelEncoding &&
|
|
93
94
|
hasEnoughMemory &&
|
|
94
95
|
(0, can_use_parallel_encoding_1.canUseParallelEncoding)(codec);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
96
|
+
logger_1.Log.verboseAdvanced({
|
|
97
|
+
indent: (_g = (_f = options.internal) === null || _f === void 0 ? void 0 : _f.indent) !== null && _g !== void 0 ? _g : false,
|
|
98
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
99
|
+
tag: 'PARALLEL ENCODING',
|
|
100
|
+
}, 'Free memory:', freeMemory, 'Estimated usage parallel encoding', estimatedUsage);
|
|
101
|
+
logger_1.Log.verboseAdvanced({
|
|
102
|
+
indent: (_j = (_h = options.internal) === null || _h === void 0 ? void 0 : _h.indent) !== null && _j !== void 0 ? _j : false,
|
|
103
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
104
|
+
tag: 'PARALLEL ENCODING',
|
|
105
|
+
}, 'Codec supports parallel rendering:', (0, can_use_parallel_encoding_1.canUseParallelEncoding)(codec));
|
|
106
|
+
logger_1.Log.verboseAdvanced({
|
|
107
|
+
indent: (_l = (_k = options.internal) === null || _k === void 0 ? void 0 : _k.indent) !== null && _l !== void 0 ? _l : false,
|
|
108
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
109
|
+
tag: 'PARALLEL ENCODING',
|
|
110
|
+
}, 'User disallowed parallel encoding:', Boolean(options.disallowParallelEncoding));
|
|
111
|
+
if (parallelEncoding) {
|
|
112
|
+
logger_1.Log.verboseAdvanced({
|
|
113
|
+
indent: (_o = (_m = options.internal) === null || _m === void 0 ? void 0 : _m.indent) !== null && _o !== void 0 ? _o : false,
|
|
114
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
115
|
+
tag: 'PARALLEL ENCODING',
|
|
116
|
+
}, 'Parallel encoding is enabled.');
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
logger_1.Log.verboseAdvanced({
|
|
120
|
+
indent: (_q = (_p = options.internal) === null || _p === void 0 ? void 0 : _p.indent) !== null && _q !== void 0 ? _q : false,
|
|
121
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
122
|
+
tag: 'PARALLEL ENCODING',
|
|
123
|
+
}, 'Parallel encoding is disabled.');
|
|
106
124
|
}
|
|
107
125
|
const imageFormat = (0, is_audio_codec_1.isAudioCodec)(codec)
|
|
108
126
|
? 'none'
|
|
109
|
-
: (
|
|
127
|
+
: (_r = options.imageFormat) !== null && _r !== void 0 ? _r : 'jpeg';
|
|
110
128
|
const jpegQuality = imageFormat === 'jpeg' ? options.jpegQuality : undefined;
|
|
111
129
|
(0, image_format_1.validateSelectedPixelFormatAndImageFormatCombination)(pixelFormat, imageFormat);
|
|
112
130
|
const preEncodedFileLocation = parallelEncoding
|
|
@@ -115,7 +133,7 @@ const renderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat,
|
|
|
115
133
|
const outputDir = parallelEncoding
|
|
116
134
|
? null
|
|
117
135
|
: node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'react-motion-render'));
|
|
118
|
-
if (((
|
|
136
|
+
if (((_s = options.internal) === null || _s === void 0 ? void 0 : _s.onCtrlCExit) && outputDir) {
|
|
119
137
|
options.internal.onCtrlCExit(() => (0, delete_directory_1.deleteDirectory)(outputDir));
|
|
120
138
|
}
|
|
121
139
|
(0, validate_even_dimensions_with_codec_1.validateEvenDimensionsWithCodec)({
|
|
@@ -147,7 +165,7 @@ const renderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat,
|
|
|
147
165
|
const fps = composition.fps / (everyNthFrame !== null && everyNthFrame !== void 0 ? everyNthFrame : 1);
|
|
148
166
|
remotion_1.Internals.validateFps(fps, 'in "renderMedia()"', codec === 'gif');
|
|
149
167
|
const createPrestitcherIfNecessary = () => {
|
|
150
|
-
var _a;
|
|
168
|
+
var _a, _b, _c;
|
|
151
169
|
if (preEncodedFileLocation) {
|
|
152
170
|
preStitcher = (0, prespawn_ffmpeg_1.prespawnFfmpeg)({
|
|
153
171
|
width: composition.width * (scale !== null && scale !== void 0 ? scale : 1),
|
|
@@ -167,6 +185,7 @@ const renderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat,
|
|
|
167
185
|
signal: cancelPrestitcher.cancelSignal,
|
|
168
186
|
ffmpegOverride: ffmpegOverride !== null && ffmpegOverride !== void 0 ? ffmpegOverride : (({ args }) => args),
|
|
169
187
|
videoBitrate: videoBitrate !== null && videoBitrate !== void 0 ? videoBitrate : null,
|
|
188
|
+
indent: (_c = (_b = options.internal) === null || _b === void 0 ? void 0 : _b.indent) !== null && _c !== void 0 ? _c : false,
|
|
170
189
|
});
|
|
171
190
|
stitcherFfmpeg = preStitcher.task;
|
|
172
191
|
}
|
|
@@ -212,7 +231,7 @@ const renderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat,
|
|
|
212
231
|
};
|
|
213
232
|
const happyPath = Promise.resolve(createPrestitcherIfNecessary())
|
|
214
233
|
.then(() => {
|
|
215
|
-
var _a;
|
|
234
|
+
var _a, _b, _c;
|
|
216
235
|
const renderFramesProc = (0, render_frames_1.renderFrames)({
|
|
217
236
|
composition,
|
|
218
237
|
onFrameUpdate: (frame, frameIndex, timeToRenderInMilliseconds) => {
|
|
@@ -260,6 +279,7 @@ const renderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat,
|
|
|
260
279
|
downloadMap,
|
|
261
280
|
muted: disableAudio,
|
|
262
281
|
verbose: (_a = options.verbose) !== null && _a !== void 0 ? _a : false,
|
|
282
|
+
indent: (_c = (_b = options.internal) === null || _b === void 0 ? void 0 : _b.indent) !== null && _c !== void 0 ? _c : false,
|
|
263
283
|
});
|
|
264
284
|
return renderFramesProc;
|
|
265
285
|
})
|
|
@@ -267,7 +287,7 @@ const renderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat,
|
|
|
267
287
|
return Promise.all([renderFramesReturn, waitForPrestitcherIfNecessary()]);
|
|
268
288
|
})
|
|
269
289
|
.then(([{ assetsInfo }]) => {
|
|
270
|
-
var _a;
|
|
290
|
+
var _a, _b, _c;
|
|
271
291
|
renderedDoneIn = Date.now() - renderStart;
|
|
272
292
|
callUpdate();
|
|
273
293
|
if (absoluteOutputLocation) {
|
|
@@ -307,6 +327,7 @@ const renderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat,
|
|
|
307
327
|
audioBitrate,
|
|
308
328
|
videoBitrate,
|
|
309
329
|
audioCodec: audioCodec !== null && audioCodec !== void 0 ? audioCodec : null,
|
|
330
|
+
indent: (_c = (_b = options.internal) === null || _b === void 0 ? void 0 : _b.indent) !== null && _c !== void 0 ? _c : false,
|
|
310
331
|
}),
|
|
311
332
|
stitchStart,
|
|
312
333
|
]);
|
package/dist/render-still.d.ts
CHANGED
|
@@ -34,6 +34,10 @@ declare type InnerStillOptions = {
|
|
|
34
34
|
* @deprecated Only for Remotion internal usage
|
|
35
35
|
*/
|
|
36
36
|
downloadMap?: DownloadMap;
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Only for Remotion internal usage
|
|
39
|
+
*/
|
|
40
|
+
indent?: boolean;
|
|
37
41
|
verbose?: boolean;
|
|
38
42
|
};
|
|
39
43
|
declare type RenderStillReturnValue = {
|
package/dist/render-still.js
CHANGED
|
@@ -94,6 +94,7 @@ const innerRenderStill = async ({ composition, quality, imageFormat = image_form
|
|
|
94
94
|
shouldDumpIo: dumpBrowserLogs,
|
|
95
95
|
chromiumOptions,
|
|
96
96
|
forceDeviceScaleFactor: scale !== null && scale !== void 0 ? scale : 1,
|
|
97
|
+
indent: false,
|
|
97
98
|
}));
|
|
98
99
|
const page = await browserInstance.newPage();
|
|
99
100
|
await page.setViewport({
|
|
@@ -197,7 +198,7 @@ const renderStill = (options) => {
|
|
|
197
198
|
const downloadMap = (_a = options.downloadMap) !== null && _a !== void 0 ? _a : (0, download_map_1.makeDownloadMap)();
|
|
198
199
|
const onDownload = (_b = options.onDownload) !== null && _b !== void 0 ? _b : (() => () => undefined);
|
|
199
200
|
const happyPath = new Promise((resolve, reject) => {
|
|
200
|
-
var _a, _b;
|
|
201
|
+
var _a, _b, _c;
|
|
201
202
|
const onError = (err) => reject(err);
|
|
202
203
|
let close = null;
|
|
203
204
|
(0, prepare_server_1.prepareServer)({
|
|
@@ -209,6 +210,7 @@ const renderStill = (options) => {
|
|
|
209
210
|
remotionRoot: (0, find_closest_package_json_1.findRemotionRoot)(),
|
|
210
211
|
concurrency: 1,
|
|
211
212
|
verbose: (_b = options.verbose) !== null && _b !== void 0 ? _b : false,
|
|
213
|
+
indent: (_c = options.indent) !== null && _c !== void 0 ? _c : false,
|
|
212
214
|
})
|
|
213
215
|
.then(({ serveUrl, closeServer, offthreadPort }) => {
|
|
214
216
|
close = closeServer;
|
package/dist/serve-static.d.ts
CHANGED
package/dist/serve-static.js
CHANGED
|
@@ -15,6 +15,7 @@ const serveStatic = async (path, options) => {
|
|
|
15
15
|
downloadMap: options.downloadMap,
|
|
16
16
|
concurrency: options.concurrency,
|
|
17
17
|
verbose: options.verbose,
|
|
18
|
+
indent: options.indent,
|
|
18
19
|
});
|
|
19
20
|
const connections = {};
|
|
20
21
|
const server = node_http_1.default.createServer((request, response) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
|
|
2
3
|
import type { RenderAssetInfo } from './assets/download-map';
|
|
3
4
|
import type { AudioCodec } from './audio-codec';
|
|
@@ -35,6 +36,7 @@ export declare type StitcherOptions = {
|
|
|
35
36
|
muted?: boolean;
|
|
36
37
|
enforceAudioTrack?: boolean;
|
|
37
38
|
ffmpegOverride?: FfmpegOverrideFn;
|
|
39
|
+
indent: boolean;
|
|
38
40
|
};
|
|
39
41
|
/**
|
|
40
42
|
* @description Takes a series of images and audio information generated by renderFrames() and encodes it to a video.
|
|
@@ -37,7 +37,6 @@ const audio_codec_1 = require("./audio-codec");
|
|
|
37
37
|
const call_ffmpeg_1 = require("./call-ffmpeg");
|
|
38
38
|
const codec_1 = require("./codec");
|
|
39
39
|
const codec_supports_media_1 = require("./codec-supports-media");
|
|
40
|
-
const get_executable_path_1 = require("./compositor/get-executable-path");
|
|
41
40
|
const convert_number_of_gif_loops_to_ffmpeg_1 = require("./convert-number-of-gif-loops-to-ffmpeg");
|
|
42
41
|
const crf_1 = require("./crf");
|
|
43
42
|
const delete_directory_1 = require("./delete-directory");
|
|
@@ -46,6 +45,7 @@ const find_closest_package_json_1 = require("./find-closest-package-json");
|
|
|
46
45
|
const get_codec_name_1 = require("./get-codec-name");
|
|
47
46
|
const get_extension_from_codec_1 = require("./get-extension-from-codec");
|
|
48
47
|
const get_prores_profile_name_1 = require("./get-prores-profile-name");
|
|
48
|
+
const logger_1 = require("./logger");
|
|
49
49
|
const make_cancel_signal_1 = require("./make-cancel-signal");
|
|
50
50
|
const merge_audio_track_1 = require("./merge-audio-track");
|
|
51
51
|
const parse_ffmpeg_progress_1 = require("./parse-ffmpeg-progress");
|
|
@@ -59,7 +59,7 @@ const packageJsonPath = node_path_1.default.join(__dirname, '..', 'package.json'
|
|
|
59
59
|
const packageJson = node_fs_1.default.existsSync(packageJsonPath)
|
|
60
60
|
? JSON.parse(node_fs_1.default.readFileSync(packageJsonPath, 'utf-8'))
|
|
61
61
|
: null;
|
|
62
|
-
const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, verbose, onProgress, downloadMap, remotionRoot, }) => {
|
|
62
|
+
const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, verbose, onProgress, downloadMap, remotionRoot, indent, }) => {
|
|
63
63
|
const fileUrlAssets = await (0, convert_assets_to_file_urls_1.convertAssetsToFileUrls)({
|
|
64
64
|
assets,
|
|
65
65
|
onDownload: onDownload !== null && onDownload !== void 0 ? onDownload : (() => () => undefined),
|
|
@@ -67,9 +67,7 @@ const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, verbose,
|
|
|
67
67
|
});
|
|
68
68
|
(0, download_and_map_assets_to_file_1.markAllAssetsAsDownloaded)(downloadMap);
|
|
69
69
|
const assetPositions = (0, calculate_asset_positions_1.calculateAssetPositions)(fileUrlAssets);
|
|
70
|
-
|
|
71
|
-
console.log('asset positions', assetPositions);
|
|
72
|
-
}
|
|
70
|
+
logger_1.Log.verboseAdvanced({ indent, logLevel: verbose ? 'verbose' : 'info', tag: 'audio' }, 'asset positions', JSON.stringify(assetPositions));
|
|
73
71
|
const preprocessProgress = new Array(assetPositions.length).fill(0);
|
|
74
72
|
const updateProgress = () => {
|
|
75
73
|
onProgress(preprocessProgress.reduce((a, b) => a + b, 0) / assetPositions.length);
|
|
@@ -139,19 +137,41 @@ const spawnFfmpeg = async (options, remotionRoot) => {
|
|
|
139
137
|
const tempFile = options.outputLocation
|
|
140
138
|
? null
|
|
141
139
|
: node_path_1.default.join(options.assetsInfo.downloadMap.stitchFrames, `out.${(0, get_extension_from_codec_1.getFileExtensionFromCodec)(codec, resolvedAudioCodec)}`);
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
140
|
+
logger_1.Log.verboseAdvanced({
|
|
141
|
+
indent: options.indent,
|
|
142
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
143
|
+
tag: 'encoder',
|
|
144
|
+
}, 'encoder', encoderName);
|
|
145
|
+
logger_1.Log.verboseAdvanced({
|
|
146
|
+
indent: options.indent,
|
|
147
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
148
|
+
tag: 'encoder',
|
|
149
|
+
}, 'audioCodec', resolvedAudioCodec);
|
|
150
|
+
logger_1.Log.verboseAdvanced({
|
|
151
|
+
indent: options.indent,
|
|
152
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
153
|
+
tag: 'encoder',
|
|
154
|
+
}, 'pixelFormat', pixelFormat);
|
|
155
|
+
logger_1.Log.verboseAdvanced({
|
|
156
|
+
indent: options.indent,
|
|
157
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
158
|
+
tag: 'encoder',
|
|
159
|
+
}, 'codec', codec);
|
|
160
|
+
logger_1.Log.verboseAdvanced({
|
|
161
|
+
indent: options.indent,
|
|
162
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
163
|
+
tag: 'encoder',
|
|
164
|
+
}, 'shouldRenderAudio', shouldRenderAudio);
|
|
165
|
+
logger_1.Log.verboseAdvanced({
|
|
166
|
+
indent: options.indent,
|
|
167
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
168
|
+
tag: 'encoder',
|
|
169
|
+
}, 'shouldRenderVideo', shouldRenderVideo);
|
|
170
|
+
logger_1.Log.verboseAdvanced({
|
|
171
|
+
indent: options.indent,
|
|
172
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
173
|
+
tag: 'encoder',
|
|
174
|
+
}, 'proResProfileName', proResProfileName);
|
|
155
175
|
(0, crf_1.validateQualitySettings)({
|
|
156
176
|
crf: options.crf,
|
|
157
177
|
codec,
|
|
@@ -174,6 +194,7 @@ const spawnFfmpeg = async (options, remotionRoot) => {
|
|
|
174
194
|
onProgress: (prog) => updateProgress(prog, 0),
|
|
175
195
|
downloadMap: options.assetsInfo.downloadMap,
|
|
176
196
|
remotionRoot,
|
|
197
|
+
indent: options.indent,
|
|
177
198
|
})
|
|
178
199
|
: null;
|
|
179
200
|
if (mediaSupport.audio && !mediaSupport.video) {
|
|
@@ -268,18 +289,20 @@ const spawnFfmpeg = async (options, remotionRoot) => {
|
|
|
268
289
|
options.force ? '-y' : null,
|
|
269
290
|
(_q = options.outputLocation) !== null && _q !== void 0 ? _q : tempFile,
|
|
270
291
|
];
|
|
271
|
-
if (options.verbose) {
|
|
272
|
-
console.log('Generated FFMPEG command:');
|
|
273
|
-
console.log(ffmpegArgs);
|
|
274
|
-
}
|
|
275
292
|
const ffmpegString = ffmpegArgs.flat(2).filter(Boolean);
|
|
276
293
|
const finalFfmpegString = options.ffmpegOverride
|
|
277
294
|
? options.ffmpegOverride({ type: 'stitcher', args: ffmpegString })
|
|
278
295
|
: ffmpegString;
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
296
|
+
logger_1.Log.verboseAdvanced({
|
|
297
|
+
indent: options.indent,
|
|
298
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
299
|
+
tag: 'encoder',
|
|
300
|
+
}, 'Generated final FFMPEG command:');
|
|
301
|
+
logger_1.Log.verboseAdvanced({
|
|
302
|
+
indent: options.indent,
|
|
303
|
+
logLevel: options.verbose ? 'verbose' : 'info',
|
|
304
|
+
tag: 'encoder',
|
|
305
|
+
}, finalFfmpegString.join(' '));
|
|
283
306
|
const task = (0, call_ffmpeg_1.callFf)('ffmpeg', finalFfmpegString, {
|
|
284
307
|
cwd: options.dir,
|
|
285
308
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AudioCodec } from './audio-codec';
|
|
2
|
-
export declare const validateOutputFilename: <T extends "
|
|
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.0-
|
|
3
|
+
"version": "4.0.0-alpha8",
|
|
4
4
|
"description": "Renderer for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"execa": "5.1.1",
|
|
18
18
|
"extract-zip": "2.0.1",
|
|
19
|
-
"remotion": "4.0.0-
|
|
19
|
+
"remotion": "4.0.0-alpha8",
|
|
20
20
|
"source-map": "^0.8.0-beta.0",
|
|
21
21
|
"ws": "8.7.0"
|
|
22
22
|
},
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"zod": "^3.21.4"
|
|
43
43
|
},
|
|
44
44
|
"optionalDependencies": {
|
|
45
|
-
"@remotion/compositor-darwin-arm64": "4.0.0-
|
|
46
|
-
"@remotion/compositor-darwin-x64": "4.0.0-
|
|
47
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.0-
|
|
48
|
-
"@remotion/compositor-linux-arm64-musl": "4.0.0-
|
|
49
|
-
"@remotion/compositor-linux-x64-gnu": "4.0.0-
|
|
50
|
-
"@remotion/compositor-linux-x64-musl": "4.0.0-
|
|
51
|
-
"@remotion/compositor-win32-x64-msvc": "4.0.0-
|
|
45
|
+
"@remotion/compositor-darwin-arm64": "4.0.0-alpha8",
|
|
46
|
+
"@remotion/compositor-darwin-x64": "4.0.0-alpha8",
|
|
47
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.0-alpha8",
|
|
48
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.0-alpha8",
|
|
49
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.0-alpha8",
|
|
50
|
+
"@remotion/compositor-linux-x64-musl": "4.0.0-alpha8",
|
|
51
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.0-alpha8"
|
|
52
52
|
},
|
|
53
53
|
"keywords": [
|
|
54
54
|
"remotion",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { FfmpegExecutable } from '../ffmpeg-executable';
|
|
2
|
-
import type { DownloadMap, VideoDurationResult } from './download-map';
|
|
3
|
-
export declare const parseVideoStreamDuration: (stdout: string) => VideoDurationResult;
|
|
4
|
-
export declare function getVideoStreamDurationwithoutCache({ src, ffprobeExecutable, remotionRoot, }: {
|
|
5
|
-
src: string;
|
|
6
|
-
ffprobeExecutable: FfmpegExecutable;
|
|
7
|
-
remotionRoot: string;
|
|
8
|
-
}): Promise<VideoDurationResult>;
|
|
9
|
-
export declare const getVideoStreamDuration: (downloadMap: DownloadMap, src: string, ffprobeExecutable: FfmpegExecutable, remotionRoot: string) => Promise<VideoDurationResult>;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getVideoStreamDuration = exports.getVideoStreamDurationwithoutCache = exports.parseVideoStreamDuration = void 0;
|
|
7
|
-
const execa_1 = __importDefault(require("execa"));
|
|
8
|
-
const ffmpeg_flags_1 = require("../ffmpeg-flags");
|
|
9
|
-
const p_limit_1 = require("../p-limit");
|
|
10
|
-
const limit = (0, p_limit_1.pLimit)(1);
|
|
11
|
-
const parseAlternativeDuration = (stdout) => {
|
|
12
|
-
const webmDuration = stdout.match(/TAG:DURATION=([0-9.]+):([0-9.]+):([0-9.]+)/);
|
|
13
|
-
if (!webmDuration) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
const [, hours, minutes, seconds] = webmDuration;
|
|
17
|
-
const hoursAsNumber = Number(hours);
|
|
18
|
-
if (Number.isNaN(hoursAsNumber)) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
const minutesAsNumber = Number(minutes);
|
|
22
|
-
if (Number.isNaN(minutesAsNumber)) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
const secondsAsNumber = Number(seconds);
|
|
26
|
-
if (Number.isNaN(secondsAsNumber)) {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
return secondsAsNumber + minutesAsNumber * 60 + hoursAsNumber * 3600;
|
|
30
|
-
};
|
|
31
|
-
const parseVideoStreamDuration = (stdout) => {
|
|
32
|
-
const duration = stdout.match(/duration=([0-9.]+)/);
|
|
33
|
-
const alternativeDuration = parseAlternativeDuration(stdout);
|
|
34
|
-
const fps = stdout.match(/r_frame_rate=([0-9.]+)\/([0-9.]+)/);
|
|
35
|
-
const result = {
|
|
36
|
-
duration: duration ? parseFloat(duration[1]) : alternativeDuration,
|
|
37
|
-
fps: fps ? parseInt(fps[1], 10) / parseInt(fps[2], 10) : null,
|
|
38
|
-
};
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
|
-
exports.parseVideoStreamDuration = parseVideoStreamDuration;
|
|
42
|
-
async function getVideoStreamDurationwithoutCache({ src, ffprobeExecutable, remotionRoot, }) {
|
|
43
|
-
const args = [
|
|
44
|
-
['-v', 'error'],
|
|
45
|
-
['-select_streams', 'v:0'],
|
|
46
|
-
['-show_entries', 'stream'],
|
|
47
|
-
[src],
|
|
48
|
-
]
|
|
49
|
-
.reduce((acc, val) => acc.concat(val), [])
|
|
50
|
-
.filter(Boolean);
|
|
51
|
-
const task = await (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffprobeExecutable, remotionRoot, 'ffprobe'), args);
|
|
52
|
-
const result = (0, exports.parseVideoStreamDuration)(task.stdout);
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
55
|
-
exports.getVideoStreamDurationwithoutCache = getVideoStreamDurationwithoutCache;
|
|
56
|
-
async function getVideoStreamDurationUnlimited(downloadMap, src, ffprobeExecutable, remotionRoot) {
|
|
57
|
-
if (downloadMap.videoDurationResultCache[src]) {
|
|
58
|
-
return downloadMap.videoDurationResultCache[src];
|
|
59
|
-
}
|
|
60
|
-
const result = await getVideoStreamDurationwithoutCache({
|
|
61
|
-
src,
|
|
62
|
-
ffprobeExecutable,
|
|
63
|
-
remotionRoot,
|
|
64
|
-
});
|
|
65
|
-
downloadMap.videoDurationResultCache[src] = result;
|
|
66
|
-
return result;
|
|
67
|
-
}
|
|
68
|
-
const getVideoStreamDuration = (downloadMap, src, ffprobeExecutable, remotionRoot) => {
|
|
69
|
-
return limit(() => getVideoStreamDurationUnlimited(downloadMap, src, ffprobeExecutable, remotionRoot));
|
|
70
|
-
};
|
|
71
|
-
exports.getVideoStreamDuration = getVideoStreamDuration;
|