@remotion/renderer 4.1.0-alpha4 → 4.1.0-alpha7
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.js +1 -1
- package/dist/browser/BrowserPage.js +41 -5
- 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/NetworkManager.d.ts +4 -1
- package/dist/browser/devtools-types.d.ts +59 -0
- package/dist/browser/should-log-message.js +6 -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/compose.js +5 -0
- package/dist/compositor/compositor.js +3 -4
- package/dist/create-ffmpeg-merge-filter.js +1 -2
- package/dist/format-logs.js +7 -1
- package/dist/get-compositions.d.ts +3 -3
- package/dist/get-compositions.js +1 -1
- package/dist/index.d.ts +27 -23
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +9 -9
- package/dist/offthread-video-server.js +8 -0
- package/dist/options/crf.js +1 -1
- package/dist/options/video-codec.js +1 -1
- package/dist/puppeteer-evaluate.d.ts +4 -1
- package/dist/puppeteer-evaluate.js +5 -5
- package/dist/render-frames.d.ts +3 -3
- package/dist/render-frames.js +12 -7
- package/dist/render-media.d.ts +3 -3
- package/dist/render-media.js +7 -5
- package/dist/render-still.d.ts +3 -3
- package/dist/render-still.js +5 -6
- package/dist/screenshot-task.js +4 -2
- package/dist/seek-to-frame.d.ts +2 -1
- package/dist/seek-to-frame.js +5 -5
- package/dist/select-composition.d.ts +7 -3
- package/dist/select-composition.js +7 -6
- package/dist/set-props-and-env.js +8 -7
- package/dist/take-frame-and-compose.js +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 -4
- 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 -16
- 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 -17
- 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 -17
- 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 -12
- 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
package/dist/index.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export declare const RenderInternals: {
|
|
|
43
43
|
downloadMap: import("./assets/download-map").DownloadMap;
|
|
44
44
|
remotionRoot: string;
|
|
45
45
|
concurrency: number;
|
|
46
|
-
logLevel: "
|
|
46
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
47
47
|
indent: boolean;
|
|
48
48
|
}) => Promise<{
|
|
49
49
|
port: number;
|
|
@@ -114,8 +114,8 @@ export declare const RenderInternals: {
|
|
|
114
114
|
validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
115
115
|
DEFAULT_BROWSER: import("./browser").Browser;
|
|
116
116
|
validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
|
|
117
|
-
DEFAULT_OPENGL_RENDERER: "
|
|
118
|
-
validateOpenGlRenderer: (option: "
|
|
117
|
+
DEFAULT_OPENGL_RENDERER: "angle" | "swangle" | "egl" | "swiftshader" | null;
|
|
118
|
+
validateOpenGlRenderer: (option: "angle" | "swangle" | "egl" | "swiftshader" | null) => "angle" | "swangle" | "egl" | "swiftshader" | null;
|
|
119
119
|
validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "gif"];
|
|
120
120
|
DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
121
121
|
validateJpegQuality: (q: number | undefined) => void;
|
|
@@ -123,7 +123,7 @@ export declare const RenderInternals: {
|
|
|
123
123
|
DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
124
124
|
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | undefined) => boolean;
|
|
125
125
|
logLevels: readonly ["verbose", "info", "warn", "error"];
|
|
126
|
-
isEqualOrBelowLogLevel: (currentLevel: "
|
|
126
|
+
isEqualOrBelowLogLevel: (currentLevel: "error" | "verbose" | "info" | "warn", level: "error" | "verbose" | "info" | "warn") => boolean;
|
|
127
127
|
isValidLogLevel: (level: string) => boolean;
|
|
128
128
|
perf: typeof perf;
|
|
129
129
|
convertToPositiveFrameIndex: ({ frame, durationInFrames, }: {
|
|
@@ -300,11 +300,11 @@ export declare const RenderInternals: {
|
|
|
300
300
|
};
|
|
301
301
|
validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
|
|
302
302
|
validVideoImageFormats: readonly ["png", "jpeg", "none"];
|
|
303
|
-
DEFAULT_STILL_IMAGE_FORMAT: "
|
|
304
|
-
DEFAULT_VIDEO_IMAGE_FORMAT: "
|
|
303
|
+
DEFAULT_STILL_IMAGE_FORMAT: "jpeg" | "png" | "webp" | "pdf";
|
|
304
|
+
DEFAULT_VIDEO_IMAGE_FORMAT: "jpeg" | "png" | "none";
|
|
305
305
|
DEFAULT_JPEG_QUALITY: number;
|
|
306
306
|
chalk: {
|
|
307
|
-
enabled: boolean;
|
|
307
|
+
enabled: () => boolean;
|
|
308
308
|
visible: boolean;
|
|
309
309
|
styles: Record<string, {
|
|
310
310
|
codes: [number, number];
|
|
@@ -328,6 +328,7 @@ export declare const RenderInternals: {
|
|
|
328
328
|
yellow: (str: string) => string;
|
|
329
329
|
blue: (str: string) => string;
|
|
330
330
|
magenta: (str: string) => string;
|
|
331
|
+
cyan: (str: string) => string;
|
|
331
332
|
white: (str: string) => string;
|
|
332
333
|
gray: (str: string) => string;
|
|
333
334
|
bgBlack: (str: string) => string;
|
|
@@ -356,33 +357,33 @@ export declare const RenderInternals: {
|
|
|
356
357
|
verbose: (message?: any, ...optionalParams: any[]) => void;
|
|
357
358
|
verboseAdvanced: (options: {
|
|
358
359
|
indent: boolean;
|
|
359
|
-
logLevel: "
|
|
360
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
360
361
|
} & {
|
|
361
362
|
tag?: string | undefined;
|
|
362
363
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
363
364
|
info: (message?: any, ...optionalParams: any[]) => void;
|
|
364
365
|
infoAdvanced: (options: {
|
|
365
366
|
indent: boolean;
|
|
366
|
-
logLevel: "
|
|
367
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
367
368
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
368
369
|
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
369
370
|
warnAdvanced: (options: {
|
|
370
371
|
indent: boolean;
|
|
371
|
-
logLevel: "
|
|
372
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
372
373
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
373
374
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
374
375
|
};
|
|
375
|
-
getLogLevel: () => "
|
|
376
|
-
setLogLevel: (newLogLevel: "
|
|
376
|
+
getLogLevel: () => "error" | "verbose" | "info" | "warn";
|
|
377
|
+
setLogLevel: (newLogLevel: "error" | "verbose" | "info" | "warn") => void;
|
|
377
378
|
INDENT_TOKEN: string;
|
|
378
|
-
isColorSupported: boolean;
|
|
379
|
+
isColorSupported: () => boolean;
|
|
379
380
|
HeadlessBrowser: typeof HeadlessBrowser;
|
|
380
381
|
prepareServer: ({ webpackConfigOrServeUrl, port, remotionRoot, concurrency, logLevel, indent, }: {
|
|
381
382
|
webpackConfigOrServeUrl: string;
|
|
382
383
|
port: number | null;
|
|
383
384
|
remotionRoot: string;
|
|
384
385
|
concurrency: number;
|
|
385
|
-
logLevel: "
|
|
386
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
386
387
|
indent: boolean;
|
|
387
388
|
}) => Promise<import("./prepare-server").RemotionServer>;
|
|
388
389
|
makeOrReuseServer: (server: import("./prepare-server").RemotionServer | undefined, config: {
|
|
@@ -390,7 +391,7 @@ export declare const RenderInternals: {
|
|
|
390
391
|
port: number | null;
|
|
391
392
|
remotionRoot: string;
|
|
392
393
|
concurrency: number;
|
|
393
|
-
logLevel: "
|
|
394
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
394
395
|
indent: boolean;
|
|
395
396
|
}, { onDownload, onError, }: {
|
|
396
397
|
onError: (err: Error) => void;
|
|
@@ -400,11 +401,11 @@ export declare const RenderInternals: {
|
|
|
400
401
|
cleanupServer: (force: boolean) => Promise<unknown>;
|
|
401
402
|
}>;
|
|
402
403
|
internalRenderStill: (options: {
|
|
403
|
-
composition: import("remotion").
|
|
404
|
+
composition: import("remotion").VideoConfig;
|
|
404
405
|
output: string | null;
|
|
405
406
|
frame: number;
|
|
406
407
|
inputProps: Record<string, unknown>;
|
|
407
|
-
imageFormat: "
|
|
408
|
+
imageFormat: "jpeg" | "png" | "webp" | "pdf";
|
|
408
409
|
jpegQuality: number;
|
|
409
410
|
puppeteerInstance: HeadlessBrowser | null;
|
|
410
411
|
envVariables: Record<string, string>;
|
|
@@ -418,7 +419,7 @@ export declare const RenderInternals: {
|
|
|
418
419
|
cancelSignal: import("./make-cancel-signal").CancelSignal | null;
|
|
419
420
|
indent: boolean;
|
|
420
421
|
server: import("./prepare-server").RemotionServer | undefined;
|
|
421
|
-
logLevel: "
|
|
422
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
422
423
|
serveUrl: string;
|
|
423
424
|
port: number | null;
|
|
424
425
|
}) => Promise<{
|
|
@@ -431,7 +432,7 @@ export declare const RenderInternals: {
|
|
|
431
432
|
viewport: import("./browser/PuppeteerViewport").Viewport | null;
|
|
432
433
|
indent: boolean;
|
|
433
434
|
browser: import("./browser").Browser;
|
|
434
|
-
logLevel: "
|
|
435
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
435
436
|
}) => Promise<HeadlessBrowser>;
|
|
436
437
|
internalSelectComposition: (options: {
|
|
437
438
|
inputProps: Record<string, unknown>;
|
|
@@ -444,10 +445,13 @@ export declare const RenderInternals: {
|
|
|
444
445
|
port: number | null;
|
|
445
446
|
indent: boolean;
|
|
446
447
|
server: import("./prepare-server").RemotionServer | undefined;
|
|
447
|
-
logLevel: "
|
|
448
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
448
449
|
serveUrl: string;
|
|
449
450
|
id: string;
|
|
450
|
-
}) => Promise<
|
|
451
|
+
}) => Promise<{
|
|
452
|
+
metadata: import("remotion").VideoConfig;
|
|
453
|
+
propsSize: number;
|
|
454
|
+
}>;
|
|
451
455
|
internalGetCompositions: ({ browserExecutable, chromiumOptions, envVariables, indent, inputProps, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, }: {
|
|
452
456
|
inputProps: Record<string, unknown>;
|
|
453
457
|
envVariables: Record<string, string>;
|
|
@@ -459,9 +463,9 @@ export declare const RenderInternals: {
|
|
|
459
463
|
port: number | null;
|
|
460
464
|
server: import("./prepare-server").RemotionServer | undefined;
|
|
461
465
|
indent: boolean;
|
|
462
|
-
logLevel: "
|
|
466
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
463
467
|
serveUrlOrWebpackUrl: string;
|
|
464
|
-
}) => Promise<import("remotion").
|
|
468
|
+
}) => Promise<import("remotion").VideoConfig[]>;
|
|
465
469
|
internalRenderFrames: ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, inputProps, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, }: import("./render-frames").InternalRenderFramesOptions) => Promise<import("./types").RenderFramesOutput>;
|
|
466
470
|
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, }: import("./render-media").InternalRenderMediaOptions) => Promise<{
|
|
467
471
|
buffer: Buffer | null;
|
package/dist/logger.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ export declare const Log: {
|
|
|
18
18
|
warnAdvanced: (options: LogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
19
19
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
20
20
|
};
|
|
21
|
-
export declare const getLogLevel: () => "
|
|
21
|
+
export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn";
|
|
22
22
|
export declare const setLogLevel: (newLogLevel: LogLevel) => void;
|
|
23
23
|
export {};
|
package/dist/logger.js
CHANGED
|
@@ -7,11 +7,11 @@ const log_level_1 = require("./log-level");
|
|
|
7
7
|
const truthy_1 = require("./truthy");
|
|
8
8
|
exports.INDENT_TOKEN = chalk_1.chalk.gray('│');
|
|
9
9
|
const verboseTag = (str) => {
|
|
10
|
-
return is_color_supported_1.isColorSupported ? chalk_1.chalk.bgBlack(` ${str} `) : `[${str}]`;
|
|
10
|
+
return (0, is_color_supported_1.isColorSupported)() ? chalk_1.chalk.bgBlack(` ${str} `) : `[${str}]`;
|
|
11
11
|
};
|
|
12
12
|
exports.verboseTag = verboseTag;
|
|
13
13
|
const secondverboseTag = (str) => {
|
|
14
|
-
return is_color_supported_1.isColorSupported ? chalk_1.chalk.bgWhite(` ${str} `) : `[${str}]`;
|
|
14
|
+
return (0, is_color_supported_1.isColorSupported)() ? chalk_1.chalk.bgWhite(` ${str} `) : `[${str}]`;
|
|
15
15
|
};
|
|
16
16
|
exports.secondverboseTag = secondverboseTag;
|
|
17
17
|
exports.Log = {
|
|
@@ -23,15 +23,16 @@ exports.Log = {
|
|
|
23
23
|
return console.log(...[
|
|
24
24
|
options.indent ? exports.INDENT_TOKEN : null,
|
|
25
25
|
options.tag ? (0, exports.verboseTag)(options.tag) : null,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
]
|
|
27
|
+
.filter(truthy_1.truthy)
|
|
28
|
+
.concat(args.map((a) => chalk_1.chalk.gray(a))));
|
|
28
29
|
}
|
|
29
30
|
},
|
|
30
31
|
info: (...args) => {
|
|
31
32
|
exports.Log.infoAdvanced({ indent: false, logLevel: (0, exports.getLogLevel)() }, ...args);
|
|
32
33
|
},
|
|
33
34
|
infoAdvanced: (options, ...args) => {
|
|
34
|
-
return console.log(...[options.indent ? exports.INDENT_TOKEN : null
|
|
35
|
+
return console.log(...[options.indent ? exports.INDENT_TOKEN : null].filter(truthy_1.truthy).concat(args));
|
|
35
36
|
},
|
|
36
37
|
warn: (...args) => {
|
|
37
38
|
if ((0, log_level_1.isEqualOrBelowLogLevel)((0, exports.getLogLevel)(), 'warn')) {
|
|
@@ -40,10 +41,9 @@ exports.Log = {
|
|
|
40
41
|
},
|
|
41
42
|
warnAdvanced: (options, ...args) => {
|
|
42
43
|
if ((0, log_level_1.isEqualOrBelowLogLevel)(options.logLevel, 'warn')) {
|
|
43
|
-
return console.warn(...[
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
].filter(truthy_1.truthy));
|
|
44
|
+
return console.warn(...[options.indent ? chalk_1.chalk.yellow(exports.INDENT_TOKEN) : null]
|
|
45
|
+
.filter(truthy_1.truthy)
|
|
46
|
+
.concat(args.map((a) => chalk_1.chalk.yellow(a))));
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
error: (...args) => {
|
|
@@ -5,6 +5,7 @@ const node_url_1 = require("node:url");
|
|
|
5
5
|
const download_and_map_assets_to_file_1 = require("./assets/download-and-map-assets-to-file");
|
|
6
6
|
const compositor_1 = require("./compositor/compositor");
|
|
7
7
|
const log_level_1 = require("./log-level");
|
|
8
|
+
const logger_1 = require("./logger");
|
|
8
9
|
const extractUrlAndSourceFromUrl = (url) => {
|
|
9
10
|
const parsed = new URL(url, 'http://localhost');
|
|
10
11
|
const query = parsed.search;
|
|
@@ -68,8 +69,10 @@ const startOffthreadVideoServer = ({ downloadMap, concurrency, logLevel, indent,
|
|
|
68
69
|
res.end();
|
|
69
70
|
return;
|
|
70
71
|
}
|
|
72
|
+
let extractStart = Date.now();
|
|
71
73
|
(0, download_and_map_assets_to_file_1.downloadAsset)({ src, emitter: events, downloadMap })
|
|
72
74
|
.then((to) => {
|
|
75
|
+
extractStart = Date.now();
|
|
73
76
|
return compositor.executeCommand('ExtractFrame', {
|
|
74
77
|
input: to,
|
|
75
78
|
time,
|
|
@@ -77,6 +80,11 @@ const startOffthreadVideoServer = ({ downloadMap, concurrency, logLevel, indent,
|
|
|
77
80
|
});
|
|
78
81
|
})
|
|
79
82
|
.then((readable) => {
|
|
83
|
+
const extractEnd = Date.now();
|
|
84
|
+
const timeToExtract = extractEnd - extractStart;
|
|
85
|
+
if (timeToExtract > 1000) {
|
|
86
|
+
logger_1.Log.verbose(`Took ${timeToExtract}ms to extract frame from ${src} at ${time}`);
|
|
87
|
+
}
|
|
80
88
|
if (!readable) {
|
|
81
89
|
throw new Error('no readable from ffmpeg');
|
|
82
90
|
}
|
package/dist/options/crf.js
CHANGED
|
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
exports.crfOption = {
|
|
6
6
|
name: 'CRF',
|
|
7
7
|
cliFlag: '--crf',
|
|
8
|
-
description: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "No matter which codec you end up using, there's always a tradeoff between file size and video quality. You can control it by setting the
|
|
8
|
+
description: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "No matter which codec you end up using, there's always a tradeoff between file size and video quality. You can control it by setting the CRF (Constant Rate Factor). The lower the number, the better the quality, the higher the number, the smaller the file is \u2013 of course at the cost of quality." })),
|
|
9
9
|
ssrName: 'crf',
|
|
10
10
|
docLink: 'https://www.remotion.dev/docs/encoding/#controlling-quality-using-the-crf-setting',
|
|
11
11
|
};
|
|
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
exports.videoCodecOption = {
|
|
6
6
|
name: 'Codec',
|
|
7
7
|
cliFlag: '--codec',
|
|
8
|
-
description: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "H264 works well in most cases, sometimes it's worth going for a different codec. WebM achieves higher compression but is slower to render. WebM and ProRes support transparency." })),
|
|
8
|
+
description: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "H264 works well in most cases, but sometimes it's worth going for a different codec. WebM achieves higher compression but is slower to render. WebM and ProRes support transparency." })),
|
|
9
9
|
ssrName: 'codec',
|
|
10
10
|
docLink: 'https://www.remotion.dev/docs/encoding/#choosing-a-codec',
|
|
11
11
|
};
|
|
@@ -39,13 +39,13 @@ async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, })
|
|
|
39
39
|
const expressionWithSourceUrl = SOURCE_URL_REGEX.test(expression)
|
|
40
40
|
? expression
|
|
41
41
|
: expression + '\n' + suffix;
|
|
42
|
-
const { exceptionDetails: exceptDetails, result: remotObject } =
|
|
42
|
+
const { value: { exceptionDetails: exceptDetails, result: remotObject }, size, } = await client.send('Runtime.evaluate', {
|
|
43
43
|
expression: expressionWithSourceUrl,
|
|
44
44
|
contextId,
|
|
45
45
|
returnByValue: true,
|
|
46
46
|
awaitPromise: true,
|
|
47
47
|
userGesture: true,
|
|
48
|
-
})
|
|
48
|
+
});
|
|
49
49
|
if (exceptDetails === null || exceptDetails === void 0 ? void 0 : exceptDetails.exception) {
|
|
50
50
|
const err = new symbolicateable_error_1.SymbolicateableError({
|
|
51
51
|
stack: exceptDetails.exception.description,
|
|
@@ -56,7 +56,7 @@ async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, })
|
|
|
56
56
|
});
|
|
57
57
|
throw err;
|
|
58
58
|
}
|
|
59
|
-
return valueFromRemoteObject(remotObject);
|
|
59
|
+
return { value: valueFromRemoteObject(remotObject), size };
|
|
60
60
|
}
|
|
61
61
|
if (typeof pageFunction !== 'function')
|
|
62
62
|
throw new Error(`Expected to get |string| or |function| as the first argument, but got "${pageFunction}" instead.`);
|
|
@@ -100,7 +100,7 @@ async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, })
|
|
|
100
100
|
throw error;
|
|
101
101
|
}
|
|
102
102
|
try {
|
|
103
|
-
const { exceptionDetails, result: remoteObject } = await callFunctionOnPromise;
|
|
103
|
+
const { value: { exceptionDetails, result: remoteObject }, size, } = await callFunctionOnPromise;
|
|
104
104
|
if (exceptionDetails) {
|
|
105
105
|
const err = new symbolicateable_error_1.SymbolicateableError({
|
|
106
106
|
stack: (_c = exceptionDetails.exception) === null || _c === void 0 ? void 0 : _c.description,
|
|
@@ -111,7 +111,7 @@ async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, })
|
|
|
111
111
|
});
|
|
112
112
|
throw err;
|
|
113
113
|
}
|
|
114
|
-
return valueFromRemoteObject(remoteObject);
|
|
114
|
+
return { size, value: valueFromRemoteObject(remoteObject) };
|
|
115
115
|
}
|
|
116
116
|
catch (error) {
|
|
117
117
|
if ((_h = error === null || error === void 0 ? void 0 : error.originalMessage) === null || _h === void 0 ? void 0 : _h.startsWith("Object couldn't be returned by value")) {
|
package/dist/render-frames.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';
|
|
@@ -31,7 +31,7 @@ export type InternalRenderFramesOptions = {
|
|
|
31
31
|
scale: number;
|
|
32
32
|
port: number | null;
|
|
33
33
|
cancelSignal: CancelSignal | undefined;
|
|
34
|
-
composition:
|
|
34
|
+
composition: VideoConfig;
|
|
35
35
|
indent: boolean;
|
|
36
36
|
server: RemotionServer | undefined;
|
|
37
37
|
muted: boolean;
|
|
@@ -72,7 +72,7 @@ export type RenderFramesOptions = {
|
|
|
72
72
|
scale?: number;
|
|
73
73
|
port?: number | null;
|
|
74
74
|
cancelSignal?: CancelSignal;
|
|
75
|
-
composition:
|
|
75
|
+
composition: VideoConfig;
|
|
76
76
|
muted?: boolean;
|
|
77
77
|
concurrency?: number | string | null;
|
|
78
78
|
serveUrl: string;
|
package/dist/render-frames.js
CHANGED
|
@@ -82,11 +82,11 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, inputProps
|
|
|
82
82
|
});
|
|
83
83
|
await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
84
84
|
// eslint-disable-next-line max-params
|
|
85
|
-
pageFunction: (id,
|
|
85
|
+
pageFunction: (id, props, durationInFrames, fps, height, width) => {
|
|
86
86
|
window.remotion_setBundleMode({
|
|
87
87
|
type: 'composition',
|
|
88
88
|
compositionName: id,
|
|
89
|
-
|
|
89
|
+
props,
|
|
90
90
|
compositionDurationInFrames: durationInFrames,
|
|
91
91
|
compositionFps: fps,
|
|
92
92
|
compositionHeight: height,
|
|
@@ -95,7 +95,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, inputProps
|
|
|
95
95
|
},
|
|
96
96
|
args: [
|
|
97
97
|
composition.id,
|
|
98
|
-
composition.
|
|
98
|
+
composition.props,
|
|
99
99
|
composition.durationInFrames,
|
|
100
100
|
composition.fps,
|
|
101
101
|
composition.height,
|
|
@@ -133,7 +133,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, inputProps
|
|
|
133
133
|
cancelSignal === null || cancelSignal === void 0 ? void 0 : cancelSignal(() => {
|
|
134
134
|
stopped = true;
|
|
135
135
|
});
|
|
136
|
-
const renderFrameWithOptionToReject = async ({ frame, index, reject, width, height, }) => {
|
|
136
|
+
const renderFrameWithOptionToReject = async ({ frame, index, reject, width, height, compId, }) => {
|
|
137
137
|
const pool = await poolPromise;
|
|
138
138
|
const freePage = await pool.acquire();
|
|
139
139
|
if (stopped) {
|
|
@@ -149,7 +149,12 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, inputProps
|
|
|
149
149
|
frame,
|
|
150
150
|
});
|
|
151
151
|
freePage.on('error', errorCallbackOnFrame);
|
|
152
|
-
|
|
152
|
+
const startSeeking = Date.now();
|
|
153
|
+
await (0, seek_to_frame_1.seekToFrame)({ frame, page: freePage, composition: compId });
|
|
154
|
+
const timeToSeek = Date.now() - startSeeking;
|
|
155
|
+
if (timeToSeek > 1000) {
|
|
156
|
+
logger_1.Log.verbose(`Seeking to frame ${frame} took ${timeToSeek}ms`);
|
|
157
|
+
}
|
|
153
158
|
if (!outputDir && !onFrameBuffer && imageFormat !== 'none') {
|
|
154
159
|
throw new Error('Called renderFrames() without specifying either `outputDir` or `onFrameBuffer`');
|
|
155
160
|
}
|
|
@@ -210,6 +215,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, inputProps
|
|
|
210
215
|
reject,
|
|
211
216
|
width: composition.width,
|
|
212
217
|
height: composition.height,
|
|
218
|
+
compId: composition.id,
|
|
213
219
|
})
|
|
214
220
|
.then(() => {
|
|
215
221
|
resolve();
|
|
@@ -290,8 +296,7 @@ const internalRenderFrames = ({ browserExecutable, cancelSignal, chromiumOptions
|
|
|
290
296
|
remotion_1.Internals.validateDimension(composition.height, 'height', 'in the `config` object passed to `renderFrames()`');
|
|
291
297
|
remotion_1.Internals.validateDimension(composition.width, 'width', 'in the `config` object passed to `renderFrames()`');
|
|
292
298
|
remotion_1.Internals.validateFps(composition.fps, 'in the `config` object of `renderFrames()`', false);
|
|
293
|
-
remotion_1.Internals.validateDurationInFrames({
|
|
294
|
-
durationInFrames: composition.durationInFrames,
|
|
299
|
+
remotion_1.Internals.validateDurationInFrames(composition.durationInFrames, {
|
|
295
300
|
component: 'in the `config` object passed to `renderFrames()`',
|
|
296
301
|
allowFloats: false,
|
|
297
302
|
});
|
package/dist/render-media.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 { AudioCodec } from './audio-codec';
|
|
5
5
|
import type { BrowserExecutable } from './browser-executable';
|
|
@@ -32,7 +32,7 @@ export type RenderMediaOnProgress = (progress: {
|
|
|
32
32
|
export type InternalRenderMediaOptions = {
|
|
33
33
|
outputLocation: string | null;
|
|
34
34
|
codec: Codec;
|
|
35
|
-
composition:
|
|
35
|
+
composition: VideoConfig;
|
|
36
36
|
inputProps: Record<string, unknown>;
|
|
37
37
|
crf: number | null;
|
|
38
38
|
imageFormat: VideoImageFormat;
|
|
@@ -73,7 +73,7 @@ export type InternalRenderMediaOptions = {
|
|
|
73
73
|
export type RenderMediaOptions = {
|
|
74
74
|
outputLocation?: string | null;
|
|
75
75
|
codec: Codec;
|
|
76
|
-
composition:
|
|
76
|
+
composition: VideoConfig;
|
|
77
77
|
inputProps?: Record<string, unknown>;
|
|
78
78
|
crf?: number | null;
|
|
79
79
|
imageFormat?: VideoImageFormat;
|
package/dist/render-media.js
CHANGED
|
@@ -94,11 +94,13 @@ const internalRenderMedia = ({ proResProfile, crf, composition, inputProps, pixe
|
|
|
94
94
|
logLevel,
|
|
95
95
|
tag: 'renderMedia()',
|
|
96
96
|
}, 'Codec supports parallel rendering:', (0, can_use_parallel_encoding_1.canUseParallelEncoding)(codec));
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
if (disallowParallelEncoding) {
|
|
98
|
+
logger_1.Log.verboseAdvanced({
|
|
99
|
+
indent,
|
|
100
|
+
logLevel,
|
|
101
|
+
tag: 'renderMedia()',
|
|
102
|
+
}, 'User disallowed parallel encoding.');
|
|
103
|
+
}
|
|
102
104
|
if (parallelEncoding) {
|
|
103
105
|
logger_1.Log.verboseAdvanced({
|
|
104
106
|
indent,
|
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';
|
|
@@ -10,7 +10,7 @@ import type { ChromiumOptions } from './open-browser';
|
|
|
10
10
|
import type { RemotionServer } from './prepare-server';
|
|
11
11
|
import type { LogLevel } from './log-level';
|
|
12
12
|
type InternalRenderStillOptions = {
|
|
13
|
-
composition:
|
|
13
|
+
composition: VideoConfig;
|
|
14
14
|
output: string | null;
|
|
15
15
|
frame: number;
|
|
16
16
|
inputProps: Record<string, unknown>;
|
|
@@ -34,7 +34,7 @@ type InternalRenderStillOptions = {
|
|
|
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>;
|
package/dist/render-still.js
CHANGED
|
@@ -53,8 +53,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
53
53
|
remotion_1.Internals.validateDimension(composition.height, 'height', 'in the `config` object passed to `renderStill()`');
|
|
54
54
|
remotion_1.Internals.validateDimension(composition.width, 'width', 'in the `config` object passed to `renderStill()`');
|
|
55
55
|
remotion_1.Internals.validateFps(composition.fps, 'in the `config` object of `renderStill()`', false);
|
|
56
|
-
remotion_1.Internals.validateDurationInFrames({
|
|
57
|
-
durationInFrames: composition.durationInFrames,
|
|
56
|
+
remotion_1.Internals.validateDurationInFrames(composition.durationInFrames, {
|
|
58
57
|
component: 'in the `config` object passed to `renderStill()`',
|
|
59
58
|
allowFloats: false,
|
|
60
59
|
});
|
|
@@ -148,11 +147,11 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
148
147
|
});
|
|
149
148
|
await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
150
149
|
// eslint-disable-next-line max-params
|
|
151
|
-
pageFunction: (id,
|
|
150
|
+
pageFunction: (id, props, durationInFrames, fps, height, width) => {
|
|
152
151
|
window.remotion_setBundleMode({
|
|
153
152
|
type: 'composition',
|
|
154
153
|
compositionName: id,
|
|
155
|
-
|
|
154
|
+
props,
|
|
156
155
|
compositionDurationInFrames: durationInFrames,
|
|
157
156
|
compositionFps: fps,
|
|
158
157
|
compositionHeight: height,
|
|
@@ -161,7 +160,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
161
160
|
},
|
|
162
161
|
args: [
|
|
163
162
|
composition.id,
|
|
164
|
-
composition.
|
|
163
|
+
composition.props,
|
|
165
164
|
composition.durationInFrames,
|
|
166
165
|
composition.fps,
|
|
167
166
|
composition.height,
|
|
@@ -170,7 +169,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
170
169
|
frame: null,
|
|
171
170
|
page,
|
|
172
171
|
});
|
|
173
|
-
await (0, seek_to_frame_1.seekToFrame)({ frame: stillFrame, page });
|
|
172
|
+
await (0, seek_to_frame_1.seekToFrame)({ frame: stillFrame, page, composition: composition.id });
|
|
174
173
|
const { buffer } = await (0, take_frame_and_compose_1.takeFrameAndCompose)({
|
|
175
174
|
frame: stillFrame,
|
|
176
175
|
freePage: page,
|
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.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Page } from './browser/BrowserPage';
|
|
2
2
|
export declare const waitForReady: (page: Page) => Promise<unknown>;
|
|
3
|
-
export declare const seekToFrame: ({ frame, page, }: {
|
|
3
|
+
export declare const seekToFrame: ({ frame, page, composition, }: {
|
|
4
4
|
frame: number;
|
|
5
|
+
composition: string;
|
|
5
6
|
page: Page;
|
|
6
7
|
}) => Promise<void>;
|
package/dist/seek-to-frame.js
CHANGED
|
@@ -33,7 +33,7 @@ const waitForReady = (page) => {
|
|
|
33
33
|
page,
|
|
34
34
|
});
|
|
35
35
|
})
|
|
36
|
-
.then((val) => {
|
|
36
|
+
.then(({ value: val }) => {
|
|
37
37
|
if (typeof val !== 'string') {
|
|
38
38
|
throw val;
|
|
39
39
|
}
|
|
@@ -48,13 +48,13 @@ const waitForReady = (page) => {
|
|
|
48
48
|
]);
|
|
49
49
|
};
|
|
50
50
|
exports.waitForReady = waitForReady;
|
|
51
|
-
const seekToFrame = async ({ frame, page, }) => {
|
|
51
|
+
const seekToFrame = async ({ frame, page, composition, }) => {
|
|
52
52
|
await (0, exports.waitForReady)(page);
|
|
53
53
|
await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
54
|
-
pageFunction: (f) => {
|
|
55
|
-
window.remotion_setFrame(f);
|
|
54
|
+
pageFunction: (f, c) => {
|
|
55
|
+
window.remotion_setFrame(f, c);
|
|
56
56
|
},
|
|
57
|
-
args: [frame],
|
|
57
|
+
args: [frame, composition],
|
|
58
58
|
frame,
|
|
59
59
|
page,
|
|
60
60
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
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';
|
|
@@ -33,10 +33,14 @@ export type SelectCompositionOptions = {
|
|
|
33
33
|
serveUrl: string;
|
|
34
34
|
id: string;
|
|
35
35
|
};
|
|
36
|
-
|
|
36
|
+
type InternalReturnType = {
|
|
37
|
+
metadata: VideoConfig;
|
|
38
|
+
propsSize: number;
|
|
39
|
+
};
|
|
40
|
+
export declare const internalSelectComposition: (options: InternalSelectCompositionsConfig) => Promise<InternalReturnType>;
|
|
37
41
|
/**
|
|
38
42
|
* @description Gets a composition defined in a Remotion project based on a Webpack bundle.
|
|
39
43
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/select-composition)
|
|
40
44
|
*/
|
|
41
|
-
export declare const selectComposition: (options: SelectCompositionOptions) => Promise<
|
|
45
|
+
export declare const selectComposition: (options: SelectCompositionOptions) => Promise<VideoConfig>;
|
|
42
46
|
export {};
|