@remotion/renderer 4.0.354 → 4.0.356
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/types.d.ts +1 -1
- package/dist/browser/Browser.d.ts +7 -4
- package/dist/browser/Browser.js +6 -3
- package/dist/browser/BrowserPage.d.ts +10 -2
- package/dist/browser/BrowserPage.js +9 -16
- package/dist/browser/Target.d.ts +3 -2
- package/dist/browser/Target.js +2 -1
- package/dist/default-on-log.d.ts +2 -0
- package/dist/default-on-log.js +8 -0
- package/dist/esm/error-handling.mjs +22 -14
- package/dist/esm/index.mjs +119 -91
- package/dist/get-browser-instance.d.ts +3 -2
- package/dist/get-browser-instance.js +3 -1
- package/dist/get-compositions.d.ts +2 -0
- package/dist/get-compositions.js +4 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +2 -0
- package/dist/logger.d.ts +1 -0
- package/dist/logger.js +24 -24
- package/dist/make-page.d.ts +3 -2
- package/dist/make-page.js +2 -2
- package/dist/render-frames.d.ts +2 -0
- package/dist/render-frames.js +6 -2
- package/dist/render-media.d.ts +2 -0
- package/dist/render-media.js +6 -11
- package/dist/render-still.d.ts +2 -0
- package/dist/render-still.js +4 -1
- package/dist/select-composition.js +2 -0
- package/dist/test-gpu.d.ts +3 -1
- package/dist/test-gpu.js +2 -1
- package/dist/validate-even-dimensions-with-codec.js +16 -23
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -124,6 +124,7 @@ const can_concat_seamlessly_1 = require("./can-concat-seamlessly");
|
|
|
124
124
|
const codec_supports_media_1 = require("./codec-supports-media");
|
|
125
125
|
const combine_chunks_2 = require("./combine-chunks");
|
|
126
126
|
const make_file_executable_1 = require("./compositor/make-file-executable");
|
|
127
|
+
const default_on_log_1 = require("./default-on-log");
|
|
127
128
|
const ensure_browser_2 = require("./ensure-browser");
|
|
128
129
|
const audio_codec_1 = require("./options/audio-codec");
|
|
129
130
|
const offthreadvideo_threads_1 = require("./options/offthreadvideo-threads");
|
|
@@ -220,6 +221,7 @@ exports.RenderInternals = {
|
|
|
220
221
|
canConcatVideoSeamlessly: can_concat_seamlessly_1.canConcatVideoSeamlessly,
|
|
221
222
|
canConcatAudioSeamlessly: can_concat_seamlessly_1.canConcatAudioSeamlessly,
|
|
222
223
|
internalCombineChunks: combine_chunks_2.internalCombineChunks,
|
|
224
|
+
defaultOnLog: default_on_log_1.defaultOnLog,
|
|
223
225
|
};
|
|
224
226
|
// Warn of potential performance issues with Apple Silicon (M1 chip under Rosetta)
|
|
225
227
|
(0, check_version_requirements_1.checkRuntimeVersion)('info', false);
|
package/dist/logger.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ type VerboseLogOptions = LogOptions & {
|
|
|
10
10
|
export declare const verboseTag: (str: string) => string;
|
|
11
11
|
export declare const secondverboseTag: (str: string) => string;
|
|
12
12
|
export declare const Log: {
|
|
13
|
+
formatLogs: (logLevel: LogLevel, options: VerboseLogOptions, args: Parameters<typeof console.log>) => string[];
|
|
13
14
|
trace: (options: VerboseLogOptions, message?: any, ...optionalParams: any[]) => boolean | void;
|
|
14
15
|
verbose: (options: VerboseLogOptions, message?: any, ...optionalParams: any[]) => boolean | void;
|
|
15
16
|
info: (options: LogOptions, message?: any, ...optionalParams: any[]) => boolean | void;
|
package/dist/logger.js
CHANGED
|
@@ -17,6 +17,25 @@ const secondverboseTag = (str) => {
|
|
|
17
17
|
};
|
|
18
18
|
exports.secondverboseTag = secondverboseTag;
|
|
19
19
|
exports.Log = {
|
|
20
|
+
formatLogs: (logLevel, options, args) => {
|
|
21
|
+
return [
|
|
22
|
+
options.indent ? exports.INDENT_TOKEN : null,
|
|
23
|
+
options.tag ? (0, exports.verboseTag)(options.tag) : null,
|
|
24
|
+
]
|
|
25
|
+
.filter(truthy_1.truthy)
|
|
26
|
+
.concat(args.map((a) => {
|
|
27
|
+
if (logLevel === 'warn') {
|
|
28
|
+
return chalk_1.chalk.yellow(a);
|
|
29
|
+
}
|
|
30
|
+
if (logLevel === 'error') {
|
|
31
|
+
return chalk_1.chalk.red(a);
|
|
32
|
+
}
|
|
33
|
+
if (logLevel === 'verbose' || logLevel === 'trace') {
|
|
34
|
+
return chalk_1.chalk.gray(a);
|
|
35
|
+
}
|
|
36
|
+
return a;
|
|
37
|
+
}));
|
|
38
|
+
},
|
|
20
39
|
trace: (options, ...args) => {
|
|
21
40
|
(0, repro_1.writeInRepro)('trace', ...args);
|
|
22
41
|
if ((0, log_level_1.isEqualOrBelowLogLevel)(options.logLevel, 'trace')) {
|
|
@@ -24,12 +43,7 @@ exports.Log = {
|
|
|
24
43
|
// Lambda will print "undefined" otherwise
|
|
25
44
|
return process.stdout.write('\n');
|
|
26
45
|
}
|
|
27
|
-
return console.log(...
|
|
28
|
-
options.indent ? exports.INDENT_TOKEN : null,
|
|
29
|
-
options.tag ? (0, exports.verboseTag)(options.tag) : null,
|
|
30
|
-
]
|
|
31
|
-
.filter(truthy_1.truthy)
|
|
32
|
-
.concat(args.map((a) => chalk_1.chalk.gray(a))));
|
|
46
|
+
return console.log(...exports.Log.formatLogs('trace', options, args));
|
|
33
47
|
}
|
|
34
48
|
},
|
|
35
49
|
verbose: (options, ...args) => {
|
|
@@ -39,12 +53,7 @@ exports.Log = {
|
|
|
39
53
|
// Lambda will print "undefined" otherwise
|
|
40
54
|
return process.stdout.write('\n');
|
|
41
55
|
}
|
|
42
|
-
return console.log(...
|
|
43
|
-
options.indent ? exports.INDENT_TOKEN : null,
|
|
44
|
-
options.tag ? (0, exports.verboseTag)(options.tag) : null,
|
|
45
|
-
]
|
|
46
|
-
.filter(truthy_1.truthy)
|
|
47
|
-
.concat(args.map((a) => chalk_1.chalk.gray(a))));
|
|
56
|
+
return console.log(...exports.Log.formatLogs('verbose', options, args));
|
|
48
57
|
}
|
|
49
58
|
},
|
|
50
59
|
info: (options, ...args) => {
|
|
@@ -54,9 +63,7 @@ exports.Log = {
|
|
|
54
63
|
// Lambda will print "undefined" otherwise
|
|
55
64
|
return process.stdout.write('\n');
|
|
56
65
|
}
|
|
57
|
-
return console.log(...
|
|
58
|
-
.filter(truthy_1.truthy)
|
|
59
|
-
.concat(args !== null && args !== void 0 ? args : []));
|
|
66
|
+
return console.log(...exports.Log.formatLogs('info', options, args));
|
|
60
67
|
}
|
|
61
68
|
},
|
|
62
69
|
warn: (options, ...args) => {
|
|
@@ -66,9 +73,7 @@ exports.Log = {
|
|
|
66
73
|
// Lambda will print "undefined" otherwise
|
|
67
74
|
return process.stdout.write('\n');
|
|
68
75
|
}
|
|
69
|
-
return console.warn(...
|
|
70
|
-
.filter(truthy_1.truthy)
|
|
71
|
-
.concat(args.map((a) => chalk_1.chalk.yellow(a))));
|
|
76
|
+
return console.warn(...exports.Log.formatLogs('warn', options, args));
|
|
72
77
|
}
|
|
73
78
|
},
|
|
74
79
|
error: (options, ...args) => {
|
|
@@ -78,12 +83,7 @@ exports.Log = {
|
|
|
78
83
|
// Lambda will print "undefined" otherwise
|
|
79
84
|
return process.stdout.write('\n');
|
|
80
85
|
}
|
|
81
|
-
return console.error(...
|
|
82
|
-
options.indent ? exports.INDENT_TOKEN : null,
|
|
83
|
-
options.tag ? (0, exports.verboseTag)(options.tag) : null,
|
|
84
|
-
]
|
|
85
|
-
.filter(truthy_1.truthy)
|
|
86
|
-
.concat(args.map((a) => chalk_1.chalk.red(a))));
|
|
86
|
+
return console.error(...exports.Log.formatLogs('error', options, args));
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
};
|
package/dist/make-page.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { VideoConfig } from 'remotion/no-react';
|
|
2
2
|
import type { BrowserLog } from './browser-log';
|
|
3
|
-
import type { Page } from './browser/BrowserPage';
|
|
3
|
+
import type { OnLog, Page } from './browser/BrowserPage';
|
|
4
4
|
import type { SourceMapGetter } from './browser/source-map-getter';
|
|
5
5
|
import type { VideoImageFormat } from './image-format';
|
|
6
6
|
import type { LogLevel } from './log-level';
|
|
7
7
|
import type { BrowserReplacer } from './replace-browser';
|
|
8
|
-
export declare const makePage: ({ context, initialFrame, browserReplacer, logLevel, indent, pagesArray, onBrowserLog, scale, timeoutInMilliseconds, composition, proxyPort, serveUrl, muted, envVariables, serializedInputPropsWithCustomSchema, imageFormat, serializedResolvedPropsWithCustomSchema, pageIndex, isMainTab, mediaCacheSizeInBytes, }: {
|
|
8
|
+
export declare const makePage: ({ context, initialFrame, browserReplacer, logLevel, indent, pagesArray, onBrowserLog, scale, timeoutInMilliseconds, composition, proxyPort, serveUrl, muted, envVariables, serializedInputPropsWithCustomSchema, imageFormat, serializedResolvedPropsWithCustomSchema, pageIndex, isMainTab, mediaCacheSizeInBytes, onLog, }: {
|
|
9
9
|
context: SourceMapGetter;
|
|
10
10
|
initialFrame: number;
|
|
11
11
|
browserReplacer: BrowserReplacer;
|
|
@@ -26,4 +26,5 @@ export declare const makePage: ({ context, initialFrame, browserReplacer, logLev
|
|
|
26
26
|
pageIndex: number;
|
|
27
27
|
isMainTab: boolean;
|
|
28
28
|
mediaCacheSizeInBytes: number | null;
|
|
29
|
+
onLog: OnLog;
|
|
29
30
|
}) => Promise<Page>;
|
package/dist/make-page.js
CHANGED
|
@@ -4,10 +4,10 @@ exports.makePage = void 0;
|
|
|
4
4
|
const get_available_memory_1 = require("./memory/get-available-memory");
|
|
5
5
|
const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
6
6
|
const set_props_and_env_1 = require("./set-props-and-env");
|
|
7
|
-
const makePage = async ({ context, initialFrame, browserReplacer, logLevel, indent, pagesArray, onBrowserLog, scale, timeoutInMilliseconds, composition, proxyPort, serveUrl, muted, envVariables, serializedInputPropsWithCustomSchema, imageFormat, serializedResolvedPropsWithCustomSchema, pageIndex, isMainTab, mediaCacheSizeInBytes, }) => {
|
|
7
|
+
const makePage = async ({ context, initialFrame, browserReplacer, logLevel, indent, pagesArray, onBrowserLog, scale, timeoutInMilliseconds, composition, proxyPort, serveUrl, muted, envVariables, serializedInputPropsWithCustomSchema, imageFormat, serializedResolvedPropsWithCustomSchema, pageIndex, isMainTab, mediaCacheSizeInBytes, onLog, }) => {
|
|
8
8
|
const page = await browserReplacer
|
|
9
9
|
.getBrowser()
|
|
10
|
-
.newPage({ context, logLevel, indent, pageIndex, onBrowserLog });
|
|
10
|
+
.newPage({ context, logLevel, indent, pageIndex, onBrowserLog, onLog });
|
|
11
11
|
pagesArray.push(page);
|
|
12
12
|
await page.setViewport({
|
|
13
13
|
width: composition.width,
|
package/dist/render-frames.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-
|
|
|
3
3
|
import type { BrowserExecutable } from './browser-executable';
|
|
4
4
|
import type { BrowserLog } from './browser-log';
|
|
5
5
|
import type { HeadlessBrowser } from './browser/Browser';
|
|
6
|
+
import type { OnLog } from './browser/BrowserPage';
|
|
6
7
|
import type { FrameRange } from './frame-range';
|
|
7
8
|
import type { VideoImageFormat } from './image-format';
|
|
8
9
|
import type { CancelSignal } from './make-cancel-signal';
|
|
@@ -42,6 +43,7 @@ type InternalRenderFramesOptions = {
|
|
|
42
43
|
parallelEncodingEnabled: boolean;
|
|
43
44
|
compositionStart: number;
|
|
44
45
|
onArtifact: OnArtifact | null;
|
|
46
|
+
onLog: OnLog;
|
|
45
47
|
} & ToOptions<typeof optionsMap.renderFrames>;
|
|
46
48
|
type ArtifactWithoutContent = {
|
|
47
49
|
frame: number;
|
package/dist/render-frames.js
CHANGED
|
@@ -13,6 +13,7 @@ const browser_download_progress_bar_1 = require("./browser/browser-download-prog
|
|
|
13
13
|
const flaky_errors_1 = require("./browser/flaky-errors");
|
|
14
14
|
const can_use_parallel_encoding_1 = require("./can-use-parallel-encoding");
|
|
15
15
|
const cycle_browser_tabs_1 = require("./cycle-browser-tabs");
|
|
16
|
+
const default_on_log_1 = require("./default-on-log");
|
|
16
17
|
const find_closest_package_json_1 = require("./find-closest-package-json");
|
|
17
18
|
const get_concurrency_1 = require("./get-concurrency");
|
|
18
19
|
const get_duration_from_frame_range_1 = require("./get-duration-from-frame-range");
|
|
@@ -34,7 +35,7 @@ const validate_1 = require("./validate");
|
|
|
34
35
|
const validate_scale_1 = require("./validate-scale");
|
|
35
36
|
const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
|
|
36
37
|
const MAX_RETRIES_PER_FRAME = 1;
|
|
37
|
-
const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, jpegQuality, imageFormat, frameRange, onError, envVariables, onBrowserLog, onFrameBuffer, onDownload, pagesArray, serveUrl, composition, timeoutInMilliseconds, scale, resolvedConcurrency, everyNthFrame, proxyPort, cancelSignal, downloadMap, muted, makeBrowser, browserReplacer, sourceMapGetter, logLevel, indent, parallelEncodingEnabled, compositionStart, forSeamlessAacConcatenation, onArtifact, binariesDirectory, imageSequencePattern, mediaCacheSizeInBytes, }) => {
|
|
38
|
+
const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, jpegQuality, imageFormat, frameRange, onError, envVariables, onBrowserLog, onFrameBuffer, onDownload, pagesArray, serveUrl, composition, timeoutInMilliseconds, scale, resolvedConcurrency, everyNthFrame, proxyPort, cancelSignal, downloadMap, muted, makeBrowser, browserReplacer, sourceMapGetter, logLevel, indent, parallelEncodingEnabled, compositionStart, forSeamlessAacConcatenation, onArtifact, binariesDirectory, imageSequencePattern, mediaCacheSizeInBytes, onLog, }) => {
|
|
38
39
|
if (outputDir) {
|
|
39
40
|
if (!node_fs_1.default.existsSync(outputDir)) {
|
|
40
41
|
node_fs_1.default.mkdirSync(outputDir, {
|
|
@@ -75,6 +76,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
|
|
|
75
76
|
pageIndex,
|
|
76
77
|
isMainTab: pageIndex === 0,
|
|
77
78
|
mediaCacheSizeInBytes,
|
|
79
|
+
onLog,
|
|
78
80
|
});
|
|
79
81
|
};
|
|
80
82
|
const getPool = async () => {
|
|
@@ -193,7 +195,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
|
|
|
193
195
|
frameCount: framesToRender.length,
|
|
194
196
|
};
|
|
195
197
|
};
|
|
196
|
-
const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, parallelEncodingEnabled, binariesDirectory, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, chromeMode, offthreadVideoThreads, imageSequencePattern, mediaCacheSizeInBytes, }) => {
|
|
198
|
+
const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, parallelEncodingEnabled, binariesDirectory, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, chromeMode, offthreadVideoThreads, imageSequencePattern, mediaCacheSizeInBytes, onLog, }) => {
|
|
197
199
|
(0, validate_1.validateDimension)(composition.height, 'height', 'in the `config` object passed to `renderFrames()`');
|
|
198
200
|
(0, validate_1.validateDimension)(composition.width, 'width', 'in the `config` object passed to `renderFrames()`');
|
|
199
201
|
(0, validate_1.validateFps)(composition.fps, 'in the `config` object of `renderFrames()`', false);
|
|
@@ -297,6 +299,7 @@ const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOpti
|
|
|
297
299
|
offthreadVideoThreads,
|
|
298
300
|
imageSequencePattern,
|
|
299
301
|
mediaCacheSizeInBytes,
|
|
302
|
+
onLog,
|
|
300
303
|
});
|
|
301
304
|
}),
|
|
302
305
|
])
|
|
@@ -404,6 +407,7 @@ const renderFrames = (options) => {
|
|
|
404
407
|
offthreadVideoThreads: offthreadVideoThreads !== null && offthreadVideoThreads !== void 0 ? offthreadVideoThreads : null,
|
|
405
408
|
imageSequencePattern: imageSequencePattern !== null && imageSequencePattern !== void 0 ? imageSequencePattern : null,
|
|
406
409
|
mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
|
|
410
|
+
onLog: default_on_log_1.defaultOnLog,
|
|
407
411
|
});
|
|
408
412
|
};
|
|
409
413
|
exports.renderFrames = renderFrames;
|
package/dist/render-media.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type RenderMediaOnDownload } from './assets/download-and-map-assets-to-
|
|
|
3
3
|
import type { BrowserExecutable } from './browser-executable';
|
|
4
4
|
import type { BrowserLog } from './browser-log';
|
|
5
5
|
import type { HeadlessBrowser } from './browser/Browser';
|
|
6
|
+
import type { OnLog } from './browser/BrowserPage';
|
|
6
7
|
import type { Codec } from './codec';
|
|
7
8
|
import type { FfmpegOverrideFn } from './ffmpeg-override';
|
|
8
9
|
import type { FrameRange } from './frame-range';
|
|
@@ -68,6 +69,7 @@ export type InternalRenderMediaOptions = {
|
|
|
68
69
|
compositionStart: number;
|
|
69
70
|
onArtifact: OnArtifact | null;
|
|
70
71
|
metadata: Record<string, string> | null;
|
|
72
|
+
onLog: OnLog;
|
|
71
73
|
} & MoreRenderMediaOptions;
|
|
72
74
|
type Prettify<T> = {
|
|
73
75
|
[K in keyof T]: T[K];
|
package/dist/render-media.js
CHANGED
|
@@ -13,6 +13,7 @@ const browser_download_progress_bar_1 = require("./browser/browser-download-prog
|
|
|
13
13
|
const can_use_parallel_encoding_1 = require("./can-use-parallel-encoding");
|
|
14
14
|
const codec_supports_media_1 = require("./codec-supports-media");
|
|
15
15
|
const crf_1 = require("./crf");
|
|
16
|
+
const default_on_log_1 = require("./default-on-log");
|
|
16
17
|
const delete_directory_1 = require("./delete-directory");
|
|
17
18
|
const ensure_frames_in_order_1 = require("./ensure-frames-in-order");
|
|
18
19
|
const ensure_output_directory_1 = require("./ensure-output-directory");
|
|
@@ -52,7 +53,7 @@ const validate_videobitrate_1 = require("./validate-videobitrate");
|
|
|
52
53
|
const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
|
|
53
54
|
const SLOWEST_FRAME_COUNT = 10;
|
|
54
55
|
const MAX_RECENT_FRAME_TIMINGS = 50;
|
|
55
|
-
const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition: compositionWithPossibleUnevenDimensions, serializedInputPropsWithCustomSchema, pixelFormat: userPixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, }) => {
|
|
56
|
+
const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition: compositionWithPossibleUnevenDimensions, serializedInputPropsWithCustomSchema, pixelFormat: userPixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, onLog, }) => {
|
|
56
57
|
var _a, _b;
|
|
57
58
|
const pixelFormat = (_a = userPixelFormat !== null && userPixelFormat !== void 0 ? userPixelFormat : compositionWithPossibleUnevenDimensions.defaultPixelFormat) !== null && _a !== void 0 ? _a : pixel_format_1.DEFAULT_PIXEL_FORMAT;
|
|
58
59
|
if (repro) {
|
|
@@ -178,16 +179,6 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition: c
|
|
|
178
179
|
onCtrlCExit(`Delete ${workingDir}`, () => (0, delete_directory_1.deleteDirectory)(workingDir));
|
|
179
180
|
}
|
|
180
181
|
const { actualWidth: widthEvenDimensions, actualHeight: heightEvenDimensions } = (0, validate_even_dimensions_with_codec_1.validateEvenDimensionsWithCodec)({
|
|
181
|
-
codec,
|
|
182
|
-
height: compositionWithPossibleUnevenDimensions.height,
|
|
183
|
-
// Don't apply scale yet, only ensure even dimensions
|
|
184
|
-
scale: 1,
|
|
185
|
-
width: compositionWithPossibleUnevenDimensions.width,
|
|
186
|
-
wantsImageSequence: false,
|
|
187
|
-
indent,
|
|
188
|
-
logLevel,
|
|
189
|
-
});
|
|
190
|
-
const { actualWidth, actualHeight } = (0, validate_even_dimensions_with_codec_1.validateEvenDimensionsWithCodec)({
|
|
191
182
|
codec,
|
|
192
183
|
height: compositionWithPossibleUnevenDimensions.height,
|
|
193
184
|
scale,
|
|
@@ -196,6 +187,8 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition: c
|
|
|
196
187
|
indent,
|
|
197
188
|
logLevel,
|
|
198
189
|
});
|
|
190
|
+
const actualWidth = widthEvenDimensions * scale;
|
|
191
|
+
const actualHeight = heightEvenDimensions * scale;
|
|
199
192
|
const composition = {
|
|
200
193
|
...compositionWithPossibleUnevenDimensions,
|
|
201
194
|
height: heightEvenDimensions,
|
|
@@ -394,6 +387,7 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition: c
|
|
|
394
387
|
chromeMode,
|
|
395
388
|
imageSequencePattern: null,
|
|
396
389
|
mediaCacheSizeInBytes,
|
|
390
|
+
onLog,
|
|
397
391
|
});
|
|
398
392
|
return renderFramesProc;
|
|
399
393
|
})
|
|
@@ -617,6 +611,7 @@ const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps,
|
|
|
617
611
|
hardwareAcceleration: hardwareAcceleration !== null && hardwareAcceleration !== void 0 ? hardwareAcceleration : 'disable',
|
|
618
612
|
chromeMode: chromeMode !== null && chromeMode !== void 0 ? chromeMode : 'headless-shell',
|
|
619
613
|
mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
|
|
614
|
+
onLog: default_on_log_1.defaultOnLog,
|
|
620
615
|
});
|
|
621
616
|
};
|
|
622
617
|
exports.renderMedia = renderMedia;
|
package/dist/render-still.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-
|
|
|
3
3
|
import type { BrowserExecutable } from './browser-executable';
|
|
4
4
|
import type { BrowserLog } from './browser-log';
|
|
5
5
|
import type { HeadlessBrowser } from './browser/Browser';
|
|
6
|
+
import type { OnLog } from './browser/BrowserPage';
|
|
6
7
|
import type { StillImageFormat } from './image-format';
|
|
7
8
|
import type { CancelSignal } from './make-cancel-signal';
|
|
8
9
|
import type { ChromiumOptions } from './open-browser';
|
|
@@ -32,6 +33,7 @@ type InternalRenderStillOptions = {
|
|
|
32
33
|
serveUrl: string;
|
|
33
34
|
port: number | null;
|
|
34
35
|
onArtifact: OnArtifact | null;
|
|
36
|
+
onLog: OnLog;
|
|
35
37
|
} & ToOptions<typeof optionsMap.renderStill>;
|
|
36
38
|
export type RenderStillOptions = {
|
|
37
39
|
port?: number | null;
|
package/dist/render-still.js
CHANGED
|
@@ -45,6 +45,7 @@ const TimeoutSettings_1 = require("./browser/TimeoutSettings");
|
|
|
45
45
|
const browser_download_progress_bar_1 = require("./browser/browser-download-progress-bar");
|
|
46
46
|
const collect_assets_1 = require("./collect-assets");
|
|
47
47
|
const convert_to_positive_frame_index_1 = require("./convert-to-positive-frame-index");
|
|
48
|
+
const default_on_log_1 = require("./default-on-log");
|
|
48
49
|
const ensure_output_directory_1 = require("./ensure-output-directory");
|
|
49
50
|
const handle_javascript_exception_1 = require("./error-handling/handle-javascript-exception");
|
|
50
51
|
const filter_asset_types_1 = require("./filter-asset-types");
|
|
@@ -65,7 +66,7 @@ const validate_1 = require("./validate");
|
|
|
65
66
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
66
67
|
const validate_scale_1 = require("./validate-scale");
|
|
67
68
|
const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
|
|
68
|
-
const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFAULT_STILL_IMAGE_FORMAT, serveUrl, puppeteerInstance, onError, serializedInputPropsWithCustomSchema, envVariables, output, frame = 0, overwrite, browserExecutable, timeoutInMilliseconds, chromiumOptions, scale, proxyPort, cancelSignal, jpegQuality, onBrowserLog, sourceMapGetter, logLevel, indent, serializedResolvedPropsWithCustomSchema, onBrowserDownload, onArtifact, chromeMode, mediaCacheSizeInBytes, }) => {
|
|
69
|
+
const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFAULT_STILL_IMAGE_FORMAT, serveUrl, puppeteerInstance, onError, serializedInputPropsWithCustomSchema, envVariables, output, frame = 0, overwrite, browserExecutable, timeoutInMilliseconds, chromiumOptions, scale, proxyPort, cancelSignal, jpegQuality, onBrowserLog, sourceMapGetter, logLevel, indent, serializedResolvedPropsWithCustomSchema, onBrowserDownload, onArtifact, chromeMode, mediaCacheSizeInBytes, onLog, }) => {
|
|
69
70
|
(0, validate_1.validateDimension)(composition.height, 'height', 'in the `config` object passed to `renderStill()`');
|
|
70
71
|
(0, validate_1.validateDimension)(composition.width, 'width', 'in the `config` object passed to `renderStill()`');
|
|
71
72
|
(0, validate_1.validateFps)(composition.fps, 'in the `config` object of `renderStill()`', false);
|
|
@@ -117,6 +118,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
117
118
|
indent,
|
|
118
119
|
pageIndex: 0,
|
|
119
120
|
onBrowserLog,
|
|
121
|
+
onLog,
|
|
120
122
|
});
|
|
121
123
|
await page.setViewport({
|
|
122
124
|
width: composition.width,
|
|
@@ -348,6 +350,7 @@ const renderStill = (options) => {
|
|
|
348
350
|
chromeMode: chromeMode !== null && chromeMode !== void 0 ? chromeMode : 'headless-shell',
|
|
349
351
|
offthreadVideoThreads: offthreadVideoThreads !== null && offthreadVideoThreads !== void 0 ? offthreadVideoThreads : null,
|
|
350
352
|
mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
|
|
353
|
+
onLog: default_on_log_1.defaultOnLog,
|
|
351
354
|
});
|
|
352
355
|
};
|
|
353
356
|
exports.renderStill = renderStill;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.selectComposition = exports.internalSelectComposition = exports.internalSelectCompositionRaw = void 0;
|
|
4
4
|
const no_react_1 = require("remotion/no-react");
|
|
5
|
+
const _1 = require(".");
|
|
5
6
|
const TimeoutSettings_1 = require("./browser/TimeoutSettings");
|
|
6
7
|
const browser_download_progress_bar_1 = require("./browser/browser-download-progress-bar");
|
|
7
8
|
const handle_javascript_exception_1 = require("./error-handling/handle-javascript-exception");
|
|
@@ -107,6 +108,7 @@ const internalSelectCompositionRaw = async (options) => {
|
|
|
107
108
|
chromeMode,
|
|
108
109
|
pageIndex: 0,
|
|
109
110
|
onBrowserLog,
|
|
111
|
+
onLog: _1.RenderInternals.defaultOnLog,
|
|
110
112
|
}),
|
|
111
113
|
(0, prepare_server_1.makeOrReuseServer)(options.server, {
|
|
112
114
|
webpackConfigOrServeUrl: serveUrlOrWebpackUrl,
|
package/dist/test-gpu.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BrowserExecutable } from './browser-executable';
|
|
2
|
+
import type { OnLog } from './browser/BrowserPage';
|
|
2
3
|
import type { LogLevel } from './log-level';
|
|
3
4
|
import type { ChromiumOptions } from './open-browser';
|
|
4
5
|
import type { ChromeMode } from './options/chrome-mode';
|
|
@@ -7,7 +8,7 @@ type Item = {
|
|
|
7
8
|
feature: string;
|
|
8
9
|
status: string;
|
|
9
10
|
};
|
|
10
|
-
export declare const getChromiumGpuInformation: ({ browserExecutable, indent, logLevel, chromiumOptions, timeoutInMilliseconds, onBrowserDownload, chromeMode, }: {
|
|
11
|
+
export declare const getChromiumGpuInformation: ({ browserExecutable, indent, logLevel, chromiumOptions, timeoutInMilliseconds, onBrowserDownload, chromeMode, onLog, }: {
|
|
11
12
|
browserExecutable: BrowserExecutable;
|
|
12
13
|
indent: boolean;
|
|
13
14
|
logLevel: LogLevel;
|
|
@@ -15,5 +16,6 @@ export declare const getChromiumGpuInformation: ({ browserExecutable, indent, lo
|
|
|
15
16
|
timeoutInMilliseconds: number;
|
|
16
17
|
onBrowserDownload: OnBrowserDownload;
|
|
17
18
|
chromeMode: ChromeMode;
|
|
19
|
+
onLog: OnLog;
|
|
18
20
|
}) => Promise<Item[]>;
|
|
19
21
|
export {};
|
package/dist/test-gpu.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getChromiumGpuInformation = void 0;
|
|
4
4
|
const get_browser_instance_1 = require("./get-browser-instance");
|
|
5
5
|
const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
6
|
-
const getChromiumGpuInformation = async ({ browserExecutable, indent, logLevel, chromiumOptions, timeoutInMilliseconds, onBrowserDownload, chromeMode, }) => {
|
|
6
|
+
const getChromiumGpuInformation = async ({ browserExecutable, indent, logLevel, chromiumOptions, timeoutInMilliseconds, onBrowserDownload, chromeMode, onLog, }) => {
|
|
7
7
|
const { page, cleanupPage: cleanup } = await (0, get_browser_instance_1.getPageAndCleanupFn)({
|
|
8
8
|
passedInInstance: undefined,
|
|
9
9
|
browserExecutable,
|
|
@@ -15,6 +15,7 @@ const getChromiumGpuInformation = async ({ browserExecutable, indent, logLevel,
|
|
|
15
15
|
chromeMode,
|
|
16
16
|
pageIndex: 0,
|
|
17
17
|
onBrowserLog: null,
|
|
18
|
+
onLog,
|
|
18
19
|
});
|
|
19
20
|
await page.goto({ url: 'chrome://gpu', timeout: 12000 });
|
|
20
21
|
const { value } = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
@@ -3,12 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.validateEvenDimensionsWithCodec = void 0;
|
|
4
4
|
const logger_1 = require("./logger");
|
|
5
5
|
const validateEvenDimensionsWithCodec = ({ width, height, codec, scale, wantsImageSequence, indent, logLevel, }) => {
|
|
6
|
-
let actualWidth = width * scale;
|
|
7
|
-
let actualHeight = height * scale;
|
|
8
6
|
if (wantsImageSequence) {
|
|
9
7
|
return {
|
|
10
|
-
actualWidth,
|
|
11
|
-
actualHeight,
|
|
8
|
+
actualWidth: width,
|
|
9
|
+
actualHeight: height,
|
|
12
10
|
};
|
|
13
11
|
}
|
|
14
12
|
if (codec !== 'h264-mkv' &&
|
|
@@ -16,32 +14,27 @@ const validateEvenDimensionsWithCodec = ({ width, height, codec, scale, wantsIma
|
|
|
16
14
|
codec !== 'h265' &&
|
|
17
15
|
codec !== 'h264-ts') {
|
|
18
16
|
return {
|
|
19
|
-
actualWidth,
|
|
20
|
-
actualHeight,
|
|
17
|
+
actualWidth: width,
|
|
18
|
+
actualHeight: height,
|
|
21
19
|
};
|
|
22
20
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
actualWidth = Math.round(actualWidth);
|
|
21
|
+
let heightEvenDimensions = height;
|
|
22
|
+
while (Math.round(heightEvenDimensions * scale) % 2 !== 0) {
|
|
23
|
+
heightEvenDimensions--;
|
|
27
24
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
actualHeight = Math.round(actualHeight);
|
|
25
|
+
let widthEvenDimensions = width;
|
|
26
|
+
while (Math.round(widthEvenDimensions * scale) % 2 !== 0) {
|
|
27
|
+
widthEvenDimensions--;
|
|
32
28
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
logger_1.Log.verbose({ indent, logLevel }, `Rounding width down to an even number from ${actualWidth} to ${actualWidth - 1} for ${displayName} codec compatibility`);
|
|
36
|
-
actualWidth -= 1;
|
|
29
|
+
if (widthEvenDimensions !== width) {
|
|
30
|
+
logger_1.Log.verbose({ indent, logLevel }, `Rounding width to an even number from ${width} to ${widthEvenDimensions}`);
|
|
37
31
|
}
|
|
38
|
-
if (
|
|
39
|
-
logger_1.Log.verbose({ indent, logLevel }, `Rounding height
|
|
40
|
-
actualHeight -= 1;
|
|
32
|
+
if (heightEvenDimensions !== height) {
|
|
33
|
+
logger_1.Log.verbose({ indent, logLevel }, `Rounding height to an even number from ${height} to ${heightEvenDimensions}`);
|
|
41
34
|
}
|
|
42
35
|
return {
|
|
43
|
-
actualWidth,
|
|
44
|
-
actualHeight,
|
|
36
|
+
actualWidth: widthEvenDimensions,
|
|
37
|
+
actualHeight: heightEvenDimensions,
|
|
45
38
|
};
|
|
46
39
|
};
|
|
47
40
|
exports.validateEvenDimensionsWithCodec = validateEvenDimensionsWithCodec;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/renderer"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/renderer",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.356",
|
|
7
7
|
"description": "Render Remotion videos using Node.js or Bun",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"extract-zip": "2.0.1",
|
|
19
19
|
"source-map": "^0.8.0-beta.0",
|
|
20
20
|
"ws": "8.17.1",
|
|
21
|
-
"remotion": "4.0.
|
|
22
|
-
"@remotion/streaming": "4.0.
|
|
21
|
+
"remotion": "4.0.356",
|
|
22
|
+
"@remotion/streaming": "4.0.356"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": ">=16.8.0",
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"react-dom": "19.0.0",
|
|
34
34
|
"@types/ws": "8.5.10",
|
|
35
35
|
"eslint": "9.19.0",
|
|
36
|
-
"@remotion/example-videos": "4.0.
|
|
37
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
36
|
+
"@remotion/example-videos": "4.0.356",
|
|
37
|
+
"@remotion/eslint-config-internal": "4.0.356"
|
|
38
38
|
},
|
|
39
39
|
"optionalDependencies": {
|
|
40
|
-
"@remotion/compositor-
|
|
41
|
-
"@remotion/compositor-darwin-
|
|
42
|
-
"@remotion/compositor-linux-
|
|
43
|
-
"@remotion/compositor-linux-arm64-musl": "4.0.
|
|
44
|
-
"@remotion/compositor-
|
|
45
|
-
"@remotion/compositor-
|
|
46
|
-
"@remotion/compositor-
|
|
40
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.356",
|
|
41
|
+
"@remotion/compositor-darwin-x64": "4.0.356",
|
|
42
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.356",
|
|
43
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.356",
|
|
44
|
+
"@remotion/compositor-darwin-arm64": "4.0.356",
|
|
45
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.356",
|
|
46
|
+
"@remotion/compositor-linux-x64-musl": "4.0.356"
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
49
49
|
"remotion",
|