@remotion/renderer 4.0.0-webhook.26 → 4.1.0-alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +8 -8
- package/README.md +9 -0
- package/client.d.ts +1 -0
- package/client.js +1 -0
- package/dist/assets/calculate-asset-positions.d.ts +0 -0
- package/dist/assets/calculate-asset-positions.js +1 -0
- package/dist/assets/calculate-atempo.d.ts +0 -0
- package/dist/assets/calculate-atempo.js +0 -0
- package/dist/assets/convert-assets-to-file-urls.d.ts +0 -0
- package/dist/assets/convert-assets-to-file-urls.js +0 -0
- package/dist/assets/download-and-map-assets-to-file.d.ts +6 -4
- package/dist/assets/download-and-map-assets-to-file.js +49 -19
- package/dist/assets/download-file.d.ts +8 -5
- package/dist/assets/download-file.js +71 -8
- package/dist/assets/download-map.d.ts +8 -29
- package/dist/assets/download-map.js +15 -16
- package/dist/assets/ffmpeg-volume-expression.d.ts +4 -3
- package/dist/assets/ffmpeg-volume-expression.js +5 -3
- package/dist/assets/flatten-volume-array.d.ts +0 -0
- package/dist/assets/flatten-volume-array.js +0 -0
- package/dist/assets/get-audio-channels.d.ts +2 -2
- package/dist/assets/get-audio-channels.js +14 -12
- package/dist/assets/read-file.d.ts +1 -1
- package/dist/assets/read-file.js +5 -7
- package/dist/assets/round-volume-to-avoid-stack-overflow.d.ts +0 -0
- package/dist/assets/round-volume-to-avoid-stack-overflow.js +0 -0
- package/dist/assets/sanitize-filename.d.ts +0 -0
- package/dist/assets/sanitize-filename.js +0 -0
- package/dist/assets/sanitize-filepath.d.ts +0 -0
- package/dist/assets/sanitize-filepath.js +2 -2
- package/dist/assets/truncate-utf8-bytes.d.ts +0 -0
- package/dist/assets/truncate-utf8-bytes.js +0 -0
- package/dist/assets/types.d.ts +5 -4
- package/dist/assets/types.js +0 -0
- package/dist/audio-codec.d.ts +28 -0
- package/dist/audio-codec.js +83 -0
- package/dist/browser/Browser.d.ts +16 -14
- package/dist/browser/Browser.js +69 -72
- package/dist/browser/BrowserConnector.d.ts +0 -0
- package/dist/browser/BrowserConnector.js +0 -0
- package/dist/browser/BrowserFetcher.d.ts +16 -64
- package/dist/browser/BrowserFetcher.js +147 -235
- package/dist/browser/BrowserPage.d.ts +21 -6
- package/dist/browser/BrowserPage.js +54 -22
- package/dist/browser/BrowserRunner.d.ts +1 -1
- package/dist/browser/BrowserRunner.js +32 -22
- package/dist/browser/Connection.d.ts +0 -0
- package/dist/browser/Connection.js +1 -1
- package/dist/browser/ConsoleMessage.d.ts +1 -1
- package/dist/browser/ConsoleMessage.js +0 -0
- package/dist/browser/DOMWorld.d.ts +5 -4
- package/dist/browser/DOMWorld.js +16 -9
- package/dist/browser/Errors.d.ts +0 -0
- package/dist/browser/Errors.js +0 -0
- package/dist/browser/EvalTypes.d.ts +7 -7
- package/dist/browser/EvalTypes.js +0 -0
- package/dist/browser/EventEmitter.d.ts +0 -0
- package/dist/browser/EventEmitter.js +0 -0
- package/dist/browser/ExecutionContext.d.ts +0 -0
- package/dist/browser/ExecutionContext.js +0 -0
- package/dist/browser/FrameManager.d.ts +0 -2
- package/dist/browser/FrameManager.js +13 -17
- package/dist/browser/HTTPRequest.d.ts +0 -0
- package/dist/browser/HTTPRequest.js +0 -0
- package/dist/browser/HTTPResponse.d.ts +0 -0
- package/dist/browser/HTTPResponse.js +0 -0
- package/dist/browser/JSHandle.d.ts +0 -0
- package/dist/browser/JSHandle.js +14 -14
- package/dist/browser/LaunchOptions.d.ts +2 -2
- package/dist/browser/LaunchOptions.js +0 -0
- package/dist/browser/Launcher.d.ts +9 -3
- package/dist/browser/Launcher.js +16 -29
- package/dist/browser/LifecycleWatcher.d.ts +1 -1
- package/dist/browser/LifecycleWatcher.js +0 -0
- package/dist/browser/NetworkEventManager.d.ts +4 -4
- package/dist/browser/NetworkEventManager.js +0 -0
- package/dist/browser/NetworkManager.d.ts +0 -0
- package/dist/browser/NetworkManager.js +0 -0
- package/dist/browser/NodeWebSocketTransport.d.ts +0 -0
- package/dist/browser/NodeWebSocketTransport.js +21 -21
- package/dist/browser/Product.d.ts +1 -1
- package/dist/browser/Product.js +0 -0
- package/dist/browser/PuppeteerNode.d.ts +2 -5
- package/dist/browser/PuppeteerNode.js +2 -11
- package/dist/browser/PuppeteerViewport.d.ts +0 -0
- package/dist/browser/PuppeteerViewport.js +0 -0
- package/dist/browser/ScreenshotOptions.d.ts +0 -14
- package/dist/browser/ScreenshotOptions.js +0 -1
- package/dist/browser/Target.d.ts +4 -3
- package/dist/browser/Target.js +8 -2
- package/dist/browser/TaskQueue.d.ts +0 -0
- package/dist/browser/TaskQueue.js +0 -0
- package/dist/browser/TimeoutSettings.d.ts +0 -0
- package/dist/browser/TimeoutSettings.js +0 -0
- package/dist/browser/assert.d.ts +0 -0
- package/dist/browser/assert.js +0 -0
- package/dist/browser/create-browser-fetcher.d.ts +0 -0
- package/dist/browser/create-browser-fetcher.js +34 -48
- package/dist/browser/devtools-commands.d.ts +5 -1
- package/dist/browser/devtools-commands.js +0 -0
- package/dist/browser/devtools-types.d.ts +92 -10
- package/dist/browser/devtools-types.js +0 -0
- package/dist/browser/get-download-destination.d.ts +0 -0
- package/dist/browser/get-download-destination.js +8 -8
- package/dist/browser/is-target-closed-err.d.ts +1 -0
- package/dist/browser/is-target-closed-err.js +9 -0
- package/dist/browser/mitt/index.d.ts +6 -6
- package/dist/browser/mitt/index.js +0 -0
- package/dist/browser/node.d.ts +0 -0
- package/dist/browser/node.js +0 -0
- package/dist/browser/revisions.d.ts +1 -1
- package/dist/browser/revisions.js +0 -0
- package/dist/browser/should-log-message.d.ts +24 -0
- package/dist/browser/should-log-message.js +72 -0
- package/dist/browser/util.d.ts +2 -2
- package/dist/browser/util.js +0 -0
- package/dist/browser-executable.d.ts +1 -1
- package/dist/browser-executable.js +0 -0
- package/dist/browser-log.d.ts +1 -1
- package/dist/browser-log.js +0 -0
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +0 -0
- package/dist/calculate-ffmpeg-filters.d.ts +2 -1
- package/dist/calculate-ffmpeg-filters.js +1 -0
- package/dist/call-ffmpeg.d.ts +14 -0
- package/dist/call-ffmpeg.js +42 -0
- package/dist/can-use-parallel-encoding.d.ts +0 -0
- package/dist/can-use-parallel-encoding.js +0 -0
- package/dist/chalk/index.d.ts +54 -0
- package/dist/chalk/index.js +135 -0
- package/dist/chalk/is-color-supported.d.ts +1 -0
- package/dist/chalk/is-color-supported.js +37 -0
- package/dist/check-apple-silicon.d.ts +1 -1
- package/dist/check-apple-silicon.js +8 -47
- package/dist/chunk.d.ts +0 -0
- package/dist/chunk.js +0 -0
- package/dist/client.d.ts +204 -0
- package/dist/client.js +49 -0
- package/dist/codec-supports-media.d.ts +3 -2
- package/dist/codec-supports-media.js +20 -5
- package/dist/codec.d.ts +2 -2
- package/dist/codec.js +0 -0
- package/dist/combine-videos.d.ts +6 -2
- package/dist/combine-videos.js +17 -17
- package/dist/compositor/compose.d.ts +26 -0
- package/dist/compositor/compose.js +82 -0
- package/dist/compositor/compositor.d.ts +11 -0
- package/dist/compositor/compositor.js +219 -0
- package/dist/compositor/get-executable-path.d.ts +1 -0
- package/dist/compositor/get-executable-path.js +57 -0
- package/dist/compositor/make-nonce.d.ts +1 -0
- package/dist/compositor/make-nonce.js +8 -0
- package/dist/compositor/payloads.d.ts +68 -0
- package/dist/{ffmpeg-executable.js → compositor/payloads.js} +0 -0
- package/dist/compress-assets.d.ts +0 -0
- package/dist/compress-assets.js +0 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.d.ts +0 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.js +0 -0
- package/dist/convert-to-positive-frame-index.d.ts +0 -0
- package/dist/convert-to-positive-frame-index.js +0 -0
- package/dist/create-ffmpeg-complex-filter.d.ts +5 -1
- package/dist/create-ffmpeg-complex-filter.js +6 -4
- package/dist/create-ffmpeg-merge-filter.d.ts +5 -1
- package/dist/create-ffmpeg-merge-filter.js +21 -13
- package/dist/create-silent-audio.d.ts +1 -3
- package/dist/create-silent-audio.js +3 -6
- package/dist/crf.d.ts +6 -2
- package/dist/crf.js +41 -8
- package/dist/cycle-browser-tabs.d.ts +2 -5
- package/dist/cycle-browser-tabs.js +5 -5
- package/dist/delay-render-embedded-stack.d.ts +0 -0
- package/dist/delay-render-embedded-stack.js +0 -0
- package/dist/delete-directory.d.ts +1 -1
- package/dist/delete-directory.js +43 -17
- package/dist/does-have-m2-bug.d.ts +3 -0
- package/dist/does-have-m2-bug.js +12 -0
- package/dist/ensure-frames-in-order.d.ts +0 -0
- package/dist/ensure-frames-in-order.js +0 -0
- package/dist/ensure-output-directory.d.ts +0 -0
- package/dist/ensure-output-directory.js +5 -5
- package/dist/error-handling/handle-javascript-exception.d.ts +0 -0
- package/dist/error-handling/handle-javascript-exception.js +10 -0
- package/dist/error-handling/symbolicate-error.d.ts +0 -0
- package/dist/error-handling/symbolicate-error.js +6 -3
- package/dist/error-handling/symbolicateable-error.d.ts +0 -0
- package/dist/error-handling/symbolicateable-error.js +0 -0
- package/dist/ffmpeg-filter-file.d.ts +6 -1
- package/dist/ffmpeg-filter-file.js +40 -8
- package/dist/ffmpeg-override.d.ts +1 -1
- package/dist/ffmpeg-override.js +0 -0
- package/dist/file-extensions.d.ts +14 -0
- package/dist/file-extensions.js +76 -0
- package/dist/find-closest-package-json.d.ts +2 -0
- package/dist/find-closest-package-json.js +31 -0
- package/dist/frame-range.d.ts +1 -1
- package/dist/frame-range.js +0 -0
- package/dist/get-browser-instance.d.ts +8 -3
- package/dist/get-browser-instance.js +10 -5
- package/dist/get-codec-name.d.ts +0 -0
- package/dist/get-codec-name.js +0 -0
- package/dist/get-compositions.d.ts +27 -14
- package/dist/get-compositions.js +72 -39
- package/dist/get-concurrency.d.ts +1 -1
- package/dist/get-concurrency.js +11 -4
- package/dist/get-duration-from-frame-range.d.ts +0 -0
- package/dist/get-duration-from-frame-range.js +0 -0
- package/dist/get-extension-from-codec.d.ts +5 -1
- package/dist/get-extension-from-codec.js +56 -32
- package/dist/get-extension-of-filename.d.ts +0 -0
- package/dist/get-extension-of-filename.js +5 -1
- package/dist/get-frame-padded-index.d.ts +3 -2
- package/dist/get-frame-padded-index.js +3 -2
- package/dist/get-frame-to-render.d.ts +0 -0
- package/dist/get-frame-to-render.js +1 -1
- package/dist/get-local-browser-executable.d.ts +0 -0
- package/dist/get-local-browser-executable.js +7 -15
- package/dist/get-port.d.ts +4 -1
- package/dist/get-port.js +8 -8
- package/dist/get-prores-profile-name.d.ts +0 -0
- package/dist/get-prores-profile-name.js +0 -0
- package/dist/get-video-threads-flag.d.ts +0 -0
- package/dist/get-video-threads-flag.js +3 -3
- package/dist/guess-extension-for-media.d.ts +3 -1
- package/dist/guess-extension-for-media.js +4 -7
- package/dist/image-format.d.ts +12 -6
- package/dist/image-format.js +19 -13
- package/dist/index.d.ts +368 -49
- package/dist/index.js +68 -46
- package/dist/is-audio-codec.d.ts +0 -0
- package/dist/is-audio-codec.js +0 -0
- package/dist/is-serve-url.d.ts +0 -0
- package/dist/is-serve-url.js +0 -0
- package/dist/jpeg-quality.d.ts +2 -0
- package/dist/jpeg-quality.js +22 -0
- package/dist/locks.d.ts +7 -0
- package/dist/locks.js +44 -0
- package/dist/log-level.d.ts +1 -1
- package/dist/log-level.js +0 -0
- package/dist/logger.d.ts +24 -0
- package/dist/logger.js +68 -0
- package/dist/make-cancel-signal.d.ts +13 -2
- package/dist/make-cancel-signal.js +24 -1
- package/dist/merge-audio-track.d.ts +4 -4
- package/dist/merge-audio-track.js +38 -33
- package/dist/mime-db.d.ts +0 -0
- package/dist/mime-db.js +0 -0
- package/dist/mime-types.d.ts +0 -0
- package/dist/mime-types.js +3 -3
- package/dist/normalize-serve-url.d.ts +0 -0
- package/dist/normalize-serve-url.js +0 -0
- package/dist/offthread-video-server.d.ts +47 -11
- package/dist/offthread-video-server.js +111 -58
- package/dist/open-browser.d.ts +21 -6
- package/dist/open-browser.js +37 -16
- package/dist/options/audio-bitrate.d.ts +2 -0
- package/dist/options/audio-bitrate.js +11 -0
- package/dist/options/crf.d.ts +2 -0
- package/dist/options/crf.js +11 -0
- package/dist/options/enforce-audio.d.ts +2 -0
- package/dist/options/enforce-audio.js +11 -0
- package/dist/options/jpeg-quality.d.ts +2 -0
- package/dist/options/jpeg-quality.js +11 -0
- package/dist/options/mute.d.ts +2 -0
- package/dist/options/mute.js +11 -0
- package/dist/options/option.d.ts +8 -0
- package/dist/options/option.js +2 -0
- package/dist/options/scale.d.ts +2 -0
- package/dist/options/scale.js +11 -0
- package/dist/options/video-bitrate.d.ts +2 -0
- package/dist/options/video-bitrate.js +11 -0
- package/dist/options/video-codec.d.ts +2 -0
- package/dist/options/video-codec.js +11 -0
- package/dist/overwrite.d.ts +0 -0
- package/dist/overwrite.js +0 -0
- package/dist/p-limit.d.ts +0 -0
- package/dist/p-limit.js +0 -0
- package/dist/parse-browser-error-stack.d.ts +1 -1
- package/dist/parse-browser-error-stack.js +0 -0
- package/dist/parse-ffmpeg-progress.d.ts +0 -0
- package/dist/parse-ffmpeg-progress.js +0 -0
- package/dist/perf.d.ts +2 -2
- package/dist/perf.js +9 -7
- package/dist/pixel-format.d.ts +2 -2
- package/dist/pixel-format.js +3 -0
- package/dist/pool.d.ts +0 -0
- package/dist/pool.js +0 -0
- package/dist/prepare-server.d.ts +25 -10
- package/dist/prepare-server.js +71 -18
- package/dist/preprocess-audio-track.d.ts +7 -5
- package/dist/preprocess-audio-track.js +7 -8
- package/dist/prespawn-ffmpeg.d.ts +20 -10
- package/dist/prespawn-ffmpeg.js +67 -29
- package/dist/prestitcher-memory-usage.d.ts +0 -4
- package/dist/prestitcher-memory-usage.js +4 -5
- package/dist/prores-profile.d.ts +6 -4
- package/dist/prores-profile.js +8 -8
- package/dist/provide-screenshot.d.ts +8 -4
- package/dist/provide-screenshot.js +5 -2
- package/dist/puppeteer-evaluate.d.ts +0 -0
- package/dist/puppeteer-evaluate.js +20 -12
- package/dist/puppeteer-screenshot.d.ts +12 -2
- package/dist/puppeteer-screenshot.js +18 -45
- package/dist/redirect-status-codes.d.ts +1 -0
- package/dist/redirect-status-codes.js +6 -0
- package/dist/render-frames.d.ts +52 -35
- package/dist/render-frames.js +248 -143
- package/dist/render-media.d.ts +76 -29
- package/dist/render-media.js +324 -195
- package/dist/render-still.d.ts +46 -19
- package/dist/render-still.js +128 -69
- package/dist/replace-browser.d.ts +6 -0
- package/dist/replace-browser.js +47 -0
- package/dist/resolve-asset-src.d.ts +0 -0
- package/dist/resolve-asset-src.js +2 -2
- package/dist/sample-rate.d.ts +0 -0
- package/dist/sample-rate.js +0 -0
- package/dist/screenshot-dom-element.d.ts +8 -4
- package/dist/screenshot-dom-element.js +15 -4
- package/dist/screenshot-task.d.ts +11 -2
- package/dist/screenshot-task.js +43 -13
- package/dist/seek-to-frame.d.ts +1 -0
- package/dist/seek-to-frame.js +49 -3
- package/dist/select-composition.d.ts +41 -0
- package/dist/select-composition.js +156 -0
- package/dist/serve-handler/index.d.ts +1 -1
- package/dist/serve-handler/index.js +21 -19
- package/dist/serve-handler/is-path-inside.d.ts +0 -0
- package/dist/serve-handler/is-path-inside.js +3 -3
- package/dist/serve-handler/range-parser.d.ts +0 -0
- package/dist/serve-handler/range-parser.js +0 -0
- package/dist/serve-static.d.ts +8 -6
- package/dist/serve-static.js +85 -59
- package/dist/set-props-and-env.d.ts +5 -3
- package/dist/set-props-and-env.js +18 -10
- package/dist/stitch-frames-to-video.d.ts +39 -16
- package/dist/stitch-frames-to-video.js +210 -121
- package/dist/stringify-ffmpeg-filter.d.ts +10 -2
- package/dist/stringify-ffmpeg-filter.js +37 -34
- package/dist/symbolicate-stacktrace.d.ts +16 -3
- package/dist/symbolicate-stacktrace.js +49 -24
- package/dist/take-frame-and-compose.d.ts +22 -0
- package/dist/take-frame-and-compose.js +103 -0
- package/dist/tmp-dir.d.ts +0 -0
- package/dist/tmp-dir.js +7 -8
- package/dist/truthy.d.ts +1 -1
- package/dist/truthy.js +0 -0
- package/dist/types.d.ts +2 -2
- package/dist/types.js +0 -0
- package/dist/validate-concurrency.d.ts +2 -0
- package/dist/validate-concurrency.js +21 -10
- package/dist/validate-even-dimensions-with-codec.d.ts +0 -0
- package/dist/validate-even-dimensions-with-codec.js +0 -0
- package/dist/validate-every-nth-frame.d.ts +2 -1
- package/dist/validate-every-nth-frame.js +8 -1
- package/dist/validate-ffmpeg-override.d.ts +0 -0
- package/dist/validate-ffmpeg-override.js +0 -0
- package/dist/validate-number-of-gif-loops.d.ts +2 -0
- package/dist/validate-number-of-gif-loops.js +24 -0
- package/dist/validate-opengl-renderer.d.ts +2 -3
- package/dist/validate-opengl-renderer.js +9 -4
- package/dist/validate-output-filename.d.ts +7 -2
- package/dist/validate-output-filename.js +20 -51
- package/dist/validate-puppeteer-timeout.d.ts +0 -0
- package/dist/validate-puppeteer-timeout.js +1 -0
- package/dist/validate-scale.d.ts +0 -0
- package/dist/validate-scale.js +0 -0
- package/dist/validate-videobitrate.d.ts +1 -0
- package/dist/validate-videobitrate.js +20 -0
- package/dist/wait-for-symbolication-error-to-be-done.d.ts +0 -0
- package/dist/wait-for-symbolication-error-to-be-done.js +5 -31
- package/dist/ws/ws-types.d.ts +0 -0
- package/dist/ws/ws-types.js +2 -1
- package/install-toolchain.mjs +36 -0
- package/package.json +70 -60
- package/types/ws/index.d.ts +5 -5
- package/.prettierrc.js +0 -14
- package/dist/assets/dl-browser.d.ts +0 -1
- package/dist/assets/dl-browser.js +0 -38
- package/dist/assets/get-video-stream-duration.d.ts +0 -4
- package/dist/assets/get-video-stream-duration.js +0 -59
- package/dist/calculate-sar-dar-pixels.d.ts +0 -9
- package/dist/calculate-sar-dar-pixels.js +0 -19
- package/dist/convert-to-pcm.d.ts +0 -6
- package/dist/convert-to-pcm.js +0 -20
- package/dist/ensure-presentation-timestamp.d.ts +0 -2
- package/dist/ensure-presentation-timestamp.js +0 -69
- package/dist/extract-frame-from-video.d.ts +0 -16
- package/dist/extract-frame-from-video.js +0 -277
- package/dist/ffmpeg-executable.d.ts +0 -1
- package/dist/ffmpeg-flags.d.ts +0 -12
- package/dist/ffmpeg-flags.js +0 -45
- package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -1
- package/dist/frame-to-ffmpeg-timestamp.js +0 -8
- package/dist/get-audio-codec-name.d.ts +0 -2
- package/dist/get-audio-codec-name.js +0 -28
- package/dist/get-video-info.d.ts +0 -3
- package/dist/get-video-info.js +0 -49
- package/dist/is-beyond-last-frame.d.ts +0 -3
- package/dist/is-beyond-last-frame.js +0 -12
- package/dist/last-frame-from-video-cache.d.ts +0 -17
- package/dist/last-frame-from-video-cache.js +0 -55
- package/dist/legacy-webpack-config.d.ts +0 -9
- package/dist/legacy-webpack-config.js +0 -13
- package/dist/quality.d.ts +0 -1
- package/dist/quality.js +0 -21
- package/dist/validate-ffmpeg.d.ts +0 -2
- package/dist/validate-ffmpeg.js +0 -72
- package/dist/validate-frame.d.ts +0 -1
- package/dist/validate-frame.js +0 -24
- package/tsconfig.json +0 -10
- package/vitest.config.ts +0 -8
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
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
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { TAsset } from 'remotion';
|
|
2
|
+
import { OffthreadVideoServerEmitter } from '../offthread-video-server';
|
|
2
3
|
import type { DownloadMap } from './download-map';
|
|
3
|
-
export
|
|
4
|
+
export type RenderMediaOnDownload = (src: string) => ((progress: {
|
|
4
5
|
percent: number | null;
|
|
5
6
|
downloaded: number;
|
|
6
7
|
totalSize: number | null;
|
|
7
8
|
}) => void) | undefined | void;
|
|
8
|
-
export declare const downloadAsset: ({ src,
|
|
9
|
+
export declare const downloadAsset: ({ src, downloadMap, emitter, }: {
|
|
9
10
|
src: string;
|
|
10
|
-
|
|
11
|
+
emitter: OffthreadVideoServerEmitter;
|
|
11
12
|
downloadMap: DownloadMap;
|
|
12
13
|
}) => Promise<string>;
|
|
13
14
|
export declare const markAllAssetsAsDownloaded: (downloadMap: DownloadMap) => void;
|
|
@@ -19,6 +20,7 @@ export declare const getSanitizedFilenameForAssetUrl: ({ src, downloadDir, conte
|
|
|
19
20
|
}) => string;
|
|
20
21
|
export declare const downloadAndMapAssetsToFileUrl: ({ asset, onDownload, downloadMap, }: {
|
|
21
22
|
asset: TAsset;
|
|
22
|
-
onDownload: RenderMediaOnDownload;
|
|
23
|
+
onDownload: RenderMediaOnDownload | null;
|
|
23
24
|
downloadMap: DownloadMap;
|
|
24
25
|
}) => Promise<TAsset>;
|
|
26
|
+
export declare const attachDownloadListenerToEmitter: (emitter: OffthreadVideoServerEmitter, onDownload: RenderMediaOnDownload | null) => () => void;
|
|
@@ -26,17 +26,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.downloadAndMapAssetsToFileUrl = exports.getSanitizedFilenameForAssetUrl = exports.markAllAssetsAsDownloaded = exports.downloadAsset = void 0;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
29
|
+
exports.attachDownloadListenerToEmitter = exports.downloadAndMapAssetsToFileUrl = exports.getSanitizedFilenameForAssetUrl = exports.markAllAssetsAsDownloaded = exports.downloadAsset = void 0;
|
|
30
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
31
|
+
const node_path_1 = __importStar(require("node:path"));
|
|
32
32
|
const remotion_1 = require("remotion");
|
|
33
33
|
const compress_assets_1 = require("../compress-assets");
|
|
34
34
|
const ensure_output_directory_1 = require("../ensure-output-directory");
|
|
35
35
|
const mime_types_1 = require("../mime-types");
|
|
36
|
+
const offthread_video_server_1 = require("../offthread-video-server");
|
|
36
37
|
const download_file_1 = require("./download-file");
|
|
37
38
|
const sanitize_filepath_1 = require("./sanitize-filepath");
|
|
38
39
|
const waitForAssetToBeDownloaded = ({ src, downloadDir, downloadMap, }) => {
|
|
39
40
|
var _a, _b;
|
|
41
|
+
if (process.env.NODE_ENV === 'test') {
|
|
42
|
+
console.log('waiting for asset to be downloaded', src);
|
|
43
|
+
}
|
|
40
44
|
if ((_a = downloadMap.hasBeenDownloadedMap[src]) === null || _a === void 0 ? void 0 : _a[downloadDir]) {
|
|
41
45
|
return Promise.resolve((_b = downloadMap.hasBeenDownloadedMap[src]) === null || _b === void 0 ? void 0 : _b[downloadDir]);
|
|
42
46
|
}
|
|
@@ -49,7 +53,7 @@ const waitForAssetToBeDownloaded = ({ src, downloadDir, downloadMap, }) => {
|
|
|
49
53
|
return new Promise((resolve) => {
|
|
50
54
|
downloadMap.listeners[src][downloadDir].push(() => {
|
|
51
55
|
const srcMap = downloadMap.hasBeenDownloadedMap[src];
|
|
52
|
-
if (!srcMap ||
|
|
56
|
+
if (!(srcMap === null || srcMap === void 0 ? void 0 : srcMap[downloadDir])) {
|
|
53
57
|
throw new Error('Expected file for ' + src + 'to be available in ' + downloadDir);
|
|
54
58
|
}
|
|
55
59
|
resolve(srcMap[downloadDir]);
|
|
@@ -112,7 +116,7 @@ function validateBufferEncoding(potentialEncoding, dataUrl) {
|
|
|
112
116
|
throw new TypeError(errMessage);
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
|
-
const downloadAsset = async ({ src,
|
|
119
|
+
const downloadAsset = async ({ src, downloadMap, emitter, }) => {
|
|
116
120
|
var _a, _b, _c;
|
|
117
121
|
if ((0, compress_assets_1.isAssetCompressed)(src)) {
|
|
118
122
|
return src;
|
|
@@ -121,7 +125,7 @@ const downloadAsset = async ({ src, onDownload, downloadMap, }) => {
|
|
|
121
125
|
if ((_a = downloadMap.hasBeenDownloadedMap[src]) === null || _a === void 0 ? void 0 : _a[downloadDir]) {
|
|
122
126
|
const claimedDownloadLocation = (_b = downloadMap.hasBeenDownloadedMap[src]) === null || _b === void 0 ? void 0 : _b[downloadDir];
|
|
123
127
|
// The OS might have deleted the file since even though we marked it as downloaded. In that case we reset the state and download it again
|
|
124
|
-
if (
|
|
128
|
+
if (node_fs_1.default.existsSync(claimedDownloadLocation)) {
|
|
125
129
|
return claimedDownloadLocation;
|
|
126
130
|
}
|
|
127
131
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -139,15 +143,11 @@ const downloadAsset = async ({ src, onDownload, downloadMap, }) => {
|
|
|
139
143
|
downloadMap.isDownloadingMap[src] = {};
|
|
140
144
|
}
|
|
141
145
|
downloadMap.isDownloadingMap[src][downloadDir] = true;
|
|
142
|
-
|
|
146
|
+
if (process.env.NODE_ENV === 'test') {
|
|
147
|
+
console.log('Actually downloading asset', src);
|
|
148
|
+
}
|
|
149
|
+
emitter.dispatchDownload(src);
|
|
143
150
|
if (src.startsWith('data:')) {
|
|
144
|
-
const output = (0, exports.getSanitizedFilenameForAssetUrl)({
|
|
145
|
-
contentDisposition: null,
|
|
146
|
-
downloadDir,
|
|
147
|
-
src,
|
|
148
|
-
contentType: null,
|
|
149
|
-
});
|
|
150
|
-
(0, ensure_output_directory_1.ensureOutputDirectory)(output);
|
|
151
151
|
const [assetDetails, assetData] = src.substring('data:'.length).split(',');
|
|
152
152
|
if (!assetDetails.includes(';')) {
|
|
153
153
|
const errMessage = [
|
|
@@ -161,15 +161,22 @@ const downloadAsset = async ({ src, onDownload, downloadMap, }) => {
|
|
|
161
161
|
const [mimeType, encoding] = assetDetails.split(';');
|
|
162
162
|
validateMimeType(mimeType, src);
|
|
163
163
|
validateBufferEncoding(encoding, src);
|
|
164
|
+
const output = (0, exports.getSanitizedFilenameForAssetUrl)({
|
|
165
|
+
contentDisposition: null,
|
|
166
|
+
downloadDir,
|
|
167
|
+
src,
|
|
168
|
+
contentType: mimeType,
|
|
169
|
+
});
|
|
170
|
+
(0, ensure_output_directory_1.ensureOutputDirectory)(output);
|
|
164
171
|
const buff = Buffer.from(assetData, encoding);
|
|
165
|
-
await
|
|
172
|
+
await node_fs_1.default.promises.writeFile(output, buff);
|
|
166
173
|
notifyAssetIsDownloaded({ src, downloadMap, downloadDir, to: output });
|
|
167
174
|
return output;
|
|
168
175
|
}
|
|
169
176
|
const { to } = await (0, download_file_1.downloadFile)({
|
|
170
177
|
url: src,
|
|
171
178
|
onProgress: (progress) => {
|
|
172
|
-
|
|
179
|
+
emitter.dispatchDownloadProgress(src, progress.percent, progress.downloaded, progress.totalSize);
|
|
173
180
|
},
|
|
174
181
|
to: (contentDisposition, contentType) => (0, exports.getSanitizedFilenameForAssetUrl)({
|
|
175
182
|
contentDisposition,
|
|
@@ -206,7 +213,7 @@ const getFilename = ({ contentDisposition, src, contentType, }) => {
|
|
|
206
213
|
};
|
|
207
214
|
}
|
|
208
215
|
const { pathname, search } = new URL(src);
|
|
209
|
-
const ext = (0,
|
|
216
|
+
const ext = (0, node_path_1.extname)(pathname);
|
|
210
217
|
// Has no file extension, check if we can derive it from contentType
|
|
211
218
|
if (!ext && contentType) {
|
|
212
219
|
const matchedExt = (0, mime_types_1.getExt)(contentType);
|
|
@@ -232,18 +239,41 @@ const getSanitizedFilenameForAssetUrl = ({ src, downloadDir, contentDisposition,
|
|
|
232
239
|
: '';
|
|
233
240
|
const hashedFileName = String((0, remotion_1.random)(`${pathname}${search}`)).replace('0.', '');
|
|
234
241
|
const filename = hashedFileName + fileExtension;
|
|
235
|
-
return
|
|
242
|
+
return node_path_1.default.join(downloadDir, (0, sanitize_filepath_1.sanitizeFilePath)(filename));
|
|
236
243
|
};
|
|
237
244
|
exports.getSanitizedFilenameForAssetUrl = getSanitizedFilenameForAssetUrl;
|
|
238
245
|
const downloadAndMapAssetsToFileUrl = async ({ asset, onDownload, downloadMap, }) => {
|
|
246
|
+
const emitter = new offthread_video_server_1.OffthreadVideoServerEmitter();
|
|
247
|
+
const cleanup = (0, exports.attachDownloadListenerToEmitter)(emitter, onDownload);
|
|
239
248
|
const newSrc = await (0, exports.downloadAsset)({
|
|
240
249
|
src: asset.src,
|
|
241
|
-
|
|
250
|
+
emitter,
|
|
242
251
|
downloadMap,
|
|
243
252
|
});
|
|
253
|
+
cleanup();
|
|
244
254
|
return {
|
|
245
255
|
...asset,
|
|
246
256
|
src: newSrc,
|
|
247
257
|
};
|
|
248
258
|
};
|
|
249
259
|
exports.downloadAndMapAssetsToFileUrl = downloadAndMapAssetsToFileUrl;
|
|
260
|
+
const attachDownloadListenerToEmitter = (emitter, onDownload) => {
|
|
261
|
+
const cleanup = [];
|
|
262
|
+
if (!onDownload) {
|
|
263
|
+
return () => undefined;
|
|
264
|
+
}
|
|
265
|
+
const a = emitter.addEventListener('download', ({ detail: { src: initialSrc } }) => {
|
|
266
|
+
const progress = onDownload(initialSrc);
|
|
267
|
+
const b = emitter.addEventListener('progress', ({ detail: { downloaded, percent, src: progressSrc, totalSize } }) => {
|
|
268
|
+
if (initialSrc === progressSrc) {
|
|
269
|
+
progress === null || progress === void 0 ? void 0 : progress({ downloaded, percent, totalSize });
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
cleanup.push(b);
|
|
273
|
+
});
|
|
274
|
+
cleanup.push(() => a());
|
|
275
|
+
return () => {
|
|
276
|
+
cleanup.forEach((c) => c());
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
exports.attachDownloadListenerToEmitter = attachDownloadListenerToEmitter;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
type Response = {
|
|
2
|
+
sizeInBytes: number;
|
|
3
|
+
to: string;
|
|
4
|
+
};
|
|
5
|
+
type Options = {
|
|
2
6
|
url: string;
|
|
3
7
|
to: (contentDisposition: string | null, contentType: string | null) => string;
|
|
4
8
|
onProgress: ((progress: {
|
|
@@ -6,7 +10,6 @@ export declare const downloadFile: ({ onProgress, url, to: toFn, }: {
|
|
|
6
10
|
downloaded: number;
|
|
7
11
|
totalSize: number | null;
|
|
8
12
|
}) => void) | undefined;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}>;
|
|
13
|
+
};
|
|
14
|
+
export declare const downloadFile: (options: Options, retries?: number, attempt?: number) => Promise<Response>;
|
|
15
|
+
export {};
|
|
@@ -1,11 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.downloadFile = void 0;
|
|
4
|
-
const
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
5
|
const ensure_output_directory_1 = require("../ensure-output-directory");
|
|
6
6
|
const read_file_1 = require("./read-file");
|
|
7
|
-
const
|
|
7
|
+
const incorrectContentLengthToken = 'Download finished with';
|
|
8
|
+
const downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
|
|
8
9
|
return new Promise((resolve, reject) => {
|
|
10
|
+
let rejected = false;
|
|
11
|
+
let resolved = false;
|
|
12
|
+
let timeout;
|
|
13
|
+
const resolveAndFlag = (val) => {
|
|
14
|
+
resolved = true;
|
|
15
|
+
resolve(val);
|
|
16
|
+
if (timeout) {
|
|
17
|
+
clearTimeout(timeout);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const rejectAndFlag = (err) => {
|
|
21
|
+
if (timeout) {
|
|
22
|
+
clearTimeout(timeout);
|
|
23
|
+
}
|
|
24
|
+
reject(err);
|
|
25
|
+
rejected = true;
|
|
26
|
+
};
|
|
27
|
+
const refreshTimeout = () => {
|
|
28
|
+
if (timeout) {
|
|
29
|
+
clearTimeout(timeout);
|
|
30
|
+
}
|
|
31
|
+
timeout = setTimeout(() => {
|
|
32
|
+
if (resolved) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
rejectAndFlag(new Error(`Tried to download file ${url}, but the server sent no data for 20 seconds`));
|
|
36
|
+
}, 20000);
|
|
37
|
+
};
|
|
38
|
+
refreshTimeout();
|
|
9
39
|
(0, read_file_1.readFile)(url)
|
|
10
40
|
.then((res) => {
|
|
11
41
|
var _a, _b;
|
|
@@ -15,34 +45,67 @@ const downloadFile = ({ onProgress, url, to: toFn, }) => {
|
|
|
15
45
|
(0, ensure_output_directory_1.ensureOutputDirectory)(to);
|
|
16
46
|
const sizeHeader = res.headers['content-length'];
|
|
17
47
|
const totalSize = typeof sizeHeader === 'undefined' ? null : Number(sizeHeader);
|
|
18
|
-
const writeStream = (0,
|
|
48
|
+
const writeStream = (0, node_fs_1.createWriteStream)(to);
|
|
19
49
|
let downloaded = 0;
|
|
20
50
|
// Listen to 'close' event instead of more
|
|
21
51
|
// concise method to avoid this problem
|
|
22
52
|
// https://github.com/remotion-dev/remotion/issues/384#issuecomment-844398183
|
|
23
53
|
writeStream.on('close', () => {
|
|
54
|
+
if (rejected) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
24
57
|
onProgress === null || onProgress === void 0 ? void 0 : onProgress({
|
|
25
58
|
downloaded,
|
|
26
59
|
percent: 1,
|
|
27
60
|
totalSize: downloaded,
|
|
28
61
|
});
|
|
29
|
-
|
|
62
|
+
refreshTimeout();
|
|
63
|
+
return resolveAndFlag({ sizeInBytes: downloaded, to });
|
|
30
64
|
});
|
|
31
|
-
writeStream.on('error', (err) =>
|
|
32
|
-
res.on('error', (err) =>
|
|
33
|
-
res.pipe(writeStream).on('error', (err) =>
|
|
65
|
+
writeStream.on('error', (err) => rejectAndFlag(err));
|
|
66
|
+
res.on('error', (err) => rejectAndFlag(err));
|
|
67
|
+
res.pipe(writeStream).on('error', (err) => rejectAndFlag(err));
|
|
34
68
|
res.on('data', (d) => {
|
|
69
|
+
refreshTimeout();
|
|
35
70
|
downloaded += d.length;
|
|
71
|
+
refreshTimeout();
|
|
36
72
|
onProgress === null || onProgress === void 0 ? void 0 : onProgress({
|
|
37
73
|
downloaded,
|
|
38
74
|
percent: totalSize === null ? null : downloaded / totalSize,
|
|
39
75
|
totalSize,
|
|
40
76
|
});
|
|
41
77
|
});
|
|
78
|
+
res.on('close', () => {
|
|
79
|
+
if (totalSize !== null && downloaded !== totalSize) {
|
|
80
|
+
rejectAndFlag(new Error(`${incorrectContentLengthToken} ${downloaded} bytes, but expected ${totalSize} bytes from 'Content-Length'.`));
|
|
81
|
+
}
|
|
82
|
+
writeStream.close();
|
|
83
|
+
});
|
|
42
84
|
})
|
|
43
85
|
.catch((err) => {
|
|
44
|
-
|
|
86
|
+
rejectAndFlag(err);
|
|
45
87
|
});
|
|
46
88
|
});
|
|
47
89
|
};
|
|
90
|
+
const downloadFile = async (options, retries = 2, attempt = 1) => {
|
|
91
|
+
try {
|
|
92
|
+
const res = await downloadFileWithoutRetries(options);
|
|
93
|
+
return res;
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
const { message } = err;
|
|
97
|
+
if (message === 'aborted' ||
|
|
98
|
+
message.includes(incorrectContentLengthToken)) {
|
|
99
|
+
if (retries === 0) {
|
|
100
|
+
throw err;
|
|
101
|
+
}
|
|
102
|
+
const backoffInSeconds = (attempt + 1) ** 2;
|
|
103
|
+
await new Promise((resolve) => {
|
|
104
|
+
setTimeout(() => resolve(), backoffInSeconds * 1000);
|
|
105
|
+
});
|
|
106
|
+
return (0, exports.downloadFile)(options, retries - 1, attempt + 1);
|
|
107
|
+
}
|
|
108
|
+
throw err;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
48
111
|
exports.downloadFile = downloadFile;
|
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { TAsset } from 'remotion';
|
|
3
|
-
|
|
4
|
-
type: 'encoding';
|
|
5
|
-
} | {
|
|
6
|
-
type: 'done';
|
|
7
|
-
src: string;
|
|
8
|
-
} | undefined;
|
|
9
|
-
export declare type SpecialVCodecForTransparency = 'vp9' | 'vp8' | 'none';
|
|
10
|
-
export declare type Vp9Result = {
|
|
11
|
-
specialVcodec: SpecialVCodecForTransparency;
|
|
12
|
-
needsResize: [number, number] | null;
|
|
13
|
-
};
|
|
14
|
-
export declare type VideoDurationResult = {
|
|
15
|
-
duration: number | null;
|
|
16
|
-
fps: number | null;
|
|
17
|
-
};
|
|
18
|
-
export declare type AudioChannelsAndDurationResultCache = {
|
|
2
|
+
export type AudioChannelsAndDurationResultCache = {
|
|
19
3
|
channels: number;
|
|
20
4
|
duration: number | null;
|
|
21
5
|
};
|
|
22
|
-
export
|
|
6
|
+
export type DownloadMap = {
|
|
23
7
|
id: string;
|
|
24
8
|
isDownloadingMap: {
|
|
25
9
|
[src: string]: {
|
|
@@ -36,14 +20,6 @@ export declare type DownloadMap = {
|
|
|
36
20
|
[downloadDir: string]: (() => void)[];
|
|
37
21
|
};
|
|
38
22
|
};
|
|
39
|
-
lastFrameMap: Record<string, {
|
|
40
|
-
lastAccessed: number;
|
|
41
|
-
data: Buffer;
|
|
42
|
-
}>;
|
|
43
|
-
isBeyondLastFrameMap: Record<string, number>;
|
|
44
|
-
isVp9VideoCache: Record<string, Vp9Result>;
|
|
45
|
-
ensureFileHasPresentationTimestamp: Record<string, EncodingStatus>;
|
|
46
|
-
videoDurationResultCache: Record<string, VideoDurationResult>;
|
|
47
23
|
durationOfAssetCache: Record<string, AudioChannelsAndDurationResultCache>;
|
|
48
24
|
downloadDir: string;
|
|
49
25
|
preEncode: string;
|
|
@@ -52,13 +28,16 @@ export declare type DownloadMap = {
|
|
|
52
28
|
audioPreprocessing: string;
|
|
53
29
|
stitchFrames: string;
|
|
54
30
|
assetDir: string;
|
|
31
|
+
compositingDir: string;
|
|
32
|
+
compositorCache: {
|
|
33
|
+
[key: string]: string;
|
|
34
|
+
};
|
|
55
35
|
};
|
|
56
|
-
export
|
|
36
|
+
export type RenderAssetInfo = {
|
|
57
37
|
assets: TAsset[][];
|
|
58
38
|
imageSequenceName: string;
|
|
59
39
|
firstFrameIndex: number;
|
|
60
40
|
downloadMap: DownloadMap;
|
|
61
41
|
};
|
|
62
42
|
export declare const makeDownloadMap: () => DownloadMap;
|
|
63
|
-
export declare const cleanDownloadMap: (downloadMap: DownloadMap) =>
|
|
64
|
-
export {};
|
|
43
|
+
export declare const cleanDownloadMap: (downloadMap: DownloadMap) => void;
|
|
@@ -27,18 +27,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.cleanDownloadMap = exports.makeDownloadMap = void 0;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
30
|
+
const node_fs_1 = __importStar(require("node:fs"));
|
|
31
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
32
32
|
const delete_directory_1 = require("../delete-directory");
|
|
33
33
|
const tmp_dir_1 = require("../tmp-dir");
|
|
34
34
|
const makeAndReturn = (dir, name) => {
|
|
35
|
-
const p =
|
|
36
|
-
(0,
|
|
35
|
+
const p = node_path_1.default.join(dir, name);
|
|
36
|
+
(0, node_fs_1.mkdirSync)(p);
|
|
37
37
|
return p;
|
|
38
38
|
};
|
|
39
|
-
const packageJsonPath =
|
|
40
|
-
const packageJson =
|
|
41
|
-
? JSON.parse(
|
|
39
|
+
const packageJsonPath = node_path_1.default.join(__dirname, '..', '..', 'package.json');
|
|
40
|
+
const packageJson = node_fs_1.default.existsSync(packageJsonPath)
|
|
41
|
+
? JSON.parse(node_fs_1.default.readFileSync(packageJsonPath, 'utf-8'))
|
|
42
42
|
: null;
|
|
43
43
|
const makeDownloadMap = () => {
|
|
44
44
|
const dir = (0, tmp_dir_1.tmpDir)(packageJson
|
|
@@ -48,11 +48,6 @@ const makeDownloadMap = () => {
|
|
|
48
48
|
isDownloadingMap: {},
|
|
49
49
|
hasBeenDownloadedMap: {},
|
|
50
50
|
listeners: {},
|
|
51
|
-
lastFrameMap: {},
|
|
52
|
-
isBeyondLastFrameMap: {},
|
|
53
|
-
ensureFileHasPresentationTimestamp: {},
|
|
54
|
-
isVp9VideoCache: {},
|
|
55
|
-
videoDurationResultCache: {},
|
|
56
51
|
durationOfAssetCache: {},
|
|
57
52
|
id: String(Math.random()),
|
|
58
53
|
assetDir: dir,
|
|
@@ -62,12 +57,16 @@ const makeDownloadMap = () => {
|
|
|
62
57
|
audioMixing: makeAndReturn(dir, 'remotion-audio-mixing'),
|
|
63
58
|
audioPreprocessing: makeAndReturn(dir, 'remotion-audio-preprocessing'),
|
|
64
59
|
stitchFrames: makeAndReturn(dir, 'remotion-stitch-temp-dir'),
|
|
60
|
+
compositingDir: makeAndReturn(dir, 'remotion-compositing-temp-dir'),
|
|
61
|
+
compositorCache: {},
|
|
65
62
|
};
|
|
66
63
|
};
|
|
67
64
|
exports.makeDownloadMap = makeDownloadMap;
|
|
68
|
-
const cleanDownloadMap =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
const cleanDownloadMap = (downloadMap) => {
|
|
66
|
+
(0, delete_directory_1.deleteDirectory)(downloadMap.downloadDir);
|
|
67
|
+
(0, delete_directory_1.deleteDirectory)(downloadMap.complexFilter);
|
|
68
|
+
(0, delete_directory_1.deleteDirectory)(downloadMap.compositingDir);
|
|
69
|
+
// Assets dir must be last since the others are contained
|
|
70
|
+
(0, delete_directory_1.deleteDirectory)(downloadMap.assetDir);
|
|
72
71
|
};
|
|
73
72
|
exports.cleanDownloadMap = cleanDownloadMap;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { AssetVolume } from './types';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type FfmpegEval = 'once' | 'frame';
|
|
3
|
+
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
|
-
import type { FfmpegExecutable } from '../ffmpeg-executable';
|
|
2
1
|
import type { AudioChannelsAndDurationResultCache, DownloadMap } from './download-map';
|
|
3
|
-
export declare const
|
|
2
|
+
export declare const getAudioChannelsAndDurationWithoutCache: (src: string) => Promise<AudioChannelsAndDurationResultCache>;
|
|
3
|
+
export declare const getAudioChannelsAndDuration: (downloadMap: DownloadMap, src: string) => Promise<AudioChannelsAndDurationResultCache>;
|
|
@@ -1,16 +1,10 @@
|
|
|
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
|
-
exports.getAudioChannelsAndDuration = void 0;
|
|
7
|
-
const
|
|
3
|
+
exports.getAudioChannelsAndDuration = exports.getAudioChannelsAndDurationWithoutCache = void 0;
|
|
4
|
+
const call_ffmpeg_1 = require("../call-ffmpeg");
|
|
8
5
|
const p_limit_1 = require("../p-limit");
|
|
9
6
|
const limit = (0, p_limit_1.pLimit)(1);
|
|
10
|
-
async
|
|
11
|
-
if (downloadMap.durationOfAssetCache[src]) {
|
|
12
|
-
return downloadMap.durationOfAssetCache[src];
|
|
13
|
-
}
|
|
7
|
+
const getAudioChannelsAndDurationWithoutCache = async (src) => {
|
|
14
8
|
const args = [
|
|
15
9
|
['-v', 'error'],
|
|
16
10
|
['-show_entries', 'stream=channels:format=duration'],
|
|
@@ -19,17 +13,25 @@ async function getAudioChannelsAndDurationUnlimited(downloadMap, src, ffprobeExe
|
|
|
19
13
|
]
|
|
20
14
|
.reduce((acc, val) => acc.concat(val), [])
|
|
21
15
|
.filter(Boolean);
|
|
22
|
-
const task = await (0,
|
|
16
|
+
const task = await (0, call_ffmpeg_1.callFf)('ffprobe', args);
|
|
23
17
|
const channels = task.stdout.match(/channels=([0-9]+)/);
|
|
24
18
|
const duration = task.stdout.match(/duration=([0-9.]+)/);
|
|
25
19
|
const result = {
|
|
26
20
|
channels: channels ? parseInt(channels[1], 10) : 0,
|
|
27
21
|
duration: duration ? parseFloat(duration[1]) : null,
|
|
28
22
|
};
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
exports.getAudioChannelsAndDurationWithoutCache = getAudioChannelsAndDurationWithoutCache;
|
|
26
|
+
async function getAudioChannelsAndDurationUnlimited(downloadMap, src) {
|
|
27
|
+
if (downloadMap.durationOfAssetCache[src]) {
|
|
28
|
+
return downloadMap.durationOfAssetCache[src];
|
|
29
|
+
}
|
|
30
|
+
const result = await (0, exports.getAudioChannelsAndDurationWithoutCache)(src);
|
|
29
31
|
downloadMap.durationOfAssetCache[src] = result;
|
|
30
32
|
return result;
|
|
31
33
|
}
|
|
32
|
-
const getAudioChannelsAndDuration = (downloadMap, src
|
|
33
|
-
return limit(() => getAudioChannelsAndDurationUnlimited(downloadMap, src
|
|
34
|
+
const getAudioChannelsAndDuration = (downloadMap, src) => {
|
|
35
|
+
return limit(() => getAudioChannelsAndDurationUnlimited(downloadMap, src));
|
|
34
36
|
};
|
|
35
37
|
exports.getAudioChannelsAndDuration = getAudioChannelsAndDuration;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import http from 'http';
|
|
1
|
+
import http from 'node:http';
|
|
2
2
|
export declare const readFile: (url: string, redirectsSoFar?: number) => Promise<http.IncomingMessage>;
|