@remotion/renderer 4.0.533 → 4.0.535
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/aac-priming.js +6 -2
- package/dist/browser/BrowserFetcher.d.ts +7 -1
- package/dist/browser/BrowserFetcher.js +33 -13
- package/dist/browser/BrowserPage.js +4 -0
- package/dist/browser/Connection.js +5 -17
- package/dist/browser/DOMWorld.js +19 -13
- package/dist/browser/devtools-commands.d.ts +13 -1
- package/dist/browser/devtools-types.d.ts +62 -0
- package/dist/browser/get-chrome-download-url.d.ts +1 -1
- package/dist/browser/get-chrome-download-url.js +19 -33
- package/dist/can-use-parallel-encoding.d.ts +0 -1
- package/dist/can-use-parallel-encoding.js +10 -10
- package/dist/client.d.ts +402 -4
- package/dist/client.js +2 -0
- package/dist/combine-chunks.d.ts +2 -1
- package/dist/combine-chunks.js +81 -52
- package/dist/combine-video-streams.js +3 -0
- package/dist/compositor/get-executable-path.js +30 -15
- package/dist/cycle-browser-tabs.js +9 -1
- package/dist/ensure-browser.d.ts +3 -0
- package/dist/ensure-browser.js +30 -6
- package/dist/esm/client.mjs +1325 -954
- package/dist/esm/index.mjs +4465 -3324
- package/dist/esm/pure.mjs +36 -10
- package/dist/file-extensions.js +4 -1
- package/dist/get-mp4-brand.d.ts +1 -0
- package/dist/get-mp4-brand.js +21 -0
- package/dist/get-video-threads-flag.js +5 -1
- package/dist/image-format.d.ts +1 -0
- package/dist/image-format.js +8 -4
- package/dist/index.d.ts +58 -2
- package/dist/index.js +4 -0
- package/dist/memory/from-macos-sysctl.d.ts +1 -0
- package/dist/memory/from-macos-sysctl.js +50 -0
- package/dist/memory/from-proc-meminfo.d.ts +1 -1
- package/dist/memory/from-proc-meminfo.js +7 -4
- package/dist/memory/get-available-memory.js +29 -21
- package/dist/mux-video-and-audio.js +11 -2
- package/dist/next-frame-to-render.d.ts +3 -7
- package/dist/next-frame-to-render.js +3 -22
- package/dist/open-browser.js +1 -0
- package/dist/options/allow-html-in-canvas.d.ts +1 -0
- package/dist/options/allow-html-in-canvas.js +2 -1
- package/dist/options/api-key.d.ts +1 -0
- package/dist/options/api-key.js +2 -1
- package/dist/options/ask-ai.d.ts +1 -0
- package/dist/options/ask-ai.js +2 -1
- package/dist/options/audio-bitrate.d.ts +1 -0
- package/dist/options/audio-bitrate.js +2 -1
- package/dist/options/audio-codec.d.ts +1 -0
- package/dist/options/audio-codec.js +13 -6
- package/dist/options/beep-on-finish.d.ts +1 -0
- package/dist/options/beep-on-finish.js +2 -1
- package/dist/options/benchmark-concurrencies.d.ts +1 -0
- package/dist/options/benchmark-concurrencies.js +2 -1
- package/dist/options/binaries-directory.d.ts +1 -0
- package/dist/options/binaries-directory.js +2 -1
- package/dist/options/browser-executable.d.ts +1 -0
- package/dist/options/browser-executable.js +2 -1
- package/dist/options/browser.d.ts +1 -0
- package/dist/options/browser.js +2 -1
- package/dist/options/bundle-cache.d.ts +1 -0
- package/dist/options/bundle-cache.js +2 -1
- package/dist/options/canvas-tabs.d.ts +1 -0
- package/dist/options/canvas-tabs.js +2 -1
- package/dist/options/chrome-mode.d.ts +1 -0
- package/dist/options/chrome-mode.js +2 -1
- package/dist/options/color-space.d.ts +1 -0
- package/dist/options/color-space.js +2 -1
- package/dist/options/concurrency.d.ts +1 -0
- package/dist/options/concurrency.js +2 -1
- package/dist/options/config.d.ts +1 -0
- package/dist/options/config.js +2 -1
- package/dist/options/crf.d.ts +1 -0
- package/dist/options/crf.js +2 -1
- package/dist/options/cross-site-isolation.d.ts +1 -0
- package/dist/options/cross-site-isolation.js +2 -1
- package/dist/options/dark-mode.d.ts +1 -0
- package/dist/options/dark-mode.js +2 -1
- package/dist/options/default-coding-agent.d.ts +1 -0
- package/dist/options/default-coding-agent.js +2 -1
- package/dist/options/default-editor.d.ts +1 -0
- package/dist/options/default-editor.js +2 -1
- package/dist/options/default-premount-in-seconds.d.ts +19 -0
- package/dist/options/default-premount-in-seconds.js +36 -0
- package/dist/options/delete-after.d.ts +1 -0
- package/dist/options/delete-after.js +2 -1
- package/dist/options/disable-git-source.d.ts +1 -0
- package/dist/options/disable-git-source.js +2 -1
- package/dist/options/disable-shared-memory-capture.d.ts +17 -0
- package/dist/options/disable-shared-memory-capture.js +30 -0
- package/dist/options/disable-web-security.d.ts +1 -0
- package/dist/options/disable-web-security.js +2 -1
- package/dist/options/disallow-parallel-encoding.d.ts +1 -0
- package/dist/options/disallow-parallel-encoding.js +2 -1
- package/dist/options/enable-cancellation.d.ts +1 -0
- package/dist/options/enable-cancellation.js +2 -1
- package/dist/options/enable-lambda-insights.d.ts +1 -0
- package/dist/options/enable-lambda-insights.js +2 -1
- package/dist/options/enable-multiprocess-on-linux.d.ts +1 -0
- package/dist/options/enable-multiprocess-on-linux.js +2 -1
- package/dist/options/encoding-buffer-size.d.ts +1 -0
- package/dist/options/encoding-buffer-size.js +2 -1
- package/dist/options/encoding-max-rate.d.ts +1 -0
- package/dist/options/encoding-max-rate.js +2 -1
- package/dist/options/enforce-audio.d.ts +1 -0
- package/dist/options/enforce-audio.js +2 -1
- package/dist/options/env-file.d.ts +1 -0
- package/dist/options/env-file.js +2 -1
- package/dist/options/every-nth-frame.d.ts +1 -0
- package/dist/options/every-nth-frame.js +2 -1
- package/dist/options/experimental-keep-audio-context-alive.d.ts +1 -0
- package/dist/options/experimental-keep-audio-context-alive.js +2 -1
- package/dist/options/experimental-sequence-activity-limit.d.ts +19 -0
- package/dist/options/experimental-sequence-activity-limit.js +40 -0
- package/dist/options/experimental-sequence-activity.d.ts +19 -0
- package/dist/options/experimental-sequence-activity.js +38 -0
- package/dist/options/experimental-tracks.d.ts +19 -0
- package/dist/options/experimental-tracks.js +43 -0
- package/dist/options/folder-expiry.d.ts +1 -0
- package/dist/options/folder-expiry.js +2 -1
- package/dist/options/for-seamless-aac-concatenation.d.ts +1 -0
- package/dist/options/for-seamless-aac-concatenation.js +2 -1
- package/dist/options/force-new-studio.d.ts +1 -0
- package/dist/options/force-new-studio.js +2 -1
- package/dist/options/frames.d.ts +1 -0
- package/dist/options/frames.js +2 -1
- package/dist/options/gl.d.ts +1 -0
- package/dist/options/gl.js +2 -1
- package/dist/options/gop-size.d.ts +1 -0
- package/dist/options/gop-size.js +2 -1
- package/dist/options/hardware-acceleration.d.ts +1 -0
- package/dist/options/hardware-acceleration.js +2 -1
- package/dist/options/headless.d.ts +1 -0
- package/dist/options/headless.js +2 -1
- package/dist/options/ignore-certificate-errors.d.ts +1 -0
- package/dist/options/ignore-certificate-errors.js +2 -1
- package/dist/options/image-sequence-pattern.d.ts +2 -1
- package/dist/options/image-sequence-pattern.js +2 -1
- package/dist/options/image-sequence.d.ts +1 -0
- package/dist/options/image-sequence.js +2 -1
- package/dist/options/index.d.ts +211 -2
- package/dist/options/index.js +12 -0
- package/dist/options/interactivity.d.ts +1 -0
- package/dist/options/interactivity.js +2 -1
- package/dist/options/ipv4.d.ts +1 -0
- package/dist/options/ipv4.js +2 -1
- package/dist/options/is-production.d.ts +1 -0
- package/dist/options/is-production.js +2 -1
- package/dist/options/jpeg-quality.d.ts +1 -0
- package/dist/options/jpeg-quality.js +6 -2
- package/dist/options/keyboard-shortcuts.d.ts +1 -0
- package/dist/options/keyboard-shortcuts.js +2 -1
- package/dist/options/latency-hint.d.ts +1 -0
- package/dist/options/latency-hint.js +2 -1
- package/dist/options/license-key.d.ts +1 -0
- package/dist/options/license-key.js +2 -1
- package/dist/options/log-level.d.ts +1 -0
- package/dist/options/log-level.js +2 -1
- package/dist/options/metadata.d.ts +1 -0
- package/dist/options/metadata.js +2 -1
- package/dist/options/mute.d.ts +1 -0
- package/dist/options/mute.js +2 -1
- package/dist/options/no-open.d.ts +1 -0
- package/dist/options/no-open.js +2 -1
- package/dist/options/number-of-gif-loops.d.ts +1 -0
- package/dist/options/number-of-gif-loops.js +2 -1
- package/dist/options/number-of-shared-audio-tags.d.ts +1 -0
- package/dist/options/number-of-shared-audio-tags.js +2 -1
- package/dist/options/offthreadvideo-cache-size.d.ts +1 -0
- package/dist/options/offthreadvideo-cache-size.js +2 -1
- package/dist/options/offthreadvideo-threads.d.ts +1 -0
- package/dist/options/offthreadvideo-threads.js +2 -1
- package/dist/options/on-browser-download.d.ts +1 -0
- package/dist/options/on-browser-download.js +2 -1
- package/dist/options/option.d.ts +1 -0
- package/dist/options/options-map.d.ts +189 -1
- package/dist/options/options-map.js +4 -0
- package/dist/options/out-dir.d.ts +1 -0
- package/dist/options/out-dir.js +2 -1
- package/dist/options/override-duration.d.ts +1 -0
- package/dist/options/override-duration.js +2 -1
- package/dist/options/override-fps.d.ts +1 -0
- package/dist/options/override-fps.js +2 -1
- package/dist/options/override-height.d.ts +1 -0
- package/dist/options/override-height.js +2 -1
- package/dist/options/override-width.d.ts +1 -0
- package/dist/options/override-width.js +2 -1
- package/dist/options/overwrite.d.ts +1 -0
- package/dist/options/overwrite.js +2 -1
- package/dist/options/package-manager.d.ts +1 -0
- package/dist/options/package-manager.js +2 -1
- package/dist/options/pixel-format.d.ts +1 -0
- package/dist/options/pixel-format.js +2 -1
- package/dist/options/port.d.ts +1 -0
- package/dist/options/port.js +2 -1
- package/dist/options/prefer-lossless.d.ts +1 -0
- package/dist/options/prefer-lossless.js +2 -1
- package/dist/options/preview-sample-rate.d.ts +1 -0
- package/dist/options/preview-sample-rate.js +2 -1
- package/dist/options/props.d.ts +1 -0
- package/dist/options/props.js +2 -1
- package/dist/options/prores-profile.d.ts +1 -0
- package/dist/options/prores-profile.js +2 -1
- package/dist/options/public-dir.d.ts +1 -0
- package/dist/options/public-dir.js +2 -1
- package/dist/options/public-license-key.d.ts +1 -0
- package/dist/options/public-license-key.js +2 -1
- package/dist/options/public-path.d.ts +1 -0
- package/dist/options/public-path.js +2 -1
- package/dist/options/repro.d.ts +1 -0
- package/dist/options/repro.js +2 -1
- package/dist/options/rspack.d.ts +2 -1
- package/dist/options/rspack.js +2 -1
- package/dist/options/runs.d.ts +1 -0
- package/dist/options/runs.js +2 -1
- package/dist/options/sample-rate.d.ts +1 -0
- package/dist/options/sample-rate.js +2 -1
- package/dist/options/scale.d.ts +1 -0
- package/dist/options/scale.js +2 -1
- package/dist/options/separate-audio.d.ts +1 -0
- package/dist/options/separate-audio.js +3 -2
- package/dist/options/show-premounting.d.ts +19 -0
- package/dist/options/show-premounting.js +33 -0
- package/dist/options/skip-skills.d.ts +1 -0
- package/dist/options/skip-skills.js +2 -1
- package/dist/options/still-frame.d.ts +1 -0
- package/dist/options/still-frame.js +2 -1
- package/dist/options/still-image-format.d.ts +1 -0
- package/dist/options/still-image-format.js +2 -1
- package/dist/options/throw-if-site-exists.d.ts +1 -0
- package/dist/options/throw-if-site-exists.js +2 -1
- package/dist/options/timeout.d.ts +1 -0
- package/dist/options/timeout.js +2 -1
- package/dist/options/user-agent.d.ts +1 -0
- package/dist/options/user-agent.js +2 -1
- package/dist/options/version-flag.d.ts +1 -0
- package/dist/options/version-flag.js +2 -1
- package/dist/options/video-bitrate.d.ts +1 -0
- package/dist/options/video-bitrate.js +2 -1
- package/dist/options/video-cache-size.d.ts +1 -0
- package/dist/options/video-cache-size.js +2 -1
- package/dist/options/video-codec.d.ts +1 -0
- package/dist/options/video-codec.js +5 -3
- package/dist/options/video-image-format.d.ts +1 -0
- package/dist/options/video-image-format.js +7 -2
- package/dist/options/webhook-custom-data.d.ts +1 -0
- package/dist/options/webhook-custom-data.js +2 -1
- package/dist/options/webpack-poll.d.ts +1 -0
- package/dist/options/webpack-poll.js +2 -1
- package/dist/options/x264-preset.d.ts +1 -0
- package/dist/options/x264-preset.js +2 -1
- package/dist/prespawn-ffmpeg.d.ts +20 -0
- package/dist/prespawn-ffmpeg.js +157 -29
- package/dist/probe-shared-memory-capture.d.ts +8 -0
- package/dist/probe-shared-memory-capture.js +111 -0
- package/dist/puppeteer-screenshot.d.ts +3 -1
- package/dist/puppeteer-screenshot.js +1 -0
- package/dist/pure.d.ts +1 -1
- package/dist/remotion-shared-memory-ffmpeg.d.ts +26 -0
- package/dist/remotion-shared-memory-ffmpeg.js +312 -0
- package/dist/remotion-shared-memory.d.ts +49 -0
- package/dist/remotion-shared-memory.js +359 -0
- package/dist/render-frame-and-retry-target-close.d.ts +5 -2
- package/dist/render-frame-and-retry-target-close.js +20 -4
- package/dist/render-frame-with-option-to-reject.d.ts +4 -1
- package/dist/render-frame-with-option-to-reject.js +206 -115
- package/dist/render-frame.d.ts +4 -5
- package/dist/render-frame.js +3 -1
- package/dist/render-frames.d.ts +3 -0
- package/dist/render-frames.js +15 -18
- package/dist/render-media.d.ts +1 -1
- package/dist/render-media.js +131 -46
- package/dist/render-still.js +1 -0
- package/dist/screenshot-background.d.ts +2 -0
- package/dist/screenshot-background.js +20 -0
- package/dist/screenshot-task.d.ts +4 -2
- package/dist/screenshot-task.js +40 -21
- package/dist/seek-to-frame.js +1 -1
- package/dist/stitch-frames-to-video.js +71 -10
- package/dist/take-frame.d.ts +11 -3
- package/dist/take-frame.js +10 -8
- package/dist/validate-output-filename.d.ts +1 -1
- package/dist/validate-output-filename.js +10 -2
- package/package.json +13 -13
package/dist/client.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BrowserSafeApis = exports.defaultEditorIds = exports.customEditorTargetPathPlaceholder = exports.customEditorLineNumberPlaceholder = exports.customEditorColumnNumberPlaceholder = exports.defaultCodingAgentIds = void 0;
|
|
4
4
|
const no_react_1 = require("remotion/no-react");
|
|
5
5
|
const TimeoutSettings_1 = require("./browser/TimeoutSettings");
|
|
6
|
+
const can_use_parallel_encoding_1 = require("./can-use-parallel-encoding");
|
|
6
7
|
const codec_1 = require("./codec");
|
|
7
8
|
const codec_supports_media_1 = require("./codec-supports-media");
|
|
8
9
|
const crf_1 = require("./crf");
|
|
@@ -31,6 +32,7 @@ Object.defineProperty(exports, "customEditorLineNumberPlaceholder", { enumerable
|
|
|
31
32
|
Object.defineProperty(exports, "customEditorTargetPathPlaceholder", { enumerable: true, get: function () { return default_editor_1.customEditorTargetPathPlaceholder; } });
|
|
32
33
|
Object.defineProperty(exports, "defaultEditorIds", { enumerable: true, get: function () { return default_editor_1.defaultEditorIds; } });
|
|
33
34
|
exports.BrowserSafeApis = {
|
|
35
|
+
canUseParallelEncoding: can_use_parallel_encoding_1.canUseParallelEncoding,
|
|
34
36
|
getExtensionOfFilename: get_extension_of_filename_1.getExtensionOfFilename,
|
|
35
37
|
getFileExtensionFromCodec: get_extension_from_codec_1.getFileExtensionFromCodec,
|
|
36
38
|
validCodecs: codec_1.validCodecs,
|
package/dist/combine-chunks.d.ts
CHANGED
|
@@ -32,8 +32,9 @@ type OptionalCombineChunksOptions = {
|
|
|
32
32
|
sampleRate: number;
|
|
33
33
|
};
|
|
34
34
|
export type CombineChunksOptions = MandatoryCombineChunksOptions & Partial<OptionalCombineChunksOptions>;
|
|
35
|
-
export declare const internalCombineChunks: ({ outputLocation: output, onProgress, codec, fps, numberOfGifLoops, audioBitrate, indent, logLevel, binariesDirectory, cancelSignal, metadata, audioFiles, videoFiles, framesPerChunk, audioCodec, preferLossless, everyNthFrame, frameRange, compositionDurationInFrames, sampleRate, }: MandatoryCombineChunksOptions & OptionalCombineChunksOptions & {
|
|
35
|
+
export declare const internalCombineChunks: ({ outputLocation: output, onProgress, codec, fps, numberOfGifLoops, audioBitrate, indent, logLevel, binariesDirectory, cancelSignal, metadata, audioFiles, videoFiles, framesPerChunk, audioCodec, preferLossless, everyNthFrame, frameRange, compositionDurationInFrames, sampleRate, separateAudioTo, }: MandatoryCombineChunksOptions & OptionalCombineChunksOptions & {
|
|
36
36
|
indent: boolean;
|
|
37
|
+
separateAudioTo: string | null;
|
|
37
38
|
}) => Promise<void>;
|
|
38
39
|
export declare const combineChunks: (options: CombineChunksOptions) => Promise<void>;
|
|
39
40
|
export {};
|
package/dist/combine-chunks.js
CHANGED
|
@@ -10,7 +10,9 @@ const combine_video_streams_1 = require("./combine-video-streams");
|
|
|
10
10
|
const combine_video_streams_seamlessly_1 = require("./combine-video-streams-seamlessly");
|
|
11
11
|
const get_duration_from_frame_range_1 = require("./get-duration-from-frame-range");
|
|
12
12
|
const get_extension_from_codec_1 = require("./get-extension-from-codec");
|
|
13
|
+
const get_extension_of_filename_1 = require("./get-extension-of-filename");
|
|
13
14
|
const get_frame_to_render_1 = require("./get-frame-to-render");
|
|
15
|
+
const get_mp4_brand_1 = require("./get-mp4-brand");
|
|
14
16
|
const is_audio_codec_1 = require("./is-audio-codec");
|
|
15
17
|
const logger_1 = require("./logger");
|
|
16
18
|
const mux_video_and_audio_1 = require("./mux-video-and-audio");
|
|
@@ -19,23 +21,28 @@ const tmp_dir_1 = require("./tmp-dir");
|
|
|
19
21
|
const truthy_1 = require("./truthy");
|
|
20
22
|
const validate_number_of_gif_loops_1 = require("./validate-number-of-gif-loops");
|
|
21
23
|
const REMOTION_FILELIST_TOKEN = 'remotion-filelist';
|
|
22
|
-
const internalCombineChunks = async ({ outputLocation: output, onProgress, codec, fps, numberOfGifLoops, audioBitrate, indent, logLevel, binariesDirectory, cancelSignal, metadata, audioFiles, videoFiles, framesPerChunk, audioCodec, preferLossless, everyNthFrame, frameRange, compositionDurationInFrames, sampleRate, }) => {
|
|
24
|
+
const internalCombineChunks = async ({ outputLocation: output, onProgress, codec, fps, numberOfGifLoops, audioBitrate, indent, logLevel, binariesDirectory, cancelSignal, metadata, audioFiles, videoFiles, framesPerChunk, audioCodec, preferLossless, everyNthFrame, frameRange, compositionDurationInFrames, sampleRate, separateAudioTo, }) => {
|
|
25
|
+
var _a;
|
|
26
|
+
var _b;
|
|
23
27
|
(0, validate_number_of_gif_loops_1.validateNumberOfGifLoops)(numberOfGifLoops, codec);
|
|
24
|
-
const filelistDir = (0, tmp_dir_1.tmpDir)(REMOTION_FILELIST_TOKEN);
|
|
25
28
|
const shouldCreateVideo = !(0, is_audio_codec_1.isAudioCodec)(codec);
|
|
26
29
|
const resolvedAudioCodec = (0, audio_codec_1.resolveAudioCodec)({
|
|
27
30
|
setting: audioCodec,
|
|
28
31
|
codec,
|
|
29
32
|
preferLossless,
|
|
30
|
-
separateAudioTo
|
|
33
|
+
separateAudioTo,
|
|
31
34
|
});
|
|
32
35
|
const shouldCreateAudio = resolvedAudioCodec !== null && audioFiles.length > 0;
|
|
36
|
+
if (separateAudioTo !== null && (!shouldCreateAudio || !shouldCreateVideo)) {
|
|
37
|
+
throw new Error('Separate audio requires a video render with audio chunks.');
|
|
38
|
+
}
|
|
33
39
|
const seamlessVideo = (0, can_concat_seamlessly_1.canConcatVideoSeamlessly)(codec);
|
|
34
40
|
const realFrameRange = (0, get_frame_to_render_1.getRealFrameRange)(compositionDurationInFrames, frameRange);
|
|
35
41
|
const seamlessAudio = (0, can_concat_seamlessly_1.canConcatAudioSeamlessly)(resolvedAudioCodec, framesPerChunk);
|
|
36
42
|
const numberOfFrames = (0, get_duration_from_frame_range_1.getFramesToRender)(realFrameRange, everyNthFrame).length;
|
|
43
|
+
const filelistDir = (0, tmp_dir_1.tmpDir)(REMOTION_FILELIST_TOKEN);
|
|
37
44
|
const videoOutput = shouldCreateVideo
|
|
38
|
-
? (0, node_path_1.join)(filelistDir, `video.${(0, get_extension_from_codec_1.getFileExtensionFromCodec)(codec, resolvedAudioCodec)}`)
|
|
45
|
+
? (0, node_path_1.join)(filelistDir, `video.${(0, get_extension_from_codec_1.getFileExtensionFromCodec)(codec, separateAudioTo === null ? resolvedAudioCodec : null)}`)
|
|
39
46
|
: null;
|
|
40
47
|
const audioOutput = shouldCreateAudio
|
|
41
48
|
? (0, node_path_1.join)(filelistDir, `audio.${(0, audio_codec_1.getExtensionFromAudioCodec)(resolvedAudioCodec)}`)
|
|
@@ -63,52 +70,52 @@ const internalCombineChunks = async ({ outputLocation: output, onProgress, codec
|
|
|
63
70
|
: seamlessVideo
|
|
64
71
|
? 'seamlessly'
|
|
65
72
|
: 'normally'}`);
|
|
66
|
-
await Promise.all([
|
|
67
|
-
shouldCreateAudio && audioOutput
|
|
68
|
-
? (0, combine_audio_1.createCombinedAudio)({
|
|
69
|
-
audioBitrate,
|
|
70
|
-
filelistDir,
|
|
71
|
-
files: audioFiles,
|
|
72
|
-
indent,
|
|
73
|
-
logLevel,
|
|
74
|
-
output: audioOutput,
|
|
75
|
-
resolvedAudioCodec,
|
|
76
|
-
seamless: seamlessAudio,
|
|
77
|
-
chunkDurationInSeconds,
|
|
78
|
-
addRemotionMetadata: !shouldCreateVideo,
|
|
79
|
-
binariesDirectory,
|
|
80
|
-
fps,
|
|
81
|
-
cancelSignal,
|
|
82
|
-
onProgress: (frames) => {
|
|
83
|
-
concatenatedAudio = frames;
|
|
84
|
-
updateProgress();
|
|
85
|
-
},
|
|
86
|
-
sampleRate,
|
|
87
|
-
})
|
|
88
|
-
: null,
|
|
89
|
-
shouldCreateVideo && !seamlessVideo && videoOutput
|
|
90
|
-
? (0, combine_video_streams_1.combineVideoStreams)({
|
|
91
|
-
codec,
|
|
92
|
-
filelistDir,
|
|
93
|
-
fps,
|
|
94
|
-
indent,
|
|
95
|
-
logLevel,
|
|
96
|
-
numberOfGifLoops,
|
|
97
|
-
output: videoOutput,
|
|
98
|
-
files: videoFiles,
|
|
99
|
-
addRemotionMetadata: !shouldCreateAudio,
|
|
100
|
-
binariesDirectory,
|
|
101
|
-
cancelSignal,
|
|
102
|
-
onProgress: (frames) => {
|
|
103
|
-
concatenatedVideo = frames;
|
|
104
|
-
updateProgress();
|
|
105
|
-
},
|
|
106
|
-
})
|
|
107
|
-
: null,
|
|
108
|
-
].filter(truthy_1.truthy));
|
|
109
73
|
try {
|
|
74
|
+
await Promise.all([
|
|
75
|
+
shouldCreateAudio && audioOutput
|
|
76
|
+
? (0, combine_audio_1.createCombinedAudio)({
|
|
77
|
+
audioBitrate,
|
|
78
|
+
filelistDir,
|
|
79
|
+
files: audioFiles,
|
|
80
|
+
indent,
|
|
81
|
+
logLevel,
|
|
82
|
+
output: audioOutput,
|
|
83
|
+
resolvedAudioCodec,
|
|
84
|
+
seamless: seamlessAudio,
|
|
85
|
+
chunkDurationInSeconds,
|
|
86
|
+
addRemotionMetadata: !shouldCreateVideo,
|
|
87
|
+
binariesDirectory,
|
|
88
|
+
fps,
|
|
89
|
+
cancelSignal,
|
|
90
|
+
onProgress: (frames) => {
|
|
91
|
+
concatenatedAudio = frames;
|
|
92
|
+
updateProgress();
|
|
93
|
+
},
|
|
94
|
+
sampleRate,
|
|
95
|
+
})
|
|
96
|
+
: null,
|
|
97
|
+
shouldCreateVideo && !seamlessVideo && videoOutput
|
|
98
|
+
? (0, combine_video_streams_1.combineVideoStreams)({
|
|
99
|
+
codec,
|
|
100
|
+
filelistDir,
|
|
101
|
+
fps,
|
|
102
|
+
indent,
|
|
103
|
+
logLevel,
|
|
104
|
+
numberOfGifLoops,
|
|
105
|
+
output: videoOutput,
|
|
106
|
+
files: videoFiles,
|
|
107
|
+
addRemotionMetadata: !shouldCreateAudio,
|
|
108
|
+
binariesDirectory,
|
|
109
|
+
cancelSignal,
|
|
110
|
+
onProgress: (frames) => {
|
|
111
|
+
concatenatedVideo = frames;
|
|
112
|
+
updateProgress();
|
|
113
|
+
},
|
|
114
|
+
})
|
|
115
|
+
: null,
|
|
116
|
+
].filter(truthy_1.truthy));
|
|
110
117
|
await (0, mux_video_and_audio_1.muxVideoAndAudio)({
|
|
111
|
-
audioOutput,
|
|
118
|
+
audioOutput: separateAudioTo === null ? audioOutput : null,
|
|
112
119
|
indent,
|
|
113
120
|
logLevel,
|
|
114
121
|
onProgress: (frames) => {
|
|
@@ -127,12 +134,33 @@ const internalCombineChunks = async ({ outputLocation: output, onProgress, codec
|
|
|
127
134
|
audioCodec: resolvedAudioCodec,
|
|
128
135
|
sampleRate,
|
|
129
136
|
});
|
|
137
|
+
if (separateAudioTo !== null && audioOutput !== null) {
|
|
138
|
+
const extension = (_b = (_a = (0, get_extension_of_filename_1.getExtensionOfFilename)(separateAudioTo)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : null;
|
|
139
|
+
if ((0, get_mp4_brand_1.getMp4BrandForExtension)(extension)) {
|
|
140
|
+
await (0, mux_video_and_audio_1.muxVideoAndAudio)({
|
|
141
|
+
videoOutput: null,
|
|
142
|
+
audioOutput,
|
|
143
|
+
output: separateAudioTo,
|
|
144
|
+
indent,
|
|
145
|
+
logLevel,
|
|
146
|
+
onProgress: () => undefined,
|
|
147
|
+
binariesDirectory,
|
|
148
|
+
fps,
|
|
149
|
+
cancelSignal,
|
|
150
|
+
metadata: null,
|
|
151
|
+
numberOfGifLoops: null,
|
|
152
|
+
audioCodec: resolvedAudioCodec,
|
|
153
|
+
sampleRate,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
(0, node_fs_1.copyFileSync)(audioOutput, separateAudioTo);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
130
160
|
onProgress({ totalProgress: 1, frames: numberOfFrames });
|
|
131
|
-
(0, node_fs_1.rmSync)(filelistDir, { recursive: true });
|
|
132
161
|
}
|
|
133
|
-
|
|
134
|
-
(0, node_fs_1.rmSync)(filelistDir, { recursive: true });
|
|
135
|
-
throw err;
|
|
162
|
+
finally {
|
|
163
|
+
(0, node_fs_1.rmSync)(filelistDir, { recursive: true, force: true });
|
|
136
164
|
}
|
|
137
165
|
};
|
|
138
166
|
exports.internalCombineChunks = internalCombineChunks;
|
|
@@ -159,6 +187,7 @@ const combineChunks = (options) => {
|
|
|
159
187
|
frameRange: (_j = options.frameRange) !== null && _j !== void 0 ? _j : null,
|
|
160
188
|
compositionDurationInFrames: options.compositionDurationInFrames,
|
|
161
189
|
sampleRate: (_k = options.sampleRate) !== null && _k !== void 0 ? _k : 48000,
|
|
190
|
+
separateAudioTo: null,
|
|
162
191
|
});
|
|
163
192
|
};
|
|
164
193
|
exports.combineChunks = combineChunks;
|
|
@@ -34,6 +34,9 @@ const combineVideoStreams = async ({ fps, codec, filelistDir, numberOfGifLoops,
|
|
|
34
34
|
'-an',
|
|
35
35
|
'-c:v',
|
|
36
36
|
encoder,
|
|
37
|
+
// Keep the MP4/MOV video time base consistent with the initial encoding.
|
|
38
|
+
'-video_track_timescale',
|
|
39
|
+
'90000',
|
|
37
40
|
codec === 'h265' ? '-tag:v' : null,
|
|
38
41
|
codec === 'h265' ? 'hvc1' : null,
|
|
39
42
|
addRemotionMetadata ? `-metadata` : null,
|
|
@@ -8,27 +8,42 @@ exports.getExecutableDir = exports.getExecutablePath = void 0;
|
|
|
8
8
|
exports.isMusl = isMusl;
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const logger_1 = require("../logger");
|
|
11
|
-
let
|
|
11
|
+
let cachedIsMusl = null;
|
|
12
12
|
function isMusl({ indent, logLevel, }) {
|
|
13
|
-
|
|
13
|
+
if (cachedIsMusl !== null) {
|
|
14
|
+
return cachedIsMusl;
|
|
15
|
+
}
|
|
14
16
|
if (!process.report && typeof Bun !== 'undefined') {
|
|
15
|
-
if
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
warned = true;
|
|
19
|
-
return false;
|
|
17
|
+
logger_1.Log.warn({ indent, logLevel }, 'Bun limitation: Could not determine if your Linux is using musl or glibc. Assuming glibc.');
|
|
18
|
+
cachedIsMusl = false;
|
|
19
|
+
return cachedIsMusl;
|
|
20
20
|
}
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const processReport = process.report;
|
|
22
|
+
const excludeNetwork = processReport && 'excludeNetwork' in processReport
|
|
23
|
+
? processReport.excludeNetwork
|
|
24
|
+
: null;
|
|
25
|
+
try {
|
|
26
|
+
// Diagnostic reports can block on reverse DNS lookups for open sockets.
|
|
27
|
+
// This option is available in Node.js 20.13.0+ and 22.0.0+.
|
|
28
|
+
if (processReport && 'excludeNetwork' in processReport) {
|
|
29
|
+
processReport.excludeNetwork = true;
|
|
30
|
+
}
|
|
31
|
+
const report = processReport === null || processReport === void 0 ? void 0 : processReport.getReport();
|
|
32
|
+
if (report && typeof report === 'string') {
|
|
24
33
|
logger_1.Log.warn({ indent, logLevel }, 'Bun limitation: Could not determine if your Windows is using musl or glibc. Assuming glibc.');
|
|
34
|
+
cachedIsMusl = false;
|
|
35
|
+
return cachedIsMusl;
|
|
36
|
+
}
|
|
37
|
+
// @ts-expect-error no types
|
|
38
|
+
const { glibcVersionRuntime } = report.header;
|
|
39
|
+
cachedIsMusl = !glibcVersionRuntime;
|
|
40
|
+
return cachedIsMusl;
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
if (processReport && 'excludeNetwork' in processReport) {
|
|
44
|
+
processReport.excludeNetwork = excludeNetwork;
|
|
25
45
|
}
|
|
26
|
-
warned = true;
|
|
27
|
-
return false;
|
|
28
46
|
}
|
|
29
|
-
// @ts-expect-error no types
|
|
30
|
-
const { glibcVersionRuntime } = report.header;
|
|
31
|
-
return !glibcVersionRuntime;
|
|
32
47
|
}
|
|
33
48
|
const getExecutablePath = ({ indent, logLevel, type, binariesDirectory, }) => {
|
|
34
49
|
const base = binariesDirectory !== null && binariesDirectory !== void 0 ? binariesDirectory : (0, exports.getExecutableDir)(indent, logLevel);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cycleBrowserTabs = void 0;
|
|
4
|
+
const flaky_errors_1 = require("./browser/flaky-errors");
|
|
4
5
|
const logger_1 = require("./logger");
|
|
5
6
|
const cycleBrowserTabs = ({ puppeteerInstance, concurrency, logLevel, indent, }) => {
|
|
6
7
|
if (concurrency <= 1) {
|
|
@@ -25,7 +26,14 @@ const cycleBrowserTabs = ({ puppeteerInstance, concurrency, logLevel, indent, })
|
|
|
25
26
|
if (!(currentPage === null || currentPage === void 0 ? void 0 : currentPage.closed) &&
|
|
26
27
|
!stopped &&
|
|
27
28
|
(currentPage === null || currentPage === void 0 ? void 0 : currentPage.url()) !== 'about:blank') {
|
|
28
|
-
return currentPage.bringToFront()
|
|
29
|
+
return currentPage.bringToFront().catch((err) => {
|
|
30
|
+
// The tabs are closed at the end of a render while a
|
|
31
|
+
// bringToFront() may still be in flight. Only that case is ignored.
|
|
32
|
+
if (stopped && (0, flaky_errors_1.isTargetClosedErr)(err)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
throw err;
|
|
36
|
+
});
|
|
29
37
|
}
|
|
30
38
|
})
|
|
31
39
|
.catch((err) => logger_1.Log.error({ indent, logLevel }, err))
|
package/dist/ensure-browser.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare const ensureBrowser: (options?: Partial<{
|
|
|
29
29
|
readonly logLevel: {
|
|
30
30
|
cliFlag: "log";
|
|
31
31
|
name: string;
|
|
32
|
+
addedIn: string;
|
|
32
33
|
ssrName: string;
|
|
33
34
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
34
35
|
docLink: string;
|
|
@@ -46,6 +47,7 @@ export declare const ensureBrowser: (options?: Partial<{
|
|
|
46
47
|
};
|
|
47
48
|
readonly onBrowserDownload: {
|
|
48
49
|
name: string;
|
|
50
|
+
addedIn: string;
|
|
49
51
|
cliFlag: "on-browser-download";
|
|
50
52
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
51
53
|
ssrName: "onBrowserDownload";
|
|
@@ -58,6 +60,7 @@ export declare const ensureBrowser: (options?: Partial<{
|
|
|
58
60
|
readonly chromeMode: {
|
|
59
61
|
cliFlag: "chrome-mode";
|
|
60
62
|
name: string;
|
|
63
|
+
addedIn: string;
|
|
61
64
|
ssrName: string;
|
|
62
65
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
63
66
|
docLink: string;
|
package/dist/ensure-browser.js
CHANGED
|
@@ -10,18 +10,37 @@ const BrowserFetcher_1 = require("./browser/BrowserFetcher");
|
|
|
10
10
|
const logger_1 = require("./logger");
|
|
11
11
|
let currentEnsureBrowserOperation = Promise.resolve();
|
|
12
12
|
const internalEnsureBrowserUncapped = async ({ indent, logLevel, browserExecutable, onBrowserDownload, chromeMode, }) => {
|
|
13
|
-
const
|
|
13
|
+
const defaultStatus = getBrowserStatus({
|
|
14
|
+
browserExecutable,
|
|
15
|
+
chromeMode,
|
|
16
|
+
version: null,
|
|
17
|
+
});
|
|
18
|
+
if (defaultStatus.type === 'local-puppeteer-browser' ||
|
|
19
|
+
defaultStatus.type === 'user-defined-path') {
|
|
20
|
+
return defaultStatus;
|
|
21
|
+
}
|
|
22
|
+
const { onProgress, version } = onBrowserDownload({ chromeMode });
|
|
23
|
+
const status = version
|
|
24
|
+
? getBrowserStatus({ browserExecutable, chromeMode, version })
|
|
25
|
+
: defaultStatus;
|
|
26
|
+
if (status.type === 'local-puppeteer-browser') {
|
|
27
|
+
return status;
|
|
28
|
+
}
|
|
14
29
|
if (status.type === 'version-mismatch') {
|
|
30
|
+
const expectedVersion = (0, BrowserFetcher_1.getExpectedVersion)({
|
|
31
|
+
version,
|
|
32
|
+
chromeMode,
|
|
33
|
+
platform: (0, BrowserFetcher_1.getPlatform)(),
|
|
34
|
+
});
|
|
15
35
|
const versionInfo = status.actualVersion
|
|
16
36
|
? ` (installed: ${status.actualVersion})`
|
|
17
37
|
: '';
|
|
18
|
-
logger_1.Log.info({ indent, logLevel }, `This version of Remotion uses Chrome version ${
|
|
38
|
+
logger_1.Log.info({ indent, logLevel }, `This version of Remotion uses Chrome version ${expectedVersion}, but the installed one differs${versionInfo}. Re-downloading.`);
|
|
19
39
|
}
|
|
20
40
|
if (status.type === 'no-browser' || status.type === 'version-mismatch') {
|
|
21
|
-
const { onProgress, version } = onBrowserDownload({ chromeMode });
|
|
22
41
|
await (0, BrowserFetcher_1.downloadBrowser)({ indent, logLevel, onProgress, version, chromeMode });
|
|
23
42
|
}
|
|
24
|
-
const newStatus = getBrowserStatus({ browserExecutable, chromeMode });
|
|
43
|
+
const newStatus = getBrowserStatus({ browserExecutable, chromeMode, version });
|
|
25
44
|
return newStatus;
|
|
26
45
|
};
|
|
27
46
|
const internalEnsureBrowser = (options) => {
|
|
@@ -29,7 +48,7 @@ const internalEnsureBrowser = (options) => {
|
|
|
29
48
|
return currentEnsureBrowserOperation;
|
|
30
49
|
};
|
|
31
50
|
exports.internalEnsureBrowser = internalEnsureBrowser;
|
|
32
|
-
const getBrowserStatus = ({ browserExecutable, chromeMode, }) => {
|
|
51
|
+
const getBrowserStatus = ({ browserExecutable, chromeMode, version, }) => {
|
|
33
52
|
if (browserExecutable) {
|
|
34
53
|
if (!fs_1.default.existsSync(browserExecutable)) {
|
|
35
54
|
throw new Error(`"browserExecutable" was specified as '${browserExecutable}' but the path doesn't exist. Pass "null" for "browserExecutable" to download a browser automatically.`);
|
|
@@ -39,7 +58,12 @@ const getBrowserStatus = ({ browserExecutable, chromeMode, }) => {
|
|
|
39
58
|
const revision = (0, BrowserFetcher_1.getRevisionInfo)(chromeMode);
|
|
40
59
|
if (revision.local && fs_1.default.existsSync(revision.executablePath)) {
|
|
41
60
|
const actualVersion = (0, BrowserFetcher_1.readVersionFile)(chromeMode);
|
|
42
|
-
if (actualVersion ===
|
|
61
|
+
if (actualVersion ===
|
|
62
|
+
(0, BrowserFetcher_1.getExpectedVersion)({
|
|
63
|
+
version,
|
|
64
|
+
chromeMode,
|
|
65
|
+
platform: (0, BrowserFetcher_1.getPlatform)(),
|
|
66
|
+
})) {
|
|
43
67
|
return { path: revision.executablePath, type: 'local-puppeteer-browser' };
|
|
44
68
|
}
|
|
45
69
|
return { type: 'version-mismatch', actualVersion };
|