@remotion/renderer 4.0.0-alpha.4 → 4.0.0-audio-mixing.3
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/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 +54 -11
- package/dist/assets/download-file.d.ts +7 -5
- package/dist/assets/download-file.js +49 -6
- package/dist/assets/download-map.d.ts +8 -3
- package/dist/assets/download-map.js +8 -4
- 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 -1
- package/dist/assets/get-audio-channels.js +5 -4
- 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 +0 -0
- package/dist/assets/read-file.js +2 -4
- 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 +1 -0
- package/dist/assets/types.js +0 -0
- package/dist/audio-codec.d.ts +27 -0
- package/dist/audio-codec.js +89 -0
- package/dist/browser/Browser.d.ts +4 -2
- package/dist/browser/Browser.js +15 -12
- package/dist/browser/BrowserConnector.d.ts +0 -0
- package/dist/browser/BrowserConnector.js +0 -0
- package/dist/browser/BrowserFetcher.d.ts +1 -0
- package/dist/browser/BrowserFetcher.js +24 -21
- package/dist/browser/BrowserPage.d.ts +8 -2
- package/dist/browser/BrowserPage.js +8 -11
- package/dist/browser/BrowserRunner.d.ts +1 -4
- package/dist/browser/BrowserRunner.js +30 -73
- 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 +2 -1
- 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 +0 -3
- 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 +0 -4
- package/dist/browser/LaunchOptions.js +0 -0
- package/dist/browser/Launcher.d.ts +7 -1
- package/dist/browser/Launcher.js +10 -368
- 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 +1 -1
- package/dist/browser/Product.d.ts +0 -0
- package/dist/browser/Product.js +0 -0
- package/dist/browser/PuppeteerNode.d.ts +0 -0
- package/dist/browser/PuppeteerNode.js +2 -9
- 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 +0 -0
- 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 +2 -44
- package/dist/browser/devtools-commands.d.ts +0 -0
- package/dist/browser/devtools-commands.js +0 -0
- package/dist/browser/devtools-types.d.ts +4 -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 +0 -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 +0 -0
- 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 +0 -0
- 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/can-use-parallel-encoding.d.ts +0 -0
- package/dist/can-use-parallel-encoding.js +0 -0
- 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 +179 -0
- package/dist/client.js +23 -0
- package/dist/codec-supports-media.d.ts +1 -0
- package/dist/codec-supports-media.js +8 -1
- package/dist/codec.d.ts +0 -0
- package/dist/codec.js +0 -0
- package/dist/combine-videos.d.ts +9 -2
- package/dist/combine-videos.js +12 -8
- package/dist/compositor/compose.d.ts +13 -0
- package/dist/compositor/compose.js +47 -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 +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-pcm.d.ts +2 -1
- 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 +1 -4
- package/dist/create-ffmpeg-complex-filter.js +0 -0
- package/dist/create-ffmpeg-merge-filter.d.ts +0 -0
- package/dist/create-ffmpeg-merge-filter.js +1 -12
- package/dist/create-silent-audio.d.ts +2 -1
- package/dist/create-silent-audio.js +3 -2
- package/dist/crf.d.ts +5 -1
- package/dist/crf.js +33 -6
- 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 +31 -5
- 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/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 +0 -0
- 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 +2 -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 +0 -0
- package/dist/ffmpeg-filter-file.js +0 -0
- 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 +25 -0
- package/dist/file-extensions.js +88 -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 +0 -0
- 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 +4 -0
- package/dist/get-compositions.js +26 -7
- package/dist/get-concurrency.d.ts +1 -1
- package/dist/get-concurrency.js +8 -1
- 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 +15 -0
- package/dist/get-frame-of-video-slow.js +72 -0
- package/dist/get-frame-padded-index.d.ts +1 -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 +0 -0
- package/dist/get-local-browser-executable.d.ts +0 -0
- package/dist/get-local-browser-executable.js +1 -3
- 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 +0 -0
- package/dist/guess-extension-for-media.d.ts +5 -1
- package/dist/guess-extension-for-media.js +4 -3
- package/dist/image-format.d.ts +1 -1
- package/dist/image-format.js +3 -0
- package/dist/index.d.ts +187 -41
- package/dist/index.js +31 -28
- 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/last-frame-from-video-cache.d.ts +2 -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/make-cancel-signal.d.ts +11 -0
- package/dist/make-cancel-signal.js +24 -1
- package/dist/merge-audio-track.d.ts +1 -0
- package/dist/merge-audio-track.js +28 -18
- 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 +6 -1
- package/dist/normalize-serve-url.d.ts +0 -0
- package/dist/normalize-serve-url.js +0 -0
- package/dist/offthread-video-server.d.ts +2 -1
- package/dist/offthread-video-server.js +13 -1
- package/dist/open-browser.d.ts +4 -0
- package/dist/open-browser.js +7 -13
- 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 +0 -0
- package/dist/perf.js +0 -0
- 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 +3 -2
- package/dist/prepare-server.js +8 -3
- package/dist/preprocess-audio-track.d.ts +1 -0
- package/dist/preprocess-audio-track.js +4 -3
- package/dist/prespawn-ffmpeg.d.ts +4 -1
- package/dist/prespawn-ffmpeg.js +17 -12
- package/dist/prestitcher-memory-usage.d.ts +0 -0
- package/dist/prestitcher-memory-usage.js +0 -0
- package/dist/prores-profile.d.ts +4 -1
- package/dist/prores-profile.js +6 -6
- package/dist/provide-screenshot.d.ts +5 -1
- package/dist/provide-screenshot.js +4 -1
- package/dist/puppeteer-evaluate.d.ts +0 -0
- package/dist/puppeteer-evaluate.js +19 -11
- package/dist/puppeteer-screenshot.d.ts +11 -2
- package/dist/puppeteer-screenshot.js +11 -14
- 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 +15 -3
- package/dist/render-frames.js +176 -84
- package/dist/render-media.d.ts +38 -6
- package/dist/render-media.js +123 -27
- package/dist/render-still.d.ts +8 -4
- package/dist/render-still.js +62 -31
- 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 +5 -1
- package/dist/screenshot-dom-element.js +10 -2
- package/dist/screenshot-task.d.ts +12 -2
- package/dist/screenshot-task.js +24 -9
- package/dist/seek-to-frame.d.ts +1 -0
- package/dist/seek-to-frame.js +49 -3
- package/dist/serve-handler/index.d.ts +0 -0
- package/dist/serve-handler/index.js +0 -0
- 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 +1 -0
- package/dist/serve-static.js +77 -41
- package/dist/set-props-and-env.d.ts +3 -1
- package/dist/set-props-and-env.js +39 -15
- package/dist/stitch-frames-to-video.d.ts +14 -1
- package/dist/stitch-frames-to-video.js +118 -49
- package/dist/stringify-ffmpeg-filter.d.ts +2 -1
- package/dist/stringify-ffmpeg-filter.js +4 -2
- package/dist/symbolicate-stacktrace.d.ts +0 -0
- package/dist/symbolicate-stacktrace.js +0 -0
- 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 +0 -0
- package/dist/truthy.js +0 -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 +0 -0
- package/dist/types.js +0 -0
- package/dist/validate-concurrency.d.ts +0 -0
- package/dist/validate-concurrency.js +14 -9
- 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 +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 +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/package.json +21 -11
- 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/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/LICENSE.md
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
# Remotion License
|
|
2
2
|
|
|
3
|
-
Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion create videos for free (even commercial), while a company license is required for for-profit
|
|
3
|
+
Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion to create videos for free (even commercial), while a company license is required for for-profit organizations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
|
|
4
4
|
|
|
5
5
|
- [Free license](#free-license)
|
|
6
6
|
- [Company license](#company-license)
|
|
7
7
|
|
|
8
8
|
## Free license
|
|
9
9
|
|
|
10
|
-
Copyright ©
|
|
10
|
+
Copyright © 2023 [Remotion](https://www.remotion.dev/)
|
|
11
11
|
|
|
12
12
|
### Eligibility
|
|
13
13
|
|
|
14
14
|
You are eligible to use Remotion for free if you are:
|
|
15
15
|
|
|
16
16
|
- an individual
|
|
17
|
-
- a for-profit
|
|
18
|
-
- a non-profit or not-for-profit
|
|
17
|
+
- a for-profit organization with up to 3 employees
|
|
18
|
+
- a non-profit or not-for-profit organization
|
|
19
19
|
- evaluating whether Remotion is a good fit, and are not yet using it in a commercial way
|
|
20
20
|
|
|
21
21
|
### Allowed use cases
|
|
22
22
|
|
|
23
|
-
Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify
|
|
23
|
+
Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
|
|
24
24
|
|
|
25
25
|
### Disallowed use cases
|
|
26
26
|
|
|
27
|
-
It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, sublicensing your own derivate of Remotion.
|
|
27
|
+
It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, or sublicensing your own derivate of Remotion.
|
|
28
28
|
|
|
29
29
|
### Warranty notice
|
|
30
30
|
|
|
31
|
-
The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and
|
|
31
|
+
The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
|
|
32
32
|
|
|
33
33
|
### Support
|
|
34
34
|
|
|
@@ -36,6 +36,6 @@ Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
|
|
|
36
36
|
|
|
37
37
|
## Company license
|
|
38
38
|
|
|
39
|
-
You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support.
|
|
39
|
+
You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support (read the [Support Policy](/docs/support)).
|
|
40
40
|
|
|
41
41
|
Visit [companies.remotion.dev](https://companies.remotion.dev) for pricing and to buy a license.
|
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Rust development
|
|
2
|
+
|
|
3
|
+
To participate in the development of the Rust parts of Remotion, you need to do additional steps. If you don't want to change the Rust code, you don't have to set anything up.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
These are instructions for macOS. Contributions for other platforms are appreciated.
|
|
8
|
+
|
|
9
|
+
First, install Cargo, if you don't have it, or upgrade to a version that supports `edition-2021`:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
curl https://sh.rustup.rs -sSf | sh
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Second, install components that allow for cross-compilation:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
sh install_platforms.sh
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Third, install linkers for cross compilation:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
brew install MaterializeInc/crosstools/x86_64-unknown-linux-gnu
|
|
25
|
+
brew install MaterializeInc/crosstools/aarch64-unknown-linux-gnu
|
|
26
|
+
brew install messense/macos-cross-toolchains/x86_64-unknown-linux-musl
|
|
27
|
+
brew install messense/macos-cross-toolchains/aarch64-unknown-linux-musl
|
|
28
|
+
brew install mingw-w64
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
> This will take a few minutes.
|
|
32
|
+
|
|
33
|
+
## Building
|
|
34
|
+
|
|
35
|
+
To build the Rust parts for your operating system, run:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
node build.mjs
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
To build the Rust binaries for all supported platforms, run:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
node build.mjs --all
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The resulting artifacts should be checked into Git.
|
package/client.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/client';
|
package/client.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/client');
|
|
File without changes
|
|
@@ -42,6 +42,7 @@ const calculateAssetPositions = (frames) => {
|
|
|
42
42
|
trimLeft: asset.mediaFrame,
|
|
43
43
|
volume: [],
|
|
44
44
|
playbackRate: asset.playbackRate,
|
|
45
|
+
allowAmplificationDuringRender: asset.allowAmplificationDuringRender,
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
48
|
const found = assets.find((a) => a.duration === null && areEqual(a, asset));
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -11,10 +11,11 @@ export declare const downloadAsset: ({ src, onDownload, downloadMap, }: {
|
|
|
11
11
|
downloadMap: DownloadMap;
|
|
12
12
|
}) => Promise<string>;
|
|
13
13
|
export declare const markAllAssetsAsDownloaded: (downloadMap: DownloadMap) => void;
|
|
14
|
-
export declare const getSanitizedFilenameForAssetUrl: ({ src, downloadDir, contentDisposition, }: {
|
|
14
|
+
export declare const getSanitizedFilenameForAssetUrl: ({ src, downloadDir, contentDisposition, contentType, }: {
|
|
15
15
|
src: string;
|
|
16
16
|
downloadDir: string;
|
|
17
17
|
contentDisposition: string | null;
|
|
18
|
+
contentType: string | null;
|
|
18
19
|
}) => string;
|
|
19
20
|
export declare const downloadAndMapAssetsToFileUrl: ({ asset, onDownload, downloadMap, }: {
|
|
20
21
|
asset: TAsset;
|
|
@@ -1,14 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
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;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
29
|
exports.downloadAndMapAssetsToFileUrl = exports.getSanitizedFilenameForAssetUrl = exports.markAllAssetsAsDownloaded = exports.downloadAsset = void 0;
|
|
7
30
|
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 =
|
|
31
|
+
const path_1 = __importStar(require("path"));
|
|
9
32
|
const remotion_1 = require("remotion");
|
|
10
33
|
const compress_assets_1 = require("../compress-assets");
|
|
11
34
|
const ensure_output_directory_1 = require("../ensure-output-directory");
|
|
35
|
+
const mime_types_1 = require("../mime-types");
|
|
12
36
|
const download_file_1 = require("./download-file");
|
|
13
37
|
const sanitize_filepath_1 = require("./sanitize-filepath");
|
|
14
38
|
const waitForAssetToBeDownloaded = ({ src, downloadDir, downloadMap, }) => {
|
|
@@ -117,12 +141,6 @@ const downloadAsset = async ({ src, onDownload, downloadMap, }) => {
|
|
|
117
141
|
downloadMap.isDownloadingMap[src][downloadDir] = true;
|
|
118
142
|
const onProgress = onDownload(src);
|
|
119
143
|
if (src.startsWith('data:')) {
|
|
120
|
-
const output = (0, exports.getSanitizedFilenameForAssetUrl)({
|
|
121
|
-
contentDisposition: null,
|
|
122
|
-
downloadDir,
|
|
123
|
-
src,
|
|
124
|
-
});
|
|
125
|
-
(0, ensure_output_directory_1.ensureOutputDirectory)(output);
|
|
126
144
|
const [assetDetails, assetData] = src.substring('data:'.length).split(',');
|
|
127
145
|
if (!assetDetails.includes(';')) {
|
|
128
146
|
const errMessage = [
|
|
@@ -136,6 +154,13 @@ const downloadAsset = async ({ src, onDownload, downloadMap, }) => {
|
|
|
136
154
|
const [mimeType, encoding] = assetDetails.split(';');
|
|
137
155
|
validateMimeType(mimeType, src);
|
|
138
156
|
validateBufferEncoding(encoding, src);
|
|
157
|
+
const output = (0, exports.getSanitizedFilenameForAssetUrl)({
|
|
158
|
+
contentDisposition: null,
|
|
159
|
+
downloadDir,
|
|
160
|
+
src,
|
|
161
|
+
contentType: mimeType,
|
|
162
|
+
});
|
|
163
|
+
(0, ensure_output_directory_1.ensureOutputDirectory)(output);
|
|
139
164
|
const buff = Buffer.from(assetData, encoding);
|
|
140
165
|
await fs_1.default.promises.writeFile(output, buff);
|
|
141
166
|
notifyAssetIsDownloaded({ src, downloadMap, downloadDir, to: output });
|
|
@@ -146,7 +171,12 @@ const downloadAsset = async ({ src, onDownload, downloadMap, }) => {
|
|
|
146
171
|
onProgress: (progress) => {
|
|
147
172
|
onProgress === null || onProgress === void 0 ? void 0 : onProgress(progress);
|
|
148
173
|
},
|
|
149
|
-
to: (contentDisposition) => (0, exports.getSanitizedFilenameForAssetUrl)({
|
|
174
|
+
to: (contentDisposition, contentType) => (0, exports.getSanitizedFilenameForAssetUrl)({
|
|
175
|
+
contentDisposition,
|
|
176
|
+
downloadDir,
|
|
177
|
+
src,
|
|
178
|
+
contentType,
|
|
179
|
+
}),
|
|
150
180
|
});
|
|
151
181
|
notifyAssetIsDownloaded({ src, downloadMap, downloadDir, to });
|
|
152
182
|
return to;
|
|
@@ -161,7 +191,7 @@ const markAllAssetsAsDownloaded = (downloadMap) => {
|
|
|
161
191
|
});
|
|
162
192
|
};
|
|
163
193
|
exports.markAllAssetsAsDownloaded = markAllAssetsAsDownloaded;
|
|
164
|
-
const getFilename = ({ contentDisposition, src, }) => {
|
|
194
|
+
const getFilename = ({ contentDisposition, src, contentType, }) => {
|
|
165
195
|
const filenameProbe = 'filename=';
|
|
166
196
|
if (contentDisposition === null || contentDisposition === void 0 ? void 0 : contentDisposition.includes(filenameProbe)) {
|
|
167
197
|
const start = contentDisposition.indexOf(filenameProbe);
|
|
@@ -176,13 +206,26 @@ const getFilename = ({ contentDisposition, src, }) => {
|
|
|
176
206
|
};
|
|
177
207
|
}
|
|
178
208
|
const { pathname, search } = new URL(src);
|
|
209
|
+
const ext = (0, path_1.extname)(pathname);
|
|
210
|
+
// Has no file extension, check if we can derive it from contentType
|
|
211
|
+
if (!ext && contentType) {
|
|
212
|
+
const matchedExt = (0, mime_types_1.getExt)(contentType);
|
|
213
|
+
return {
|
|
214
|
+
pathname: `${pathname}.${matchedExt}`,
|
|
215
|
+
search,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
179
218
|
return { pathname, search };
|
|
180
219
|
};
|
|
181
|
-
const getSanitizedFilenameForAssetUrl = ({ src, downloadDir, contentDisposition, }) => {
|
|
220
|
+
const getSanitizedFilenameForAssetUrl = ({ src, downloadDir, contentDisposition, contentType, }) => {
|
|
182
221
|
if ((0, compress_assets_1.isAssetCompressed)(src)) {
|
|
183
222
|
return src;
|
|
184
223
|
}
|
|
185
|
-
const { pathname, search } = getFilename({
|
|
224
|
+
const { pathname, search } = getFilename({
|
|
225
|
+
contentDisposition,
|
|
226
|
+
contentType,
|
|
227
|
+
src,
|
|
228
|
+
});
|
|
186
229
|
const split = pathname.split('.');
|
|
187
230
|
const fileExtension = split.length > 1 && split[split.length - 1]
|
|
188
231
|
? `.${split[split.length - 1]}`
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
declare type Response = {
|
|
2
|
+
sizeInBytes: number;
|
|
3
|
+
to: string;
|
|
4
|
+
};
|
|
1
5
|
export declare const downloadFile: ({ onProgress, url, to: toFn, }: {
|
|
2
6
|
url: string;
|
|
3
|
-
to: (contentDisposition: string | null) => string;
|
|
7
|
+
to: (contentDisposition: string | null, contentType: string | null) => string;
|
|
4
8
|
onProgress: ((progress: {
|
|
5
9
|
percent: number | null;
|
|
6
10
|
downloaded: number;
|
|
7
11
|
totalSize: number | null;
|
|
8
12
|
}) => void) | undefined;
|
|
9
|
-
}) => Promise<
|
|
10
|
-
|
|
11
|
-
to: string;
|
|
12
|
-
}>;
|
|
13
|
+
}) => Promise<Response>;
|
|
14
|
+
export {};
|
|
@@ -6,11 +6,41 @@ const ensure_output_directory_1 = require("../ensure-output-directory");
|
|
|
6
6
|
const read_file_1 = require("./read-file");
|
|
7
7
|
const downloadFile = ({ onProgress, url, to: toFn, }) => {
|
|
8
8
|
return new Promise((resolve, reject) => {
|
|
9
|
+
let rejected = false;
|
|
10
|
+
let resolved = false;
|
|
11
|
+
let timeout;
|
|
12
|
+
const resolveAndFlag = (val) => {
|
|
13
|
+
resolved = true;
|
|
14
|
+
resolve(val);
|
|
15
|
+
if (timeout) {
|
|
16
|
+
clearTimeout(timeout);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const rejectAndFlag = (err) => {
|
|
20
|
+
if (timeout) {
|
|
21
|
+
clearTimeout(timeout);
|
|
22
|
+
}
|
|
23
|
+
reject(err);
|
|
24
|
+
rejected = true;
|
|
25
|
+
};
|
|
26
|
+
const refreshTimeout = () => {
|
|
27
|
+
if (timeout) {
|
|
28
|
+
clearTimeout(timeout);
|
|
29
|
+
}
|
|
30
|
+
timeout = setTimeout(() => {
|
|
31
|
+
if (resolved) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
rejectAndFlag(new Error(`Tried to download file ${url}, but the server sent no data for 20 seconds`));
|
|
35
|
+
}, 20000);
|
|
36
|
+
};
|
|
37
|
+
refreshTimeout();
|
|
9
38
|
(0, read_file_1.readFile)(url)
|
|
10
39
|
.then((res) => {
|
|
11
|
-
var _a;
|
|
40
|
+
var _a, _b;
|
|
12
41
|
const contentDisposition = (_a = res.headers['content-disposition']) !== null && _a !== void 0 ? _a : null;
|
|
13
|
-
const
|
|
42
|
+
const contentType = (_b = res.headers['content-type']) !== null && _b !== void 0 ? _b : null;
|
|
43
|
+
const to = toFn(contentDisposition, contentType);
|
|
14
44
|
(0, ensure_output_directory_1.ensureOutputDirectory)(to);
|
|
15
45
|
const sizeHeader = res.headers['content-length'];
|
|
16
46
|
const totalSize = typeof sizeHeader === 'undefined' ? null : Number(sizeHeader);
|
|
@@ -20,26 +50,39 @@ const downloadFile = ({ onProgress, url, to: toFn, }) => {
|
|
|
20
50
|
// concise method to avoid this problem
|
|
21
51
|
// https://github.com/remotion-dev/remotion/issues/384#issuecomment-844398183
|
|
22
52
|
writeStream.on('close', () => {
|
|
53
|
+
if (rejected) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
23
56
|
onProgress === null || onProgress === void 0 ? void 0 : onProgress({
|
|
24
57
|
downloaded,
|
|
25
58
|
percent: 1,
|
|
26
59
|
totalSize: downloaded,
|
|
27
60
|
});
|
|
28
|
-
|
|
61
|
+
refreshTimeout();
|
|
62
|
+
return resolveAndFlag({ sizeInBytes: downloaded, to });
|
|
29
63
|
});
|
|
30
|
-
writeStream.on('error', (err) =>
|
|
31
|
-
res.
|
|
64
|
+
writeStream.on('error', (err) => rejectAndFlag(err));
|
|
65
|
+
res.on('error', (err) => rejectAndFlag(err));
|
|
66
|
+
res.pipe(writeStream).on('error', (err) => rejectAndFlag(err));
|
|
32
67
|
res.on('data', (d) => {
|
|
68
|
+
refreshTimeout();
|
|
33
69
|
downloaded += d.length;
|
|
70
|
+
refreshTimeout();
|
|
34
71
|
onProgress === null || onProgress === void 0 ? void 0 : onProgress({
|
|
35
72
|
downloaded,
|
|
36
73
|
percent: totalSize === null ? null : downloaded / totalSize,
|
|
37
74
|
totalSize,
|
|
38
75
|
});
|
|
39
76
|
});
|
|
77
|
+
res.on('close', () => {
|
|
78
|
+
if (totalSize !== null && downloaded !== totalSize) {
|
|
79
|
+
rejectAndFlag(new Error(`Download finished with ${downloaded} bytes, but expected ${totalSize} bytes from 'Content-Length'.`));
|
|
80
|
+
}
|
|
81
|
+
writeStream.close();
|
|
82
|
+
});
|
|
40
83
|
})
|
|
41
84
|
.catch((err) => {
|
|
42
|
-
|
|
85
|
+
rejectAndFlag(err);
|
|
43
86
|
});
|
|
44
87
|
});
|
|
45
88
|
};
|
|
@@ -7,9 +7,10 @@ declare type EncodingStatus = {
|
|
|
7
7
|
src: string;
|
|
8
8
|
} | undefined;
|
|
9
9
|
export declare type SpecialVCodecForTransparency = 'vp9' | 'vp8' | 'none';
|
|
10
|
+
export declare type NeedsResize = [number, number] | null;
|
|
10
11
|
export declare type Vp9Result = {
|
|
11
|
-
|
|
12
|
-
needsResize:
|
|
12
|
+
specialVcodecForTransparency: SpecialVCodecForTransparency;
|
|
13
|
+
needsResize: NeedsResize;
|
|
13
14
|
};
|
|
14
15
|
export declare type VideoDurationResult = {
|
|
15
16
|
duration: number | null;
|
|
@@ -52,6 +53,10 @@ export declare type DownloadMap = {
|
|
|
52
53
|
audioPreprocessing: string;
|
|
53
54
|
stitchFrames: string;
|
|
54
55
|
assetDir: string;
|
|
56
|
+
compositingDir: string;
|
|
57
|
+
compositorCache: {
|
|
58
|
+
[key: string]: string;
|
|
59
|
+
};
|
|
55
60
|
};
|
|
56
61
|
export declare type RenderAssetInfo = {
|
|
57
62
|
assets: TAsset[][];
|
|
@@ -60,5 +65,5 @@ export declare type RenderAssetInfo = {
|
|
|
60
65
|
downloadMap: DownloadMap;
|
|
61
66
|
};
|
|
62
67
|
export declare const makeDownloadMap: () => DownloadMap;
|
|
63
|
-
export declare const cleanDownloadMap: (downloadMap: DownloadMap) =>
|
|
68
|
+
export declare const cleanDownloadMap: (downloadMap: DownloadMap) => void;
|
|
64
69
|
export {};
|
|
@@ -62,12 +62,16 @@ const makeDownloadMap = () => {
|
|
|
62
62
|
audioMixing: makeAndReturn(dir, 'remotion-audio-mixing'),
|
|
63
63
|
audioPreprocessing: makeAndReturn(dir, 'remotion-audio-preprocessing'),
|
|
64
64
|
stitchFrames: makeAndReturn(dir, 'remotion-stitch-temp-dir'),
|
|
65
|
+
compositingDir: makeAndReturn(dir, 'remotion-compositing-temp-dir'),
|
|
66
|
+
compositorCache: {},
|
|
65
67
|
};
|
|
66
68
|
};
|
|
67
69
|
exports.makeDownloadMap = makeDownloadMap;
|
|
68
|
-
const cleanDownloadMap =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
const cleanDownloadMap = (downloadMap) => {
|
|
71
|
+
(0, delete_directory_1.deleteDirectory)(downloadMap.downloadDir);
|
|
72
|
+
(0, delete_directory_1.deleteDirectory)(downloadMap.complexFilter);
|
|
73
|
+
(0, delete_directory_1.deleteDirectory)(downloadMap.compositingDir);
|
|
74
|
+
// Assets dir must be last since the others are contained
|
|
75
|
+
(0, delete_directory_1.deleteDirectory)(downloadMap.assetDir);
|
|
72
76
|
};
|
|
73
77
|
exports.cleanDownloadMap = cleanDownloadMap;
|
|
@@ -4,9 +4,10 @@ declare type FfmpegVolumeExpression = {
|
|
|
4
4
|
eval: FfmpegEval;
|
|
5
5
|
value: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const ffmpegVolumeExpression: ({ volume, fps, trimLeft, }: {
|
|
7
|
+
export declare const ffmpegVolumeExpression: ({ volume, fps, trimLeft, allowAmplificationDuringRender, }: {
|
|
8
8
|
volume: AssetVolume;
|
|
9
9
|
trimLeft: number;
|
|
10
10
|
fps: number;
|
|
11
|
+
allowAmplificationDuringRender: boolean;
|
|
11
12
|
}) => FfmpegVolumeExpression;
|
|
12
13
|
export {};
|
|
@@ -43,13 +43,14 @@ const ffmpegBuildVolumeExpression = (arr, delay, fps) => {
|
|
|
43
43
|
const [volume, frames] = first;
|
|
44
44
|
return ffmpegIfOrElse(ffmpegIsOneOfFrames({ frames, trimLeft: delay, fps }), String(volume), ffmpegBuildVolumeExpression(rest, delay, fps));
|
|
45
45
|
};
|
|
46
|
-
const ffmpegVolumeExpression = ({ volume, fps, trimLeft, }) => {
|
|
46
|
+
const ffmpegVolumeExpression = ({ volume, fps, trimLeft, allowAmplificationDuringRender, }) => {
|
|
47
|
+
const maxVolume = allowAmplificationDuringRender ? Infinity : 1;
|
|
47
48
|
// If it's a static volume, we return it and tell
|
|
48
49
|
// FFMPEG it only has to evaluate it once
|
|
49
50
|
if (typeof volume === 'number') {
|
|
50
51
|
return {
|
|
51
52
|
eval: 'once',
|
|
52
|
-
value: String(Math.min(
|
|
53
|
+
value: String(Math.min(maxVolume, volume)),
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
56
|
if ([...new Set(volume)].length === 1) {
|
|
@@ -57,6 +58,7 @@ const ffmpegVolumeExpression = ({ volume, fps, trimLeft, }) => {
|
|
|
57
58
|
volume: volume[0],
|
|
58
59
|
fps,
|
|
59
60
|
trimLeft,
|
|
61
|
+
allowAmplificationDuringRender,
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
64
|
// A 1 sec video with frames 0-29 would mean that
|
|
@@ -71,7 +73,7 @@ const ffmpegVolumeExpression = ({ volume, fps, trimLeft, }) => {
|
|
|
71
73
|
const volumeMap = {};
|
|
72
74
|
paddedVolume.forEach((baseVolume, frame) => {
|
|
73
75
|
// Adjust volume based on how many other tracks have not yet finished
|
|
74
|
-
const actualVolume = (0, round_volume_to_avoid_stack_overflow_1.roundVolumeToAvoidStackOverflow)(Math.min(
|
|
76
|
+
const actualVolume = (0, round_volume_to_avoid_stack_overflow_1.roundVolumeToAvoidStackOverflow)(Math.min(maxVolume, baseVolume));
|
|
75
77
|
if (!volumeMap[actualVolume]) {
|
|
76
78
|
volumeMap[actualVolume] = [];
|
|
77
79
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { FfmpegExecutable } from '../ffmpeg-executable';
|
|
2
2
|
import type { AudioChannelsAndDurationResultCache, DownloadMap } from './download-map';
|
|
3
|
-
export declare const getAudioChannelsAndDuration: (downloadMap: DownloadMap, src: string, ffprobeExecutable: FfmpegExecutable) => Promise<AudioChannelsAndDurationResultCache>;
|
|
3
|
+
export declare const getAudioChannelsAndDuration: (downloadMap: DownloadMap, src: string, ffprobeExecutable: FfmpegExecutable, remotionRoot: string) => Promise<AudioChannelsAndDurationResultCache>;
|
|
@@ -5,9 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getAudioChannelsAndDuration = void 0;
|
|
7
7
|
const execa_1 = __importDefault(require("execa"));
|
|
8
|
+
const ffmpeg_flags_1 = require("../ffmpeg-flags");
|
|
8
9
|
const p_limit_1 = require("../p-limit");
|
|
9
10
|
const limit = (0, p_limit_1.pLimit)(1);
|
|
10
|
-
async function getAudioChannelsAndDurationUnlimited(downloadMap, src, ffprobeExecutable) {
|
|
11
|
+
async function getAudioChannelsAndDurationUnlimited(downloadMap, src, ffprobeExecutable, remotionRoot) {
|
|
11
12
|
if (downloadMap.durationOfAssetCache[src]) {
|
|
12
13
|
return downloadMap.durationOfAssetCache[src];
|
|
13
14
|
}
|
|
@@ -19,7 +20,7 @@ async function getAudioChannelsAndDurationUnlimited(downloadMap, src, ffprobeExe
|
|
|
19
20
|
]
|
|
20
21
|
.reduce((acc, val) => acc.concat(val), [])
|
|
21
22
|
.filter(Boolean);
|
|
22
|
-
const task = await (0, execa_1.default)(
|
|
23
|
+
const task = await (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffprobeExecutable, remotionRoot, 'ffprobe'), args);
|
|
23
24
|
const channels = task.stdout.match(/channels=([0-9]+)/);
|
|
24
25
|
const duration = task.stdout.match(/duration=([0-9.]+)/);
|
|
25
26
|
const result = {
|
|
@@ -29,7 +30,7 @@ async function getAudioChannelsAndDurationUnlimited(downloadMap, src, ffprobeExe
|
|
|
29
30
|
downloadMap.durationOfAssetCache[src] = result;
|
|
30
31
|
return result;
|
|
31
32
|
}
|
|
32
|
-
const getAudioChannelsAndDuration = (downloadMap, src, ffprobeExecutable) => {
|
|
33
|
-
return limit(() => getAudioChannelsAndDurationUnlimited(downloadMap, src, ffprobeExecutable));
|
|
33
|
+
const getAudioChannelsAndDuration = (downloadMap, src, ffprobeExecutable, remotionRoot) => {
|
|
34
|
+
return limit(() => getAudioChannelsAndDurationUnlimited(downloadMap, src, ffprobeExecutable, remotionRoot));
|
|
34
35
|
};
|
|
35
36
|
exports.getAudioChannelsAndDuration = getAudioChannelsAndDuration;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import type { FfmpegExecutable } from '../ffmpeg-executable';
|
|
2
2
|
import type { DownloadMap, VideoDurationResult } from './download-map';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const parseVideoStreamDuration: (stdout: string) => VideoDurationResult;
|
|
4
|
+
export declare function getVideoStreamDurationwithoutCache({ src, ffprobeExecutable, remotionRoot, }: {
|
|
5
|
+
src: string;
|
|
6
|
+
ffprobeExecutable: FfmpegExecutable;
|
|
7
|
+
remotionRoot: string;
|
|
8
|
+
}): Promise<VideoDurationResult>;
|
|
9
|
+
export declare const getVideoStreamDuration: (downloadMap: DownloadMap, src: string, ffprobeExecutable: FfmpegExecutable, remotionRoot: string) => Promise<VideoDurationResult>;
|
|
@@ -3,33 +3,69 @@ 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.getVideoStreamDuration = void 0;
|
|
6
|
+
exports.getVideoStreamDuration = exports.getVideoStreamDurationwithoutCache = exports.parseVideoStreamDuration = void 0;
|
|
7
7
|
const execa_1 = __importDefault(require("execa"));
|
|
8
|
+
const ffmpeg_flags_1 = require("../ffmpeg-flags");
|
|
8
9
|
const p_limit_1 = require("../p-limit");
|
|
9
10
|
const limit = (0, p_limit_1.pLimit)(1);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const parseAlternativeDuration = (stdout) => {
|
|
12
|
+
const webmDuration = stdout.match(/TAG:DURATION=([0-9.]+):([0-9.]+):([0-9.]+)/);
|
|
13
|
+
if (!webmDuration) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const [, hours, minutes, seconds] = webmDuration;
|
|
17
|
+
const hoursAsNumber = Number(hours);
|
|
18
|
+
if (Number.isNaN(hoursAsNumber)) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const minutesAsNumber = Number(minutes);
|
|
22
|
+
if (Number.isNaN(minutesAsNumber)) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const secondsAsNumber = Number(seconds);
|
|
26
|
+
if (Number.isNaN(secondsAsNumber)) {
|
|
27
|
+
return null;
|
|
13
28
|
}
|
|
29
|
+
return secondsAsNumber + minutesAsNumber * 60 + hoursAsNumber * 3600;
|
|
30
|
+
};
|
|
31
|
+
const parseVideoStreamDuration = (stdout) => {
|
|
32
|
+
const duration = stdout.match(/duration=([0-9.]+)/);
|
|
33
|
+
const alternativeDuration = parseAlternativeDuration(stdout);
|
|
34
|
+
const fps = stdout.match(/r_frame_rate=([0-9.]+)\/([0-9.]+)/);
|
|
35
|
+
const result = {
|
|
36
|
+
duration: duration ? parseFloat(duration[1]) : alternativeDuration,
|
|
37
|
+
fps: fps ? parseInt(fps[1], 10) / parseInt(fps[2], 10) : null,
|
|
38
|
+
};
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
exports.parseVideoStreamDuration = parseVideoStreamDuration;
|
|
42
|
+
async function getVideoStreamDurationwithoutCache({ src, ffprobeExecutable, remotionRoot, }) {
|
|
14
43
|
const args = [
|
|
15
44
|
['-v', 'error'],
|
|
16
45
|
['-select_streams', 'v:0'],
|
|
17
|
-
['-show_entries', 'stream
|
|
46
|
+
['-show_entries', 'stream'],
|
|
18
47
|
[src],
|
|
19
48
|
]
|
|
20
49
|
.reduce((acc, val) => acc.concat(val), [])
|
|
21
50
|
.filter(Boolean);
|
|
22
|
-
const task = await (0, execa_1.default)(
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
51
|
+
const task = await (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffprobeExecutable, remotionRoot, 'ffprobe'), args);
|
|
52
|
+
const result = (0, exports.parseVideoStreamDuration)(task.stdout);
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
exports.getVideoStreamDurationwithoutCache = getVideoStreamDurationwithoutCache;
|
|
56
|
+
async function getVideoStreamDurationUnlimited(downloadMap, src, ffprobeExecutable, remotionRoot) {
|
|
57
|
+
if (downloadMap.videoDurationResultCache[src]) {
|
|
58
|
+
return downloadMap.videoDurationResultCache[src];
|
|
59
|
+
}
|
|
60
|
+
const result = await getVideoStreamDurationwithoutCache({
|
|
61
|
+
src,
|
|
62
|
+
ffprobeExecutable,
|
|
63
|
+
remotionRoot,
|
|
64
|
+
});
|
|
29
65
|
downloadMap.videoDurationResultCache[src] = result;
|
|
30
66
|
return result;
|
|
31
67
|
}
|
|
32
|
-
const getVideoStreamDuration = (downloadMap, src, ffprobeExecutable) => {
|
|
33
|
-
return limit(() => getVideoStreamDurationUnlimited(downloadMap, src, ffprobeExecutable));
|
|
68
|
+
const getVideoStreamDuration = (downloadMap, src, ffprobeExecutable, remotionRoot) => {
|
|
69
|
+
return limit(() => getVideoStreamDurationUnlimited(downloadMap, src, ffprobeExecutable, remotionRoot));
|
|
34
70
|
};
|
|
35
71
|
exports.getVideoStreamDuration = getVideoStreamDuration;
|
|
File without changes
|
package/dist/assets/read-file.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.readFile = void 0;
|
|
7
7
|
const http_1 = __importDefault(require("http"));
|
|
8
8
|
const https_1 = __importDefault(require("https"));
|
|
9
|
+
const redirect_status_codes_1 = require("../redirect-status-codes");
|
|
9
10
|
const getClient = (url) => {
|
|
10
11
|
if (url.startsWith('https://')) {
|
|
11
12
|
return https_1.default.get;
|
|
@@ -29,10 +30,7 @@ const readFile = async (url, redirectsSoFar = 0) => {
|
|
|
29
30
|
throw new Error(`Too many redirects while downloading ${url}`);
|
|
30
31
|
}
|
|
31
32
|
const file = await readFileWithoutRedirect(url);
|
|
32
|
-
if (file.statusCode
|
|
33
|
-
file.statusCode === 301 ||
|
|
34
|
-
file.statusCode === 307 ||
|
|
35
|
-
file.statusCode === 308) {
|
|
33
|
+
if (redirect_status_codes_1.redirectStatusCodes.includes(file.statusCode)) {
|
|
36
34
|
if (!file.headers.location) {
|
|
37
35
|
throw new Error(`Received a status code ${file.statusCode} but no "Location" header while calling ${file.headers.location}`);
|
|
38
36
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|