@remotion/renderer 4.0.0-defer.6 → 4.0.0-esm.17
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 +47 -0
- package/dist/assets/calculate-asset-positions.d.ts +2 -2
- 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 +5 -4
- package/dist/assets/convert-assets-to-file-urls.js +2 -2
- package/dist/assets/download-and-map-assets-to-file.d.ts +16 -12
- package/dist/assets/download-and-map-assets-to-file.js +145 -65
- package/dist/assets/download-file.d.ts +13 -6
- package/dist/assets/download-file.js +64 -8
- package/dist/assets/download-map.d.ts +69 -0
- package/dist/assets/download-map.js +77 -0
- package/dist/assets/ffmpeg-volume-expression.d.ts +3 -3
- package/dist/assets/ffmpeg-volume-expression.js +6 -5
- package/dist/assets/flatten-volume-array.d.ts +1 -1
- package/dist/assets/flatten-volume-array.js +0 -0
- package/dist/assets/get-audio-channels.d.ts +3 -5
- package/dist/assets/get-audio-channels.js +15 -4
- package/dist/assets/get-video-stream-duration.d.ts +9 -0
- package/dist/assets/get-video-stream-duration.js +71 -0
- package/dist/assets/read-file.d.ts +0 -0
- package/dist/assets/read-file.js +2 -1
- 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 +0 -0
- 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 +2 -1
- package/dist/assets/types.js +0 -0
- package/dist/browser/Browser.d.ts +62 -0
- package/dist/browser/Browser.js +221 -0
- package/dist/browser/BrowserConnector.d.ts +19 -0
- package/dist/browser/BrowserConnector.js +17 -0
- package/dist/browser/BrowserFetcher.d.ts +90 -0
- package/dist/browser/BrowserFetcher.js +513 -0
- package/dist/browser/BrowserPage.d.ts +80 -0
- package/dist/browser/BrowserPage.js +280 -0
- package/dist/browser/BrowserRunner.d.ts +36 -0
- package/dist/browser/BrowserRunner.js +265 -0
- package/dist/browser/Connection.d.ts +42 -0
- package/dist/browser/Connection.js +242 -0
- package/dist/browser/ConsoleMessage.d.ts +31 -0
- package/dist/browser/ConsoleMessage.js +48 -0
- package/dist/browser/DOMWorld.d.ts +53 -0
- package/dist/browser/DOMWorld.js +279 -0
- package/dist/browser/Errors.d.ts +25 -0
- package/dist/browser/Errors.js +35 -0
- package/dist/browser/EvalTypes.d.ts +27 -0
- package/dist/browser/EvalTypes.js +17 -0
- package/dist/browser/EventEmitter.d.ts +23 -0
- package/dist/browser/EventEmitter.js +53 -0
- package/dist/browser/ExecutionContext.d.ts +34 -0
- package/dist/browser/ExecutionContext.js +174 -0
- package/dist/browser/FrameManager.d.ts +91 -0
- package/dist/browser/FrameManager.js +493 -0
- package/dist/browser/HTTPRequest.d.ts +28 -0
- package/dist/browser/HTTPRequest.js +37 -0
- package/dist/browser/HTTPResponse.d.ts +21 -0
- package/dist/browser/HTTPResponse.js +41 -0
- package/dist/browser/JSHandle.d.ts +35 -0
- package/dist/browser/JSHandle.js +90 -0
- package/dist/browser/LaunchOptions.d.ts +33 -0
- package/dist/browser/LaunchOptions.js +17 -0
- package/dist/browser/Launcher.d.ts +15 -0
- package/dist/browser/Launcher.js +144 -0
- package/dist/browser/LifecycleWatcher.d.ts +29 -0
- package/dist/browser/LifecycleWatcher.js +180 -0
- package/dist/browser/NetworkEventManager.d.ts +33 -0
- package/dist/browser/NetworkEventManager.js +81 -0
- package/dist/browser/NetworkManager.d.ts +34 -0
- package/dist/browser/NetworkManager.js +231 -0
- package/dist/browser/NodeWebSocketTransport.d.ts +17 -0
- package/dist/browser/NodeWebSocketTransport.js +87 -0
- package/dist/browser/Product.d.ts +16 -0
- package/dist/browser/Product.js +17 -0
- package/dist/browser/PuppeteerNode.d.ts +40 -0
- package/dist/browser/PuppeteerNode.js +74 -0
- package/dist/browser/PuppeteerViewport.d.ts +5 -0
- package/dist/{faststart/options.js → browser/PuppeteerViewport.js} +0 -0
- package/dist/{faststart/index.d.ts → browser/ScreenshotOptions.d.ts} +0 -0
- package/dist/{faststart/index.js → browser/ScreenshotOptions.js} +0 -0
- package/dist/browser/Target.d.ts +61 -0
- package/dist/browser/Target.js +146 -0
- package/dist/browser/TaskQueue.d.ts +20 -0
- package/dist/browser/TaskQueue.js +47 -0
- package/dist/browser/TimeoutSettings.d.ts +24 -0
- package/dist/browser/TimeoutSettings.js +62 -0
- package/dist/browser/assert.d.ts +1 -0
- package/dist/browser/assert.js +9 -0
- package/dist/browser/create-browser-fetcher.d.ts +17 -0
- package/dist/browser/create-browser-fetcher.js +77 -0
- package/dist/browser/devtools-commands.d.ts +270 -0
- package/dist/browser/devtools-commands.js +2 -0
- package/dist/browser/devtools-types.d.ts +1126 -0
- package/dist/browser/devtools-types.js +2 -0
- package/dist/browser/get-download-destination.d.ts +1 -0
- package/dist/browser/get-download-destination.js +38 -0
- 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 +22 -0
- package/dist/browser/mitt/index.js +49 -0
- package/dist/browser/node.d.ts +2 -0
- package/dist/browser/node.js +9 -0
- package/dist/browser/revisions.d.ts +20 -0
- package/dist/browser/revisions.js +21 -0
- package/dist/browser/util.d.ts +47 -0
- package/dist/browser/util.js +169 -0
- package/dist/browser-executable.d.ts +1 -0
- package/dist/{assets/cleanup-assets.js → 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 +2 -0
- package/dist/browser.js +4 -0
- package/dist/calculate-ffmpeg-filters.d.ts +1 -1
- package/dist/calculate-ffmpeg-filters.js +1 -0
- package/dist/calculate-sar-dar-pixels.d.ts +9 -0
- package/dist/calculate-sar-dar-pixels.js +19 -0
- package/dist/can-use-parallel-encoding.d.ts +1 -1
- package/dist/can-use-parallel-encoding.js +2 -2
- package/dist/check-apple-silicon.d.ts +1 -0
- package/dist/check-apple-silicon.js +55 -0
- package/dist/chunk.d.ts +0 -0
- package/dist/chunk.js +0 -0
- package/dist/client.d.ts +10 -0
- package/dist/client.js +19 -0
- package/dist/codec-supports-media.d.ts +8 -0
- package/dist/codec-supports-media.js +56 -0
- package/dist/codec.d.ts +4 -0
- package/dist/codec.js +16 -0
- package/dist/combine-videos.d.ts +9 -3
- package/dist/combine-videos.js +18 -10
- package/dist/compositor/compose.d.ts +13 -0
- package/dist/compositor/compose.js +47 -0
- package/dist/compositor/compositor.d.ts +12 -0
- package/dist/compositor/compositor.js +111 -0
- package/dist/compositor/get-executable-path.d.ts +1 -0
- package/dist/compositor/get-executable-path.js +47 -0
- package/dist/compositor/payloads.d.ts +41 -0
- package/dist/compositor/payloads.js +2 -0
- package/dist/compress-assets.d.ts +7 -0
- package/dist/compress-assets.js +25 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.d.ts +1 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.js +17 -0
- package/dist/convert-to-pcm.d.ts +3 -2
- package/dist/convert-to-pcm.js +3 -2
- 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 +2 -1
- package/dist/create-ffmpeg-complex-filter.js +2 -11
- package/dist/create-ffmpeg-merge-filter.d.ts +0 -0
- package/dist/create-ffmpeg-merge-filter.js +3 -3
- package/dist/create-silent-audio.d.ts +3 -2
- package/dist/create-silent-audio.js +3 -2
- package/dist/crf.d.ts +9 -0
- package/dist/crf.js +91 -0
- 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 +1 -1
- package/dist/delay-render-embedded-stack.js +0 -0
- package/dist/delete-directory.d.ts +0 -0
- package/dist/delete-directory.js +0 -0
- package/dist/determine-resize-params.d.ts +1 -0
- package/dist/determine-resize-params.js +10 -0
- package/dist/determine-vcodec-ffmepg-flags.d.ts +2 -0
- package/dist/determine-vcodec-ffmepg-flags.js +13 -0
- package/dist/determine-vcodec-ffmpeg-flags.d.ts +2 -0
- package/dist/determine-vcodec-ffmpeg-flags.js +13 -0
- package/dist/ensure-ffmpeg.d.ts +10 -0
- package/dist/ensure-ffmpeg.js +50 -0
- package/dist/ensure-frames-in-order.d.ts +1 -1
- package/dist/ensure-frames-in-order.js +3 -2
- package/dist/ensure-output-directory.d.ts +0 -0
- package/dist/ensure-output-directory.js +0 -0
- package/dist/ensure-presentation-timestamp.d.ts +15 -0
- package/dist/ensure-presentation-timestamp.js +88 -0
- package/dist/error-handling/handle-javascript-exception.d.ts +2 -2
- package/dist/error-handling/handle-javascript-exception.js +3 -4
- package/dist/error-handling/symbolicate-error.d.ts +1 -1
- package/dist/error-handling/symbolicate-error.js +0 -0
- package/dist/error-handling/symbolicateable-error.d.ts +1 -1
- package/dist/error-handling/symbolicateable-error.js +0 -0
- package/dist/extract-frame-from-video.d.ts +7 -6
- package/dist/extract-frame-from-video.js +91 -105
- package/dist/ffmpeg-executable.d.ts +1 -0
- package/dist/ffmpeg-executable.js +2 -0
- package/dist/ffmpeg-filter-file.d.ts +2 -1
- package/dist/ffmpeg-filter-file.js +4 -6
- 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/find-closest-package-json.d.ts +2 -0
- package/dist/find-closest-package-json.js +31 -0
- package/dist/frame-range.d.ts +2 -0
- package/dist/frame-range.js +49 -0
- package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -0
- package/dist/frame-to-ffmpeg-timestamp.js +0 -0
- package/dist/get-audio-codec-name.d.ts +1 -1
- package/dist/get-audio-codec-name.js +2 -2
- package/dist/get-browser-instance.d.ts +4 -3
- package/dist/get-browser-instance.js +3 -3
- package/dist/get-can-extract-frames-fast.d.ts +10 -0
- package/dist/get-can-extract-frames-fast.js +67 -0
- package/dist/get-codec-name.d.ts +1 -1
- package/dist/get-codec-name.js +5 -2
- package/dist/get-compositions-from-bundle.d.ts +7 -0
- package/dist/get-compositions-from-bundle.js +55 -0
- package/dist/get-compositions-from-markup.d.ts +3 -0
- package/dist/get-compositions-from-markup.js +17 -0
- package/dist/get-compositions-on-server.d.ts +3 -0
- package/dist/get-compositions-on-server.js +18 -0
- package/dist/get-compositions.d.ts +11 -4
- package/dist/get-compositions.js +30 -11
- package/dist/get-concurrency.d.ts +1 -1
- package/dist/get-concurrency.js +8 -1
- package/dist/get-duration-from-frame-range.d.ts +1 -2
- package/dist/get-duration-from-frame-range.js +13 -9
- package/dist/get-extension-from-codec.d.ts +2 -2
- package/dist/get-extension-from-codec.js +8 -5
- package/dist/get-extension-of-filename.d.ts +1 -1
- package/dist/get-extension-of-filename.js +8 -1
- package/dist/get-frame-of-video-slow.d.ts +15 -0
- package/dist/get-frame-of-video-slow.js +72 -0
- package/dist/get-frame-padded-index.d.ts +14 -0
- package/dist/get-frame-padded-index.js +34 -0
- package/dist/get-frame-to-render.d.ts +1 -1
- package/dist/get-frame-to-render.js +0 -0
- package/dist/get-local-browser-executable.d.ts +2 -1
- package/dist/get-local-browser-executable.js +8 -8
- package/dist/get-port.d.ts +4 -1
- package/dist/get-port.js +13 -22
- package/dist/get-prores-profile-name.d.ts +2 -1
- package/dist/get-prores-profile-name.js +0 -0
- package/dist/get-video-info.d.ts +8 -0
- package/dist/get-video-info.js +59 -0
- package/dist/get-video-signals.d.ts +2 -0
- package/dist/get-video-signals.js +28 -0
- package/dist/get-video-threads-flag.d.ts +1 -0
- package/dist/get-video-threads-flag.js +18 -0
- package/dist/guess-extension-for-media.d.ts +5 -0
- package/dist/guess-extension-for-media.js +28 -0
- package/dist/image-format.d.ts +6 -1
- package/dist/image-format.js +28 -1
- package/dist/index.d.ts +117 -34
- package/dist/index.js +101 -15
- package/dist/is-audio-codec.d.ts +2 -0
- package/dist/is-audio-codec.js +7 -0
- package/dist/is-beyond-last-frame.d.ts +3 -2
- package/dist/is-beyond-last-frame.js +5 -5
- package/dist/is-serve-url.d.ts +0 -0
- package/dist/is-serve-url.js +0 -0
- package/dist/last-frame-from-video-cache.d.ts +9 -4
- package/dist/last-frame-from-video-cache.js +24 -21
- package/dist/legacy-webpack-config.d.ts +0 -0
- package/dist/legacy-webpack-config.js +0 -0
- package/dist/lock-port-selection.d.ts +2 -0
- package/dist/lock-port-selection.js +11 -0
- package/dist/locks.d.ts +7 -0
- package/dist/locks.js +44 -0
- package/dist/log-level.d.ts +4 -0
- package/dist/log-level.js +15 -0
- package/dist/make-cancel-signal.d.ts +7 -0
- package/dist/make-cancel-signal.js +20 -1
- package/dist/make-comp-manager-context.d.ts +2 -0
- package/dist/make-comp-manager-context.js +45 -0
- package/dist/make-timeline-context-value.d.ts +2 -0
- package/dist/make-timeline-context-value.js +20 -0
- package/dist/merge-audio-track.d.ts +4 -1
- package/dist/merge-audio-track.js +18 -7
- package/dist/mime-db.d.ts +6 -0
- package/dist/mime-db.js +8636 -0
- package/dist/mime-types.d.ts +3 -0
- package/dist/mime-types.js +94 -0
- package/dist/normalize-serve-url.d.ts +0 -0
- package/dist/normalize-serve-url.js +0 -0
- package/dist/offthread-video-server.d.ts +9 -5
- package/dist/offthread-video-server.js +30 -10
- package/dist/open-browser.d.ts +5 -3
- package/dist/open-browser.js +18 -28
- package/dist/overwrite.d.ts +1 -0
- package/dist/overwrite.js +4 -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 +5 -0
- package/dist/perf.js +35 -0
- package/dist/pixel-format.d.ts +5 -0
- package/dist/pixel-format.js +29 -0
- package/dist/pool.d.ts +0 -0
- package/dist/pool.js +0 -0
- package/dist/prepare-server.d.ts +7 -5
- package/dist/prepare-server.js +24 -5
- package/dist/preprocess-audio-track.d.ts +5 -2
- package/dist/preprocess-audio-track.js +5 -4
- package/dist/prespawn-ffmpeg.d.ts +10 -3
- package/dist/prespawn-ffmpeg.js +24 -16
- package/dist/prestitcher-memory-usage.d.ts +12 -0
- package/dist/prestitcher-memory-usage.js +30 -0
- package/dist/prores-profile.d.ts +8 -0
- package/dist/prores-profile.js +23 -0
- package/dist/provide-screenshot.d.ts +9 -5
- package/dist/provide-screenshot.js +4 -2
- package/dist/puppeteer-evaluate.d.ts +1 -1
- package/dist/puppeteer-evaluate.js +3 -4
- package/dist/puppeteer-screenshot.d.ts +12 -2
- package/dist/puppeteer-screenshot.js +11 -16
- package/dist/quality.d.ts +1 -0
- package/dist/quality.js +21 -0
- package/dist/redirect-status-codes.d.ts +1 -0
- package/dist/redirect-status-codes.js +6 -0
- package/dist/render-frames.d.ts +30 -12
- package/dist/render-frames.js +232 -138
- package/dist/render-media.d.ts +49 -12
- package/dist/render-media.js +152 -30
- package/dist/render-on-server.d.ts +3 -0
- package/dist/render-on-server.js +90 -0
- package/dist/render-still.d.ts +21 -9
- package/dist/render-still.js +75 -37
- package/dist/render-svg.d.ts +8 -0
- package/dist/render-svg.js +13 -0
- package/dist/render-video-layer.d.ts +9 -0
- package/dist/render-video-layer.js +23 -0
- package/dist/render-web-frame.d.ts +74 -0
- package/dist/render-web-frame.js +259 -0
- 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 +0 -0
- package/dist/sample-rate.d.ts +0 -0
- package/dist/sample-rate.js +0 -0
- package/dist/screenshot-dom-element.d.ts +11 -8
- package/dist/screenshot-dom-element.js +12 -7
- package/dist/screenshot-task.d.ts +13 -3
- package/dist/screenshot-task.js +55 -27
- package/dist/seek-to-frame.d.ts +3 -2
- package/dist/seek-to-frame.js +24 -3
- package/dist/serve-handler/index.d.ts +1 -1
- package/dist/serve-handler/index.js +7 -15
- package/dist/serve-handler/is-path-inside.d.ts +0 -0
- package/dist/serve-handler/is-path-inside.js +0 -0
- 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 +5 -3
- package/dist/serve-static.js +20 -4
- package/dist/set-props-and-env.d.ts +4 -2
- package/dist/set-props-and-env.js +41 -15
- package/dist/stitch-frames-to-video.d.ts +20 -7
- package/dist/stitch-frames-to-video.js +175 -59
- package/dist/stringify-ffmpeg-filter.d.ts +4 -3
- package/dist/stringify-ffmpeg-filter.js +15 -11
- package/dist/symbolicate-stacktrace.d.ts +1 -1
- package/dist/symbolicate-stacktrace.js +3 -3
- package/dist/take-frame-and-compose.d.ts +20 -0
- package/dist/take-frame-and-compose.js +96 -0
- package/dist/tmp-dir.d.ts +0 -0
- package/dist/tmp-dir.js +0 -0
- package/dist/truthy.d.ts +3 -0
- package/dist/truthy.js +7 -0
- package/dist/try-to-extract-frame-of-video-fast.d.ts +13 -0
- package/dist/try-to-extract-frame-of-video-fast.js +55 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +0 -0
- package/dist/validate-concurrency.d.ts +1 -0
- package/dist/validate-concurrency.js +29 -0
- package/dist/validate-even-dimensions-with-codec.d.ts +1 -1
- package/dist/validate-even-dimensions-with-codec.js +2 -2
- package/dist/validate-every-nth-frame.d.ts +2 -0
- package/dist/validate-every-nth-frame.js +28 -0
- 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 -44
- package/dist/validate-frame.d.ts +1 -0
- package/dist/validate-frame.js +24 -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 +5 -0
- package/dist/validate-opengl-renderer.js +15 -0
- package/dist/validate-output-filename.d.ts +1 -1
- package/dist/validate-output-filename.js +5 -0
- package/dist/validate-puppeteer-timeout.d.ts +0 -0
- package/dist/validate-puppeteer-timeout.js +1 -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 +3 -0
- package/dist/wait-for-symbolication-error-to-be-done.js +8 -0
- 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 +14 -0
- package/dist/ws/ws-types.js +10 -0
- package/package.json +30 -22
- package/types/ws/index.d.ts +509 -0
- package/.prettierrc.js +0 -14
- package/dist/abort.d.ts +0 -7
- package/dist/abort.js +0 -20
- package/dist/assets/cleanup-assets.d.ts +0 -2
- package/dist/cancel.d.ts +0 -7
- package/dist/cancel.js +0 -25
- package/dist/ensure-faststart.d.ts +0 -1
- package/dist/ensure-faststart.js +0 -14
- package/dist/faststart/atom.d.ts +0 -35
- package/dist/faststart/atom.js +0 -138
- package/dist/faststart/options.d.ts +0 -6
- package/dist/faststart/qt-faststart.d.ts +0 -18
- package/dist/faststart/qt-faststart.js +0 -66
- package/dist/faststart/update-chunk-offsets.d.ts +0 -10
- package/dist/faststart/update-chunk-offsets.js +0 -114
- package/dist/faststart/util.d.ts +0 -9
- package/dist/faststart/util.js +0 -34
- package/dist/get-duration-of-asset.d.ts +0 -7
- package/dist/get-duration-of-asset.js +0 -36
- package/dist/make-assets-download-dir.d.ts +0 -1
- package/dist/make-assets-download-dir.js +0 -13
- package/dist/offthread/index.d.ts +0 -0
- package/dist/offthread/index.js +0 -1
- package/dist/render-gif.d.ts +0 -2
- package/dist/render-gif.js +0 -242
- package/dist/serve-handler/glob-slash.d.ts +0 -1
- package/dist/serve-handler/glob-slash.js +0 -12
- package/dist/stitch-frames-to-gif.d.ts +0 -8
- package/dist/stitch-frames-to-gif.js +0 -128
- package/dist/validate-fps-for-gif.d.ts +0 -2
- package/dist/validate-fps-for-gif.js +0 -9
- package/tsconfig.json +0 -10
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.codecSupportsCrf = exports.codecSupportsMedia = void 0;
|
|
4
|
+
const get_codec_name_1 = require("./get-codec-name");
|
|
5
|
+
const support = {
|
|
6
|
+
'h264-mkv': {
|
|
7
|
+
audio: true,
|
|
8
|
+
video: true,
|
|
9
|
+
},
|
|
10
|
+
aac: {
|
|
11
|
+
audio: true,
|
|
12
|
+
video: false,
|
|
13
|
+
},
|
|
14
|
+
gif: {
|
|
15
|
+
video: true,
|
|
16
|
+
audio: false,
|
|
17
|
+
},
|
|
18
|
+
h264: {
|
|
19
|
+
video: true,
|
|
20
|
+
audio: true,
|
|
21
|
+
},
|
|
22
|
+
h265: {
|
|
23
|
+
video: true,
|
|
24
|
+
audio: true,
|
|
25
|
+
},
|
|
26
|
+
mp3: {
|
|
27
|
+
audio: true,
|
|
28
|
+
video: false,
|
|
29
|
+
},
|
|
30
|
+
prores: {
|
|
31
|
+
audio: true,
|
|
32
|
+
video: true,
|
|
33
|
+
},
|
|
34
|
+
vp8: {
|
|
35
|
+
audio: true,
|
|
36
|
+
video: true,
|
|
37
|
+
},
|
|
38
|
+
vp9: {
|
|
39
|
+
audio: true,
|
|
40
|
+
video: true,
|
|
41
|
+
},
|
|
42
|
+
wav: {
|
|
43
|
+
audio: true,
|
|
44
|
+
video: false,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
const codecSupportsMedia = (codec) => {
|
|
48
|
+
return support[codec];
|
|
49
|
+
};
|
|
50
|
+
exports.codecSupportsMedia = codecSupportsMedia;
|
|
51
|
+
const codecSupportsCrf = (codec) => {
|
|
52
|
+
const encoderName = (0, get_codec_name_1.getCodecName)(codec);
|
|
53
|
+
const supportsCrf = encoderName && codec !== 'prores';
|
|
54
|
+
return supportsCrf;
|
|
55
|
+
};
|
|
56
|
+
exports.codecSupportsCrf = codecSupportsCrf;
|
package/dist/codec.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "gif"];
|
|
2
|
+
export declare type Codec = typeof validCodecs[number];
|
|
3
|
+
export declare type CodecOrUndefined = Codec | undefined;
|
|
4
|
+
export declare const DEFAULT_CODEC: Codec;
|
package/dist/codec.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_CODEC = exports.validCodecs = void 0;
|
|
4
|
+
exports.validCodecs = [
|
|
5
|
+
'h264',
|
|
6
|
+
'h265',
|
|
7
|
+
'vp8',
|
|
8
|
+
'vp9',
|
|
9
|
+
'mp3',
|
|
10
|
+
'aac',
|
|
11
|
+
'wav',
|
|
12
|
+
'prores',
|
|
13
|
+
'h264-mkv',
|
|
14
|
+
'gif',
|
|
15
|
+
];
|
|
16
|
+
exports.DEFAULT_CODEC = 'h264';
|
package/dist/combine-videos.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Codec } from '
|
|
2
|
-
|
|
1
|
+
import type { Codec } from './codec';
|
|
2
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
3
|
+
declare type Options = {
|
|
3
4
|
files: string[];
|
|
4
5
|
filelistDir: string;
|
|
5
6
|
output: string;
|
|
@@ -7,4 +8,9 @@ export declare const combineVideos: ({ files, filelistDir, output, onProgress, n
|
|
|
7
8
|
numberOfFrames: number;
|
|
8
9
|
codec: Codec;
|
|
9
10
|
fps: number;
|
|
10
|
-
|
|
11
|
+
numberOfGifLoops: number | null;
|
|
12
|
+
remotionRoot: string;
|
|
13
|
+
ffmpegExecutable: FfmpegExecutable;
|
|
14
|
+
};
|
|
15
|
+
export declare const combineVideos: (options: Options) => Promise<void>;
|
|
16
|
+
export {};
|
package/dist/combine-videos.js
CHANGED
|
@@ -8,37 +8,45 @@ exports.combineVideos = void 0;
|
|
|
8
8
|
const execa_1 = __importDefault(require("execa"));
|
|
9
9
|
const fs_1 = require("fs");
|
|
10
10
|
const path_1 = require("path");
|
|
11
|
-
const
|
|
11
|
+
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
12
12
|
const get_audio_codec_name_1 = require("./get-audio-codec-name");
|
|
13
|
+
const is_audio_codec_1 = require("./is-audio-codec");
|
|
13
14
|
const parse_ffmpeg_progress_1 = require("./parse-ffmpeg-progress");
|
|
14
|
-
const
|
|
15
|
+
const truthy_1 = require("./truthy");
|
|
16
|
+
const combineVideos = async (options) => {
|
|
15
17
|
var _a;
|
|
18
|
+
const { files, filelistDir, output, onProgress, numberOfFrames, codec, fps, numberOfGifLoops, ffmpegExecutable, remotionRoot, } = options;
|
|
16
19
|
const fileList = files.map((p) => `file '${p}'`).join('\n');
|
|
17
20
|
const fileListTxt = (0, path_1.join)(filelistDir, 'files.txt');
|
|
18
21
|
(0, fs_1.writeFileSync)(fileListTxt, fileList);
|
|
19
22
|
try {
|
|
20
|
-
const task = (0, execa_1.default)('ffmpeg', [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
const task = (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffmpegExecutable, remotionRoot, 'ffmpeg'), [
|
|
24
|
+
(0, is_audio_codec_1.isAudioCodec)(codec) ? null : '-r',
|
|
25
|
+
(0, is_audio_codec_1.isAudioCodec)(codec) ? null : String(fps),
|
|
23
26
|
'-f',
|
|
24
27
|
'concat',
|
|
25
28
|
'-safe',
|
|
26
29
|
'0',
|
|
27
30
|
'-i',
|
|
28
31
|
fileListTxt,
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
numberOfGifLoops === null ? null : '-loop',
|
|
33
|
+
numberOfGifLoops === null
|
|
34
|
+
? null
|
|
35
|
+
: typeof numberOfGifLoops === 'number'
|
|
36
|
+
? String(numberOfGifLoops)
|
|
37
|
+
: '-1',
|
|
38
|
+
(0, is_audio_codec_1.isAudioCodec)(codec) ? null : '-c:v',
|
|
39
|
+
(0, is_audio_codec_1.isAudioCodec)(codec) ? null : codec === 'gif' ? 'gif' : 'copy',
|
|
31
40
|
'-c:a',
|
|
32
41
|
(0, get_audio_codec_name_1.getAudioCodecName)(codec),
|
|
33
|
-
// Set max bitrate up to
|
|
42
|
+
// Set max bitrate up to 512kbps, will choose lower if that's too much
|
|
34
43
|
'-b:a',
|
|
35
44
|
'512K',
|
|
36
45
|
codec === 'h264' ? '-movflags' : null,
|
|
37
46
|
codec === 'h264' ? 'faststart' : null,
|
|
38
|
-
'-shortest',
|
|
39
47
|
'-y',
|
|
40
48
|
output,
|
|
41
|
-
].filter(
|
|
49
|
+
].filter(truthy_1.truthy));
|
|
42
50
|
(_a = task.stderr) === null || _a === void 0 ? void 0 : _a.on('data', (data) => {
|
|
43
51
|
if (onProgress) {
|
|
44
52
|
const parsed = (0, parse_ffmpeg_progress_1.parseFfmpegProgress)(data.toString());
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DownloadMap } from '../assets/download-map';
|
|
2
|
+
import type { CompositorImageFormat, Layer } from './payloads';
|
|
3
|
+
declare type CompositorInput = {
|
|
4
|
+
height: number;
|
|
5
|
+
width: number;
|
|
6
|
+
layers: Layer[];
|
|
7
|
+
imageFormat: CompositorImageFormat;
|
|
8
|
+
};
|
|
9
|
+
export declare const compose: ({ height, width, layers, output, downloadMap, imageFormat, }: CompositorInput & {
|
|
10
|
+
downloadMap: DownloadMap;
|
|
11
|
+
output: string;
|
|
12
|
+
}) => Promise<void>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.compose = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const crypto_1 = require("crypto");
|
|
6
|
+
const promises_1 = require("fs/promises");
|
|
7
|
+
const get_executable_path_1 = require("./get-executable-path");
|
|
8
|
+
const getCompositorHash = ({ ...input }) => {
|
|
9
|
+
return (0, crypto_1.createHash)('sha256').update(JSON.stringify(input)).digest('base64');
|
|
10
|
+
};
|
|
11
|
+
const compose = async ({ height, width, layers, output, downloadMap, imageFormat, }) => {
|
|
12
|
+
const bin = (0, get_executable_path_1.getExecutablePath)();
|
|
13
|
+
const hash = getCompositorHash({ height, width, layers, imageFormat });
|
|
14
|
+
if (downloadMap.compositorCache[hash]) {
|
|
15
|
+
await (0, promises_1.copyFile)(downloadMap.compositorCache[hash], output);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const payload = {
|
|
19
|
+
v: 1,
|
|
20
|
+
height,
|
|
21
|
+
width,
|
|
22
|
+
layers,
|
|
23
|
+
output,
|
|
24
|
+
output_format: imageFormat,
|
|
25
|
+
};
|
|
26
|
+
await new Promise((resolve, reject) => {
|
|
27
|
+
const child = (0, child_process_1.spawn)(bin);
|
|
28
|
+
child.stdin.write(JSON.stringify(payload));
|
|
29
|
+
child.stdin.end();
|
|
30
|
+
const stderrChunks = [];
|
|
31
|
+
child.stderr.on('data', (d) => stderrChunks.push(d));
|
|
32
|
+
child.on('close', (code) => {
|
|
33
|
+
if (code === 0) {
|
|
34
|
+
resolve();
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
const message = Buffer.concat(stderrChunks).toString('utf-8');
|
|
38
|
+
const parsed = JSON.parse(message);
|
|
39
|
+
const err = new Error(parsed.error);
|
|
40
|
+
err.stack = parsed.error + '\n' + parsed.backtrace;
|
|
41
|
+
reject(err);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
downloadMap.compositorCache[hash] = output;
|
|
46
|
+
};
|
|
47
|
+
exports.compose = compose;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CompositorCommand, CompositorInitiatePayload } from './payloads';
|
|
2
|
+
export declare type Compositor = {
|
|
3
|
+
finishCommands: () => void;
|
|
4
|
+
executeCommand: (payload: Omit<CompositorCommand, 'nonce'>) => Promise<void>;
|
|
5
|
+
waitForDone: () => Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
export declare const spawnCompositorOrReuse: ({ initiatePayload, renderId, }: {
|
|
8
|
+
initiatePayload: CompositorInitiatePayload;
|
|
9
|
+
renderId: string;
|
|
10
|
+
}) => Compositor;
|
|
11
|
+
export declare const releaseCompositorWithId: (renderId: string) => void;
|
|
12
|
+
export declare const waitForCompositorWithIdToQuit: (renderId: string) => Promise<void>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.waitForCompositorWithIdToQuit = exports.releaseCompositorWithId = exports.spawnCompositorOrReuse = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const truthy_1 = require("../truthy");
|
|
6
|
+
const get_executable_path_1 = require("./get-executable-path");
|
|
7
|
+
const compositorMap = {};
|
|
8
|
+
const spawnCompositorOrReuse = ({ initiatePayload, renderId, }) => {
|
|
9
|
+
if (!compositorMap[renderId]) {
|
|
10
|
+
compositorMap[renderId] = startCompositor(initiatePayload);
|
|
11
|
+
}
|
|
12
|
+
return compositorMap[renderId];
|
|
13
|
+
};
|
|
14
|
+
exports.spawnCompositorOrReuse = spawnCompositorOrReuse;
|
|
15
|
+
const releaseCompositorWithId = (renderId) => {
|
|
16
|
+
if (compositorMap[renderId]) {
|
|
17
|
+
compositorMap[renderId].finishCommands();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.releaseCompositorWithId = releaseCompositorWithId;
|
|
21
|
+
const waitForCompositorWithIdToQuit = (renderId) => {
|
|
22
|
+
if (!compositorMap[renderId]) {
|
|
23
|
+
throw new TypeError('No compositor with that id');
|
|
24
|
+
}
|
|
25
|
+
return compositorMap[renderId].waitForDone();
|
|
26
|
+
};
|
|
27
|
+
exports.waitForCompositorWithIdToQuit = waitForCompositorWithIdToQuit;
|
|
28
|
+
const startCompositor = (compositorInitiatePayload) => {
|
|
29
|
+
const bin = (0, get_executable_path_1.getExecutablePath)();
|
|
30
|
+
const child = (0, child_process_1.spawn)(`${bin}`, [JSON.stringify(compositorInitiatePayload)]);
|
|
31
|
+
const stderrChunks = [];
|
|
32
|
+
let stdoutListeners = [];
|
|
33
|
+
let stderrListeners = [];
|
|
34
|
+
child.stderr.on('data', (d) => {
|
|
35
|
+
stderrChunks.push(d);
|
|
36
|
+
const str = d.toString('utf-8');
|
|
37
|
+
stderrListeners.forEach((s) => s(str));
|
|
38
|
+
});
|
|
39
|
+
child.stdout.on('data', (d) => {
|
|
40
|
+
const str = d.toString('utf-8');
|
|
41
|
+
stdoutListeners.forEach((s) => s(str));
|
|
42
|
+
});
|
|
43
|
+
let nonce = 0;
|
|
44
|
+
return {
|
|
45
|
+
waitForDone: () => {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
47
|
+
child.on('exit', (code) => {
|
|
48
|
+
if (code === 0) {
|
|
49
|
+
resolve();
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
reject(Buffer.concat(stderrChunks).toString('utf-8'));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
finishCommands: () => {
|
|
58
|
+
child.stdin.write('EOF\n');
|
|
59
|
+
},
|
|
60
|
+
executeCommand: (payload) => {
|
|
61
|
+
const actualPayload = {
|
|
62
|
+
...payload,
|
|
63
|
+
nonce,
|
|
64
|
+
};
|
|
65
|
+
nonce++;
|
|
66
|
+
return new Promise((resolve, reject) => {
|
|
67
|
+
child.stdin.write(JSON.stringify(actualPayload) + '\n');
|
|
68
|
+
const onStderr = (message) => {
|
|
69
|
+
let parsed = null;
|
|
70
|
+
try {
|
|
71
|
+
const content = JSON.parse(message);
|
|
72
|
+
if (content.msg_type === 'error') {
|
|
73
|
+
parsed = content;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
// TODO: Obviously bad, does not handle panics
|
|
78
|
+
console.log('Rust debug err:', message);
|
|
79
|
+
}
|
|
80
|
+
if (parsed) {
|
|
81
|
+
const err = new Error(parsed.error);
|
|
82
|
+
err.stack = parsed.error + '\n' + parsed.backtrace;
|
|
83
|
+
reject(err);
|
|
84
|
+
stdoutListeners = stdoutListeners.filter((s) => s !== onStdout);
|
|
85
|
+
stderrListeners = stderrListeners.filter((s) => s !== onStderr);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const onStdout = (str) => {
|
|
89
|
+
const lineSplit = str.split('\n');
|
|
90
|
+
for (const line of lineSplit.filter(truthy_1.truthy)) {
|
|
91
|
+
let parsed = null;
|
|
92
|
+
try {
|
|
93
|
+
const p = JSON.parse(line);
|
|
94
|
+
if (p.msg_type === 'finish') {
|
|
95
|
+
parsed = p;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
catch (e) { }
|
|
99
|
+
if (parsed && parsed.nonce === actualPayload.nonce) {
|
|
100
|
+
resolve();
|
|
101
|
+
stdoutListeners = stdoutListeners.filter((s) => s !== onStdout);
|
|
102
|
+
stderrListeners = stderrListeners.filter((s) => s !== onStderr);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
stdoutListeners.push(onStdout);
|
|
107
|
+
stderrListeners.push(onStderr);
|
|
108
|
+
});
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getExecutablePath: () => any;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Adapted from @swc/core package
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getExecutablePath = void 0;
|
|
5
|
+
function isMusl() {
|
|
6
|
+
// @ts-expect-error no types
|
|
7
|
+
const { glibcVersionRuntime } = process.report.getReport().header;
|
|
8
|
+
return !glibcVersionRuntime;
|
|
9
|
+
}
|
|
10
|
+
const getExecutablePath = () => {
|
|
11
|
+
switch (process.platform) {
|
|
12
|
+
case 'win32':
|
|
13
|
+
switch (process.arch) {
|
|
14
|
+
case 'x64':
|
|
15
|
+
return require('@remotion/compositor-win32-x64-msvc').binaryPath;
|
|
16
|
+
default:
|
|
17
|
+
throw new Error(`Unsupported architecture on Windows: ${process.arch}`);
|
|
18
|
+
}
|
|
19
|
+
case 'darwin':
|
|
20
|
+
switch (process.arch) {
|
|
21
|
+
case 'x64':
|
|
22
|
+
return require('@remotion/compositor-darwin-x64').binaryPath;
|
|
23
|
+
case 'arm64':
|
|
24
|
+
return require('@remotion/compositor-darwin-arm64').binaryPath;
|
|
25
|
+
default:
|
|
26
|
+
throw new Error(`Unsupported architecture on macOS: ${process.arch}`);
|
|
27
|
+
}
|
|
28
|
+
case 'linux':
|
|
29
|
+
switch (process.arch) {
|
|
30
|
+
case 'x64':
|
|
31
|
+
if (isMusl()) {
|
|
32
|
+
return require('@remotion/compositor-linux-x64-musl').binaryPath;
|
|
33
|
+
}
|
|
34
|
+
return require('@remotion/compositor-linux-x64-gnu').binaryPath;
|
|
35
|
+
case 'arm64':
|
|
36
|
+
if (isMusl()) {
|
|
37
|
+
return require('@remotion/compositor-linux-arm64-musl').binaryPath;
|
|
38
|
+
}
|
|
39
|
+
return require('@remotion/compositor-linux-arm64-gnu').binaryPath;
|
|
40
|
+
default:
|
|
41
|
+
throw new Error(`Unsupported architecture on Linux: ${process.arch}`);
|
|
42
|
+
}
|
|
43
|
+
default:
|
|
44
|
+
throw new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.getExecutablePath = getExecutablePath;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare type Layer = {
|
|
2
|
+
type: 'PngImage';
|
|
3
|
+
params: {
|
|
4
|
+
src: string;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
} | {
|
|
11
|
+
type: 'JpgImage';
|
|
12
|
+
params: {
|
|
13
|
+
src: string;
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
19
|
+
} | {
|
|
20
|
+
type: 'Solid';
|
|
21
|
+
params: {
|
|
22
|
+
fill: [number, number, number, number];
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare type CompositorImageFormat = 'Png' | 'Jpeg';
|
|
30
|
+
export declare type CliInput = {
|
|
31
|
+
v: number;
|
|
32
|
+
output: string;
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
layers: Layer[];
|
|
36
|
+
output_format: CompositorImageFormat;
|
|
37
|
+
};
|
|
38
|
+
export declare type ErrorPayload = {
|
|
39
|
+
error: string;
|
|
40
|
+
backtrace: string;
|
|
41
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Since audio or video can be base64-encoded, those can be really long strings.
|
|
3
|
+
* Since we track the `src` property for every frame, Node.JS can run out of memory easily. Instead of duplicating the src for every frame, we save memory by replacing the full base 64 encoded data with a string `same-as-[asset-id]-[frame]` referencing a previous asset with the same src.
|
|
4
|
+
*/
|
|
5
|
+
import type { TAsset } from 'remotion';
|
|
6
|
+
export declare const compressAsset: (previousAssets: TAsset[], newAsset: TAsset) => TAsset;
|
|
7
|
+
export declare const isAssetCompressed: (src: string) => boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Since audio or video can be base64-encoded, those can be really long strings.
|
|
4
|
+
* Since we track the `src` property for every frame, Node.JS can run out of memory easily. Instead of duplicating the src for every frame, we save memory by replacing the full base 64 encoded data with a string `same-as-[asset-id]-[frame]` referencing a previous asset with the same src.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.isAssetCompressed = exports.compressAsset = void 0;
|
|
8
|
+
const compressAsset = (previousAssets, newAsset) => {
|
|
9
|
+
if (newAsset.src.length < 400) {
|
|
10
|
+
return newAsset;
|
|
11
|
+
}
|
|
12
|
+
const assetWithSameSrc = previousAssets.find((a) => a.src === newAsset.src);
|
|
13
|
+
if (!assetWithSameSrc) {
|
|
14
|
+
return newAsset;
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
...newAsset,
|
|
18
|
+
src: `same-as-${assetWithSameSrc.id}-${assetWithSameSrc.frame}`,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
exports.compressAsset = compressAsset;
|
|
22
|
+
const isAssetCompressed = (src) => {
|
|
23
|
+
return src.startsWith('same-as');
|
|
24
|
+
};
|
|
25
|
+
exports.isAssetCompressed = isAssetCompressed;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const convertNumberOfGifLoopsToFfmpegSyntax: (loops: number | null) => string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// https://superuser.com/questions/1607099/how-to-control-gif-loop-settings-in-ffmpeg
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.convertNumberOfGifLoopsToFfmpegSyntax = void 0;
|
|
5
|
+
const convertNumberOfGifLoopsToFfmpegSyntax = (loops) => {
|
|
6
|
+
// Infinite loop
|
|
7
|
+
if (loops === null) {
|
|
8
|
+
return '0';
|
|
9
|
+
}
|
|
10
|
+
// No loops
|
|
11
|
+
if (loops === 0) {
|
|
12
|
+
return '-1';
|
|
13
|
+
}
|
|
14
|
+
// N amount of loops
|
|
15
|
+
return String(loops);
|
|
16
|
+
};
|
|
17
|
+
exports.convertNumberOfGifLoopsToFfmpegSyntax = convertNumberOfGifLoopsToFfmpegSyntax;
|
package/dist/convert-to-pcm.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { FfmpegExecutable } from '
|
|
2
|
-
export declare const convertToPcm: ({ ffmpegExecutable, input, outName, }: {
|
|
1
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
2
|
+
export declare const convertToPcm: ({ ffmpegExecutable, input, outName, remotionRoot, }: {
|
|
3
3
|
ffmpegExecutable: FfmpegExecutable;
|
|
4
4
|
input: string;
|
|
5
5
|
outName: string;
|
|
6
|
+
remotionRoot: string;
|
|
6
7
|
}) => Promise<void>;
|
package/dist/convert-to-pcm.js
CHANGED
|
@@ -5,9 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.convertToPcm = void 0;
|
|
7
7
|
const execa_1 = __importDefault(require("execa"));
|
|
8
|
+
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
8
9
|
const sample_rate_1 = require("./sample-rate");
|
|
9
|
-
const convertToPcm = async ({ ffmpegExecutable, input, outName, }) => {
|
|
10
|
-
await (0, execa_1.default)(
|
|
10
|
+
const convertToPcm = async ({ ffmpegExecutable, input, outName, remotionRoot, }) => {
|
|
11
|
+
await (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffmpegExecutable, remotionRoot, 'ffmpeg'), [
|
|
11
12
|
'-i',
|
|
12
13
|
input,
|
|
13
14
|
'-c:a',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertToPositiveFrameIndex = void 0;
|
|
4
|
+
// Handle negative indices (e.g. -1 being the last frame)
|
|
5
|
+
const convertToPositiveFrameIndex = ({ frame, durationInFrames, }) => {
|
|
6
|
+
return frame < 0 ? durationInFrames - frame : frame;
|
|
7
|
+
};
|
|
8
|
+
exports.convertToPositiveFrameIndex = convertToPositiveFrameIndex;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DownloadMap } from './assets/download-map';
|
|
2
|
+
export declare const createFfmpegComplexFilter: (filters: number, downloadMap: DownloadMap) => Promise<{
|
|
2
3
|
complexFilterFlag: [string, string] | null;
|
|
3
4
|
cleanup: () => void;
|
|
4
5
|
}>;
|
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.createFfmpegComplexFilter = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
4
|
const create_ffmpeg_merge_filter_1 = require("./create-ffmpeg-merge-filter");
|
|
10
5
|
const ffmpeg_filter_file_1 = require("./ffmpeg-filter-file");
|
|
11
|
-
const
|
|
12
|
-
const createFfmpegComplexFilter = async (filters) => {
|
|
6
|
+
const createFfmpegComplexFilter = async (filters, downloadMap) => {
|
|
13
7
|
if (filters === 0) {
|
|
14
8
|
return { complexFilterFlag: null, cleanup: () => undefined };
|
|
15
9
|
}
|
|
16
10
|
const complexFilter = (0, create_ffmpeg_merge_filter_1.createFfmpegMergeFilter)(filters);
|
|
17
|
-
const { file, cleanup } = await (0, ffmpeg_filter_file_1.makeFfmpegFilterFile)(complexFilter);
|
|
18
|
-
const tempPath = (0, tmp_dir_1.tmpDir)('remotion-complex-filter-script');
|
|
19
|
-
const filterFile = path_1.default.join(tempPath, 'complex-filter.txt');
|
|
20
|
-
await fs_1.default.promises.writeFile(filterFile, complexFilter);
|
|
11
|
+
const { file, cleanup } = await (0, ffmpeg_filter_file_1.makeFfmpegFilterFile)(complexFilter, downloadMap);
|
|
21
12
|
return {
|
|
22
13
|
complexFilterFlag: ['-filter_complex_script', file],
|
|
23
14
|
cleanup,
|
|
File without changes
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createFfmpegMergeFilter = void 0;
|
|
4
|
-
const
|
|
4
|
+
const truthy_1 = require("./truthy");
|
|
5
5
|
const createFfmpegMergeFilter = (inputs) => {
|
|
6
6
|
const leftChannel = new Array(inputs * 2)
|
|
7
7
|
.fill(true)
|
|
8
8
|
.map((_, i) => (i % 2 === 0 ? `c${i}` : null))
|
|
9
|
-
.filter(
|
|
9
|
+
.filter(truthy_1.truthy)
|
|
10
10
|
.join('+');
|
|
11
11
|
const rightChannel = new Array(inputs * 2)
|
|
12
12
|
.fill(true)
|
|
13
13
|
.map((_, i) => (i % 2 === 1 ? `c${i}` : null))
|
|
14
|
-
.filter(
|
|
14
|
+
.filter(truthy_1.truthy)
|
|
15
15
|
.join('+');
|
|
16
16
|
return `[0:a][1:a]amerge=inputs=${inputs},pan=stereo|c0=${leftChannel}|c1=${rightChannel}[a]`;
|
|
17
17
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { FfmpegExecutable } from '
|
|
2
|
-
export declare const createSilentAudio: ({ ffmpegExecutable, numberOfSeconds, outName, }: {
|
|
1
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
2
|
+
export declare const createSilentAudio: ({ ffmpegExecutable, numberOfSeconds, outName, remotionRoot, }: {
|
|
3
3
|
ffmpegExecutable: FfmpegExecutable;
|
|
4
4
|
numberOfSeconds: number;
|
|
5
5
|
outName: string;
|
|
6
|
+
remotionRoot: string;
|
|
6
7
|
}) => Promise<void>;
|
|
@@ -5,9 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createSilentAudio = void 0;
|
|
7
7
|
const execa_1 = __importDefault(require("execa"));
|
|
8
|
+
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
8
9
|
const sample_rate_1 = require("./sample-rate");
|
|
9
|
-
const createSilentAudio = async ({ ffmpegExecutable, numberOfSeconds, outName, }) => {
|
|
10
|
-
await (0, execa_1.default)(
|
|
10
|
+
const createSilentAudio = async ({ ffmpegExecutable, numberOfSeconds, outName, remotionRoot, }) => {
|
|
11
|
+
await (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffmpegExecutable, remotionRoot, 'ffmpeg'), [
|
|
11
12
|
'-f',
|
|
12
13
|
'lavfi',
|
|
13
14
|
'-i',
|
package/dist/crf.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Codec } from './codec';
|
|
2
|
+
export declare type Crf = number | undefined;
|
|
3
|
+
export declare const getDefaultCrfForCodec: (codec: Codec) => number;
|
|
4
|
+
export declare const getValidCrfRanges: (codec: Codec) => [number, number];
|
|
5
|
+
export declare const validateQualitySettings: ({ codec, crf, videoBitrate, }: {
|
|
6
|
+
crf: unknown;
|
|
7
|
+
codec: Codec;
|
|
8
|
+
videoBitrate: string | null | undefined;
|
|
9
|
+
}) => string[];
|