@remotion/renderer 4.0.0-webhook.26 → 4.0.0
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/LICENSE.md +8 -8
- package/README.md +9 -0
- package/client.d.ts +1 -0
- package/client.js +1 -0
- package/dist/assets/calculate-asset-positions.d.ts +0 -0
- package/dist/assets/calculate-asset-positions.js +1 -0
- package/dist/assets/calculate-atempo.d.ts +0 -0
- package/dist/assets/calculate-atempo.js +0 -0
- package/dist/assets/convert-assets-to-file-urls.d.ts +0 -0
- package/dist/assets/convert-assets-to-file-urls.js +0 -0
- package/dist/assets/download-and-map-assets-to-file.d.ts +6 -4
- package/dist/assets/download-and-map-assets-to-file.js +49 -19
- package/dist/assets/download-file.d.ts +8 -5
- package/dist/assets/download-file.js +71 -8
- package/dist/assets/download-map.d.ts +8 -29
- package/dist/assets/download-map.js +15 -16
- package/dist/assets/ffmpeg-volume-expression.d.ts +4 -3
- package/dist/assets/ffmpeg-volume-expression.js +5 -3
- package/dist/assets/flatten-volume-array.d.ts +0 -0
- package/dist/assets/flatten-volume-array.js +0 -0
- package/dist/assets/get-audio-channels.d.ts +2 -2
- package/dist/assets/get-audio-channels.js +14 -12
- package/dist/assets/read-file.d.ts +1 -1
- package/dist/assets/read-file.js +5 -7
- package/dist/assets/round-volume-to-avoid-stack-overflow.d.ts +0 -0
- package/dist/assets/round-volume-to-avoid-stack-overflow.js +0 -0
- package/dist/assets/sanitize-filename.d.ts +0 -0
- package/dist/assets/sanitize-filename.js +0 -0
- package/dist/assets/sanitize-filepath.d.ts +0 -0
- package/dist/assets/sanitize-filepath.js +2 -2
- package/dist/assets/truncate-utf8-bytes.d.ts +0 -0
- package/dist/assets/truncate-utf8-bytes.js +0 -0
- package/dist/assets/types.d.ts +5 -4
- package/dist/assets/types.js +0 -0
- package/dist/audio-codec.d.ts +28 -0
- package/dist/audio-codec.js +83 -0
- package/dist/browser/Browser.d.ts +19 -16
- package/dist/browser/Browser.js +72 -75
- package/dist/browser/BrowserConnector.d.ts +0 -0
- package/dist/browser/BrowserConnector.js +0 -0
- package/dist/browser/BrowserFetcher.d.ts +16 -64
- package/dist/browser/BrowserFetcher.js +147 -235
- package/dist/browser/BrowserPage.d.ts +32 -6
- package/dist/browser/BrowserPage.js +90 -26
- package/dist/browser/BrowserRunner.d.ts +1 -1
- package/dist/browser/BrowserRunner.js +32 -22
- package/dist/browser/Connection.d.ts +9 -3
- package/dist/browser/Connection.js +12 -4
- package/dist/browser/ConsoleMessage.d.ts +9 -2
- package/dist/browser/ConsoleMessage.js +2 -1
- package/dist/browser/DOMWorld.d.ts +5 -4
- package/dist/browser/DOMWorld.js +16 -9
- package/dist/browser/Errors.d.ts +0 -0
- package/dist/browser/Errors.js +0 -0
- package/dist/browser/EvalTypes.d.ts +7 -7
- package/dist/browser/EvalTypes.js +0 -0
- package/dist/browser/EventEmitter.d.ts +0 -0
- package/dist/browser/EventEmitter.js +0 -0
- package/dist/browser/ExecutionContext.d.ts +0 -0
- package/dist/browser/ExecutionContext.js +4 -4
- package/dist/browser/FrameManager.d.ts +0 -2
- package/dist/browser/FrameManager.js +15 -19
- package/dist/browser/HTTPRequest.d.ts +0 -0
- package/dist/browser/HTTPRequest.js +0 -0
- package/dist/browser/HTTPResponse.d.ts +0 -0
- package/dist/browser/HTTPResponse.js +0 -0
- package/dist/browser/JSHandle.d.ts +0 -0
- package/dist/browser/JSHandle.js +14 -14
- package/dist/browser/LaunchOptions.d.ts +4 -2
- package/dist/browser/LaunchOptions.js +0 -0
- package/dist/browser/Launcher.d.ts +9 -3
- package/dist/browser/Launcher.js +17 -29
- package/dist/browser/LifecycleWatcher.d.ts +1 -1
- package/dist/browser/LifecycleWatcher.js +0 -0
- package/dist/browser/NetworkEventManager.d.ts +4 -4
- package/dist/browser/NetworkEventManager.js +0 -0
- package/dist/browser/NetworkManager.d.ts +4 -1
- package/dist/browser/NetworkManager.js +0 -0
- package/dist/browser/NodeWebSocketTransport.d.ts +0 -0
- package/dist/browser/NodeWebSocketTransport.js +21 -21
- package/dist/browser/Product.d.ts +1 -1
- package/dist/browser/Product.js +0 -0
- package/dist/browser/PuppeteerNode.d.ts +2 -5
- package/dist/browser/PuppeteerNode.js +2 -11
- package/dist/browser/PuppeteerViewport.d.ts +0 -0
- package/dist/browser/PuppeteerViewport.js +0 -0
- package/dist/browser/ScreenshotOptions.d.ts +0 -14
- package/dist/browser/ScreenshotOptions.js +0 -1
- package/dist/browser/Target.d.ts +5 -3
- package/dist/browser/Target.js +10 -2
- package/dist/browser/TaskQueue.d.ts +0 -0
- package/dist/browser/TaskQueue.js +0 -0
- package/dist/browser/TimeoutSettings.d.ts +0 -0
- package/dist/browser/TimeoutSettings.js +0 -0
- package/dist/browser/assert.d.ts +0 -0
- package/dist/browser/assert.js +0 -0
- package/dist/browser/create-browser-fetcher.d.ts +0 -0
- package/dist/browser/create-browser-fetcher.js +34 -48
- package/dist/browser/devtools-commands.d.ts +5 -1
- package/dist/browser/devtools-commands.js +0 -0
- package/dist/browser/devtools-types.d.ts +151 -10
- package/dist/browser/devtools-types.js +0 -0
- package/dist/browser/get-download-destination.d.ts +0 -0
- package/dist/browser/get-download-destination.js +8 -8
- package/dist/browser/is-target-closed-err.d.ts +1 -0
- package/dist/browser/is-target-closed-err.js +9 -0
- package/dist/browser/mitt/index.d.ts +6 -6
- package/dist/browser/mitt/index.js +0 -0
- package/dist/browser/node.d.ts +0 -0
- package/dist/browser/node.js +0 -0
- package/dist/browser/revisions.d.ts +1 -1
- package/dist/browser/revisions.js +0 -0
- package/dist/browser/should-log-message.d.ts +24 -0
- package/dist/browser/should-log-message.js +80 -0
- package/dist/browser/util.d.ts +2 -2
- package/dist/browser/util.js +0 -0
- package/dist/browser-executable.d.ts +1 -1
- package/dist/browser-executable.js +0 -0
- package/dist/browser-log.d.ts +1 -1
- package/dist/browser-log.js +0 -0
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +0 -0
- package/dist/calculate-ffmpeg-filters.d.ts +2 -1
- package/dist/calculate-ffmpeg-filters.js +1 -0
- package/dist/call-ffmpeg.d.ts +14 -0
- package/dist/call-ffmpeg.js +42 -0
- package/dist/can-use-parallel-encoding.d.ts +0 -0
- package/dist/can-use-parallel-encoding.js +0 -0
- package/dist/chalk/index.d.ts +55 -0
- package/dist/chalk/index.js +130 -0
- package/dist/chalk/is-color-supported.d.ts +1 -0
- package/dist/chalk/is-color-supported.js +45 -0
- package/dist/check-apple-silicon.d.ts +1 -1
- package/dist/check-apple-silicon.js +8 -47
- package/dist/chunk.d.ts +0 -0
- package/dist/chunk.js +0 -0
- package/dist/client.d.ts +204 -0
- package/dist/client.js +49 -0
- package/dist/codec-supports-media.d.ts +3 -2
- package/dist/codec-supports-media.js +20 -5
- package/dist/codec.d.ts +2 -2
- package/dist/codec.js +0 -0
- package/dist/combine-videos.d.ts +6 -2
- package/dist/combine-videos.js +17 -17
- package/dist/compositor/compose.d.ts +26 -0
- package/dist/compositor/compose.js +87 -0
- package/dist/compositor/compositor.d.ts +12 -0
- package/dist/compositor/compositor.js +219 -0
- package/dist/compositor/get-executable-path.d.ts +1 -0
- package/dist/compositor/get-executable-path.js +57 -0
- package/dist/compositor/make-nonce.d.ts +1 -0
- package/dist/compositor/make-nonce.js +8 -0
- package/dist/compositor/payloads.d.ts +68 -0
- package/dist/{ffmpeg-executable.js → compositor/payloads.js} +0 -0
- package/dist/compress-assets.d.ts +0 -0
- package/dist/compress-assets.js +0 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.d.ts +0 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.js +0 -0
- package/dist/convert-to-positive-frame-index.d.ts +0 -0
- package/dist/convert-to-positive-frame-index.js +0 -0
- package/dist/create-ffmpeg-complex-filter.d.ts +5 -1
- package/dist/create-ffmpeg-complex-filter.js +6 -4
- package/dist/create-ffmpeg-merge-filter.d.ts +5 -1
- package/dist/create-ffmpeg-merge-filter.js +20 -13
- package/dist/create-silent-audio.d.ts +1 -3
- package/dist/create-silent-audio.js +3 -6
- package/dist/crf.d.ts +6 -2
- package/dist/crf.js +41 -8
- package/dist/cycle-browser-tabs.d.ts +3 -5
- package/dist/cycle-browser-tabs.js +7 -7
- package/dist/delay-render-embedded-stack.d.ts +0 -0
- package/dist/delay-render-embedded-stack.js +0 -0
- package/dist/delete-directory.d.ts +1 -1
- package/dist/delete-directory.js +43 -17
- package/dist/does-have-m2-bug.d.ts +3 -0
- package/dist/does-have-m2-bug.js +12 -0
- package/dist/ensure-frames-in-order.d.ts +0 -0
- package/dist/ensure-frames-in-order.js +0 -0
- package/dist/ensure-output-directory.d.ts +0 -0
- package/dist/ensure-output-directory.js +5 -5
- package/dist/error-handling/handle-javascript-exception.d.ts +0 -0
- package/dist/error-handling/handle-javascript-exception.js +10 -0
- package/dist/error-handling/symbolicate-error.d.ts +0 -0
- package/dist/error-handling/symbolicate-error.js +6 -3
- package/dist/error-handling/symbolicateable-error.d.ts +0 -0
- package/dist/error-handling/symbolicateable-error.js +0 -0
- package/dist/ffmpeg-filter-file.d.ts +6 -1
- package/dist/ffmpeg-filter-file.js +40 -8
- package/dist/ffmpeg-override.d.ts +1 -1
- package/dist/ffmpeg-override.js +0 -0
- package/dist/file-extensions.d.ts +14 -0
- package/dist/file-extensions.js +76 -0
- package/dist/find-closest-package-json.d.ts +2 -0
- package/dist/find-closest-package-json.js +31 -0
- package/dist/format-logs.d.ts +3 -0
- package/dist/format-logs.js +201 -0
- package/dist/frame-range.d.ts +1 -1
- package/dist/frame-range.js +0 -0
- package/dist/get-browser-instance.d.ts +9 -3
- package/dist/get-browser-instance.js +10 -5
- package/dist/get-codec-name.d.ts +0 -0
- package/dist/get-codec-name.js +0 -0
- package/dist/get-compositions.d.ts +28 -14
- package/dist/get-compositions.js +74 -40
- package/dist/get-concurrency.d.ts +1 -1
- package/dist/get-concurrency.js +11 -4
- package/dist/get-duration-from-frame-range.d.ts +0 -0
- package/dist/get-duration-from-frame-range.js +0 -0
- package/dist/get-extension-from-codec.d.ts +5 -1
- package/dist/get-extension-from-codec.js +56 -32
- package/dist/get-extension-of-filename.d.ts +0 -0
- package/dist/get-extension-of-filename.js +5 -1
- package/dist/get-frame-padded-index.d.ts +3 -2
- package/dist/get-frame-padded-index.js +3 -2
- package/dist/get-frame-to-render.d.ts +0 -0
- package/dist/get-frame-to-render.js +1 -1
- package/dist/get-local-browser-executable.d.ts +0 -0
- package/dist/get-local-browser-executable.js +7 -15
- package/dist/get-port.d.ts +4 -1
- package/dist/get-port.js +8 -8
- package/dist/get-prores-profile-name.d.ts +0 -0
- package/dist/get-prores-profile-name.js +0 -0
- package/dist/get-video-threads-flag.d.ts +0 -0
- package/dist/get-video-threads-flag.js +3 -3
- package/dist/guess-extension-for-media.d.ts +3 -1
- package/dist/guess-extension-for-media.js +4 -7
- package/dist/image-format.d.ts +12 -6
- package/dist/image-format.js +19 -13
- package/dist/index.d.ts +369 -49
- package/dist/index.js +67 -46
- package/dist/is-audio-codec.d.ts +0 -0
- package/dist/is-audio-codec.js +0 -0
- package/dist/is-serve-url.d.ts +0 -0
- package/dist/is-serve-url.js +0 -0
- package/dist/jpeg-quality.d.ts +2 -0
- package/dist/jpeg-quality.js +22 -0
- package/dist/locks.d.ts +7 -0
- package/dist/locks.js +44 -0
- package/dist/log-level.d.ts +1 -1
- package/dist/log-level.js +0 -0
- package/dist/logger.d.ts +23 -0
- package/dist/logger.js +63 -0
- package/dist/make-cancel-signal.d.ts +13 -2
- package/dist/make-cancel-signal.js +24 -1
- package/dist/merge-audio-track.d.ts +4 -4
- package/dist/merge-audio-track.js +38 -33
- package/dist/mime-db.d.ts +0 -0
- package/dist/mime-db.js +0 -0
- package/dist/mime-types.d.ts +0 -0
- package/dist/mime-types.js +3 -3
- package/dist/normalize-serve-url.d.ts +0 -0
- package/dist/normalize-serve-url.js +0 -0
- package/dist/offthread-video-server.d.ts +48 -11
- package/dist/offthread-video-server.js +112 -58
- package/dist/open-browser.d.ts +22 -6
- package/dist/open-browser.js +40 -17
- package/dist/options/audio-bitrate.d.ts +2 -0
- package/dist/options/audio-bitrate.js +11 -0
- package/dist/options/crf.d.ts +2 -0
- package/dist/options/crf.js +11 -0
- package/dist/options/enforce-audio.d.ts +2 -0
- package/dist/options/enforce-audio.js +11 -0
- package/dist/options/jpeg-quality.d.ts +2 -0
- package/dist/options/jpeg-quality.js +11 -0
- package/dist/options/mute.d.ts +2 -0
- package/dist/options/mute.js +11 -0
- package/dist/options/option.d.ts +8 -0
- package/dist/options/option.js +2 -0
- package/dist/options/scale.d.ts +2 -0
- package/dist/options/scale.js +11 -0
- package/dist/options/video-bitrate.d.ts +2 -0
- package/dist/options/video-bitrate.js +11 -0
- package/dist/options/video-codec.d.ts +2 -0
- package/dist/options/video-codec.js +11 -0
- package/dist/overwrite.d.ts +0 -0
- package/dist/overwrite.js +0 -0
- package/dist/p-limit.d.ts +0 -0
- package/dist/p-limit.js +0 -0
- package/dist/parse-browser-error-stack.d.ts +1 -1
- package/dist/parse-browser-error-stack.js +0 -0
- package/dist/parse-ffmpeg-progress.d.ts +0 -0
- package/dist/parse-ffmpeg-progress.js +0 -0
- package/dist/perf.d.ts +2 -2
- package/dist/perf.js +11 -7
- package/dist/pixel-format.d.ts +2 -2
- package/dist/pixel-format.js +3 -0
- package/dist/pool.d.ts +0 -0
- package/dist/pool.js +0 -0
- package/dist/prepare-server.d.ts +26 -10
- package/dist/prepare-server.js +71 -18
- package/dist/preprocess-audio-track.d.ts +7 -5
- package/dist/preprocess-audio-track.js +7 -8
- package/dist/prespawn-ffmpeg.d.ts +22 -11
- package/dist/prespawn-ffmpeg.js +41 -31
- package/dist/prestitcher-memory-usage.d.ts +0 -4
- package/dist/prestitcher-memory-usage.js +4 -5
- package/dist/prores-profile.d.ts +6 -4
- package/dist/prores-profile.js +8 -8
- package/dist/provide-screenshot.d.ts +8 -4
- package/dist/provide-screenshot.js +5 -2
- package/dist/puppeteer-evaluate.d.ts +4 -1
- package/dist/puppeteer-evaluate.js +23 -15
- package/dist/puppeteer-screenshot.d.ts +12 -2
- package/dist/puppeteer-screenshot.js +18 -45
- package/dist/redirect-status-codes.d.ts +1 -0
- package/dist/redirect-status-codes.js +6 -0
- package/dist/render-frames.d.ts +59 -35
- package/dist/render-frames.js +256 -147
- package/dist/render-media.d.ts +82 -28
- package/dist/render-media.js +322 -195
- package/dist/render-still.d.ts +52 -19
- package/dist/render-still.js +132 -74
- package/dist/replace-browser.d.ts +7 -0
- package/dist/replace-browser.js +47 -0
- package/dist/resolve-asset-src.d.ts +0 -0
- package/dist/resolve-asset-src.js +2 -2
- package/dist/sample-rate.d.ts +0 -0
- package/dist/sample-rate.js +0 -0
- package/dist/screenshot-dom-element.d.ts +8 -4
- package/dist/screenshot-dom-element.js +15 -4
- package/dist/screenshot-task.d.ts +11 -2
- package/dist/screenshot-task.js +45 -13
- package/dist/seek-to-frame.d.ts +3 -1
- package/dist/seek-to-frame.js +53 -7
- package/dist/select-composition.d.ts +46 -0
- package/dist/select-composition.js +157 -0
- package/dist/serve-handler/index.d.ts +1 -1
- package/dist/serve-handler/index.js +21 -19
- package/dist/serve-handler/is-path-inside.d.ts +0 -0
- package/dist/serve-handler/is-path-inside.js +3 -3
- package/dist/serve-handler/range-parser.d.ts +0 -0
- package/dist/serve-handler/range-parser.js +0 -0
- package/dist/serve-static.d.ts +9 -6
- package/dist/serve-static.js +85 -59
- package/dist/set-props-and-env.d.ts +5 -3
- package/dist/set-props-and-env.js +20 -12
- package/dist/stitch-frames-to-video.d.ts +40 -16
- package/dist/stitch-frames-to-video.js +200 -121
- package/dist/stringify-ffmpeg-filter.d.ts +10 -2
- package/dist/stringify-ffmpeg-filter.js +37 -34
- package/dist/symbolicate-stacktrace.d.ts +16 -3
- package/dist/symbolicate-stacktrace.js +49 -24
- package/dist/take-frame-and-compose.d.ts +22 -0
- package/dist/take-frame-and-compose.js +103 -0
- package/dist/tmp-dir.d.ts +0 -0
- package/dist/tmp-dir.js +7 -8
- package/dist/truthy.d.ts +1 -1
- package/dist/truthy.js +0 -0
- package/dist/types.d.ts +2 -2
- package/dist/types.js +0 -0
- package/dist/validate-concurrency.d.ts +2 -0
- package/dist/validate-concurrency.js +21 -10
- package/dist/validate-even-dimensions-with-codec.d.ts +0 -0
- package/dist/validate-even-dimensions-with-codec.js +0 -0
- package/dist/validate-every-nth-frame.d.ts +2 -1
- package/dist/validate-every-nth-frame.js +8 -1
- package/dist/validate-ffmpeg-override.d.ts +0 -0
- package/dist/validate-ffmpeg-override.js +0 -0
- package/dist/validate-number-of-gif-loops.d.ts +2 -0
- package/dist/validate-number-of-gif-loops.js +24 -0
- package/dist/validate-opengl-renderer.d.ts +1 -1
- package/dist/validate-opengl-renderer.js +0 -0
- package/dist/validate-output-filename.d.ts +7 -2
- package/dist/validate-output-filename.js +20 -51
- package/dist/validate-puppeteer-timeout.d.ts +0 -0
- package/dist/validate-puppeteer-timeout.js +1 -0
- package/dist/validate-scale.d.ts +0 -0
- package/dist/validate-scale.js +0 -0
- package/dist/validate-videobitrate.d.ts +1 -0
- package/dist/validate-videobitrate.js +20 -0
- package/dist/wait-for-symbolication-error-to-be-done.d.ts +0 -0
- package/dist/wait-for-symbolication-error-to-be-done.js +5 -31
- package/dist/ws/ws-types.d.ts +0 -0
- package/dist/ws/ws-types.js +2 -1
- package/install-toolchain.mjs +36 -0
- package/package.json +70 -60
- package/types/ws/index.d.ts +5 -5
- package/.prettierrc.js +0 -14
- package/dist/assets/dl-browser.d.ts +0 -1
- package/dist/assets/dl-browser.js +0 -38
- package/dist/assets/get-video-stream-duration.d.ts +0 -4
- package/dist/assets/get-video-stream-duration.js +0 -59
- package/dist/calculate-sar-dar-pixels.d.ts +0 -9
- package/dist/calculate-sar-dar-pixels.js +0 -19
- package/dist/convert-to-pcm.d.ts +0 -6
- package/dist/convert-to-pcm.js +0 -20
- package/dist/ensure-presentation-timestamp.d.ts +0 -2
- package/dist/ensure-presentation-timestamp.js +0 -69
- package/dist/extract-frame-from-video.d.ts +0 -16
- package/dist/extract-frame-from-video.js +0 -277
- package/dist/ffmpeg-executable.d.ts +0 -1
- package/dist/ffmpeg-flags.d.ts +0 -12
- package/dist/ffmpeg-flags.js +0 -45
- package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -1
- package/dist/frame-to-ffmpeg-timestamp.js +0 -8
- package/dist/get-audio-codec-name.d.ts +0 -2
- package/dist/get-audio-codec-name.js +0 -28
- package/dist/get-video-info.d.ts +0 -3
- package/dist/get-video-info.js +0 -49
- package/dist/is-beyond-last-frame.d.ts +0 -3
- package/dist/is-beyond-last-frame.js +0 -12
- package/dist/last-frame-from-video-cache.d.ts +0 -17
- package/dist/last-frame-from-video-cache.js +0 -55
- package/dist/legacy-webpack-config.d.ts +0 -9
- package/dist/legacy-webpack-config.js +0 -13
- package/dist/quality.d.ts +0 -1
- package/dist/quality.js +0 -21
- package/dist/validate-ffmpeg.d.ts +0 -2
- package/dist/validate-ffmpeg.js +0 -72
- package/dist/validate-frame.d.ts +0 -1
- package/dist/validate-frame.js +0 -24
- package/tsconfig.json +0 -10
- package/vitest.config.ts +0 -8
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatObjectPreview = exports.formatRemoteObject = void 0;
|
|
4
|
+
const chalk_1 = require("./chalk");
|
|
5
|
+
const formatRemoteObject = (remoteObject) => {
|
|
6
|
+
if (remoteObject.preview) {
|
|
7
|
+
return (0, exports.formatObjectPreview)(remoteObject.preview);
|
|
8
|
+
}
|
|
9
|
+
if (remoteObject.type === 'string') {
|
|
10
|
+
return chalk_1.chalk.reset(`${remoteObject.value}`);
|
|
11
|
+
}
|
|
12
|
+
if (remoteObject.type === 'number') {
|
|
13
|
+
return chalk_1.chalk.yellow(`${remoteObject.value}`);
|
|
14
|
+
}
|
|
15
|
+
if (remoteObject.type === 'bigint') {
|
|
16
|
+
return chalk_1.chalk.yellow(`${remoteObject.description}`);
|
|
17
|
+
}
|
|
18
|
+
if (remoteObject.type === 'boolean') {
|
|
19
|
+
return chalk_1.chalk.yellow(`${remoteObject.value}`);
|
|
20
|
+
}
|
|
21
|
+
if (remoteObject.type === 'function') {
|
|
22
|
+
return chalk_1.chalk.cyan(String(remoteObject.description));
|
|
23
|
+
}
|
|
24
|
+
if (remoteObject.type === 'object') {
|
|
25
|
+
if (remoteObject.subtype === 'null') {
|
|
26
|
+
return chalk_1.chalk.white(`null`);
|
|
27
|
+
}
|
|
28
|
+
return chalk_1.chalk.reset(`Object`);
|
|
29
|
+
}
|
|
30
|
+
if (remoteObject.type === 'symbol') {
|
|
31
|
+
return chalk_1.chalk.green(`${remoteObject.description}`);
|
|
32
|
+
}
|
|
33
|
+
if (remoteObject.type === 'undefined') {
|
|
34
|
+
return chalk_1.chalk.gray(`undefined`);
|
|
35
|
+
}
|
|
36
|
+
throw new Error('unhandled remote object');
|
|
37
|
+
};
|
|
38
|
+
exports.formatRemoteObject = formatRemoteObject;
|
|
39
|
+
const formatObjectPreview = (preview) => {
|
|
40
|
+
if (typeof preview === 'undefined') {
|
|
41
|
+
return '';
|
|
42
|
+
}
|
|
43
|
+
if (preview.type === 'object') {
|
|
44
|
+
if (preview.subtype === 'date') {
|
|
45
|
+
return chalk_1.chalk.reset(`Date { ${chalk_1.chalk.magenta(String(preview.description))} }`);
|
|
46
|
+
}
|
|
47
|
+
const properties = preview.properties.map((property) => {
|
|
48
|
+
return chalk_1.chalk.reset(`${property.name}: ${formatProperty(property)}`);
|
|
49
|
+
});
|
|
50
|
+
if (preview.subtype === 'array') {
|
|
51
|
+
return chalk_1.chalk.reset(`[ ${preview.properties.map((p) => formatProperty(p)).join(', ')} ]`);
|
|
52
|
+
}
|
|
53
|
+
if (preview.subtype === 'arraybuffer') {
|
|
54
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
55
|
+
}
|
|
56
|
+
if (preview.subtype === 'dataview') {
|
|
57
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
58
|
+
}
|
|
59
|
+
if (preview.subtype === 'generator') {
|
|
60
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
61
|
+
}
|
|
62
|
+
if (preview.subtype === 'iterator') {
|
|
63
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
64
|
+
}
|
|
65
|
+
if (preview.subtype === 'map') {
|
|
66
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
67
|
+
}
|
|
68
|
+
if (preview.subtype === 'node') {
|
|
69
|
+
return chalk_1.chalk.magenta(`<${preview.description}>`);
|
|
70
|
+
}
|
|
71
|
+
if (preview.subtype === 'null') {
|
|
72
|
+
return chalk_1.chalk.white(String(preview.description));
|
|
73
|
+
}
|
|
74
|
+
if (preview.subtype === 'promise') {
|
|
75
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
76
|
+
}
|
|
77
|
+
if (preview.subtype === 'proxy') {
|
|
78
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
79
|
+
}
|
|
80
|
+
if (preview.subtype === 'regexp') {
|
|
81
|
+
return chalk_1.chalk.red(String(preview.description));
|
|
82
|
+
}
|
|
83
|
+
if (preview.subtype === 'set') {
|
|
84
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
85
|
+
}
|
|
86
|
+
if (preview.subtype === 'typedarray') {
|
|
87
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
88
|
+
}
|
|
89
|
+
if (preview.subtype === 'error') {
|
|
90
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
91
|
+
}
|
|
92
|
+
if (preview.subtype === 'wasmvalue') {
|
|
93
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
94
|
+
}
|
|
95
|
+
if (preview.subtype === 'weakmap') {
|
|
96
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
97
|
+
}
|
|
98
|
+
if (preview.subtype === 'weakset') {
|
|
99
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
100
|
+
}
|
|
101
|
+
if (preview.subtype === 'webassemblymemory') {
|
|
102
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
103
|
+
}
|
|
104
|
+
if (properties.length === 0) {
|
|
105
|
+
return chalk_1.chalk.reset('{}');
|
|
106
|
+
}
|
|
107
|
+
return chalk_1.chalk.reset(`{ ${properties.join(', ')} }`);
|
|
108
|
+
}
|
|
109
|
+
return '';
|
|
110
|
+
};
|
|
111
|
+
exports.formatObjectPreview = formatObjectPreview;
|
|
112
|
+
const formatProperty = (property) => {
|
|
113
|
+
if (property.type === 'string') {
|
|
114
|
+
return chalk_1.chalk.green(`"${property.value}"`);
|
|
115
|
+
}
|
|
116
|
+
if (property.type === 'object') {
|
|
117
|
+
if (!property.subtype && property.value === 'Object') {
|
|
118
|
+
return chalk_1.chalk.reset(`{…}`);
|
|
119
|
+
}
|
|
120
|
+
if (property.subtype === 'date') {
|
|
121
|
+
return chalk_1.chalk.reset(`Date { ${chalk_1.chalk.magenta(String(property.value))} }`);
|
|
122
|
+
}
|
|
123
|
+
if (property.subtype === 'arraybuffer') {
|
|
124
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
125
|
+
}
|
|
126
|
+
if (property.subtype === 'array') {
|
|
127
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
128
|
+
}
|
|
129
|
+
if (property.subtype === 'dataview') {
|
|
130
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
131
|
+
}
|
|
132
|
+
if (property.subtype === 'error') {
|
|
133
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
134
|
+
}
|
|
135
|
+
if (property.subtype === 'generator') {
|
|
136
|
+
return chalk_1.chalk.reset(`[generator ${property.value}]`);
|
|
137
|
+
}
|
|
138
|
+
if (property.subtype === 'iterator') {
|
|
139
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
140
|
+
}
|
|
141
|
+
if (property.subtype === 'map') {
|
|
142
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
143
|
+
}
|
|
144
|
+
if (property.subtype === 'node') {
|
|
145
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
146
|
+
}
|
|
147
|
+
if (property.subtype === 'null') {
|
|
148
|
+
return chalk_1.chalk.white(`${property.value}`);
|
|
149
|
+
}
|
|
150
|
+
if (property.subtype === 'promise') {
|
|
151
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
152
|
+
}
|
|
153
|
+
if (property.subtype === 'proxy') {
|
|
154
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
155
|
+
}
|
|
156
|
+
if (property.subtype === 'regexp') {
|
|
157
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
158
|
+
}
|
|
159
|
+
if (property.subtype === 'set') {
|
|
160
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
161
|
+
}
|
|
162
|
+
if (property.subtype === 'typedarray') {
|
|
163
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
164
|
+
}
|
|
165
|
+
if (property.subtype === 'wasmvalue') {
|
|
166
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
167
|
+
}
|
|
168
|
+
if (property.subtype === 'webassemblymemory') {
|
|
169
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
170
|
+
}
|
|
171
|
+
if (property.subtype === 'weakmap') {
|
|
172
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
173
|
+
}
|
|
174
|
+
if (property.subtype === 'weakset') {
|
|
175
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
176
|
+
}
|
|
177
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
178
|
+
}
|
|
179
|
+
if (property.type === 'accessor') {
|
|
180
|
+
return chalk_1.chalk.gray(`get()`);
|
|
181
|
+
}
|
|
182
|
+
if (property.type === 'bigint') {
|
|
183
|
+
return chalk_1.chalk.yellow(`${property.value}`);
|
|
184
|
+
}
|
|
185
|
+
if (property.type === 'boolean') {
|
|
186
|
+
return chalk_1.chalk.yellow(`${property.value}`);
|
|
187
|
+
}
|
|
188
|
+
if (property.type === 'function') {
|
|
189
|
+
return chalk_1.chalk.cyan(`Function`);
|
|
190
|
+
}
|
|
191
|
+
if (property.type === 'number') {
|
|
192
|
+
return chalk_1.chalk.yellow(`${property.value}`);
|
|
193
|
+
}
|
|
194
|
+
if (property.type === 'symbol') {
|
|
195
|
+
return chalk_1.chalk.green(`${property.value}`);
|
|
196
|
+
}
|
|
197
|
+
if (property.type === 'undefined') {
|
|
198
|
+
return chalk_1.chalk.gray(`undefined`);
|
|
199
|
+
}
|
|
200
|
+
throw new Error('unexpected property type ' + JSON.stringify(property));
|
|
201
|
+
};
|
package/dist/frame-range.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type FrameRange = number | [number, number];
|
|
2
2
|
export declare const validateFrameRange: (frameRange: FrameRange | null) => void;
|
package/dist/frame-range.js
CHANGED
|
File without changes
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import type { BrowserExecutable } from './browser-executable';
|
|
2
|
-
import type {
|
|
2
|
+
import type { HeadlessBrowser } from './browser/Browser';
|
|
3
3
|
import type { Page } from './browser/BrowserPage';
|
|
4
|
+
import type { LogLevel } from './log-level';
|
|
4
5
|
import type { ChromiumOptions } from './open-browser';
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
import type { AnySourceMapConsumer } from './symbolicate-stacktrace';
|
|
7
|
+
export declare const getPageAndCleanupFn: ({ passedInInstance, browserExecutable, chromiumOptions, context, forceDeviceScaleFactor, indent, logLevel, }: {
|
|
8
|
+
passedInInstance: HeadlessBrowser | undefined;
|
|
7
9
|
browserExecutable: BrowserExecutable | null;
|
|
8
10
|
chromiumOptions: ChromiumOptions;
|
|
11
|
+
context: AnySourceMapConsumer | null;
|
|
12
|
+
indent: boolean;
|
|
13
|
+
forceDeviceScaleFactor: number | undefined;
|
|
14
|
+
logLevel: LogLevel;
|
|
9
15
|
}) => Promise<{
|
|
10
16
|
cleanup: () => void;
|
|
11
17
|
page: Page;
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getPageAndCleanupFn = void 0;
|
|
4
4
|
const browser_1 = require("./browser");
|
|
5
5
|
const open_browser_1 = require("./open-browser");
|
|
6
|
-
const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromiumOptions, }) => {
|
|
6
|
+
const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromiumOptions, context, forceDeviceScaleFactor, indent, logLevel, }) => {
|
|
7
7
|
if (passedInInstance) {
|
|
8
|
-
const page = await passedInInstance.newPage();
|
|
8
|
+
const page = await passedInInstance.newPage(context, logLevel, indent);
|
|
9
9
|
return {
|
|
10
10
|
page,
|
|
11
11
|
cleanup: () => {
|
|
@@ -17,16 +17,21 @@ const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromi
|
|
|
17
17
|
},
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
const browserInstance = await (0, open_browser_1.
|
|
20
|
+
const browserInstance = await (0, open_browser_1.internalOpenBrowser)({
|
|
21
|
+
browser: browser_1.DEFAULT_BROWSER,
|
|
21
22
|
browserExecutable,
|
|
22
23
|
chromiumOptions,
|
|
24
|
+
forceDeviceScaleFactor,
|
|
25
|
+
indent,
|
|
26
|
+
viewport: null,
|
|
27
|
+
logLevel,
|
|
23
28
|
});
|
|
24
|
-
const browserPage = await browserInstance.newPage();
|
|
29
|
+
const browserPage = await browserInstance.newPage(context, logLevel, indent);
|
|
25
30
|
return {
|
|
26
31
|
page: browserPage,
|
|
27
32
|
cleanup: () => {
|
|
28
33
|
// Close whole browser that was just created and don't wait for it to finish.
|
|
29
|
-
browserInstance.close().catch((err) => {
|
|
34
|
+
browserInstance.close(true, logLevel, indent).catch((err) => {
|
|
30
35
|
console.error('Was not able to close puppeteer page', err);
|
|
31
36
|
});
|
|
32
37
|
},
|
package/dist/get-codec-name.d.ts
CHANGED
|
File without changes
|
package/dist/get-codec-name.js
CHANGED
|
File without changes
|
|
@@ -1,25 +1,39 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { DownloadMap } from './assets/download-map';
|
|
1
|
+
import type { VideoConfig } from 'remotion';
|
|
3
2
|
import type { BrowserExecutable } from './browser-executable';
|
|
4
3
|
import type { BrowserLog } from './browser-log';
|
|
5
|
-
import type {
|
|
6
|
-
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
4
|
+
import type { HeadlessBrowser } from './browser/Browser';
|
|
7
5
|
import type { ChromiumOptions } from './open-browser';
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import type { RemotionServer } from './prepare-server';
|
|
7
|
+
import { type LogLevel } from './log-level';
|
|
8
|
+
type InternalGetCompositionsOptions = {
|
|
9
|
+
inputProps: Record<string, unknown>;
|
|
10
|
+
envVariables: Record<string, string>;
|
|
11
|
+
puppeteerInstance: HeadlessBrowser | undefined;
|
|
12
|
+
onBrowserLog: null | ((log: BrowserLog) => void);
|
|
13
|
+
browserExecutable: BrowserExecutable | null;
|
|
14
|
+
timeoutInMilliseconds: number;
|
|
15
|
+
chromiumOptions: ChromiumOptions;
|
|
16
|
+
port: number | null;
|
|
17
|
+
server: RemotionServer | undefined;
|
|
18
|
+
indent: boolean;
|
|
19
|
+
logLevel: LogLevel;
|
|
20
|
+
serveUrlOrWebpackUrl: string;
|
|
21
|
+
};
|
|
22
|
+
export type GetCompositionsOptions = {
|
|
23
|
+
inputProps?: Record<string, unknown> | null;
|
|
10
24
|
envVariables?: Record<string, string>;
|
|
11
|
-
puppeteerInstance?:
|
|
25
|
+
puppeteerInstance?: HeadlessBrowser;
|
|
12
26
|
onBrowserLog?: (log: BrowserLog) => void;
|
|
13
27
|
browserExecutable?: BrowserExecutable;
|
|
14
28
|
timeoutInMilliseconds?: number;
|
|
15
29
|
chromiumOptions?: ChromiumOptions;
|
|
16
|
-
ffmpegExecutable?: FfmpegExecutable;
|
|
17
|
-
ffprobeExecutable?: FfmpegExecutable;
|
|
18
30
|
port?: number | null;
|
|
19
|
-
|
|
20
|
-
* @deprecated Only for Remotion internal usage
|
|
21
|
-
*/
|
|
22
|
-
downloadMap?: DownloadMap;
|
|
31
|
+
logLevel?: LogLevel;
|
|
23
32
|
};
|
|
24
|
-
export declare const
|
|
33
|
+
export declare const internalGetCompositions: ({ browserExecutable, chromiumOptions, envVariables, indent, inputProps, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, }: InternalGetCompositionsOptions) => Promise<VideoConfig[]>;
|
|
34
|
+
/**
|
|
35
|
+
* @description Gets the compositions defined in a Remotion project based on a Webpack bundle.
|
|
36
|
+
* @see [Documentation](https://www.remotion.dev/docs/renderer/get-compositions)
|
|
37
|
+
*/
|
|
38
|
+
export declare const getCompositions: (serveUrlOrWebpackUrl: string, config?: GetCompositionsOptions) => Promise<VideoConfig[]>;
|
|
25
39
|
export {};
|
package/dist/get-compositions.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCompositions = void 0;
|
|
4
|
-
const
|
|
3
|
+
exports.getCompositions = exports.internalGetCompositions = void 0;
|
|
4
|
+
const TimeoutSettings_1 = require("./browser/TimeoutSettings");
|
|
5
5
|
const handle_javascript_exception_1 = require("./error-handling/handle-javascript-exception");
|
|
6
|
+
const find_closest_package_json_1 = require("./find-closest-package-json");
|
|
6
7
|
const get_browser_instance_1 = require("./get-browser-instance");
|
|
7
8
|
const prepare_server_1 = require("./prepare-server");
|
|
8
9
|
const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
10
|
+
const seek_to_frame_1 = require("./seek-to-frame");
|
|
9
11
|
const set_props_and_env_1 = require("./set-props-and-env");
|
|
10
12
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
+
const logger_1 = require("./logger");
|
|
14
|
+
const innerGetCompositions = async ({ envVariables, inputProps, onBrowserLog, page, proxyPort, serveUrl, timeoutInMilliseconds, }) => {
|
|
15
|
+
if (onBrowserLog) {
|
|
13
16
|
page.on('console', (log) => {
|
|
14
|
-
|
|
15
|
-
(_a = config.onBrowserLog) === null || _a === void 0 ? void 0 : _a.call(config, {
|
|
17
|
+
onBrowserLog({
|
|
16
18
|
stackTrace: log.stackTrace(),
|
|
17
19
|
text: log.text,
|
|
18
20
|
type: log.type,
|
|
19
21
|
});
|
|
20
22
|
});
|
|
21
23
|
}
|
|
22
|
-
(0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(
|
|
24
|
+
(0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
|
|
23
25
|
await (0, set_props_and_env_1.setPropsAndEnv)({
|
|
24
|
-
inputProps
|
|
25
|
-
envVariables
|
|
26
|
+
inputProps,
|
|
27
|
+
envVariables,
|
|
26
28
|
page,
|
|
27
29
|
serveUrl,
|
|
28
30
|
initialFrame: 0,
|
|
29
|
-
timeoutInMilliseconds
|
|
31
|
+
timeoutInMilliseconds,
|
|
30
32
|
proxyPort,
|
|
31
33
|
retriesRemaining: 2,
|
|
32
34
|
audioEnabled: false,
|
|
@@ -35,15 +37,15 @@ const innerGetCompositions = async (serveUrl, page, config, proxyPort) => {
|
|
|
35
37
|
await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
36
38
|
page,
|
|
37
39
|
pageFunction: () => {
|
|
38
|
-
window.
|
|
40
|
+
window.remotion_setBundleMode({
|
|
39
41
|
type: 'evaluation',
|
|
40
42
|
});
|
|
41
43
|
},
|
|
42
44
|
frame: null,
|
|
43
45
|
args: [],
|
|
44
46
|
});
|
|
45
|
-
await
|
|
46
|
-
const result = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
47
|
+
await (0, seek_to_frame_1.waitForReady)(page);
|
|
48
|
+
const { value: result } = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
47
49
|
pageFunction: () => {
|
|
48
50
|
return window.getStaticCompositions();
|
|
49
51
|
},
|
|
@@ -53,49 +55,81 @@ const innerGetCompositions = async (serveUrl, page, config, proxyPort) => {
|
|
|
53
55
|
});
|
|
54
56
|
return result;
|
|
55
57
|
};
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
const internalGetCompositions = async ({ browserExecutable, chromiumOptions, envVariables, indent, inputProps, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, }) => {
|
|
59
|
+
const { page, cleanup: cleanupPage } = await (0, get_browser_instance_1.getPageAndCleanupFn)({
|
|
60
|
+
passedInInstance: puppeteerInstance,
|
|
61
|
+
browserExecutable,
|
|
62
|
+
chromiumOptions,
|
|
63
|
+
context: null,
|
|
64
|
+
forceDeviceScaleFactor: undefined,
|
|
65
|
+
indent,
|
|
66
|
+
logLevel,
|
|
63
67
|
});
|
|
68
|
+
const cleanup = [cleanupPage];
|
|
64
69
|
return new Promise((resolve, reject) => {
|
|
65
|
-
var _a, _b, _c;
|
|
66
70
|
const onError = (err) => reject(err);
|
|
67
|
-
|
|
71
|
+
cleanup.push((0, handle_javascript_exception_1.handleJavascriptException)({
|
|
68
72
|
page,
|
|
69
73
|
frame: null,
|
|
70
74
|
onError,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
(0, prepare_server_1.prepareServer)({
|
|
75
|
+
}));
|
|
76
|
+
(0, prepare_server_1.makeOrReuseServer)(server, {
|
|
74
77
|
webpackConfigOrServeUrl: serveUrlOrWebpackUrl,
|
|
78
|
+
port,
|
|
79
|
+
remotionRoot: (0, find_closest_package_json_1.findRemotionRoot)(),
|
|
80
|
+
concurrency: 1,
|
|
81
|
+
logLevel,
|
|
82
|
+
indent,
|
|
83
|
+
}, {
|
|
75
84
|
onDownload: () => undefined,
|
|
76
85
|
onError,
|
|
77
|
-
ffmpegExecutable: (_a = config === null || config === void 0 ? void 0 : config.ffmpegExecutable) !== null && _a !== void 0 ? _a : null,
|
|
78
|
-
ffprobeExecutable: (_b = config === null || config === void 0 ? void 0 : config.ffprobeExecutable) !== null && _b !== void 0 ? _b : null,
|
|
79
|
-
port: (_c = config === null || config === void 0 ? void 0 : config.port) !== null && _c !== void 0 ? _c : null,
|
|
80
|
-
downloadMap,
|
|
81
86
|
})
|
|
82
|
-
.then(({ serveUrl,
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
.then(({ server: { serveUrl, offthreadPort, sourceMap }, cleanupServer }) => {
|
|
88
|
+
page.setBrowserSourceMapContext(sourceMap);
|
|
89
|
+
cleanup.push(() => cleanupServer(true));
|
|
90
|
+
return innerGetCompositions({
|
|
91
|
+
envVariables,
|
|
92
|
+
inputProps,
|
|
93
|
+
onBrowserLog,
|
|
94
|
+
page,
|
|
95
|
+
proxyPort: offthreadPort,
|
|
96
|
+
serveUrl,
|
|
97
|
+
timeoutInMilliseconds,
|
|
98
|
+
});
|
|
99
|
+
})
|
|
100
|
+
.then((comp) => {
|
|
101
|
+
return resolve(comp);
|
|
85
102
|
})
|
|
86
|
-
.then((comp) => resolve(comp))
|
|
87
103
|
.catch((err) => {
|
|
88
104
|
reject(err);
|
|
89
105
|
})
|
|
90
106
|
.finally(() => {
|
|
91
|
-
cleanup()
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
// Clean download map if it was not passed in
|
|
95
|
-
if (!(config === null || config === void 0 ? void 0 : config.downloadMap)) {
|
|
96
|
-
(0, download_map_1.cleanDownloadMap)(downloadMap);
|
|
97
|
-
}
|
|
107
|
+
cleanup.forEach((c) => {
|
|
108
|
+
c();
|
|
109
|
+
});
|
|
98
110
|
});
|
|
99
111
|
});
|
|
100
112
|
};
|
|
113
|
+
exports.internalGetCompositions = internalGetCompositions;
|
|
114
|
+
/**
|
|
115
|
+
* @description Gets the compositions defined in a Remotion project based on a Webpack bundle.
|
|
116
|
+
* @see [Documentation](https://www.remotion.dev/docs/renderer/get-compositions)
|
|
117
|
+
*/
|
|
118
|
+
const getCompositions = (serveUrlOrWebpackUrl, config) => {
|
|
119
|
+
const { browserExecutable, chromiumOptions, envVariables, inputProps, onBrowserLog, port, puppeteerInstance, timeoutInMilliseconds, logLevel, } = config !== null && config !== void 0 ? config : {};
|
|
120
|
+
return (0, exports.internalGetCompositions)({
|
|
121
|
+
browserExecutable: browserExecutable !== null && browserExecutable !== void 0 ? browserExecutable : null,
|
|
122
|
+
chromiumOptions: chromiumOptions !== null && chromiumOptions !== void 0 ? chromiumOptions : {},
|
|
123
|
+
envVariables: envVariables !== null && envVariables !== void 0 ? envVariables : {},
|
|
124
|
+
inputProps: inputProps !== null && inputProps !== void 0 ? inputProps : {},
|
|
125
|
+
indent: false,
|
|
126
|
+
onBrowserLog: onBrowserLog !== null && onBrowserLog !== void 0 ? onBrowserLog : null,
|
|
127
|
+
port: port !== null && port !== void 0 ? port : null,
|
|
128
|
+
puppeteerInstance: puppeteerInstance !== null && puppeteerInstance !== void 0 ? puppeteerInstance : undefined,
|
|
129
|
+
serveUrlOrWebpackUrl,
|
|
130
|
+
server: undefined,
|
|
131
|
+
timeoutInMilliseconds: timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT,
|
|
132
|
+
logLevel: logLevel !== null && logLevel !== void 0 ? logLevel : (0, logger_1.getLogLevel)(),
|
|
133
|
+
});
|
|
134
|
+
};
|
|
101
135
|
exports.getCompositions = getCompositions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getActualConcurrency: (userPreference: number | null) => number;
|
|
1
|
+
export declare const getActualConcurrency: (userPreference: number | string | null) => number;
|
package/dist/get-concurrency.js
CHANGED
|
@@ -4,14 +4,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getActualConcurrency = void 0;
|
|
7
|
-
const
|
|
7
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
8
8
|
const getActualConcurrency = (userPreference) => {
|
|
9
9
|
if (userPreference === null) {
|
|
10
|
-
return Math.round(Math.min(8, Math.max(1,
|
|
10
|
+
return Math.round(Math.min(8, Math.max(1, node_os_1.default.cpus().length / 2)));
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
const max = os_1.default.cpus().length;
|
|
12
|
+
const max = node_os_1.default.cpus().length;
|
|
14
13
|
const min = 1;
|
|
14
|
+
let rounded;
|
|
15
|
+
if (typeof userPreference === 'string') {
|
|
16
|
+
const percentage = parseInt(userPreference.slice(0, -1), 10);
|
|
17
|
+
rounded = Math.floor((percentage / 100) * max);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
rounded = Math.floor(userPreference);
|
|
21
|
+
}
|
|
15
22
|
if (rounded > max) {
|
|
16
23
|
throw new Error(`Maximum for --concurrency is ${max} (number of cores on this system)`);
|
|
17
24
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import type { AudioCodec } from './audio-codec';
|
|
1
2
|
import type { Codec } from './codec';
|
|
2
|
-
|
|
3
|
+
import type { FileExtension } from './file-extensions';
|
|
4
|
+
export declare const getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">(codec: T, audioCodec: AudioCodec | null) => FileExtension;
|
|
5
|
+
export declare const makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif")[]>;
|
|
6
|
+
export declare const defaultCodecsForFileExtension: Record<FileExtension, Codec>;
|
|
@@ -1,37 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFileExtensionFromCodec = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return 'mp4';
|
|
18
|
-
case 'mp3':
|
|
19
|
-
return 'mp3';
|
|
20
|
-
case 'prores':
|
|
21
|
-
return 'mov';
|
|
22
|
-
case 'vp8':
|
|
23
|
-
return 'webm';
|
|
24
|
-
case 'vp9':
|
|
25
|
-
return 'webm';
|
|
26
|
-
case 'gif':
|
|
27
|
-
if (type === 'chunk') {
|
|
28
|
-
return 'mkv';
|
|
29
|
-
}
|
|
30
|
-
return 'gif';
|
|
31
|
-
case 'wav':
|
|
32
|
-
return 'wav';
|
|
33
|
-
default:
|
|
34
|
-
throw new Error("Don't know which file extension to use for codec " + codec);
|
|
3
|
+
exports.defaultCodecsForFileExtension = exports.makeFileExtensionMap = exports.getFileExtensionFromCodec = void 0;
|
|
4
|
+
const codec_1 = require("./codec");
|
|
5
|
+
const file_extensions_1 = require("./file-extensions");
|
|
6
|
+
const getFileExtensionFromCodec = (codec, audioCodec) => {
|
|
7
|
+
if (!codec_1.validCodecs.includes(codec)) {
|
|
8
|
+
throw new Error(`Codec must be one of the following: ${codec_1.validCodecs.join(', ')}, but got ${codec}`);
|
|
9
|
+
}
|
|
10
|
+
const map = file_extensions_1.defaultFileExtensionMap[codec];
|
|
11
|
+
if (audioCodec === null) {
|
|
12
|
+
return map.default;
|
|
13
|
+
}
|
|
14
|
+
const typedAudioCodec = audioCodec;
|
|
15
|
+
if (!(typedAudioCodec in map.forAudioCodec)) {
|
|
16
|
+
throw new Error(`Audio codec ${typedAudioCodec} is not supported for codec ${codec}`);
|
|
35
17
|
}
|
|
18
|
+
return map.forAudioCodec[audioCodec]
|
|
19
|
+
.default;
|
|
36
20
|
};
|
|
37
21
|
exports.getFileExtensionFromCodec = getFileExtensionFromCodec;
|
|
22
|
+
const makeFileExtensionMap = () => {
|
|
23
|
+
const map = {};
|
|
24
|
+
Object.keys(file_extensions_1.defaultFileExtensionMap).forEach((_codec) => {
|
|
25
|
+
const codec = _codec;
|
|
26
|
+
const fileExtMap = file_extensions_1.defaultFileExtensionMap[codec];
|
|
27
|
+
const audioCodecs = Object.keys(fileExtMap.forAudioCodec);
|
|
28
|
+
const possibleExtensionsForAudioCodec = audioCodecs.map((audioCodec) => fileExtMap.forAudioCodec[audioCodec].possible);
|
|
29
|
+
const allPossibleExtensions = [
|
|
30
|
+
fileExtMap.default,
|
|
31
|
+
...possibleExtensionsForAudioCodec.flat(1),
|
|
32
|
+
];
|
|
33
|
+
for (const extension of allPossibleExtensions) {
|
|
34
|
+
if (!map[extension]) {
|
|
35
|
+
map[extension] = [];
|
|
36
|
+
}
|
|
37
|
+
if (!map[extension].includes(codec)) {
|
|
38
|
+
map[extension].push(codec);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return map;
|
|
43
|
+
};
|
|
44
|
+
exports.makeFileExtensionMap = makeFileExtensionMap;
|
|
45
|
+
exports.defaultCodecsForFileExtension = {
|
|
46
|
+
'3gp': 'aac',
|
|
47
|
+
aac: 'aac',
|
|
48
|
+
gif: 'gif',
|
|
49
|
+
hevc: 'h265',
|
|
50
|
+
m4a: 'aac',
|
|
51
|
+
m4b: 'aac',
|
|
52
|
+
mkv: 'h264-mkv',
|
|
53
|
+
mov: 'prores',
|
|
54
|
+
mp3: 'mp3',
|
|
55
|
+
mp4: 'h264',
|
|
56
|
+
mpeg: 'aac',
|
|
57
|
+
mpg: 'aac',
|
|
58
|
+
mxf: 'prores',
|
|
59
|
+
wav: 'wav',
|
|
60
|
+
webm: 'vp8',
|
|
61
|
+
};
|
|
File without changes
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.getExtensionOfFilename = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
4
8
|
const getExtensionOfFilename = (filename) => {
|
|
5
9
|
if (filename === null) {
|
|
6
10
|
return null;
|
|
7
11
|
}
|
|
8
|
-
const filenameArr = filename.split('.');
|
|
12
|
+
const filenameArr = node_path_1.default.normalize(filename).split('.');
|
|
9
13
|
const hasExtension = filenameArr.length >= 2;
|
|
10
14
|
const filenameArrLength = filenameArr.length;
|
|
11
15
|
const extension = hasExtension ? filenameArr[filenameArrLength - 1] : null;
|