@remotion/renderer 4.0.0-alpha.4 → 4.0.0-alpha10
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 +2 -1
- package/dist/assets/download-and-map-assets-to-file.js +64 -15
- package/dist/assets/download-file.d.ts +9 -6
- package/dist/assets/download-file.js +67 -9
- package/dist/assets/download-map.d.ts +5 -26
- package/dist/assets/download-map.js +15 -16
- package/dist/assets/ffmpeg-volume-expression.d.ts +2 -1
- 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 +1 -2
- package/dist/assets/get-audio-channels.js +5 -8
- package/dist/assets/get-video-stream-duration.d.ts +7 -1
- package/dist/assets/get-video-stream-duration.js +50 -14
- package/dist/assets/read-file.d.ts +1 -1
- package/dist/assets/read-file.js +4 -6
- 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 +1 -0
- 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 +8 -6
- package/dist/browser/Browser.js +48 -45
- package/dist/browser/BrowserConnector.d.ts +0 -0
- package/dist/browser/BrowserConnector.js +0 -0
- package/dist/browser/BrowserFetcher.d.ts +15 -63
- package/dist/browser/BrowserFetcher.js +151 -237
- package/dist/browser/BrowserPage.d.ts +12 -6
- package/dist/browser/BrowserPage.js +8 -11
- package/dist/browser/BrowserRunner.d.ts +2 -5
- package/dist/browser/BrowserRunner.js +42 -92
- package/dist/browser/Connection.d.ts +0 -0
- package/dist/browser/Connection.js +1 -1
- package/dist/browser/ConsoleMessage.d.ts +0 -0
- package/dist/browser/ConsoleMessage.js +0 -0
- package/dist/browser/DOMWorld.d.ts +5 -4
- package/dist/browser/DOMWorld.js +8 -1
- package/dist/browser/Errors.d.ts +0 -0
- package/dist/browser/Errors.js +0 -0
- package/dist/browser/EvalTypes.d.ts +0 -0
- 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 +0 -0
- package/dist/browser/FrameManager.d.ts +0 -2
- package/dist/browser/FrameManager.js +2 -6
- 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 +0 -0
- package/dist/browser/LaunchOptions.d.ts +1 -5
- package/dist/browser/LaunchOptions.js +0 -0
- package/dist/browser/Launcher.d.ts +9 -3
- package/dist/browser/Launcher.js +17 -387
- package/dist/browser/LifecycleWatcher.d.ts +0 -0
- package/dist/browser/LifecycleWatcher.js +0 -0
- package/dist/browser/NetworkEventManager.d.ts +0 -0
- package/dist/browser/NetworkEventManager.js +0 -0
- package/dist/browser/NetworkManager.d.ts +0 -0
- package/dist/browser/NetworkManager.js +0 -0
- package/dist/browser/NodeWebSocketTransport.d.ts +0 -0
- package/dist/browser/NodeWebSocketTransport.js +5 -5
- package/dist/browser/Product.d.ts +0 -0
- package/dist/browser/Product.js +0 -0
- package/dist/browser/PuppeteerNode.d.ts +2 -5
- package/dist/browser/PuppeteerNode.js +2 -14
- 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 +2 -2
- package/dist/browser/Target.js +0 -0
- 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 -90
- package/dist/browser/devtools-commands.d.ts +5 -1
- package/dist/browser/devtools-commands.js +0 -0
- package/dist/browser/devtools-types.d.ts +82 -0
- 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 +0 -0
- 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 +0 -1
- package/dist/browser/revisions.js +0 -1
- package/dist/browser/util.d.ts +2 -2
- package/dist/browser/util.js +0 -0
- package/dist/browser-executable.d.ts +0 -0
- package/dist/browser-executable.js +0 -0
- package/dist/browser-log.d.ts +0 -0
- package/dist/browser-log.js +0 -0
- package/dist/browser.d.ts +0 -0
- 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/calculate-sar-dar-pixels.d.ts +0 -0
- package/dist/calculate-sar-dar-pixels.js +0 -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 +54 -0
- package/dist/chalk/index.js +135 -0
- package/dist/chalk/is-color-supported.d.ts +1 -0
- package/dist/chalk/is-color-supported.js +37 -0
- package/dist/check-apple-silicon.d.ts +1 -0
- package/dist/check-apple-silicon.js +12 -0
- 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 +2 -0
- package/dist/codec-supports-media.js +23 -1
- package/dist/codec.d.ts +0 -0
- package/dist/codec.js +0 -0
- package/dist/combine-videos.d.ts +6 -2
- package/dist/combine-videos.js +18 -18
- package/dist/compositor/compose.d.ts +17 -0
- package/dist/compositor/compose.js +71 -0
- package/dist/compositor/compositor.d.ts +11 -0
- package/dist/compositor/compositor.js +207 -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/compositor/payloads.js +2 -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 +4 -0
- package/dist/convert-to-positive-frame-index.js +8 -0
- package/dist/create-ffmpeg-complex-filter.d.ts +6 -5
- 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 +21 -13
- package/dist/create-silent-audio.d.ts +1 -3
- package/dist/create-silent-audio.js +3 -6
- package/dist/crf.d.ts +5 -1
- package/dist/crf.js +41 -8
- package/dist/cycle-browser-tabs.d.ts +2 -5
- package/dist/cycle-browser-tabs.js +5 -5
- 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/determine-resize-params.d.ts +1 -0
- package/dist/determine-resize-params.js +10 -0
- package/dist/determine-vcodec-ffmpeg-flags.d.ts +2 -0
- package/dist/determine-vcodec-ffmpeg-flags.js +13 -0
- package/dist/does-have-m2-bug.d.ts +3 -0
- package/dist/does-have-m2-bug.js +12 -0
- package/dist/ensure-ffmpeg.d.ts +18 -0
- package/dist/ensure-ffmpeg.js +58 -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/ensure-presentation-timestamp.d.ts +14 -1
- package/dist/ensure-presentation-timestamp.js +36 -17
- 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 +2 -1
- package/dist/error-handling/symbolicateable-error.d.ts +0 -0
- package/dist/error-handling/symbolicateable-error.js +0 -0
- package/dist/extract-frame-from-video.d.ts +1 -0
- package/dist/extract-frame-from-video.js +47 -110
- package/dist/ffmpeg-executable.d.ts +0 -0
- package/dist/ffmpeg-executable.js +0 -0
- package/dist/ffmpeg-filter-file.d.ts +6 -1
- package/dist/ffmpeg-filter-file.js +40 -8
- package/dist/ffmpeg-flags.d.ts +20 -2
- package/dist/ffmpeg-flags.js +205 -9
- package/dist/ffmpeg-override.d.ts +4 -0
- package/dist/ffmpeg-override.js +2 -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/frame-range.d.ts +0 -0
- package/dist/frame-range.js +0 -0
- package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -0
- package/dist/frame-to-ffmpeg-timestamp.js +0 -0
- package/dist/get-browser-instance.d.ts +2 -2
- package/dist/get-browser-instance.js +1 -1
- package/dist/get-can-extract-frames-fast.d.ts +14 -0
- package/dist/get-can-extract-frames-fast.js +71 -0
- package/dist/get-codec-name.d.ts +0 -0
- package/dist/get-codec-name.js +0 -0
- package/dist/get-compositions.d.ts +14 -8
- package/dist/get-compositions.js +25 -7
- 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-of-video-slow.d.ts +17 -0
- package/dist/get-frame-of-video-slow.js +72 -0
- package/dist/get-frame-padded-index.d.ts +2 -1
- 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 -17
- 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-info.d.ts +6 -1
- package/dist/get-video-info.js +19 -9
- 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 +5 -8
- package/dist/image-format.d.ts +12 -6
- package/dist/image-format.js +19 -13
- package/dist/index.d.ts +284 -51
- package/dist/index.js +50 -36
- package/dist/is-audio-codec.d.ts +0 -0
- package/dist/is-audio-codec.js +0 -0
- package/dist/is-beyond-last-frame.d.ts +0 -0
- package/dist/is-beyond-last-frame.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 +1 -0
- package/dist/jpeg-quality.js +21 -0
- package/dist/last-frame-from-video-cache.d.ts +1 -0
- package/dist/last-frame-from-video-cache.js +0 -0
- package/dist/legacy-webpack-config.d.ts +0 -0
- package/dist/legacy-webpack-config.js +0 -0
- package/dist/locks.d.ts +7 -0
- package/dist/locks.js +44 -0
- package/dist/log-level.d.ts +0 -0
- package/dist/log-level.js +0 -0
- package/dist/logger.d.ts +22 -0
- package/dist/logger.js +61 -0
- package/dist/make-cancel-signal.d.ts +11 -0
- package/dist/make-cancel-signal.js +24 -1
- package/dist/merge-audio-track.d.ts +3 -3
- package/dist/merge-audio-track.js +40 -34
- package/dist/mime-db.d.ts +0 -0
- package/dist/mime-db.js +0 -0
- package/dist/mime-types.d.ts +1 -0
- package/dist/mime-types.js +8 -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 +12 -8
- package/dist/offthread-video-server.js +67 -47
- package/dist/open-browser.d.ts +8 -2
- package/dist/open-browser.js +16 -18
- 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 +0 -0
- 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 +1 -1
- package/dist/perf.js +9 -7
- package/dist/pixel-format.d.ts +1 -1
- 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 +8 -5
- package/dist/prepare-server.js +22 -13
- package/dist/preprocess-audio-track.d.ts +6 -4
- package/dist/preprocess-audio-track.js +7 -8
- package/dist/prespawn-ffmpeg.d.ts +10 -9
- package/dist/prespawn-ffmpeg.js +51 -28
- package/dist/prestitcher-memory-usage.d.ts +0 -4
- package/dist/prestitcher-memory-usage.js +4 -5
- package/dist/prores-profile.d.ts +5 -3
- 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 +0 -0
- package/dist/puppeteer-evaluate.js +20 -12
- package/dist/puppeteer-screenshot.d.ts +12 -2
- package/dist/puppeteer-screenshot.js +19 -45
- package/dist/quality.d.ts +0 -0
- package/dist/quality.js +0 -0
- package/dist/redirect-status-codes.d.ts +1 -0
- package/dist/redirect-status-codes.js +6 -0
- package/dist/render-frames.d.ts +26 -22
- package/dist/render-frames.js +204 -109
- package/dist/render-media.d.ts +52 -19
- package/dist/render-media.js +162 -55
- package/dist/render-still.d.ts +26 -14
- package/dist/render-still.js +97 -46
- package/dist/replace-browser.d.ts +6 -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 +12 -2
- package/dist/screenshot-task.js +44 -14
- package/dist/seek-to-frame.d.ts +1 -0
- package/dist/seek-to-frame.js +49 -3
- package/dist/select-composition.d.ts +33 -0
- package/dist/select-composition.js +119 -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 +6 -3
- package/dist/serve-static.js +86 -45
- package/dist/set-props-and-env.d.ts +7 -3
- package/dist/set-props-and-env.js +50 -16
- package/dist/stitch-frames-to-video.d.ts +16 -11
- package/dist/stitch-frames-to-video.js +165 -79
- package/dist/stringify-ffmpeg-filter.d.ts +10 -2
- package/dist/stringify-ffmpeg-filter.js +37 -34
- package/dist/symbolicate-stacktrace.d.ts +0 -0
- package/dist/symbolicate-stacktrace.js +0 -0
- 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 +0 -0
- package/dist/truthy.js +0 -0
- package/dist/try-to-extract-frame-of-video-fast.d.ts +12 -0
- package/dist/try-to-extract-frame-of-video-fast.js +55 -0
- package/dist/types.d.ts +0 -0
- 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 +2 -0
- package/dist/validate-ffmpeg-override.js +12 -0
- package/dist/validate-ffmpeg.d.ts +7 -2
- package/dist/validate-ffmpeg.js +48 -43
- 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 +0 -0
- 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 +2 -1
- 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/warn-about-ffmpeg-version.d.ts +5 -0
- package/dist/warn-about-ffmpeg-version.js +37 -0
- 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/add-silent-audio-if-necessary.d.ts +0 -8
- package/dist/add-silent-audio-if-necessary.d.ts.map +0 -1
- package/dist/add-silent-audio-if-necessary.js +0 -51
- package/dist/add-silent-audio-if-necessary.js.map +0 -1
- package/dist/assets/asset-is-used-at-time.d.ts +0 -3
- package/dist/assets/asset-is-used-at-time.d.ts.map +0 -1
- package/dist/assets/asset-is-used-at-time.js +0 -8
- package/dist/assets/asset-is-used-at-time.js.map +0 -1
- package/dist/assets/calculate-asset-positions.d.ts.map +0 -1
- package/dist/assets/calculate-asset-positions.js.map +0 -1
- package/dist/assets/calculate-atempo.d.ts.map +0 -1
- package/dist/assets/calculate-atempo.js.map +0 -1
- package/dist/assets/convert-assets-to-file-urls.d.ts.map +0 -1
- package/dist/assets/convert-assets-to-file-urls.js.map +0 -1
- package/dist/assets/download-and-map-assets-to-file.d.ts.map +0 -1
- package/dist/assets/download-and-map-assets-to-file.js.map +0 -1
- package/dist/assets/download-file.d.ts.map +0 -1
- package/dist/assets/download-file.js.map +0 -1
- package/dist/assets/ffmpeg-volume-expression.d.ts.map +0 -1
- package/dist/assets/ffmpeg-volume-expression.js.map +0 -1
- package/dist/assets/flatten-volume-array.d.ts.map +0 -1
- package/dist/assets/flatten-volume-array.js.map +0 -1
- package/dist/assets/get-asset-audio-details.d.ts +0 -5
- package/dist/assets/get-asset-audio-details.d.ts.map +0 -1
- package/dist/assets/get-asset-audio-details.js +0 -21
- package/dist/assets/get-asset-audio-details.js.map +0 -1
- package/dist/assets/get-audio-channels.d.ts.map +0 -1
- package/dist/assets/get-audio-channels.js.map +0 -1
- package/dist/assets/get-simulatenous-assets.d.ts +0 -3
- package/dist/assets/get-simulatenous-assets.d.ts.map +0 -1
- package/dist/assets/get-simulatenous-assets.js +0 -14
- package/dist/assets/get-simulatenous-assets.js.map +0 -1
- package/dist/assets/read-file.d.ts.map +0 -1
- package/dist/assets/read-file.js.map +0 -1
- package/dist/assets/round-volume-to-avoid-stack-overflow.d.ts.map +0 -1
- package/dist/assets/round-volume-to-avoid-stack-overflow.js.map +0 -1
- package/dist/assets/sanitize-filename.d.ts.map +0 -1
- package/dist/assets/sanitize-filename.js.map +0 -1
- package/dist/assets/sanitize-filepath.d.ts.map +0 -1
- package/dist/assets/sanitize-filepath.js.map +0 -1
- package/dist/assets/split-assets-into-segments.d.ts +0 -6
- package/dist/assets/split-assets-into-segments.d.ts.map +0 -1
- package/dist/assets/split-assets-into-segments.js +0 -89
- package/dist/assets/split-assets-into-segments.js.map +0 -1
- package/dist/assets/truncate-utf8-bytes.d.ts.map +0 -1
- package/dist/assets/truncate-utf8-bytes.js.map +0 -1
- package/dist/assets/types.d.ts.map +0 -1
- package/dist/assets/types.js.map +0 -1
- package/dist/assets-to-ffmpeg-inputs.d.ts +0 -7
- package/dist/assets-to-ffmpeg-inputs.d.ts.map +0 -1
- package/dist/assets-to-ffmpeg-inputs.js +0 -15
- package/dist/assets-to-ffmpeg-inputs.js.map +0 -1
- package/dist/browser-log.d.ts.map +0 -1
- package/dist/browser-log.js.map +0 -1
- package/dist/calculate-ffmpeg-filters.d.ts.map +0 -1
- package/dist/calculate-ffmpeg-filters.js.map +0 -1
- package/dist/can-use-parallel-encoding.d.ts.map +0 -1
- package/dist/can-use-parallel-encoding.js.map +0 -1
- package/dist/combine-videos.d.ts.map +0 -1
- package/dist/combine-videos.js.map +0 -1
- package/dist/convert-to-pcm.d.ts +0 -6
- package/dist/convert-to-pcm.js +0 -20
- package/dist/create-ffmpeg-complex-filter.d.ts.map +0 -1
- package/dist/create-ffmpeg-complex-filter.js.map +0 -1
- package/dist/cycle-browser-tabs.d.ts.map +0 -1
- package/dist/cycle-browser-tabs.js.map +0 -1
- package/dist/delay-render-embedded-stack.d.ts.map +0 -1
- package/dist/delay-render-embedded-stack.js.map +0 -1
- package/dist/delete-directory.d.ts.map +0 -1
- package/dist/delete-directory.js.map +0 -1
- package/dist/ensure-frames-in-order.d.ts.map +0 -1
- package/dist/ensure-frames-in-order.js.map +0 -1
- package/dist/ensure-output-directory.d.ts.map +0 -1
- package/dist/ensure-output-directory.js.map +0 -1
- package/dist/error-handling/handle-javascript-exception.d.ts.map +0 -1
- package/dist/error-handling/handle-javascript-exception.js.map +0 -1
- package/dist/error-handling/symbolicate-error.d.ts.map +0 -1
- package/dist/error-handling/symbolicate-error.js.map +0 -1
- package/dist/error-handling/symbolicateable-error.d.ts.map +0 -1
- package/dist/error-handling/symbolicateable-error.js.map +0 -1
- package/dist/ffmpeg-flags.d.ts.map +0 -1
- package/dist/ffmpeg-flags.js.map +0 -1
- package/dist/get-audio-codec-name.d.ts +0 -2
- package/dist/get-audio-codec-name.d.ts.map +0 -1
- package/dist/get-audio-codec-name.js +0 -28
- package/dist/get-audio-codec-name.js.map +0 -1
- package/dist/get-browser-instance.d.ts.map +0 -1
- package/dist/get-browser-instance.js.map +0 -1
- package/dist/get-codec-name.d.ts.map +0 -1
- package/dist/get-codec-name.js.map +0 -1
- package/dist/get-compositions.d.ts.map +0 -1
- package/dist/get-compositions.js.map +0 -1
- package/dist/get-concurrency.d.ts.map +0 -1
- package/dist/get-concurrency.js.map +0 -1
- package/dist/get-extension-from-codec.d.ts.map +0 -1
- package/dist/get-extension-from-codec.js.map +0 -1
- package/dist/get-frame-to-render.d.ts.map +0 -1
- package/dist/get-frame-to-render.js.map +0 -1
- package/dist/get-local-browser-executable.d.ts.map +0 -1
- package/dist/get-local-browser-executable.js.map +0 -1
- package/dist/get-port.d.ts.map +0 -1
- package/dist/get-port.js.map +0 -1
- package/dist/get-prores-profile-name.d.ts.map +0 -1
- package/dist/get-prores-profile-name.js.map +0 -1
- package/dist/image-format.d.ts.map +0 -1
- package/dist/image-format.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/is-serve-url.d.ts.map +0 -1
- package/dist/is-serve-url.js.map +0 -1
- package/dist/legacy-webpack-config.d.ts.map +0 -1
- package/dist/legacy-webpack-config.js.map +0 -1
- package/dist/make-assets-download-dir.d.ts +0 -1
- package/dist/make-assets-download-dir.d.ts.map +0 -1
- package/dist/make-assets-download-dir.js +0 -13
- package/dist/make-assets-download-dir.js.map +0 -1
- package/dist/normalize-serve-url.d.ts.map +0 -1
- package/dist/normalize-serve-url.js.map +0 -1
- package/dist/open-browser.d.ts.map +0 -1
- package/dist/open-browser.js.map +0 -1
- package/dist/parse-browser-error-stack.d.ts.map +0 -1
- package/dist/parse-browser-error-stack.js.map +0 -1
- package/dist/parse-ffmpeg-progress.d.ts.map +0 -1
- package/dist/parse-ffmpeg-progress.js.map +0 -1
- package/dist/pool.d.ts.map +0 -1
- package/dist/pool.js.map +0 -1
- package/dist/prepare-server.d.ts.map +0 -1
- package/dist/prepare-server.js.map +0 -1
- package/dist/provide-screenshot.d.ts.map +0 -1
- package/dist/provide-screenshot.js.map +0 -1
- package/dist/puppeteer-evaluate.d.ts.map +0 -1
- package/dist/puppeteer-evaluate.js.map +0 -1
- package/dist/puppeteer-screenshot.d.ts.map +0 -1
- package/dist/puppeteer-screenshot.js.map +0 -1
- package/dist/render-media.d.ts.map +0 -1
- package/dist/render-media.js.map +0 -1
- package/dist/render-still.d.ts.map +0 -1
- package/dist/render-still.js.map +0 -1
- package/dist/render.d.ts +0 -45
- package/dist/render.d.ts.map +0 -1
- package/dist/render.js +0 -245
- package/dist/render.js.map +0 -1
- package/dist/resolve-asset-src.d.ts.map +0 -1
- package/dist/resolve-asset-src.js.map +0 -1
- package/dist/sample-rate.d.ts.map +0 -1
- package/dist/sample-rate.js.map +0 -1
- package/dist/screenshot-dom-element.d.ts.map +0 -1
- package/dist/screenshot-dom-element.js.map +0 -1
- package/dist/screenshot-task.d.ts.map +0 -1
- package/dist/screenshot-task.js.map +0 -1
- package/dist/seek-to-frame.d.ts.map +0 -1
- package/dist/seek-to-frame.js.map +0 -1
- package/dist/serve-static.d.ts.map +0 -1
- package/dist/serve-static.js.map +0 -1
- package/dist/set-props-and-env.d.ts.map +0 -1
- package/dist/set-props-and-env.js.map +0 -1
- package/dist/stitcher.d.ts +0 -32
- package/dist/stitcher.d.ts.map +0 -1
- package/dist/stitcher.js +0 -204
- package/dist/stitcher.js.map +0 -1
- package/dist/stringify-ffmpeg-filter.d.ts.map +0 -1
- package/dist/stringify-ffmpeg-filter.js.map +0 -1
- package/dist/symbolicate-stacktrace.d.ts.map +0 -1
- package/dist/symbolicate-stacktrace.js.map +0 -1
- package/dist/tmp-dir.d.ts.map +0 -1
- package/dist/tmp-dir.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/validate-even-dimensions-with-codec.d.ts.map +0 -1
- package/dist/validate-even-dimensions-with-codec.js.map +0 -1
- package/dist/validate-ffmpeg.d.ts.map +0 -1
- package/dist/validate-ffmpeg.js.map +0 -1
- package/dist/validate-frame.d.ts +0 -1
- package/dist/validate-frame.js +0 -24
- package/dist/validate-puppeteer-timeout.d.ts.map +0 -1
- package/dist/validate-puppeteer-timeout.js.map +0 -1
- package/dist/validate-scale.d.ts.map +0 -1
- package/dist/validate-scale.js.map +0 -1
- package/tsconfig.json +0 -10
- package/vitest.config.ts +0 -8
package/dist/crf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.validateQualitySettings = exports.getValidCrfRanges = exports.getDefaultCrfForCodec = void 0;
|
|
4
4
|
const is_audio_codec_1 = require("./is-audio-codec");
|
|
5
5
|
const getDefaultCrfForCodec = (codec) => {
|
|
6
6
|
if ((0, is_audio_codec_1.isAudioCodec)(codec)) {
|
|
@@ -9,7 +9,7 @@ const getDefaultCrfForCodec = (codec) => {
|
|
|
9
9
|
if (codec === 'h264' || codec === 'h264-mkv') {
|
|
10
10
|
return 18; // FFMPEG default 23
|
|
11
11
|
}
|
|
12
|
-
if (codec === 'h265'
|
|
12
|
+
if (codec === 'h265') {
|
|
13
13
|
return 23; // FFMPEG default 28
|
|
14
14
|
}
|
|
15
15
|
if (codec === 'vp8') {
|
|
@@ -21,6 +21,9 @@ const getDefaultCrfForCodec = (codec) => {
|
|
|
21
21
|
if (codec === 'prores') {
|
|
22
22
|
return 0;
|
|
23
23
|
}
|
|
24
|
+
if (codec === 'gif') {
|
|
25
|
+
return 0;
|
|
26
|
+
}
|
|
24
27
|
throw new TypeError(`Got unexpected codec "${codec}"`);
|
|
25
28
|
};
|
|
26
29
|
exports.getDefaultCrfForCodec = getDefaultCrfForCodec;
|
|
@@ -31,10 +34,13 @@ const getValidCrfRanges = (codec) => {
|
|
|
31
34
|
if (codec === 'prores') {
|
|
32
35
|
return [0, 0];
|
|
33
36
|
}
|
|
37
|
+
if (codec === 'gif') {
|
|
38
|
+
return [0, 0];
|
|
39
|
+
}
|
|
34
40
|
if (codec === 'h264' || codec === 'h264-mkv') {
|
|
35
41
|
return [1, 51];
|
|
36
42
|
}
|
|
37
|
-
if (codec === 'h265'
|
|
43
|
+
if (codec === 'h265') {
|
|
38
44
|
return [0, 51];
|
|
39
45
|
}
|
|
40
46
|
if (codec === 'vp8') {
|
|
@@ -46,19 +52,46 @@ const getValidCrfRanges = (codec) => {
|
|
|
46
52
|
throw new TypeError(`Got unexpected codec "${codec}"`);
|
|
47
53
|
};
|
|
48
54
|
exports.getValidCrfRanges = getValidCrfRanges;
|
|
49
|
-
const
|
|
50
|
-
if (crf
|
|
51
|
-
|
|
55
|
+
const validateQualitySettings = ({ codec, crf, videoBitrate, }) => {
|
|
56
|
+
if (crf && videoBitrate) {
|
|
57
|
+
throw new Error('"crf" and "videoBitrate" can not both be set. Choose one of either.');
|
|
58
|
+
}
|
|
59
|
+
if (videoBitrate) {
|
|
60
|
+
if (codec === 'prores') {
|
|
61
|
+
console.warn('ProRes does not support videoBitrate. Ignoring.');
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
if ((0, is_audio_codec_1.isAudioCodec)(codec)) {
|
|
65
|
+
console.warn(`${codec} does not support videoBitrate. Ignoring.`);
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
return ['-b:v', videoBitrate];
|
|
69
|
+
}
|
|
70
|
+
if (crf === null || typeof crf === 'undefined') {
|
|
71
|
+
const actualCrf = (0, exports.getDefaultCrfForCodec)(codec);
|
|
72
|
+
return ['-crf', String(actualCrf)];
|
|
52
73
|
}
|
|
53
74
|
if (typeof crf !== 'number') {
|
|
54
75
|
throw new TypeError('Expected CRF to be a number, but is ' + JSON.stringify(crf));
|
|
55
76
|
}
|
|
56
77
|
const range = (0, exports.getValidCrfRanges)(codec);
|
|
57
78
|
if (crf === 0 && (codec === 'h264' || codec === 'h264-mkv')) {
|
|
58
|
-
throw new TypeError("Setting the CRF to 0 with a H264 codec is not supported anymore because of it's inconsistencies between platforms. Videos with CRF 0 cannot be played on iOS/macOS. 0 is a extreme value with inefficient settings which you probably want. Set CRF to a higher value to fix this error.");
|
|
79
|
+
throw new TypeError("Setting the CRF to 0 with a H264 codec is not supported anymore because of it's inconsistencies between platforms. Videos with CRF 0 cannot be played on iOS/macOS. 0 is a extreme value with inefficient settings which you probably do not want. Set CRF to a higher value to fix this error.");
|
|
59
80
|
}
|
|
60
81
|
if (crf < range[0] || crf > range[1]) {
|
|
82
|
+
if (range[0] === 0 && range[1] === 0) {
|
|
83
|
+
throw new TypeError(`The "${codec}" codec does not support the --crf option.`);
|
|
84
|
+
}
|
|
61
85
|
throw new TypeError(`CRF must be between ${range[0]} and ${range[1]} for codec ${codec}. Passed: ${crf}`);
|
|
62
86
|
}
|
|
87
|
+
if (codec === 'prores') {
|
|
88
|
+
console.warn('ProRes does not support the "crf" option. Ignoring.');
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
if ((0, is_audio_codec_1.isAudioCodec)(codec)) {
|
|
92
|
+
console.warn(`${codec} does not support the "crf" option. Ignoring.`);
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
return ['-crf', String(crf)];
|
|
63
96
|
};
|
|
64
|
-
exports.
|
|
97
|
+
exports.validateQualitySettings = validateQualitySettings;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare
|
|
3
|
-
declare type Browser = Await<ReturnType<typeof openBrowser>>;
|
|
4
|
-
export declare const cycleBrowserTabs: (puppeteerInstance: Browser, concurrency: number) => {
|
|
1
|
+
import type { BrowserReplacer } from './replace-browser';
|
|
2
|
+
export declare const cycleBrowserTabs: (puppeteerInstance: BrowserReplacer, concurrency: number) => {
|
|
5
3
|
stopCycling: () => void;
|
|
6
4
|
};
|
|
7
|
-
export {};
|
|
@@ -13,24 +13,24 @@ const cycleBrowserTabs = (puppeteerInstance, concurrency) => {
|
|
|
13
13
|
const set = () => {
|
|
14
14
|
interval = setTimeout(() => {
|
|
15
15
|
puppeteerInstance
|
|
16
|
+
.getBrowser()
|
|
16
17
|
.pages()
|
|
17
18
|
.then((pages) => {
|
|
18
|
-
var _a;
|
|
19
19
|
if (pages.length === 0) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
const currentPage = pages[i % pages.length];
|
|
23
23
|
i++;
|
|
24
|
-
if (!(
|
|
24
|
+
if (!(currentPage === null || currentPage === void 0 ? void 0 : currentPage.closed) &&
|
|
25
25
|
!stopped &&
|
|
26
26
|
(currentPage === null || currentPage === void 0 ? void 0 : currentPage.url()) !== 'about:blank') {
|
|
27
27
|
return currentPage.bringToFront();
|
|
28
28
|
}
|
|
29
29
|
})
|
|
30
|
-
.
|
|
30
|
+
.catch((err) => console.log(err))
|
|
31
|
+
.finally(() => {
|
|
31
32
|
set();
|
|
32
|
-
})
|
|
33
|
-
.catch((err) => console.log(err));
|
|
33
|
+
});
|
|
34
34
|
}, 200);
|
|
35
35
|
};
|
|
36
36
|
set();
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const deleteDirectory: (directory: string) =>
|
|
1
|
+
export declare const deleteDirectory: (directory: string) => void;
|
package/dist/delete-directory.js
CHANGED
|
@@ -1,32 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.deleteDirectory = void 0;
|
|
7
|
-
const
|
|
8
|
-
const fs_1 = __importDefault(require("fs"));
|
|
27
|
+
const node_fs_1 = __importStar(require("node:fs"));
|
|
9
28
|
const is_serve_url_1 = require("./is-serve-url");
|
|
10
|
-
const deleteDirectory =
|
|
11
|
-
var _a;
|
|
29
|
+
const deleteDirectory = (directory) => {
|
|
12
30
|
if ((0, is_serve_url_1.isServeUrl)(directory)) {
|
|
13
31
|
return;
|
|
14
32
|
}
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
33
|
+
if (!(0, node_fs_1.existsSync)(directory)) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// Working around a bug with NodeJS 16 on Windows:
|
|
37
|
+
// If a subdirectory is already deleted, it will fail with EPERM
|
|
38
|
+
// even with force: true and recursive and maxRetries set higher.
|
|
39
|
+
// This is even with the fixWinEPERMSync function being called by Node.JS.
|
|
40
|
+
// This is a workaround for this issue.
|
|
41
|
+
let retries = 2;
|
|
42
|
+
while (retries >= 0) {
|
|
19
43
|
try {
|
|
20
|
-
|
|
44
|
+
node_fs_1.default.rmSync(directory, {
|
|
45
|
+
maxRetries: 2,
|
|
46
|
+
recursive: true,
|
|
47
|
+
force: true,
|
|
48
|
+
retryDelay: 100,
|
|
49
|
+
});
|
|
21
50
|
}
|
|
22
51
|
catch (err) {
|
|
23
|
-
|
|
52
|
+
retries--;
|
|
53
|
+
continue;
|
|
24
54
|
}
|
|
25
|
-
|
|
26
|
-
else {
|
|
27
|
-
await ((_a = fs_1.default.promises.rm) !== null && _a !== void 0 ? _a : fs_1.default.promises.rmdir)(directory, {
|
|
28
|
-
recursive: true,
|
|
29
|
-
});
|
|
55
|
+
break;
|
|
30
56
|
}
|
|
31
57
|
};
|
|
32
58
|
exports.deleteDirectory = deleteDirectory;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const determineResizeParams: (needsResize: [number, number] | null) => string[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.determineResizeParams = void 0;
|
|
4
|
+
const determineResizeParams = (needsResize) => {
|
|
5
|
+
if (needsResize === null) {
|
|
6
|
+
return [];
|
|
7
|
+
}
|
|
8
|
+
return ['-s', `${needsResize[0]}x${needsResize[1]}`];
|
|
9
|
+
};
|
|
10
|
+
exports.determineResizeParams = determineResizeParams;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.determineVcodecFfmpegFlags = void 0;
|
|
4
|
+
const truthy_1 = require("./truthy");
|
|
5
|
+
const determineVcodecFfmpegFlags = (vcodecFlag) => {
|
|
6
|
+
return [
|
|
7
|
+
vcodecFlag === 'vp9' ? '-vcodec' : null,
|
|
8
|
+
vcodecFlag === 'vp9' ? 'libvpx-vp9' : null,
|
|
9
|
+
vcodecFlag === 'vp8' ? '-vcodec' : null,
|
|
10
|
+
vcodecFlag === 'vp8' ? 'libvpx' : null,
|
|
11
|
+
].filter(truthy_1.truthy);
|
|
12
|
+
};
|
|
13
|
+
exports.determineVcodecFfmpegFlags = determineVcodecFfmpegFlags;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.warnAboutM2Bug = void 0;
|
|
4
|
+
const node_os_1 = require("node:os");
|
|
5
|
+
const warnAboutM2Bug = (codec, pixelFormat) => {
|
|
6
|
+
const isM2 = (0, node_os_1.cpus)().find((c) => c.model.includes('Apple M2'));
|
|
7
|
+
if (codec === 'prores' && pixelFormat === 'yuv422p10le' && isM2) {
|
|
8
|
+
console.warn();
|
|
9
|
+
console.warn('⚠️ Known issue: Apple M2 CPUs currently suffer from a bug where transparent ProRes videos have flickering. https://github.com/remotion-dev/remotion/issues/1929');
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
exports.warnAboutM2Bug = warnAboutM2Bug;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare type EnsureFfmpegOptions = {
|
|
2
|
+
remotionRoot?: string;
|
|
3
|
+
};
|
|
4
|
+
declare type Result = {
|
|
5
|
+
result: 'found-in-path' | 'found-in-node-modules' | 'installed';
|
|
6
|
+
wasAlreadyInstalled: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* @description Checks if the ffmpeg binary is installed and if it is not, downloads it and puts it into your node_modules folder.
|
|
10
|
+
* @see [Documentation](https://www.remotion.dev/docs/renderer/ensure-ffmpeg)
|
|
11
|
+
*/
|
|
12
|
+
export declare const ensureFfmpeg: (options?: EnsureFfmpegOptions) => Promise<Result>;
|
|
13
|
+
/**
|
|
14
|
+
* @description Checks if the ffprobe binary is installed and if it is not, downloads it and puts it into your node_modules folder.
|
|
15
|
+
* @see [Documentation](https://www.remotion.dev/docs/renderer/ensure-ffprobe)
|
|
16
|
+
*/
|
|
17
|
+
export declare const ensureFfprobe: (options?: EnsureFfmpegOptions) => Promise<Result>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ensureFfprobe = exports.ensureFfmpeg = void 0;
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const os_1 = __importDefault(require("os"));
|
|
9
|
+
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
10
|
+
const validate_ffmpeg_1 = require("./validate-ffmpeg");
|
|
11
|
+
const ensureFfmpegOrFfprobe = async (binary, options) => {
|
|
12
|
+
var _a;
|
|
13
|
+
const exists = (0, validate_ffmpeg_1.binaryExists)(binary);
|
|
14
|
+
const remotionRoot = (_a = options === null || options === void 0 ? void 0 : options.remotionRoot) !== null && _a !== void 0 ? _a : process.cwd();
|
|
15
|
+
if (exists) {
|
|
16
|
+
return {
|
|
17
|
+
wasAlreadyInstalled: true,
|
|
18
|
+
result: 'found-in-path',
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
if (process.platform === 'linux' && (0, fs_1.existsSync)(ffmpeg_flags_1.lambdaFfmpegPaths[binary])) {
|
|
22
|
+
return {
|
|
23
|
+
wasAlreadyInstalled: true,
|
|
24
|
+
result: 'found-in-path',
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
if ((0, ffmpeg_flags_1.ffmpegInNodeModules)(remotionRoot, binary)) {
|
|
28
|
+
return {
|
|
29
|
+
result: 'found-in-node-modules',
|
|
30
|
+
wasAlreadyInstalled: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const binaryUrl = (0, ffmpeg_flags_1.getBinaryDownloadUrl)(binary);
|
|
34
|
+
if (binaryUrl) {
|
|
35
|
+
await (0, ffmpeg_flags_1.downloadBinary)(remotionRoot, binaryUrl.url, binary);
|
|
36
|
+
return {
|
|
37
|
+
result: 'installed',
|
|
38
|
+
wasAlreadyInstalled: false,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
throw new Error(`${binary} could not be installed automatically. Your architecture and OS combination (os = ${os_1.default.platform()}, arch = ${process.arch}) is not supported. Please install ${binary} manually and add "${binary}" to your PATH.`);
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* @description Checks if the ffmpeg binary is installed and if it is not, downloads it and puts it into your node_modules folder.
|
|
45
|
+
* @see [Documentation](https://www.remotion.dev/docs/renderer/ensure-ffmpeg)
|
|
46
|
+
*/
|
|
47
|
+
const ensureFfmpeg = (options) => {
|
|
48
|
+
return ensureFfmpegOrFfprobe('ffmpeg', options);
|
|
49
|
+
};
|
|
50
|
+
exports.ensureFfmpeg = ensureFfmpeg;
|
|
51
|
+
/**
|
|
52
|
+
* @description Checks if the ffprobe binary is installed and if it is not, downloads it and puts it into your node_modules folder.
|
|
53
|
+
* @see [Documentation](https://www.remotion.dev/docs/renderer/ensure-ffprobe)
|
|
54
|
+
*/
|
|
55
|
+
const ensureFfprobe = (options) => {
|
|
56
|
+
return ensureFfmpegOrFfprobe('ffprobe', options);
|
|
57
|
+
};
|
|
58
|
+
exports.ensureFfprobe = ensureFfprobe;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ensureOutputDirectory = void 0;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const ensureOutputDirectory = (outputLocation) => {
|
|
10
|
-
const dirName =
|
|
11
|
-
if (!
|
|
12
|
-
|
|
10
|
+
const dirName = node_path_1.default.dirname(outputLocation);
|
|
11
|
+
if (!node_fs_1.default.existsSync(dirName)) {
|
|
12
|
+
node_fs_1.default.mkdirSync(dirName, {
|
|
13
13
|
recursive: true,
|
|
14
14
|
});
|
|
15
15
|
}
|
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
import type { DownloadMap } from './assets/download-map';
|
|
2
|
-
|
|
2
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
3
|
+
export declare const ensurePresentationTimestampWithoutCache: ({ src, remotionRoot, ffmpegExecutable, ffprobeExecutable, }: {
|
|
4
|
+
src: string;
|
|
5
|
+
remotionRoot: string;
|
|
6
|
+
ffmpegExecutable: FfmpegExecutable;
|
|
7
|
+
ffprobeExecutable: FfmpegExecutable;
|
|
8
|
+
}) => Promise<string>;
|
|
9
|
+
export declare const ensurePresentationTimestamps: ({ downloadMap, src, remotionRoot, ffmpegExecutable, ffprobeExecutable, }: {
|
|
10
|
+
downloadMap: DownloadMap;
|
|
11
|
+
src: string;
|
|
12
|
+
remotionRoot: string;
|
|
13
|
+
ffmpegExecutable: FfmpegExecutable;
|
|
14
|
+
ffprobeExecutable: FfmpegExecutable;
|
|
15
|
+
}) => Promise<string>;
|
|
@@ -3,19 +3,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ensurePresentationTimestamps = void 0;
|
|
6
|
+
exports.ensurePresentationTimestamps = exports.ensurePresentationTimestampWithoutCache = void 0;
|
|
7
7
|
const execa_1 = __importDefault(require("execa"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
9
10
|
const guess_extension_for_media_1 = require("./guess-extension-for-media");
|
|
10
11
|
const truthy_1 = require("./truthy");
|
|
11
12
|
let callbacks = [];
|
|
12
|
-
const getTemporaryOutputName = async (src) => {
|
|
13
|
+
const getTemporaryOutputName = async ({ src, remotionRoot, ffprobeBinary, }) => {
|
|
13
14
|
const parts = src.split(path_1.default.sep);
|
|
14
15
|
// If there is no file extension for the video, then we need to temporarily add an extension
|
|
15
16
|
const lastPart = parts[parts.length - 1];
|
|
16
17
|
const extraExtension = lastPart.includes('.')
|
|
17
18
|
? null
|
|
18
|
-
: await (0, guess_extension_for_media_1.guessExtensionForVideo)(
|
|
19
|
+
: await (0, guess_extension_for_media_1.guessExtensionForVideo)({
|
|
20
|
+
src,
|
|
21
|
+
remotionRoot,
|
|
22
|
+
ffprobeBinary,
|
|
23
|
+
});
|
|
19
24
|
return parts
|
|
20
25
|
.map((p, i) => {
|
|
21
26
|
if (i === parts.length - 1) {
|
|
@@ -25,7 +30,29 @@ const getTemporaryOutputName = async (src) => {
|
|
|
25
30
|
})
|
|
26
31
|
.join(path_1.default.sep);
|
|
27
32
|
};
|
|
28
|
-
const
|
|
33
|
+
const ensurePresentationTimestampWithoutCache = async ({ src, remotionRoot, ffmpegExecutable, ffprobeExecutable, }) => {
|
|
34
|
+
// If there is no file extension for the video, then we need to tempoa
|
|
35
|
+
const output = await getTemporaryOutputName({
|
|
36
|
+
src,
|
|
37
|
+
remotionRoot,
|
|
38
|
+
ffprobeBinary: ffprobeExecutable,
|
|
39
|
+
});
|
|
40
|
+
await (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffmpegExecutable, remotionRoot, 'ffmpeg'), [
|
|
41
|
+
'-i',
|
|
42
|
+
src,
|
|
43
|
+
'-fflags',
|
|
44
|
+
'+genpts+igndts',
|
|
45
|
+
'-vcodec',
|
|
46
|
+
'copy',
|
|
47
|
+
'-acodec',
|
|
48
|
+
'copy',
|
|
49
|
+
output,
|
|
50
|
+
'-y',
|
|
51
|
+
]);
|
|
52
|
+
return output;
|
|
53
|
+
};
|
|
54
|
+
exports.ensurePresentationTimestampWithoutCache = ensurePresentationTimestampWithoutCache;
|
|
55
|
+
const ensurePresentationTimestamps = async ({ downloadMap, src, remotionRoot, ffmpegExecutable, ffprobeExecutable, }) => {
|
|
29
56
|
const elem = downloadMap.ensureFileHasPresentationTimestamp[src];
|
|
30
57
|
if ((elem === null || elem === void 0 ? void 0 : elem.type) === 'encoding') {
|
|
31
58
|
return new Promise((resolve) => {
|
|
@@ -39,20 +66,12 @@ const ensurePresentationTimestamps = async (downloadMap, src) => {
|
|
|
39
66
|
return elem.src;
|
|
40
67
|
}
|
|
41
68
|
downloadMap.ensureFileHasPresentationTimestamp[src] = { type: 'encoding' };
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
69
|
+
const output = await (0, exports.ensurePresentationTimestampWithoutCache)({
|
|
70
|
+
ffmpegExecutable,
|
|
71
|
+
ffprobeExecutable,
|
|
72
|
+
remotionRoot,
|
|
46
73
|
src,
|
|
47
|
-
|
|
48
|
-
'+genpts+igndts',
|
|
49
|
-
'-vcodec',
|
|
50
|
-
'copy',
|
|
51
|
-
'-acodec',
|
|
52
|
-
'copy',
|
|
53
|
-
output,
|
|
54
|
-
'-y',
|
|
55
|
-
]);
|
|
74
|
+
});
|
|
56
75
|
callbacks = callbacks.filter((c) => {
|
|
57
76
|
if (c.src === src) {
|
|
58
77
|
c.fn(output);
|
|
File without changes
|
|
@@ -16,6 +16,9 @@ exports.ErrorWithStackFrame = ErrorWithStackFrame;
|
|
|
16
16
|
const cleanUpErrorMessage = (exception) => {
|
|
17
17
|
var _a, _b, _c, _d;
|
|
18
18
|
let errorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
|
|
19
|
+
if (!errorMessage) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
19
22
|
const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
|
|
20
23
|
const prefix = `${errorType}: `;
|
|
21
24
|
if (errorMessage.startsWith(prefix)) {
|
|
@@ -46,6 +49,13 @@ const handleJavascriptException = ({ page, onError, frame, }) => {
|
|
|
46
49
|
var _a, _b, _c;
|
|
47
50
|
const rawErrorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
|
|
48
51
|
const cleanErrorMessage = cleanUpErrorMessage(exception);
|
|
52
|
+
if (!cleanErrorMessage) {
|
|
53
|
+
console.error(exception);
|
|
54
|
+
const err = new Error(rawErrorMessage);
|
|
55
|
+
err.stack = rawErrorMessage;
|
|
56
|
+
onError(err);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
49
59
|
if (!exception.exceptionDetails.stackTrace) {
|
|
50
60
|
const err = new Error(removeDelayRenderStack(cleanErrorMessage));
|
|
51
61
|
err.stack = rawErrorMessage;
|
|
File without changes
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.symbolicateError = void 0;
|
|
4
4
|
const symbolicate_stacktrace_1 = require("../symbolicate-stacktrace");
|
|
5
|
+
const truthy_1 = require("../truthy");
|
|
5
6
|
const handle_javascript_exception_1 = require("./handle-javascript-exception");
|
|
6
7
|
const symbolicateError = async (symbolicateableError) => {
|
|
7
8
|
const { delayRenderCall, stackFrame } = symbolicateableError;
|
|
8
9
|
const [mainErrorFrames, delayRenderFrames] = await Promise.all([
|
|
9
10
|
stackFrame ? (0, symbolicate_stacktrace_1.symbolicateStackTrace)(stackFrame) : null,
|
|
10
11
|
delayRenderCall ? (0, symbolicate_stacktrace_1.symbolicateStackTrace)(delayRenderCall) : null,
|
|
11
|
-
]);
|
|
12
|
+
].filter(truthy_1.truthy));
|
|
12
13
|
const symbolicatedErr = new handle_javascript_exception_1.ErrorWithStackFrame({
|
|
13
14
|
message: symbolicateableError.message,
|
|
14
15
|
symbolicatedStackFrames: mainErrorFrames,
|
|
File without changes
|
|
File without changes
|
|
@@ -10,6 +10,7 @@ declare type Options = {
|
|
|
10
10
|
ffprobeExecutable: FfmpegExecutable;
|
|
11
11
|
imageFormat: OffthreadVideoImageFormat;
|
|
12
12
|
downloadMap: DownloadMap;
|
|
13
|
+
remotionRoot: string;
|
|
13
14
|
};
|
|
14
15
|
export declare const extractFrameFromVideo: (options: Options) => Promise<Buffer>;
|
|
15
16
|
export {};
|