@remotion/renderer 4.0.538 → 4.0.540
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/download-and-map-assets-to-file.js +16 -3
- package/dist/assets/download-file.js +9 -2
- package/dist/assets/download-map.d.ts +1 -1
- package/dist/assets/read-file.d.ts +1 -1
- package/dist/assets/read-file.js +7 -7
- package/dist/browser/BrowserFetcher.js +4 -1
- package/dist/browser/BrowserPage.js +27 -8
- package/dist/browser/NetworkManager.js +6 -1
- package/dist/browser/devtools-commands.d.ts +6 -1
- package/dist/browser/get-chrome-download-url.d.ts +1 -1
- package/dist/browser/get-chrome-download-url.js +4 -1
- package/dist/check-version-requirements.js +6 -6
- package/dist/client.d.ts +459 -238
- package/dist/esm/client.mjs +372 -314
- package/dist/esm/index.mjs +393 -349
- package/dist/get-compositions.js +6 -3
- package/dist/index.d.ts +113 -41
- package/dist/index.js +4 -2
- package/dist/make-page.d.ts +3 -1
- package/dist/make-page.js +2 -1
- package/dist/merge-audio-track.d.ts +1 -1
- package/dist/merge-audio-track.js +24 -23
- package/dist/options/allow-html-in-canvas.d.ts +1 -1
- package/dist/options/api-key.d.ts +1 -1
- package/dist/options/ask-ai.d.ts +1 -1
- package/dist/options/ask-ai.js +1 -1
- package/dist/options/audio-bitrate.d.ts +1 -1
- package/dist/options/beep-on-finish.d.ts +1 -1
- package/dist/options/benchmark-concurrencies.d.ts +1 -1
- package/dist/options/binaries-directory.d.ts +1 -1
- package/dist/options/browser-executable.d.ts +1 -1
- package/dist/options/browser-executable.js +1 -1
- package/dist/options/browser.d.ts +1 -1
- package/dist/options/bundle-cache.d.ts +1 -1
- package/dist/options/canvas-tabs.d.ts +1 -1
- package/dist/options/chrome-mode.d.ts +1 -1
- package/dist/options/color-space.d.ts +1 -1
- package/dist/options/concurrency.d.ts +1 -1
- package/dist/options/config.d.ts +1 -1
- package/dist/options/crf.d.ts +1 -1
- package/dist/options/crf.js +1 -1
- package/dist/options/cross-site-isolation.d.ts +1 -1
- package/dist/options/cross-site-isolation.js +2 -2
- package/dist/options/dark-mode.d.ts +1 -1
- package/dist/options/default-coding-agent.d.ts +1 -1
- package/dist/options/default-editor.d.ts +1 -1
- package/dist/options/default-premount-in-seconds.d.ts +1 -1
- package/dist/options/delete-after.d.ts +1 -1
- package/dist/options/disable-git-source.d.ts +2 -2
- package/dist/options/disable-shared-memory-capture.d.ts +1 -1
- package/dist/options/disable-web-security.d.ts +1 -1
- package/dist/options/disallow-parallel-encoding.d.ts +1 -1
- package/dist/options/enable-cancellation.d.ts +1 -1
- package/dist/options/enable-lambda-insights.d.ts +1 -1
- package/dist/options/enable-lambda-insights.js +2 -2
- package/dist/options/enable-multiprocess-on-linux.d.ts +1 -1
- package/dist/options/enable-multiprocess-on-linux.js +2 -2
- package/dist/options/encoding-buffer-size.d.ts +1 -1
- package/dist/options/encoding-max-rate.d.ts +1 -1
- package/dist/options/enforce-audio.d.ts +1 -1
- package/dist/options/env-file.d.ts +1 -1
- package/dist/options/every-nth-frame.d.ts +1 -1
- package/dist/options/experimental-keep-audio-context-alive.d.ts +1 -1
- package/dist/options/folder-expiry.d.ts +1 -1
- package/dist/options/folder-expiry.js +1 -1
- package/dist/options/for-seamless-aac-concatenation.d.ts +1 -1
- package/dist/options/force-new-studio.d.ts +1 -1
- package/dist/options/frames.d.ts +1 -1
- package/dist/options/gl.d.ts +1 -1
- package/dist/options/gop-size.d.ts +1 -1
- package/dist/options/headless.d.ts +1 -1
- package/dist/options/ignore-certificate-errors.d.ts +1 -1
- package/dist/options/image-sequence-pattern.d.ts +1 -1
- package/dist/options/image-sequence.d.ts +1 -1
- package/dist/options/index.d.ts +119 -102
- package/dist/options/index.js +2 -0
- package/dist/options/interactivity.d.ts +1 -1
- package/dist/options/ipv4.d.ts +1 -1
- package/dist/options/is-production.d.ts +1 -1
- package/dist/options/is-production.js +1 -1
- package/dist/options/jpeg-quality.d.ts +1 -1
- package/dist/options/keyboard-shortcuts.d.ts +1 -1
- package/dist/options/latency-hint.d.ts +1 -1
- package/dist/options/license-key.d.ts +1 -1
- package/dist/options/license-key.js +1 -1
- package/dist/options/log-level.d.ts +1 -1
- package/dist/options/metadata.d.ts +1 -1
- package/dist/options/mute.d.ts +1 -1
- package/dist/options/no-open.d.ts +1 -1
- package/dist/options/number-of-gif-loops.d.ts +1 -1
- package/dist/options/number-of-shared-audio-tags.d.ts +1 -1
- package/dist/options/offthreadvideo-cache-size.d.ts +1 -1
- package/dist/options/offthreadvideo-threads.d.ts +1 -1
- package/dist/options/on-browser-download.d.ts +1 -1
- package/dist/options/options-map.d.ts +340 -136
- package/dist/options/options-map.js +13 -0
- package/dist/options/out-dir.d.ts +1 -1
- package/dist/options/override-duration.d.ts +1 -1
- package/dist/options/override-fps.d.ts +1 -1
- package/dist/options/override-height.d.ts +1 -1
- package/dist/options/override-width.d.ts +1 -1
- package/dist/options/overwrite.d.ts +1 -1
- package/dist/options/package-manager.d.ts +1 -1
- package/dist/options/pixel-format.d.ts +1 -1
- package/dist/options/port.d.ts +1 -1
- package/dist/options/prefer-lossless.d.ts +1 -1
- package/dist/options/preferred-effect-backend.d.ts +18 -0
- package/dist/options/preferred-effect-backend.js +28 -0
- package/dist/options/preserve-pitch-on-playback.d.ts +1 -1
- package/dist/options/preview-sample-rate.d.ts +1 -1
- package/dist/options/props.d.ts +1 -1
- package/dist/options/prores-profile.d.ts +1 -1
- package/dist/options/public-dir.d.ts +1 -1
- package/dist/options/public-license-key.d.ts +1 -1
- package/dist/options/public-path.d.ts +1 -1
- package/dist/options/repro.d.ts +1 -1
- package/dist/options/rspack.d.ts +1 -1
- package/dist/options/runs.d.ts +1 -1
- package/dist/options/sample-rate.d.ts +1 -1
- package/dist/options/scale.d.ts +1 -1
- package/dist/options/sequence-activity-limit.d.ts +1 -1
- package/dist/options/show-layer-frame-numbers.d.ts +1 -1
- package/dist/options/show-premounting.d.ts +1 -1
- package/dist/options/skip-skills.d.ts +1 -1
- package/dist/options/still-frame.d.ts +1 -1
- package/dist/options/still-image-format.d.ts +1 -1
- package/dist/options/throw-if-site-exists.d.ts +2 -2
- package/dist/options/timeout.d.ts +1 -1
- package/dist/options/user-agent.d.ts +1 -1
- package/dist/options/version-flag.d.ts +1 -1
- package/dist/options/video-bitrate.d.ts +1 -1
- package/dist/options/video-cache-size.d.ts +1 -1
- package/dist/options/video-codec.d.ts +1 -1
- package/dist/options/video-image-format.d.ts +1 -1
- package/dist/options/webhook-custom-data.d.ts +1 -1
- package/dist/options/webpack-poll.d.ts +1 -1
- package/dist/options/x264-preset.d.ts +1 -1
- package/dist/render-frames.js +6 -3
- package/dist/render-media.d.ts +1 -1
- package/dist/render-media.js +4 -2
- package/dist/render-still.js +6 -2
- package/dist/select-composition.js +6 -3
- package/dist/serve-handler/range-parser.js +1 -1
- package/dist/serve-static.js +4 -1
- package/dist/set-props-and-env.d.ts +2 -0
- package/dist/set-props-and-env.js +8 -3
- package/dist/stringify-ffmpeg-filter.js +6 -2
- package/dist/symbolicate-stacktrace.js +1 -1
- package/dist/validate-selected-frames.d.ts +4 -4
- package/dist/validate-selected-frames.js +2 -31
- package/package.json +15 -15
package/dist/render-media.js
CHANGED
|
@@ -56,7 +56,7 @@ const validate_videobitrate_1 = require("./validate-videobitrate");
|
|
|
56
56
|
const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
|
|
57
57
|
const SLOWEST_FRAME_COUNT = 10;
|
|
58
58
|
const MAX_RECENT_FRAME_TIMINGS = 150;
|
|
59
|
-
const internalRenderMediaRaw = async ({ proResProfile, x264Preset, gopSize, 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, disableSharedMemoryCapture, 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, licenseKey, isProduction, sampleRate, }) => {
|
|
59
|
+
const internalRenderMediaRaw = async ({ proResProfile, x264Preset, gopSize, 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, disableSharedMemoryCapture, 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, preferredEffectBackend, onLog, licenseKey, isProduction, sampleRate, }) => {
|
|
60
60
|
var _a, _b;
|
|
61
61
|
const pixelFormat = (_a = userPixelFormat !== null && userPixelFormat !== void 0 ? userPixelFormat : compositionWithPossibleUnevenDimensions.defaultPixelFormat) !== null && _a !== void 0 ? _a : pixel_format_1.DEFAULT_PIXEL_FORMAT;
|
|
62
62
|
if (repro) {
|
|
@@ -491,6 +491,7 @@ const internalRenderMediaRaw = async ({ proResProfile, x264Preset, gopSize, crf,
|
|
|
491
491
|
chromeMode,
|
|
492
492
|
imageSequencePattern: null,
|
|
493
493
|
mediaCacheSizeInBytes,
|
|
494
|
+
preferredEffectBackend,
|
|
494
495
|
onLog,
|
|
495
496
|
sampleRate,
|
|
496
497
|
});
|
|
@@ -671,7 +672,7 @@ exports.internalRenderMedia = (0, wrap_with_error_handling_1.wrapWithErrorHandli
|
|
|
671
672
|
* @description Render a video or an audio programmatically.
|
|
672
673
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/render-media)
|
|
673
674
|
*/
|
|
674
|
-
const renderMedia = ({ proResProfile, x264Preset, gopSize, 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, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, disableSharedMemoryCapture, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, compositionStart, mediaCacheSizeInBytes, isProduction, sampleRate, ...apiKeyOrLicenseKey }) => {
|
|
675
|
+
const renderMedia = ({ proResProfile, x264Preset, gopSize, 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, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, disableSharedMemoryCapture, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, compositionStart, mediaCacheSizeInBytes, preferredEffectBackend, isProduction, sampleRate, ...apiKeyOrLicenseKey }) => {
|
|
675
676
|
var _a, _b, _c, _d;
|
|
676
677
|
const indent = false;
|
|
677
678
|
const logLevel = verbose || dumpBrowserLogs ? 'verbose' : (passedLogLevel !== null && passedLogLevel !== void 0 ? passedLogLevel : 'info');
|
|
@@ -765,6 +766,7 @@ const renderMedia = ({ proResProfile, x264Preset, gopSize, crf, composition, inp
|
|
|
765
766
|
hardwareAcceleration: hardwareAcceleration !== null && hardwareAcceleration !== void 0 ? hardwareAcceleration : 'disable',
|
|
766
767
|
chromeMode: chromeMode !== null && chromeMode !== void 0 ? chromeMode : 'headless-shell',
|
|
767
768
|
mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
|
|
769
|
+
preferredEffectBackend: preferredEffectBackend !== null && preferredEffectBackend !== void 0 ? preferredEffectBackend : 'auto',
|
|
768
770
|
licenseKey: effectiveLicenseKey,
|
|
769
771
|
onLog: default_on_log_1.defaultOnLog,
|
|
770
772
|
isProduction: isProduction !== null && isProduction !== void 0 ? isProduction : null,
|
package/dist/render-still.js
CHANGED
|
@@ -68,7 +68,7 @@ const validate_1 = require("./validate");
|
|
|
68
68
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
69
69
|
const validate_scale_1 = require("./validate-scale");
|
|
70
70
|
const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
|
|
71
|
-
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, }) => {
|
|
71
|
+
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, preferredEffectBackend, onLog, }) => {
|
|
72
72
|
var _a;
|
|
73
73
|
(0, validate_1.validateDimension)(composition.height, 'height', 'in the `config` object passed to `renderStill()`');
|
|
74
74
|
(0, validate_1.validateDimension)(composition.width, 'width', 'in the `config` object passed to `renderStill()`');
|
|
@@ -137,8 +137,10 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
137
137
|
onError: errorCallback,
|
|
138
138
|
frame: null,
|
|
139
139
|
});
|
|
140
|
+
page.on('error', errorCallback);
|
|
140
141
|
const cleanup = async () => {
|
|
141
142
|
cleanUpJSException();
|
|
143
|
+
page.off('error', errorCallback);
|
|
142
144
|
if (puppeteerInstance) {
|
|
143
145
|
await page.close();
|
|
144
146
|
}
|
|
@@ -167,6 +169,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
167
169
|
onServeUrlVisited: () => undefined,
|
|
168
170
|
isMainTab: true,
|
|
169
171
|
mediaCacheSizeInBytes,
|
|
172
|
+
preferredEffectBackend,
|
|
170
173
|
initialMemoryAvailable: (0, get_available_memory_1.getAvailableMemory)(logLevel),
|
|
171
174
|
darkMode: (_a = chromiumOptions.darkMode) !== null && _a !== void 0 ? _a : false,
|
|
172
175
|
sampleRate: 48000,
|
|
@@ -337,7 +340,7 @@ exports.internalRenderStill = (0, wrap_with_error_handling_1.wrapWithErrorHandli
|
|
|
337
340
|
*/
|
|
338
341
|
const renderStill = (options) => {
|
|
339
342
|
var _a, _b, _c;
|
|
340
|
-
const { composition, serveUrl, browserExecutable, cancelSignal, chromiumOptions, dumpBrowserLogs, envVariables, frame, imageFormat, inputProps, jpegQuality, onBrowserLog, onDownload, output, overwrite, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, offthreadVideoCacheSizeInBytes, logLevel: passedLogLevel, binariesDirectory, onBrowserDownload, onArtifact, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, isProduction, ...apiKeyOrLicenseKey } = options;
|
|
343
|
+
const { composition, serveUrl, browserExecutable, cancelSignal, chromiumOptions, dumpBrowserLogs, envVariables, frame, imageFormat, inputProps, jpegQuality, onBrowserLog, onDownload, output, overwrite, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, offthreadVideoCacheSizeInBytes, logLevel: passedLogLevel, binariesDirectory, onBrowserDownload, onArtifact, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, preferredEffectBackend, isProduction, ...apiKeyOrLicenseKey } = options;
|
|
341
344
|
if (typeof jpegQuality !== 'undefined' && imageFormat !== 'jpeg') {
|
|
342
345
|
throw new Error("You can only pass the `quality` option if `imageFormat` is 'jpeg'.");
|
|
343
346
|
}
|
|
@@ -403,6 +406,7 @@ const renderStill = (options) => {
|
|
|
403
406
|
chromeMode: chromeMode !== null && chromeMode !== void 0 ? chromeMode : 'headless-shell',
|
|
404
407
|
offthreadVideoThreads: offthreadVideoThreads !== null && offthreadVideoThreads !== void 0 ? offthreadVideoThreads : null,
|
|
405
408
|
mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
|
|
409
|
+
preferredEffectBackend: preferredEffectBackend !== null && preferredEffectBackend !== void 0 ? preferredEffectBackend : 'auto',
|
|
406
410
|
licenseKey: effectiveLicenseKey,
|
|
407
411
|
onLog: default_on_log_1.defaultOnLog,
|
|
408
412
|
isProduction: isProduction !== null && isProduction !== void 0 ? isProduction : null,
|
|
@@ -16,7 +16,7 @@ const seek_to_frame_1 = require("./seek-to-frame");
|
|
|
16
16
|
const set_props_and_env_1 = require("./set-props-and-env");
|
|
17
17
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
18
18
|
const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
|
|
19
|
-
const innerSelectComposition = async ({ page, serializedInputPropsWithCustomSchema, envVariables, serveUrl, timeoutInMilliseconds, port, id, indent, logLevel, onServeUrlVisited, mediaCacheSizeInBytes, chromiumOptions, }) => {
|
|
19
|
+
const innerSelectComposition = async ({ page, serializedInputPropsWithCustomSchema, envVariables, serveUrl, timeoutInMilliseconds, port, id, indent, logLevel, onServeUrlVisited, mediaCacheSizeInBytes, preferredEffectBackend, chromiumOptions, }) => {
|
|
20
20
|
var _a;
|
|
21
21
|
(0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
|
|
22
22
|
await (0, set_props_and_env_1.setPropsAndEnv)({
|
|
@@ -35,6 +35,7 @@ const innerSelectComposition = async ({ page, serializedInputPropsWithCustomSche
|
|
|
35
35
|
onServeUrlVisited,
|
|
36
36
|
isMainTab: true,
|
|
37
37
|
mediaCacheSizeInBytes,
|
|
38
|
+
preferredEffectBackend,
|
|
38
39
|
initialMemoryAvailable: (0, get_available_memory_1.getAvailableMemory)(logLevel),
|
|
39
40
|
darkMode: (_a = chromiumOptions.darkMode) !== null && _a !== void 0 ? _a : false,
|
|
40
41
|
sampleRate: 48000,
|
|
@@ -100,7 +101,7 @@ const innerSelectComposition = async ({ page, serializedInputPropsWithCustomSche
|
|
|
100
101
|
};
|
|
101
102
|
const internalSelectCompositionRaw = async (options) => {
|
|
102
103
|
const cleanup = [];
|
|
103
|
-
const { puppeteerInstance, browserExecutable, chromiumOptions, serveUrl: serveUrlOrWebpackUrl, logLevel, indent, port, envVariables, id, serializedInputPropsWithCustomSchema, onBrowserLog, server, timeoutInMilliseconds, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, onServeUrlVisited, chromeMode, mediaCacheSizeInBytes, } = options;
|
|
104
|
+
const { puppeteerInstance, browserExecutable, chromiumOptions, serveUrl: serveUrlOrWebpackUrl, logLevel, indent, port, envVariables, id, serializedInputPropsWithCustomSchema, onBrowserLog, server, timeoutInMilliseconds, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, onServeUrlVisited, chromeMode, mediaCacheSizeInBytes, preferredEffectBackend, } = options;
|
|
104
105
|
const [{ page, cleanupPage }, serverUsed] = await Promise.all([
|
|
105
106
|
(0, get_browser_instance_1.getPageAndCleanupFn)({
|
|
106
107
|
passedInInstance: puppeteerInstance,
|
|
@@ -162,6 +163,7 @@ const internalSelectCompositionRaw = async (options) => {
|
|
|
162
163
|
onServeUrlVisited,
|
|
163
164
|
chromeMode,
|
|
164
165
|
mediaCacheSizeInBytes,
|
|
166
|
+
preferredEffectBackend,
|
|
165
167
|
})
|
|
166
168
|
.then((data) => {
|
|
167
169
|
return resolve(data);
|
|
@@ -187,7 +189,7 @@ exports.internalSelectComposition = (0, wrap_with_error_handling_1.wrapWithError
|
|
|
187
189
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/select-composition)
|
|
188
190
|
*/
|
|
189
191
|
const selectComposition = async (options) => {
|
|
190
|
-
const { id, serveUrl, browserExecutable, chromiumOptions, envVariables, inputProps, onBrowserLog, port, puppeteerInstance, timeoutInMilliseconds, verbose, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, } = options;
|
|
192
|
+
const { id, serveUrl, browserExecutable, chromiumOptions, envVariables, inputProps, onBrowserLog, port, puppeteerInstance, timeoutInMilliseconds, verbose, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, preferredEffectBackend, } = options;
|
|
191
193
|
const indent = false;
|
|
192
194
|
const logLevel = passedLogLevel !== null && passedLogLevel !== void 0 ? passedLogLevel : (verbose ? 'verbose' : 'info');
|
|
193
195
|
const data = await (0, exports.internalSelectComposition)({
|
|
@@ -219,6 +221,7 @@ const selectComposition = async (options) => {
|
|
|
219
221
|
chromeMode: chromeMode !== null && chromeMode !== void 0 ? chromeMode : 'headless-shell',
|
|
220
222
|
offthreadVideoThreads: offthreadVideoThreads !== null && offthreadVideoThreads !== void 0 ? offthreadVideoThreads : null,
|
|
221
223
|
mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
|
|
224
|
+
preferredEffectBackend: preferredEffectBackend !== null && preferredEffectBackend !== void 0 ? preferredEffectBackend : 'auto',
|
|
222
225
|
});
|
|
223
226
|
return data.metadata;
|
|
224
227
|
};
|
package/dist/serve-static.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.serveStatic = void 0;
|
|
|
7
7
|
const node_http_1 = __importDefault(require("node:http"));
|
|
8
8
|
const get_port_1 = require("./get-port");
|
|
9
9
|
const offthread_video_server_1 = require("./offthread-video-server");
|
|
10
|
+
const port_config_1 = require("./port-config");
|
|
10
11
|
const serve_handler_1 = require("./serve-handler");
|
|
11
12
|
const serveStatic = async (path, options) => {
|
|
12
13
|
const { listener: offthreadRequest, close: closeCompositor, compositor, } = (0, offthread_video_server_1.startOffthreadVideoServer)({
|
|
@@ -55,6 +56,8 @@ const serveStatic = async (path, options) => {
|
|
|
55
56
|
const maxTries = 10;
|
|
56
57
|
// Rendering only needs local access, unlike the Studio server.
|
|
57
58
|
const host = '127.0.0.1';
|
|
59
|
+
// URLs use localhost, which can resolve to another supported address family.
|
|
60
|
+
const { hostsToTry } = (0, port_config_1.getPortConfig)(options.forceIPv4);
|
|
58
61
|
for (let i = 0; i < maxTries; i++) {
|
|
59
62
|
let unlock = () => { };
|
|
60
63
|
try {
|
|
@@ -64,7 +67,7 @@ const serveStatic = async (path, options) => {
|
|
|
64
67
|
desiredPort: (_a = options === null || options === void 0 ? void 0 : options.port) !== null && _a !== void 0 ? _a : undefined,
|
|
65
68
|
from: 3000,
|
|
66
69
|
to: 3100,
|
|
67
|
-
hostsToTry
|
|
70
|
+
hostsToTry,
|
|
68
71
|
})
|
|
69
72
|
.then(({ port, unlockPort }) => {
|
|
70
73
|
unlock = unlockPort;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PreferredEffectBackend } from 'remotion';
|
|
1
2
|
import type { Page } from './browser/BrowserPage';
|
|
2
3
|
import type { LogLevel } from './log-level';
|
|
3
4
|
type SetPropsAndEnv = {
|
|
@@ -17,6 +18,7 @@ type SetPropsAndEnv = {
|
|
|
17
18
|
onServeUrlVisited: () => void;
|
|
18
19
|
isMainTab: boolean;
|
|
19
20
|
mediaCacheSizeInBytes: number | null;
|
|
21
|
+
preferredEffectBackend: PreferredEffectBackend;
|
|
20
22
|
initialMemoryAvailable: number | null;
|
|
21
23
|
sampleRate: number;
|
|
22
24
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setPropsAndEnv = void 0;
|
|
4
|
+
const no_react_1 = require("remotion/no-react");
|
|
4
5
|
const version_1 = require("remotion/version");
|
|
5
6
|
const TimeoutSettings_1 = require("./browser/TimeoutSettings");
|
|
6
7
|
const goto_page_or_throw_1 = require("./goto-page-or-throw");
|
|
@@ -10,16 +11,19 @@ const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
|
10
11
|
const redirect_status_codes_1 = require("./redirect-status-codes");
|
|
11
12
|
const truthy_1 = require("./truthy");
|
|
12
13
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
13
|
-
const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVariables, page, serveUrl, initialFrame, timeoutInMilliseconds, proxyPort, retriesRemaining, audioEnabled, videoEnabled, indent, logLevel, onServeUrlVisited, isMainTab, mediaCacheSizeInBytes, initialMemoryAvailable, darkMode, sampleRate, }) => {
|
|
14
|
+
const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVariables, page, serveUrl, initialFrame, timeoutInMilliseconds, proxyPort, retriesRemaining, audioEnabled, videoEnabled, indent, logLevel, onServeUrlVisited, isMainTab, mediaCacheSizeInBytes, preferredEffectBackend, initialMemoryAvailable, darkMode, sampleRate, }) => {
|
|
15
|
+
no_react_1.NoReactInternals.validatePreferredEffectBackend(preferredEffectBackend);
|
|
14
16
|
(0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
|
|
15
17
|
const actualTimeout = timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT;
|
|
16
18
|
page.setDefaultTimeout(actualTimeout);
|
|
17
19
|
page.setDefaultNavigationTimeout(actualTimeout);
|
|
18
20
|
const urlToVisit = (0, normalize_serve_url_1.normalizeServeUrl)(serveUrl);
|
|
19
|
-
await page.evaluateOnNewDocument((timeout, mainTab, cacheSizeInBytes, initMemoryAvailable, sRate) => {
|
|
21
|
+
await page.evaluateOnNewDocument((timeout, mainTab, cacheSizeInBytes, effectBackend, disableWebGpuEffects, initMemoryAvailable, sRate) => {
|
|
20
22
|
window.remotion_puppeteerTimeout = timeout;
|
|
21
23
|
window.remotion_isMainTab = mainTab;
|
|
22
24
|
window.remotion_mediaCacheSizeInBytes = cacheSizeInBytes;
|
|
25
|
+
window.remotion_preferredEffectBackend = effectBackend;
|
|
26
|
+
window.remotion_disableWebGpuEffects = disableWebGpuEffects;
|
|
23
27
|
window.remotion_initialMemoryAvailable = initMemoryAvailable;
|
|
24
28
|
window.remotion_sampleRate = sRate;
|
|
25
29
|
// To make useRemotionEnvironment() work
|
|
@@ -31,7 +35,7 @@ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVa
|
|
|
31
35
|
window.process.env = {};
|
|
32
36
|
}
|
|
33
37
|
window.process.env.NODE_ENV = 'production';
|
|
34
|
-
}, actualTimeout, isMainTab, mediaCacheSizeInBytes, initialMemoryAvailable, sampleRate);
|
|
38
|
+
}, actualTimeout, isMainTab, mediaCacheSizeInBytes, preferredEffectBackend, Boolean(process.env.AWS_LAMBDA_FUNCTION_NAME), initialMemoryAvailable, sampleRate);
|
|
35
39
|
await page.evaluateOnNewDocument('window.remotion_broadcastChannel = new BroadcastChannel("remotion-video-frame-extraction")');
|
|
36
40
|
if (envVariables) {
|
|
37
41
|
await page.evaluateOnNewDocument((input) => {
|
|
@@ -89,6 +93,7 @@ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVa
|
|
|
89
93
|
onServeUrlVisited,
|
|
90
94
|
isMainTab,
|
|
91
95
|
mediaCacheSizeInBytes,
|
|
96
|
+
preferredEffectBackend,
|
|
92
97
|
initialMemoryAvailable,
|
|
93
98
|
darkMode,
|
|
94
99
|
sampleRate,
|
|
@@ -88,6 +88,9 @@ const stringifyFfmpegFilter = ({ channels, volume, fps, assetDuration, chunkLeng
|
|
|
88
88
|
// For later assets, remove that time from the silence before the asset instead.
|
|
89
89
|
const assetTrimLeftOffset = startInVideo === 0 ? trimLeftOffset : 0;
|
|
90
90
|
const startInChunkSeconds = startInVideo === 0 ? 0 : startInVideoSeconds - trimLeftOffset;
|
|
91
|
+
const capturedFrameCount = Math.round((chunkLengthInSeconds + trimLeftOffset - trimRightOffset) * fps);
|
|
92
|
+
// Only assets present on the last captured frame need the chunk's trailing trim.
|
|
93
|
+
const assetTrimRightOffset = startInVideo + asset.duration >= capturedFrameCount ? trimRightOffset : 0;
|
|
91
94
|
const { trimLeft, maxTrim } = (0, seamless_aac_trim_1.getActualTrimLeft)({
|
|
92
95
|
trimLeft: asset.trimLeft,
|
|
93
96
|
fps,
|
|
@@ -106,7 +109,7 @@ const stringifyFfmpegFilter = ({ channels, volume, fps, assetDuration, chunkLeng
|
|
|
106
109
|
const { actualTrimLeft, audibleDuration, filter: trimAndTempoFilter, } = trimAndSetTempo({
|
|
107
110
|
assetDuration,
|
|
108
111
|
trimLeftOffset: assetTrimLeftOffset,
|
|
109
|
-
trimRightOffset,
|
|
112
|
+
trimRightOffset: assetTrimRightOffset,
|
|
110
113
|
asset,
|
|
111
114
|
fps,
|
|
112
115
|
indent,
|
|
@@ -150,10 +153,11 @@ const stringifyFfmpegFilter = ({ channels, volume, fps, assetDuration, chunkLeng
|
|
|
150
153
|
// This should be fine because FFMPEG documentation states:
|
|
151
154
|
// "Unused delays will be silently ignored."
|
|
152
155
|
// https://ffmpeg.org/ffmpeg-filters.html#adelay
|
|
156
|
+
// Use samples so adjacent AAC chunks place the waveform at the same offset.
|
|
153
157
|
padStart === 0
|
|
154
158
|
? null
|
|
155
159
|
: `adelay=${new Array(channels + 1)
|
|
156
|
-
.fill((padStart *
|
|
160
|
+
.fill(`${Math.round(padStart * sampleRate)}S`)
|
|
157
161
|
.join('|')}`,
|
|
158
162
|
actualTrimLeft,
|
|
159
163
|
};
|
|
@@ -62,7 +62,7 @@ const getSourceMap = (filePath, fileContents, type) => {
|
|
|
62
62
|
return (0, exports.getSourceMapFromRemoteUrl)(url);
|
|
63
63
|
};
|
|
64
64
|
const fetchUrl = async (url) => {
|
|
65
|
-
const { request, response } = await (0, read_file_1.readFile)(url);
|
|
65
|
+
const { request, response } = await (0, read_file_1.readFile)(url, null);
|
|
66
66
|
return new Promise((resolve, reject) => {
|
|
67
67
|
let downloaded = '';
|
|
68
68
|
response.on('data', (d) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
import { NoReactInternals } from 'remotion/no-react';
|
|
2
|
+
export declare const { validateSelectedFrames, }: {
|
|
3
|
+
validateSelectedFrames: typeof NoReactInternals.validateSelectedFrames;
|
|
4
|
+
};
|
|
@@ -1,34 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateSelectedFrames = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
throw new TypeError('The `frames` option must be an array of frame numbers.');
|
|
7
|
-
}
|
|
8
|
-
if (frames.length === 0) {
|
|
9
|
-
throw new TypeError('The `frames` option must contain at least one frame.');
|
|
10
|
-
}
|
|
11
|
-
for (const frame of frames) {
|
|
12
|
-
if (typeof frame !== 'number') {
|
|
13
|
-
throw new TypeError(`The \`frames\` option must contain only numbers, but got ${typeof frame}.`);
|
|
14
|
-
}
|
|
15
|
-
if (!Number.isFinite(frame)) {
|
|
16
|
-
throw new TypeError(`The \`frames\` option must contain only finite numbers, but got ${frame}.`);
|
|
17
|
-
}
|
|
18
|
-
if (!Number.isInteger(frame)) {
|
|
19
|
-
throw new TypeError(`The \`frames\` option must contain only integers, but got ${frame}.`);
|
|
20
|
-
}
|
|
21
|
-
if (frame < 0) {
|
|
22
|
-
throw new TypeError(`The \`frames\` option must contain only non-negative numbers, but got ${frame}.`);
|
|
23
|
-
}
|
|
24
|
-
if (durationInFrames !== null && frame >= durationInFrames) {
|
|
25
|
-
throw new RangeError(`Frame ${frame} is out of range, must be between 0 and ${durationInFrames - 1}.`);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const uniqueFrames = new Set(frames);
|
|
29
|
-
if (uniqueFrames.size !== frames.length) {
|
|
30
|
-
throw new TypeError('The `frames` option must not contain duplicate frames.');
|
|
31
|
-
}
|
|
32
|
-
return [...frames].sort((a, b) => a - b);
|
|
33
|
-
};
|
|
34
|
-
exports.validateSelectedFrames = validateSelectedFrames;
|
|
4
|
+
const no_react_1 = require("remotion/no-react");
|
|
5
|
+
({ validateSelectedFrames: exports.validateSelectedFrames } = no_react_1.NoReactInternals);
|
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.540",
|
|
7
7
|
"description": "Render Remotion videos using Node.js or Bun",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"execa": "5.1.1",
|
|
25
|
-
"remotion": "4.0.
|
|
26
|
-
"@remotion/streaming": "4.0.
|
|
25
|
+
"remotion": "4.0.540",
|
|
26
|
+
"@remotion/streaming": "4.0.540",
|
|
27
27
|
"source-map": "0.8.0",
|
|
28
28
|
"ws": "8.21.0",
|
|
29
|
-
"@remotion/licensing": "4.0.
|
|
29
|
+
"@remotion/licensing": "4.0.540"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": ">=16.8.0",
|
|
@@ -36,25 +36,25 @@
|
|
|
36
36
|
"@testing-library/dom": "10.4.0",
|
|
37
37
|
"@testing-library/react": "16.1.0",
|
|
38
38
|
"@happy-dom/global-registrator": "14.5.1",
|
|
39
|
-
"react": "19.
|
|
40
|
-
"react-dom": "19.
|
|
39
|
+
"react": "19.3.1",
|
|
40
|
+
"react-dom": "19.3.1",
|
|
41
41
|
"typescript": "7.1.0-beta",
|
|
42
42
|
"@types/ws": "8.5.10",
|
|
43
|
-
"@remotion/example-videos": "4.0.
|
|
44
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
43
|
+
"@remotion/example-videos": "4.0.540",
|
|
44
|
+
"@remotion/eslint-config-internal": "4.0.540",
|
|
45
45
|
"eslint": "9.19.0",
|
|
46
46
|
"@types/node": "20.12.14",
|
|
47
47
|
"@types/pngjs": "6.0.5",
|
|
48
48
|
"pngjs": "7.0.0"
|
|
49
49
|
},
|
|
50
50
|
"optionalDependencies": {
|
|
51
|
-
"@remotion/compositor-darwin-arm64": "4.0.
|
|
52
|
-
"@remotion/compositor-darwin-x64": "4.0.
|
|
53
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
54
|
-
"@remotion/compositor-linux-arm64-musl": "4.0.
|
|
55
|
-
"@remotion/compositor-linux-x64-gnu": "4.0.
|
|
56
|
-
"@remotion/compositor-linux-x64-musl": "4.0.
|
|
57
|
-
"@remotion/compositor-win32-x64-msvc": "4.0.
|
|
51
|
+
"@remotion/compositor-darwin-arm64": "4.0.540",
|
|
52
|
+
"@remotion/compositor-darwin-x64": "4.0.540",
|
|
53
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.540",
|
|
54
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.540",
|
|
55
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.540",
|
|
56
|
+
"@remotion/compositor-linux-x64-musl": "4.0.540",
|
|
57
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.540"
|
|
58
58
|
},
|
|
59
59
|
"keywords": [
|
|
60
60
|
"remotion",
|