@remotion/renderer 4.1.0-alpha3 → 4.1.0-alpha5
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/browser/Browser.d.ts +7 -6
- package/dist/browser/Browser.js +13 -13
- package/dist/browser/BrowserPage.d.ts +13 -2
- package/dist/browser/BrowserPage.js +45 -13
- package/dist/browser/BrowserRunner.js +2 -2
- package/dist/browser/Connection.d.ts +9 -3
- package/dist/browser/Connection.js +11 -3
- package/dist/browser/ConsoleMessage.d.ts +8 -1
- package/dist/browser/ConsoleMessage.js +2 -1
- package/dist/browser/ExecutionContext.js +4 -4
- package/dist/browser/FrameManager.js +2 -2
- package/dist/browser/LaunchOptions.d.ts +2 -0
- package/dist/browser/Launcher.js +2 -1
- package/dist/browser/NetworkManager.d.ts +4 -1
- package/dist/browser/Target.d.ts +2 -1
- package/dist/browser/Target.js +3 -1
- package/dist/browser/devtools-types.d.ts +59 -0
- package/dist/browser/should-log-message.js +8 -0
- package/dist/chalk/index.d.ts +2 -1
- package/dist/chalk/index.js +3 -8
- package/dist/chalk/is-color-supported.d.ts +1 -1
- package/dist/chalk/is-color-supported.js +18 -10
- package/dist/compositor/compositor.d.ts +3 -2
- package/dist/compositor/compositor.js +6 -5
- package/dist/create-ffmpeg-merge-filter.js +1 -2
- package/dist/cycle-browser-tabs.d.ts +2 -1
- package/dist/cycle-browser-tabs.js +2 -2
- package/dist/format-logs.d.ts +3 -0
- package/dist/format-logs.js +201 -0
- package/dist/get-browser-instance.d.ts +3 -2
- package/dist/get-browser-instance.js +5 -5
- package/dist/get-compositions.d.ts +6 -5
- package/dist/get-compositions.js +7 -6
- package/dist/index.d.ts +21 -19
- package/dist/logger.d.ts +1 -2
- package/dist/logger.js +7 -12
- package/dist/offthread-video-server.d.ts +3 -2
- package/dist/offthread-video-server.js +4 -3
- package/dist/open-browser.d.ts +3 -2
- package/dist/open-browser.js +7 -5
- package/dist/perf.js +4 -2
- package/dist/prepare-server.d.ts +3 -2
- package/dist/prepare-server.js +4 -4
- package/dist/prespawn-ffmpeg.d.ts +2 -1
- package/dist/prespawn-ffmpeg.js +2 -30
- package/dist/puppeteer-evaluate.d.ts +4 -1
- package/dist/puppeteer-evaluate.js +5 -5
- package/dist/render-frames.d.ts +14 -7
- package/dist/render-frames.js +18 -14
- package/dist/render-media.d.ts +14 -7
- package/dist/render-media.js +12 -14
- package/dist/render-still.d.ts +11 -5
- package/dist/render-still.js +11 -11
- package/dist/replace-browser.d.ts +2 -1
- package/dist/replace-browser.js +2 -2
- package/dist/screenshot-task.js +4 -2
- package/dist/seek-to-frame.js +1 -1
- package/dist/select-composition.d.ts +9 -4
- package/dist/select-composition.js +15 -14
- package/dist/serve-static.d.ts +2 -1
- package/dist/serve-static.js +1 -1
- package/dist/set-props-and-env.js +5 -5
- package/dist/stitch-frames-to-video.d.ts +2 -1
- package/dist/stitch-frames-to-video.js +12 -22
- package/dist/take-frame-and-compose.js +1 -1
- package/package.json +9 -9
package/dist/render-media.js
CHANGED
|
@@ -43,7 +43,7 @@ const validate_output_filename_1 = require("./validate-output-filename");
|
|
|
43
43
|
const validate_scale_1 = require("./validate-scale");
|
|
44
44
|
const validate_videobitrate_1 = require("./validate-videobitrate");
|
|
45
45
|
const SLOWEST_FRAME_COUNT = 10;
|
|
46
|
-
const internalRenderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload,
|
|
46
|
+
const internalRenderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, }) => {
|
|
47
47
|
(0, jpeg_quality_1.validateJpegQuality)(jpegQuality);
|
|
48
48
|
(0, crf_1.validateQualitySettings)({ crf, codec, videoBitrate });
|
|
49
49
|
(0, validate_videobitrate_1.validateBitrate)(audioBitrate, 'audioBitrate');
|
|
@@ -86,30 +86,30 @@ const internalRenderMedia = ({ proResProfile, crf, composition, inputProps, pixe
|
|
|
86
86
|
(0, can_use_parallel_encoding_1.canUseParallelEncoding)(codec);
|
|
87
87
|
logger_1.Log.verboseAdvanced({
|
|
88
88
|
indent,
|
|
89
|
-
logLevel
|
|
89
|
+
logLevel,
|
|
90
90
|
tag: 'renderMedia()',
|
|
91
91
|
}, 'Free memory:', freeMemory, 'Estimated usage parallel encoding', estimatedUsage);
|
|
92
92
|
logger_1.Log.verboseAdvanced({
|
|
93
93
|
indent,
|
|
94
|
-
logLevel
|
|
94
|
+
logLevel,
|
|
95
95
|
tag: 'renderMedia()',
|
|
96
96
|
}, 'Codec supports parallel rendering:', (0, can_use_parallel_encoding_1.canUseParallelEncoding)(codec));
|
|
97
97
|
logger_1.Log.verboseAdvanced({
|
|
98
98
|
indent,
|
|
99
|
-
logLevel
|
|
99
|
+
logLevel,
|
|
100
100
|
tag: 'renderMedia()',
|
|
101
101
|
}, 'User disallowed parallel encoding:', Boolean(disallowParallelEncoding));
|
|
102
102
|
if (parallelEncoding) {
|
|
103
103
|
logger_1.Log.verboseAdvanced({
|
|
104
104
|
indent,
|
|
105
|
-
logLevel
|
|
105
|
+
logLevel,
|
|
106
106
|
tag: 'renderMedia()',
|
|
107
107
|
}, 'Parallel encoding is enabled.');
|
|
108
108
|
}
|
|
109
109
|
else {
|
|
110
110
|
logger_1.Log.verboseAdvanced({
|
|
111
111
|
indent,
|
|
112
|
-
logLevel
|
|
112
|
+
logLevel,
|
|
113
113
|
tag: 'renderMedia()',
|
|
114
114
|
}, 'Parallel encoding is disabled.');
|
|
115
115
|
}
|
|
@@ -167,7 +167,7 @@ const internalRenderMedia = ({ proResProfile, crf, composition, inputProps, pixe
|
|
|
167
167
|
encodedFrames = frame;
|
|
168
168
|
callUpdate();
|
|
169
169
|
},
|
|
170
|
-
|
|
170
|
+
logLevel,
|
|
171
171
|
imageFormat,
|
|
172
172
|
signal: cancelPrestitcher.cancelSignal,
|
|
173
173
|
ffmpegOverride: ffmpegOverride !== null && ffmpegOverride !== void 0 ? ffmpegOverride : (({ args }) => args),
|
|
@@ -225,7 +225,7 @@ const internalRenderMedia = ({ proResProfile, crf, composition, inputProps, pixe
|
|
|
225
225
|
indent,
|
|
226
226
|
port,
|
|
227
227
|
remotionRoot: (0, find_closest_package_json_1.findRemotionRoot)(),
|
|
228
|
-
|
|
228
|
+
logLevel,
|
|
229
229
|
webpackConfigOrServeUrl: serveUrl,
|
|
230
230
|
}, {
|
|
231
231
|
onDownload,
|
|
@@ -276,7 +276,6 @@ const internalRenderMedia = ({ proResProfile, crf, composition, inputProps, pixe
|
|
|
276
276
|
}
|
|
277
277
|
: null,
|
|
278
278
|
webpackBundleOrServeUrl: serveUrl,
|
|
279
|
-
dumpBrowserLogs,
|
|
280
279
|
onBrowserLog,
|
|
281
280
|
onDownload,
|
|
282
281
|
timeoutInMilliseconds,
|
|
@@ -286,7 +285,7 @@ const internalRenderMedia = ({ proResProfile, crf, composition, inputProps, pixe
|
|
|
286
285
|
port,
|
|
287
286
|
cancelSignal: cancelRenderFrames.cancelSignal,
|
|
288
287
|
muted: disableAudio,
|
|
289
|
-
|
|
288
|
+
logLevel,
|
|
290
289
|
indent,
|
|
291
290
|
server,
|
|
292
291
|
});
|
|
@@ -327,7 +326,7 @@ const internalRenderMedia = ({ proResProfile, crf, composition, inputProps, pixe
|
|
|
327
326
|
},
|
|
328
327
|
onDownload,
|
|
329
328
|
numberOfGifLoops,
|
|
330
|
-
|
|
329
|
+
logLevel,
|
|
331
330
|
dir: workingDir,
|
|
332
331
|
cancelSignal: cancelStitcher.cancelSignal,
|
|
333
332
|
muted: disableAudio,
|
|
@@ -401,7 +400,7 @@ exports.internalRenderMedia = internalRenderMedia;
|
|
|
401
400
|
* @description Render a video from a composition
|
|
402
401
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/render-media)
|
|
403
402
|
*/
|
|
404
|
-
const renderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload,
|
|
403
|
+
const renderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel, }) => {
|
|
405
404
|
var _a;
|
|
406
405
|
if (quality !== undefined) {
|
|
407
406
|
console.warn(`The "quality" option has been renamed. Please use "jpegQuality" instead.`);
|
|
@@ -419,7 +418,6 @@ const renderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat,
|
|
|
419
418
|
concurrency: concurrency !== null && concurrency !== void 0 ? concurrency : null,
|
|
420
419
|
crf: crf !== null && crf !== void 0 ? crf : null,
|
|
421
420
|
disallowParallelEncoding: disallowParallelEncoding !== null && disallowParallelEncoding !== void 0 ? disallowParallelEncoding : false,
|
|
422
|
-
dumpBrowserLogs: dumpBrowserLogs !== null && dumpBrowserLogs !== void 0 ? dumpBrowserLogs : false,
|
|
423
421
|
enforceAudioTrack: enforceAudioTrack !== null && enforceAudioTrack !== void 0 ? enforceAudioTrack : false,
|
|
424
422
|
envVariables: envVariables !== null && envVariables !== void 0 ? envVariables : {},
|
|
425
423
|
everyNthFrame: everyNthFrame !== null && everyNthFrame !== void 0 ? everyNthFrame : 1,
|
|
@@ -442,7 +440,7 @@ const renderMedia = ({ proResProfile, crf, composition, inputProps, pixelFormat,
|
|
|
442
440
|
scale: scale !== null && scale !== void 0 ? scale : 1,
|
|
443
441
|
timeoutInMilliseconds: timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT,
|
|
444
442
|
videoBitrate: videoBitrate !== null && videoBitrate !== void 0 ? videoBitrate : null,
|
|
445
|
-
|
|
443
|
+
logLevel: verbose || dumpBrowserLogs ? 'verbose' : logLevel !== null && logLevel !== void 0 ? logLevel : (0, logger_1.getLogLevel)(),
|
|
446
444
|
preferLossless: preferLossless !== null && preferLossless !== void 0 ? preferLossless : false,
|
|
447
445
|
indent: false,
|
|
448
446
|
onCtrlCExit: () => undefined,
|
package/dist/render-still.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { VideoConfig } from 'remotion';
|
|
3
3
|
import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
|
|
4
4
|
import type { BrowserExecutable } from './browser-executable';
|
|
5
5
|
import type { BrowserLog } from './browser-log';
|
|
@@ -8,15 +8,15 @@ import type { StillImageFormat } from './image-format';
|
|
|
8
8
|
import type { CancelSignal } from './make-cancel-signal';
|
|
9
9
|
import type { ChromiumOptions } from './open-browser';
|
|
10
10
|
import type { RemotionServer } from './prepare-server';
|
|
11
|
+
import type { LogLevel } from './log-level';
|
|
11
12
|
type InternalRenderStillOptions = {
|
|
12
|
-
composition:
|
|
13
|
+
composition: VideoConfig;
|
|
13
14
|
output: string | null;
|
|
14
15
|
frame: number;
|
|
15
16
|
inputProps: Record<string, unknown>;
|
|
16
17
|
imageFormat: StillImageFormat;
|
|
17
18
|
jpegQuality: number;
|
|
18
19
|
puppeteerInstance: HeadlessBrowser | null;
|
|
19
|
-
dumpBrowserLogs: boolean;
|
|
20
20
|
envVariables: Record<string, string>;
|
|
21
21
|
overwrite: boolean;
|
|
22
22
|
browserExecutable: BrowserExecutable;
|
|
@@ -28,19 +28,22 @@ type InternalRenderStillOptions = {
|
|
|
28
28
|
cancelSignal: CancelSignal | null;
|
|
29
29
|
indent: boolean;
|
|
30
30
|
server: RemotionServer | undefined;
|
|
31
|
-
|
|
31
|
+
logLevel: LogLevel;
|
|
32
32
|
serveUrl: string;
|
|
33
33
|
port: number | null;
|
|
34
34
|
};
|
|
35
35
|
export type RenderStillOptions = {
|
|
36
36
|
port?: number | null;
|
|
37
|
-
composition:
|
|
37
|
+
composition: VideoConfig;
|
|
38
38
|
output?: string | null;
|
|
39
39
|
frame?: number;
|
|
40
40
|
inputProps?: Record<string, unknown>;
|
|
41
41
|
imageFormat?: StillImageFormat;
|
|
42
42
|
jpegQuality?: number;
|
|
43
43
|
puppeteerInstance?: HeadlessBrowser;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Use "logLevel": "verbose" instead
|
|
46
|
+
*/
|
|
44
47
|
dumpBrowserLogs?: boolean;
|
|
45
48
|
envVariables?: Record<string, string>;
|
|
46
49
|
overwrite?: boolean;
|
|
@@ -51,6 +54,9 @@ export type RenderStillOptions = {
|
|
|
51
54
|
scale?: number;
|
|
52
55
|
onDownload?: RenderMediaOnDownload;
|
|
53
56
|
cancelSignal?: CancelSignal;
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated Use "logLevel" instead
|
|
59
|
+
*/
|
|
54
60
|
verbose?: boolean;
|
|
55
61
|
serveUrl: string;
|
|
56
62
|
/**
|
package/dist/render-still.js
CHANGED
|
@@ -48,7 +48,8 @@ const set_props_and_env_1 = require("./set-props-and-env");
|
|
|
48
48
|
const take_frame_and_compose_1 = require("./take-frame-and-compose");
|
|
49
49
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
50
50
|
const validate_scale_1 = require("./validate-scale");
|
|
51
|
-
const
|
|
51
|
+
const logger_1 = require("./logger");
|
|
52
|
+
const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFAULT_STILL_IMAGE_FORMAT, serveUrl, puppeteerInstance, onError, inputProps, envVariables, output, frame = 0, overwrite, browserExecutable, timeoutInMilliseconds, chromiumOptions, scale, proxyPort, cancelSignal, jpegQuality, onBrowserLog, compositor, sourceMapContext, downloadMap, logLevel, indent, }) => {
|
|
52
53
|
remotion_1.Internals.validateDimension(composition.height, 'height', 'in the `config` object passed to `renderStill()`');
|
|
53
54
|
remotion_1.Internals.validateDimension(composition.width, 'width', 'in the `config` object passed to `renderStill()`');
|
|
54
55
|
remotion_1.Internals.validateFps(composition.fps, 'in the `config` object of `renderStill()`', false);
|
|
@@ -87,13 +88,13 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
87
88
|
const browserInstance = puppeteerInstance !== null && puppeteerInstance !== void 0 ? puppeteerInstance : (await (0, open_browser_1.internalOpenBrowser)({
|
|
88
89
|
browser: browser_1.DEFAULT_BROWSER,
|
|
89
90
|
browserExecutable,
|
|
90
|
-
shouldDumpIo: dumpBrowserLogs,
|
|
91
91
|
chromiumOptions,
|
|
92
92
|
forceDeviceScaleFactor: scale,
|
|
93
|
-
indent
|
|
93
|
+
indent,
|
|
94
94
|
viewport: null,
|
|
95
|
+
logLevel,
|
|
95
96
|
}));
|
|
96
|
-
const page = await browserInstance.newPage(sourceMapContext);
|
|
97
|
+
const page = await browserInstance.newPage(sourceMapContext, logLevel, indent);
|
|
97
98
|
await page.setViewport({
|
|
98
99
|
width: composition.width,
|
|
99
100
|
height: composition.height,
|
|
@@ -122,7 +123,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
122
123
|
await page.close();
|
|
123
124
|
}
|
|
124
125
|
else {
|
|
125
|
-
browserInstance.close(true).catch((err) => {
|
|
126
|
+
browserInstance.close(true, logLevel, indent).catch((err) => {
|
|
126
127
|
console.log('Unable to close browser', err);
|
|
127
128
|
});
|
|
128
129
|
}
|
|
@@ -147,11 +148,11 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
147
148
|
});
|
|
148
149
|
await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
149
150
|
// eslint-disable-next-line max-params
|
|
150
|
-
pageFunction: (id,
|
|
151
|
+
pageFunction: (id, props, durationInFrames, fps, height, width) => {
|
|
151
152
|
window.remotion_setBundleMode({
|
|
152
153
|
type: 'composition',
|
|
153
154
|
compositionName: id,
|
|
154
|
-
|
|
155
|
+
props,
|
|
155
156
|
compositionDurationInFrames: durationInFrames,
|
|
156
157
|
compositionFps: fps,
|
|
157
158
|
compositionHeight: height,
|
|
@@ -160,7 +161,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
160
161
|
},
|
|
161
162
|
args: [
|
|
162
163
|
composition.id,
|
|
163
|
-
composition.
|
|
164
|
+
composition.props,
|
|
164
165
|
composition.durationInFrames,
|
|
165
166
|
composition.fps,
|
|
166
167
|
composition.height,
|
|
@@ -195,7 +196,7 @@ const internalRenderStill = (options) => {
|
|
|
195
196
|
port: options.port,
|
|
196
197
|
remotionRoot: (0, find_closest_package_json_1.findRemotionRoot)(),
|
|
197
198
|
concurrency: 1,
|
|
198
|
-
|
|
199
|
+
logLevel: options.logLevel,
|
|
199
200
|
indent: options.indent,
|
|
200
201
|
}, {
|
|
201
202
|
onDownload: options.onDownload,
|
|
@@ -252,7 +253,6 @@ const renderStill = (options) => {
|
|
|
252
253
|
browserExecutable: browserExecutable !== null && browserExecutable !== void 0 ? browserExecutable : null,
|
|
253
254
|
cancelSignal: cancelSignal !== null && cancelSignal !== void 0 ? cancelSignal : null,
|
|
254
255
|
chromiumOptions: chromiumOptions !== null && chromiumOptions !== void 0 ? chromiumOptions : {},
|
|
255
|
-
dumpBrowserLogs: dumpBrowserLogs !== null && dumpBrowserLogs !== void 0 ? dumpBrowserLogs : false,
|
|
256
256
|
envVariables: envVariables !== null && envVariables !== void 0 ? envVariables : {},
|
|
257
257
|
frame: frame !== null && frame !== void 0 ? frame : 0,
|
|
258
258
|
imageFormat: imageFormat !== null && imageFormat !== void 0 ? imageFormat : image_format_1.DEFAULT_STILL_IMAGE_FORMAT,
|
|
@@ -269,7 +269,7 @@ const renderStill = (options) => {
|
|
|
269
269
|
server: undefined,
|
|
270
270
|
serveUrl,
|
|
271
271
|
timeoutInMilliseconds: timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT,
|
|
272
|
-
|
|
272
|
+
logLevel: verbose || dumpBrowserLogs ? 'verbose' : (0, logger_1.getLogLevel)(),
|
|
273
273
|
});
|
|
274
274
|
};
|
|
275
275
|
exports.renderStill = renderStill;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { HeadlessBrowser } from './browser/Browser';
|
|
2
|
+
import type { LogLevel } from './log-level';
|
|
2
3
|
export type BrowserReplacer = {
|
|
3
4
|
getBrowser: () => HeadlessBrowser;
|
|
4
5
|
replaceBrowser: (make: () => Promise<HeadlessBrowser>, makeNewPages: () => Promise<void>) => Promise<HeadlessBrowser>;
|
|
5
6
|
};
|
|
6
|
-
export declare const handleBrowserCrash: (instance: HeadlessBrowser) => BrowserReplacer;
|
|
7
|
+
export declare const handleBrowserCrash: (instance: HeadlessBrowser, logLevel: LogLevel, indent: boolean) => BrowserReplacer;
|
package/dist/replace-browser.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handleBrowserCrash = void 0;
|
|
4
|
-
const handleBrowserCrash = (instance) => {
|
|
4
|
+
const handleBrowserCrash = (instance, logLevel, indent) => {
|
|
5
5
|
let _instance = instance;
|
|
6
6
|
const waiters = [];
|
|
7
7
|
let replacing = false;
|
|
@@ -20,7 +20,7 @@ const handleBrowserCrash = (instance) => {
|
|
|
20
20
|
try {
|
|
21
21
|
replacing = true;
|
|
22
22
|
await _instance
|
|
23
|
-
.close(true)
|
|
23
|
+
.close(true, logLevel, indent)
|
|
24
24
|
.then(() => {
|
|
25
25
|
console.log('Killed previous browser and making new one');
|
|
26
26
|
})
|
package/dist/screenshot-task.js
CHANGED
|
@@ -24,7 +24,7 @@ const screenshotTask = async ({ format, height, omitBackground, page, width, pat
|
|
|
24
24
|
try {
|
|
25
25
|
let result;
|
|
26
26
|
if (format === 'pdf') {
|
|
27
|
-
|
|
27
|
+
const res = await client.send('Page.printToPDF', {
|
|
28
28
|
paperWidth: width / 96,
|
|
29
29
|
paperHeight: height / 96,
|
|
30
30
|
marginTop: 0,
|
|
@@ -34,9 +34,10 @@ const screenshotTask = async ({ format, height, omitBackground, page, width, pat
|
|
|
34
34
|
scale: 1,
|
|
35
35
|
printBackground: true,
|
|
36
36
|
});
|
|
37
|
+
result = res.value;
|
|
37
38
|
}
|
|
38
39
|
else {
|
|
39
|
-
|
|
40
|
+
const { value } = await client.send('Page.captureScreenshot', {
|
|
40
41
|
format,
|
|
41
42
|
quality: jpegQuality,
|
|
42
43
|
clip: clipRegion !== null && clipRegion !== 'hide'
|
|
@@ -57,6 +58,7 @@ const screenshotTask = async ({ format, height, omitBackground, page, width, pat
|
|
|
57
58
|
captureBeyondViewport: true,
|
|
58
59
|
optimizeForSpeed: true,
|
|
59
60
|
});
|
|
61
|
+
result = value;
|
|
60
62
|
}
|
|
61
63
|
(0, perf_1.stopPerfMeasure)(cap);
|
|
62
64
|
if (shouldSetDefaultBackground)
|
package/dist/seek-to-frame.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { VideoConfig } from 'remotion';
|
|
2
2
|
import type { BrowserExecutable } from './browser-executable';
|
|
3
3
|
import type { BrowserLog } from './browser-log';
|
|
4
4
|
import type { HeadlessBrowser } from './browser/Browser';
|
|
5
5
|
import type { ChromiumOptions } from './open-browser';
|
|
6
6
|
import type { RemotionServer } from './prepare-server';
|
|
7
|
+
import { type LogLevel } from './log-level';
|
|
7
8
|
type InternalSelectCompositionsConfig = {
|
|
8
9
|
inputProps: Record<string, unknown>;
|
|
9
10
|
envVariables: Record<string, string>;
|
|
@@ -15,7 +16,7 @@ type InternalSelectCompositionsConfig = {
|
|
|
15
16
|
port: number | null;
|
|
16
17
|
indent: boolean;
|
|
17
18
|
server: RemotionServer | undefined;
|
|
18
|
-
|
|
19
|
+
logLevel: LogLevel;
|
|
19
20
|
serveUrl: string;
|
|
20
21
|
id: string;
|
|
21
22
|
};
|
|
@@ -32,10 +33,14 @@ export type SelectCompositionOptions = {
|
|
|
32
33
|
serveUrl: string;
|
|
33
34
|
id: string;
|
|
34
35
|
};
|
|
35
|
-
|
|
36
|
+
type InternalReturnType = {
|
|
37
|
+
metadata: VideoConfig;
|
|
38
|
+
propsSize: number;
|
|
39
|
+
};
|
|
40
|
+
export declare const internalSelectComposition: (options: InternalSelectCompositionsConfig) => Promise<InternalReturnType>;
|
|
36
41
|
/**
|
|
37
42
|
* @description Gets a composition defined in a Remotion project based on a Webpack bundle.
|
|
38
43
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/select-composition)
|
|
39
44
|
*/
|
|
40
|
-
export declare const selectComposition: (options: SelectCompositionOptions) => Promise<
|
|
45
|
+
export declare const selectComposition: (options: SelectCompositionOptions) => Promise<VideoConfig>;
|
|
41
46
|
export {};
|
|
@@ -11,7 +11,7 @@ const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
|
11
11
|
const seek_to_frame_1 = require("./seek-to-frame");
|
|
12
12
|
const set_props_and_env_1 = require("./set-props-and-env");
|
|
13
13
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
14
|
-
const innerSelectComposition = async ({ page, onBrowserLog, inputProps, envVariables, serveUrl, timeoutInMilliseconds, port, id, indent,
|
|
14
|
+
const innerSelectComposition = async ({ page, onBrowserLog, inputProps, envVariables, serveUrl, timeoutInMilliseconds, port, id, indent, logLevel, }) => {
|
|
15
15
|
if (onBrowserLog) {
|
|
16
16
|
page.on('console', (log) => {
|
|
17
17
|
onBrowserLog({
|
|
@@ -48,10 +48,10 @@ const innerSelectComposition = async ({ page, onBrowserLog, inputProps, envVaria
|
|
|
48
48
|
logger_1.Log.verboseAdvanced({
|
|
49
49
|
indent,
|
|
50
50
|
tag: 'selectComposition()',
|
|
51
|
-
logLevel
|
|
51
|
+
logLevel,
|
|
52
52
|
}, 'Running calculateMetadata()...');
|
|
53
53
|
const time = Date.now();
|
|
54
|
-
const result = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
54
|
+
const { value: result, size } = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
55
55
|
pageFunction: (_id) => {
|
|
56
56
|
return window.remotion_calculateComposition(_id);
|
|
57
57
|
},
|
|
@@ -62,13 +62,13 @@ const innerSelectComposition = async ({ page, onBrowserLog, inputProps, envVaria
|
|
|
62
62
|
logger_1.Log.verboseAdvanced({
|
|
63
63
|
indent,
|
|
64
64
|
tag: 'selectComposition()',
|
|
65
|
-
logLevel
|
|
65
|
+
logLevel,
|
|
66
66
|
}, `calculateMetadata() took ${Date.now() - time}ms`);
|
|
67
|
-
return result;
|
|
67
|
+
return { metadata: result, propsSize: size };
|
|
68
68
|
};
|
|
69
69
|
const internalSelectComposition = async (options) => {
|
|
70
70
|
const cleanup = [];
|
|
71
|
-
const { puppeteerInstance, browserExecutable, chromiumOptions, serveUrl: serveUrlOrWebpackUrl,
|
|
71
|
+
const { puppeteerInstance, browserExecutable, chromiumOptions, serveUrl: serveUrlOrWebpackUrl, logLevel, indent, port, envVariables, id, inputProps, onBrowserLog, server, timeoutInMilliseconds, } = options;
|
|
72
72
|
const { page, cleanup: cleanupPage } = await (0, get_browser_instance_1.getPageAndCleanupFn)({
|
|
73
73
|
passedInInstance: puppeteerInstance,
|
|
74
74
|
browserExecutable,
|
|
@@ -76,7 +76,7 @@ const internalSelectComposition = async (options) => {
|
|
|
76
76
|
context: null,
|
|
77
77
|
forceDeviceScaleFactor: undefined,
|
|
78
78
|
indent,
|
|
79
|
-
|
|
79
|
+
logLevel,
|
|
80
80
|
});
|
|
81
81
|
cleanup.push(() => cleanupPage());
|
|
82
82
|
return new Promise((resolve, reject) => {
|
|
@@ -91,7 +91,7 @@ const internalSelectComposition = async (options) => {
|
|
|
91
91
|
port,
|
|
92
92
|
remotionRoot: (0, find_closest_package_json_1.findRemotionRoot)(),
|
|
93
93
|
concurrency: 1,
|
|
94
|
-
|
|
94
|
+
logLevel,
|
|
95
95
|
indent,
|
|
96
96
|
}, {
|
|
97
97
|
onDownload: () => undefined,
|
|
@@ -111,14 +111,14 @@ const internalSelectComposition = async (options) => {
|
|
|
111
111
|
inputProps,
|
|
112
112
|
onBrowserLog,
|
|
113
113
|
timeoutInMilliseconds,
|
|
114
|
-
|
|
114
|
+
logLevel,
|
|
115
115
|
indent,
|
|
116
116
|
puppeteerInstance,
|
|
117
117
|
server,
|
|
118
118
|
});
|
|
119
119
|
})
|
|
120
|
-
.then((
|
|
121
|
-
return resolve(
|
|
120
|
+
.then((data) => {
|
|
121
|
+
return resolve(data);
|
|
122
122
|
})
|
|
123
123
|
.catch((err) => {
|
|
124
124
|
reject(err);
|
|
@@ -135,9 +135,9 @@ exports.internalSelectComposition = internalSelectComposition;
|
|
|
135
135
|
* @description Gets a composition defined in a Remotion project based on a Webpack bundle.
|
|
136
136
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/select-composition)
|
|
137
137
|
*/
|
|
138
|
-
const selectComposition = (options) => {
|
|
138
|
+
const selectComposition = async (options) => {
|
|
139
139
|
const { id, serveUrl, browserExecutable, chromiumOptions, envVariables, inputProps, onBrowserLog, port, puppeteerInstance, timeoutInMilliseconds, verbose, } = options;
|
|
140
|
-
|
|
140
|
+
const data = await (0, exports.internalSelectComposition)({
|
|
141
141
|
id,
|
|
142
142
|
serveUrl,
|
|
143
143
|
browserExecutable: browserExecutable !== null && browserExecutable !== void 0 ? browserExecutable : null,
|
|
@@ -148,9 +148,10 @@ const selectComposition = (options) => {
|
|
|
148
148
|
port: port !== null && port !== void 0 ? port : null,
|
|
149
149
|
puppeteerInstance,
|
|
150
150
|
timeoutInMilliseconds: timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT,
|
|
151
|
-
|
|
151
|
+
logLevel: verbose ? 'verbose' : 'info',
|
|
152
152
|
indent: false,
|
|
153
153
|
server: undefined,
|
|
154
154
|
});
|
|
155
|
+
return data.metadata;
|
|
155
156
|
};
|
|
156
157
|
exports.selectComposition = selectComposition;
|
package/dist/serve-static.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { DownloadMap } from './assets/download-map';
|
|
2
2
|
import type { Compositor } from './compositor/compositor';
|
|
3
3
|
import type { OffthreadVideoServerEmitter } from './offthread-video-server';
|
|
4
|
+
import type { LogLevel } from './log-level';
|
|
4
5
|
export declare const serveStatic: (path: string | null, options: {
|
|
5
6
|
port: number | null;
|
|
6
7
|
downloadMap: DownloadMap;
|
|
7
8
|
remotionRoot: string;
|
|
8
9
|
concurrency: number;
|
|
9
|
-
|
|
10
|
+
logLevel: LogLevel;
|
|
10
11
|
indent: boolean;
|
|
11
12
|
}) => Promise<{
|
|
12
13
|
port: number;
|
package/dist/serve-static.js
CHANGED
|
@@ -12,7 +12,7 @@ const serveStatic = async (path, options) => {
|
|
|
12
12
|
const { listener: offthreadRequest, close: closeCompositor, compositor, events, } = (0, offthread_video_server_1.startOffthreadVideoServer)({
|
|
13
13
|
downloadMap: options.downloadMap,
|
|
14
14
|
concurrency: options.concurrency,
|
|
15
|
-
|
|
15
|
+
logLevel: options.logLevel,
|
|
16
16
|
indent: options.indent,
|
|
17
17
|
});
|
|
18
18
|
const connections = {};
|
|
@@ -81,7 +81,7 @@ const innerSetPropsAndEnv = async ({ inputProps, envVariables, page, serveUrl, i
|
|
|
81
81
|
if (isRemotionFn === undefined) {
|
|
82
82
|
throw new Error(`Error while getting compositions: Tried to go to ${urlToVisit} and verify that it is a Remotion project by checking if window.getStaticCompositions is defined. However, the function was undefined, which indicates that this is not a valid Remotion project. Please check the URL you passed.`);
|
|
83
83
|
}
|
|
84
|
-
const siteVersion = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
84
|
+
const { value: siteVersion } = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
85
85
|
pageFunction: () => {
|
|
86
86
|
return window.siteVersion;
|
|
87
87
|
},
|
|
@@ -89,7 +89,7 @@ const innerSetPropsAndEnv = async ({ inputProps, envVariables, page, serveUrl, i
|
|
|
89
89
|
frame: null,
|
|
90
90
|
page,
|
|
91
91
|
});
|
|
92
|
-
const remotionVersion = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
92
|
+
const { value: remotionVersion } = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
93
93
|
pageFunction: () => {
|
|
94
94
|
return window.remotion_version;
|
|
95
95
|
},
|
|
@@ -97,7 +97,7 @@ const innerSetPropsAndEnv = async ({ inputProps, envVariables, page, serveUrl, i
|
|
|
97
97
|
frame: null,
|
|
98
98
|
page,
|
|
99
99
|
});
|
|
100
|
-
const requiredVersion = '
|
|
100
|
+
const requiredVersion = '6';
|
|
101
101
|
if (siteVersion !== requiredVersion) {
|
|
102
102
|
throw new Error(`Incompatible site: When visiting ${urlToVisit}, a bundle was found, but one that is not compatible with this version of Remotion. Found version: ${siteVersion} - Required version: ${requiredVersion}. To resolve this error, please bundle and deploy again.`);
|
|
103
103
|
}
|
|
@@ -115,8 +115,8 @@ const setPropsAndEnv = (params) => {
|
|
|
115
115
|
innerSetPropsAndEnv(params),
|
|
116
116
|
new Promise((_, reject) => {
|
|
117
117
|
setTimeout(() => {
|
|
118
|
-
reject(new Error(
|
|
119
|
-
},
|
|
118
|
+
reject(new Error(`Timed out after ${params.timeoutInMilliseconds} while setting up the headless browser. This could be because the you specified takes a long time to load (or network resources that it includes like fonts) or because the browser is not responding. Optimize the site or increase the browser timeout.`));
|
|
119
|
+
}, params.timeoutInMilliseconds);
|
|
120
120
|
}),
|
|
121
121
|
]);
|
|
122
122
|
};
|
|
@@ -7,6 +7,7 @@ import type { FfmpegOverrideFn } from './ffmpeg-override';
|
|
|
7
7
|
import type { CancelSignal } from './make-cancel-signal';
|
|
8
8
|
import type { PixelFormat } from './pixel-format';
|
|
9
9
|
import type { ProResProfile } from './prores-profile';
|
|
10
|
+
import type { LogLevel } from './log-level';
|
|
10
11
|
type InternalStitchFramesToVideoOptions = {
|
|
11
12
|
audioBitrate: string | null;
|
|
12
13
|
videoBitrate: string | null;
|
|
@@ -24,7 +25,7 @@ type InternalStitchFramesToVideoOptions = {
|
|
|
24
25
|
onProgress?: null | ((progress: number) => void);
|
|
25
26
|
onDownload: undefined | RenderMediaOnDownload;
|
|
26
27
|
proResProfile: undefined | ProResProfile;
|
|
27
|
-
|
|
28
|
+
logLevel: LogLevel;
|
|
28
29
|
dir: string;
|
|
29
30
|
cancelSignal: CancelSignal | null;
|
|
30
31
|
preEncodedFileLocation: string | null;
|
|
@@ -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,
|
|
62
|
+
const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, logLevel, 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,7 +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
|
-
logger_1.Log.verboseAdvanced({ indent, logLevel
|
|
70
|
+
logger_1.Log.verboseAdvanced({ indent, logLevel, tag: 'audio' }, 'asset positions', JSON.stringify(assetPositions));
|
|
71
71
|
const preprocessProgress = new Array(assetPositions.length).fill(0);
|
|
72
72
|
const updateProgress = () => {
|
|
73
73
|
onProgress(preprocessProgress.reduce((a, b) => a + b, 0) / assetPositions.length);
|
|
@@ -100,7 +100,7 @@ const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, verbose,
|
|
|
100
100
|
});
|
|
101
101
|
return outName;
|
|
102
102
|
};
|
|
103
|
-
const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec, cancelSignal, codec, crf, dir, enforceAudioTrack, ffmpegOverride, force, fps, height, indent, muted, onDownload, outputLocation, pixelFormat, preEncodedFileLocation, preferLossless, proResProfile,
|
|
103
|
+
const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec, cancelSignal, codec, crf, dir, enforceAudioTrack, ffmpegOverride, force, fps, height, indent, muted, onDownload, outputLocation, pixelFormat, preEncodedFileLocation, preferLossless, proResProfile, logLevel, videoBitrate, width, numberOfGifLoops, onProgress, }, remotionRoot) => {
|
|
104
104
|
var _a;
|
|
105
105
|
remotion_1.Internals.validateDimension(height, 'height', 'passed to `stitchFramesToVideo()`');
|
|
106
106
|
remotion_1.Internals.validateDimension(width, 'width', 'passed to `stitchFramesToVideo()`');
|
|
@@ -136,39 +136,29 @@ const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec,
|
|
|
136
136
|
: node_path_1.default.join(assetsInfo.downloadMap.stitchFrames, `out.${(0, get_extension_from_codec_1.getFileExtensionFromCodec)(codec, resolvedAudioCodec)}`);
|
|
137
137
|
logger_1.Log.verboseAdvanced({
|
|
138
138
|
indent,
|
|
139
|
-
logLevel
|
|
140
|
-
tag: 'stitchFramesToVideo()',
|
|
141
|
-
}, 'encoder', encoderName);
|
|
142
|
-
logger_1.Log.verboseAdvanced({
|
|
143
|
-
indent,
|
|
144
|
-
logLevel: verbose ? 'verbose' : 'info',
|
|
139
|
+
logLevel,
|
|
145
140
|
tag: 'stitchFramesToVideo()',
|
|
146
141
|
}, 'audioCodec', resolvedAudioCodec);
|
|
147
142
|
logger_1.Log.verboseAdvanced({
|
|
148
143
|
indent,
|
|
149
|
-
logLevel
|
|
144
|
+
logLevel,
|
|
150
145
|
tag: 'stitchFramesToVideo()',
|
|
151
146
|
}, 'pixelFormat', pixelFormat);
|
|
152
147
|
logger_1.Log.verboseAdvanced({
|
|
153
148
|
indent,
|
|
154
|
-
logLevel
|
|
149
|
+
logLevel,
|
|
155
150
|
tag: 'stitchFramesToVideo()',
|
|
156
151
|
}, 'codec', codec);
|
|
157
152
|
logger_1.Log.verboseAdvanced({
|
|
158
153
|
indent,
|
|
159
|
-
logLevel
|
|
154
|
+
logLevel,
|
|
160
155
|
tag: 'stitchFramesToVideo()',
|
|
161
156
|
}, 'shouldRenderAudio', shouldRenderAudio);
|
|
162
157
|
logger_1.Log.verboseAdvanced({
|
|
163
158
|
indent,
|
|
164
|
-
logLevel
|
|
159
|
+
logLevel,
|
|
165
160
|
tag: 'stitchFramesToVideo()',
|
|
166
161
|
}, 'shouldRenderVideo', shouldRenderVideo);
|
|
167
|
-
logger_1.Log.verboseAdvanced({
|
|
168
|
-
indent,
|
|
169
|
-
logLevel: verbose ? 'verbose' : 'info',
|
|
170
|
-
tag: 'stitchFramesToVideo()',
|
|
171
|
-
}, 'proResProfileName', proResProfileName);
|
|
172
162
|
(0, crf_1.validateQualitySettings)({
|
|
173
163
|
crf,
|
|
174
164
|
codec,
|
|
@@ -186,7 +176,7 @@ const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec,
|
|
|
186
176
|
onDownload,
|
|
187
177
|
fps,
|
|
188
178
|
expectedFrames,
|
|
189
|
-
|
|
179
|
+
logLevel,
|
|
190
180
|
onProgress: (prog) => updateProgress(prog, 0),
|
|
191
181
|
downloadMap: assetsInfo.downloadMap,
|
|
192
182
|
remotionRoot,
|
|
@@ -288,12 +278,12 @@ const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec,
|
|
|
288
278
|
: ffmpegString;
|
|
289
279
|
logger_1.Log.verboseAdvanced({
|
|
290
280
|
indent: indent !== null && indent !== void 0 ? indent : false,
|
|
291
|
-
logLevel
|
|
281
|
+
logLevel,
|
|
292
282
|
tag: 'stitchFramesToVideo()',
|
|
293
283
|
}, 'Generated final FFMPEG command:');
|
|
294
284
|
logger_1.Log.verboseAdvanced({
|
|
295
285
|
indent,
|
|
296
|
-
logLevel
|
|
286
|
+
logLevel,
|
|
297
287
|
tag: 'stitchFramesToVideo()',
|
|
298
288
|
}, finalFfmpegString.join(' '));
|
|
299
289
|
const task = (0, call_ffmpeg_1.callFf)('ffmpeg', finalFfmpegString, {
|
|
@@ -391,7 +381,7 @@ const stitchFramesToVideo = ({ assetsInfo, force, fps, height, width, audioBitra
|
|
|
391
381
|
outputLocation: outputLocation !== null && outputLocation !== void 0 ? outputLocation : null,
|
|
392
382
|
pixelFormat: pixelFormat !== null && pixelFormat !== void 0 ? pixelFormat : pixel_format_1.DEFAULT_PIXEL_FORMAT,
|
|
393
383
|
proResProfile,
|
|
394
|
-
|
|
384
|
+
logLevel: verbose ? 'verbose' : 'info',
|
|
395
385
|
videoBitrate: videoBitrate !== null && videoBitrate !== void 0 ? videoBitrate : null,
|
|
396
386
|
width,
|
|
397
387
|
preEncodedFileLocation: null,
|