@remotion/renderer 4.0.0-lambda.3 → 4.0.0-newpaths.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +8 -8
- package/README.md +47 -0
- package/dist/assets/calculate-asset-positions.d.ts +2 -2
- package/dist/assets/calculate-asset-positions.js +1 -0
- package/dist/assets/calculate-atempo.d.ts +0 -0
- package/dist/assets/calculate-atempo.js +0 -0
- package/dist/assets/convert-assets-to-file-urls.d.ts +5 -4
- package/dist/assets/convert-assets-to-file-urls.js +2 -2
- package/dist/assets/download-and-map-assets-to-file.d.ts +16 -12
- package/dist/assets/download-and-map-assets-to-file.js +145 -65
- package/dist/assets/download-file.d.ts +13 -6
- package/dist/assets/download-file.js +64 -8
- package/dist/assets/download-map.d.ts +69 -0
- package/dist/assets/download-map.js +77 -0
- package/dist/assets/ffmpeg-volume-expression.d.ts +3 -3
- package/dist/assets/ffmpeg-volume-expression.js +6 -5
- package/dist/assets/flatten-volume-array.d.ts +1 -1
- package/dist/assets/flatten-volume-array.js +0 -0
- package/dist/assets/get-audio-channels.d.ts +3 -7
- package/dist/assets/get-audio-channels.js +8 -8
- package/dist/assets/get-video-stream-duration.d.ts +9 -0
- package/dist/assets/get-video-stream-duration.js +71 -0
- package/dist/assets/read-file.d.ts +0 -0
- package/dist/assets/read-file.js +2 -1
- package/dist/assets/round-volume-to-avoid-stack-overflow.d.ts +0 -0
- package/dist/assets/round-volume-to-avoid-stack-overflow.js +0 -0
- package/dist/assets/sanitize-filename.d.ts +0 -0
- package/dist/assets/sanitize-filename.js +0 -0
- package/dist/assets/sanitize-filepath.d.ts +0 -0
- package/dist/assets/sanitize-filepath.js +0 -0
- package/dist/assets/truncate-utf8-bytes.d.ts +0 -0
- package/dist/assets/truncate-utf8-bytes.js +0 -0
- package/dist/assets/types.d.ts +2 -1
- package/dist/assets/types.js +0 -0
- package/dist/browser/Browser.d.ts +13 -160
- package/dist/browser/Browser.js +19 -200
- package/dist/browser/BrowserConnector.d.ts +1 -8
- package/dist/browser/BrowserConnector.js +0 -32
- package/dist/browser/BrowserFetcher.d.ts +2 -1
- package/dist/browser/BrowserFetcher.js +27 -26
- package/dist/browser/{page.d.ts → BrowserPage.d.ts} +16 -14
- package/dist/browser/{page.js → BrowserPage.js} +24 -21
- package/dist/browser/BrowserRunner.d.ts +2 -5
- package/dist/browser/BrowserRunner.js +29 -72
- package/dist/browser/Connection.d.ts +7 -14
- package/dist/browser/Connection.js +6 -26
- package/dist/browser/ConsoleMessage.d.ts +4 -28
- package/dist/browser/ConsoleMessage.js +5 -32
- package/dist/browser/DOMWorld.d.ts +11 -8
- package/dist/browser/DOMWorld.js +20 -21
- package/dist/browser/Errors.d.ts +0 -0
- package/dist/browser/Errors.js +0 -0
- package/dist/browser/EvalTypes.d.ts +1 -1
- package/dist/browser/EvalTypes.js +0 -0
- package/dist/browser/EventEmitter.d.ts +1 -48
- package/dist/browser/EventEmitter.js +0 -49
- package/dist/browser/ExecutionContext.d.ts +8 -9
- package/dist/browser/ExecutionContext.js +0 -16
- package/dist/browser/FrameManager.d.ts +11 -16
- package/dist/browser/FrameManager.js +3 -22
- package/dist/browser/HTTPRequest.d.ts +4 -18
- package/dist/browser/HTTPRequest.js +3 -48
- package/dist/browser/HTTPResponse.d.ts +2 -81
- package/dist/browser/HTTPResponse.js +18 -173
- package/dist/browser/JSHandle.d.ts +7 -8
- package/dist/browser/JSHandle.js +0 -3
- package/dist/browser/LaunchOptions.d.ts +2 -86
- package/dist/browser/LaunchOptions.js +0 -0
- package/dist/browser/Launcher.d.ts +9 -3
- package/dist/browser/Launcher.js +13 -471
- package/dist/browser/LifecycleWatcher.d.ts +4 -4
- package/dist/browser/LifecycleWatcher.js +4 -17
- package/dist/browser/NetworkEventManager.d.ts +10 -12
- package/dist/browser/NetworkEventManager.js +0 -47
- package/dist/browser/NetworkManager.d.ts +3 -5
- package/dist/browser/NetworkManager.js +6 -59
- package/dist/browser/NodeWebSocketTransport.d.ts +10 -4
- package/dist/browser/NodeWebSocketTransport.js +4 -7
- package/dist/browser/Product.d.ts +0 -0
- package/dist/browser/Product.js +0 -0
- package/dist/browser/PuppeteerNode.d.ts +7 -59
- package/dist/browser/PuppeteerNode.js +5 -74
- 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 +8 -8
- package/dist/browser/Target.js +2 -2
- package/dist/browser/TaskQueue.d.ts +0 -0
- package/dist/browser/TaskQueue.js +0 -0
- package/dist/browser/TimeoutSettings.d.ts +1 -0
- package/dist/browser/TimeoutSettings.js +4 -4
- package/dist/browser/assert.d.ts +0 -20
- package/dist/browser/assert.js +0 -20
- package/dist/browser/create-browser-fetcher.d.ts +1 -1
- package/dist/browser/create-browser-fetcher.js +5 -68
- package/dist/browser/devtools-commands.d.ts +270 -0
- package/dist/browser/devtools-commands.js +2 -0
- package/dist/browser/devtools-types.d.ts +1126 -0
- package/dist/browser/devtools-types.js +2 -0
- package/dist/browser/get-download-destination.d.ts +0 -0
- package/dist/browser/get-download-destination.js +0 -0
- package/dist/browser/is-target-closed-err.d.ts +1 -0
- package/dist/browser/is-target-closed-err.js +9 -0
- package/dist/browser/mitt/index.d.ts +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 +8 -7
- package/dist/browser/util.js +11 -3
- package/dist/browser-executable.d.ts +1 -0
- package/dist/{assets/cleanup-assets.js → browser-executable.js} +0 -0
- package/dist/browser-log.d.ts +1 -1
- package/dist/browser-log.js +0 -0
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +4 -0
- package/dist/calculate-ffmpeg-filters.d.ts +1 -1
- package/dist/calculate-ffmpeg-filters.js +1 -0
- package/dist/calculate-sar-dar-pixels.d.ts +9 -0
- package/dist/calculate-sar-dar-pixels.js +19 -0
- package/dist/can-use-parallel-encoding.d.ts +1 -1
- package/dist/can-use-parallel-encoding.js +2 -2
- package/dist/check-apple-silicon.d.ts +1 -0
- package/dist/check-apple-silicon.js +55 -0
- package/dist/chunk.d.ts +0 -0
- package/dist/chunk.js +0 -0
- package/dist/client.d.ts +3 -0
- package/dist/client.js +7 -0
- package/dist/codec-supports-media.d.ts +8 -0
- package/dist/codec-supports-media.js +56 -0
- package/dist/codec.d.ts +4 -0
- package/dist/codec.js +16 -0
- package/dist/combine-videos.d.ts +9 -3
- package/dist/combine-videos.js +18 -10
- package/dist/compositor/compose.d.ts +13 -0
- package/dist/compositor/compose.js +47 -0
- package/dist/compositor/compositor.d.ts +12 -0
- package/dist/compositor/compositor.js +96 -0
- package/dist/compositor/get-executable-path.d.ts +1 -0
- package/dist/compositor/get-executable-path.js +47 -0
- package/dist/compositor/payloads.d.ts +41 -0
- package/dist/compositor/payloads.js +2 -0
- package/dist/compress-assets.d.ts +7 -0
- package/dist/compress-assets.js +25 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.d.ts +1 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.js +17 -0
- package/dist/convert-to-pcm.d.ts +3 -2
- package/dist/convert-to-pcm.js +3 -2
- package/dist/convert-to-positive-frame-index.d.ts +4 -0
- package/dist/convert-to-positive-frame-index.js +8 -0
- package/dist/create-ffmpeg-complex-filter.d.ts +3 -5
- package/dist/create-ffmpeg-complex-filter.js +2 -11
- package/dist/create-ffmpeg-merge-filter.d.ts +0 -0
- package/dist/create-ffmpeg-merge-filter.js +3 -3
- package/dist/create-silent-audio.d.ts +3 -2
- package/dist/create-silent-audio.js +3 -2
- package/dist/crf.d.ts +9 -0
- package/dist/crf.js +91 -0
- package/dist/cycle-browser-tabs.d.ts +2 -5
- package/dist/cycle-browser-tabs.js +5 -5
- package/dist/delay-render-embedded-stack.d.ts +1 -1
- package/dist/delay-render-embedded-stack.js +0 -0
- package/dist/delete-directory.d.ts +0 -0
- package/dist/delete-directory.js +0 -0
- package/dist/determine-resize-params.d.ts +1 -0
- package/dist/determine-resize-params.js +10 -0
- package/dist/determine-vcodec-ffmpeg-flags.d.ts +2 -0
- package/dist/determine-vcodec-ffmpeg-flags.js +13 -0
- package/dist/ensure-ffmpeg.d.ts +10 -0
- package/dist/ensure-ffmpeg.js +50 -0
- package/dist/ensure-frames-in-order.d.ts +1 -1
- package/dist/ensure-frames-in-order.js +3 -2
- package/dist/ensure-output-directory.d.ts +0 -0
- package/dist/ensure-output-directory.js +0 -0
- package/dist/ensure-presentation-timestamp.d.ts +15 -1
- package/dist/ensure-presentation-timestamp.js +54 -23
- package/dist/error-handling/handle-javascript-exception.d.ts +2 -2
- package/dist/error-handling/handle-javascript-exception.js +3 -4
- package/dist/error-handling/symbolicate-error.d.ts +1 -1
- package/dist/error-handling/symbolicate-error.js +0 -0
- package/dist/error-handling/symbolicateable-error.d.ts +1 -1
- package/dist/error-handling/symbolicateable-error.js +0 -0
- package/dist/extract-frame-from-video.d.ts +8 -2
- package/dist/extract-frame-from-video.js +85 -91
- package/dist/ffmpeg-executable.d.ts +1 -0
- package/dist/ffmpeg-executable.js +2 -0
- package/dist/ffmpeg-filter-file.d.ts +2 -1
- package/dist/ffmpeg-filter-file.js +4 -6
- package/dist/ffmpeg-flags.d.ts +20 -2
- package/dist/ffmpeg-flags.js +205 -9
- package/dist/ffmpeg-override.d.ts +4 -0
- package/dist/ffmpeg-override.js +2 -0
- package/dist/find-closest-package-json.d.ts +2 -0
- package/dist/find-closest-package-json.js +31 -0
- package/dist/frame-range.d.ts +2 -0
- package/dist/frame-range.js +49 -0
- package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -0
- package/dist/frame-to-ffmpeg-timestamp.js +0 -0
- package/dist/get-audio-codec-name.d.ts +1 -1
- package/dist/get-audio-codec-name.js +2 -2
- package/dist/get-browser-instance.d.ts +4 -3
- package/dist/get-browser-instance.js +3 -3
- package/dist/get-can-extract-frames-fast.d.ts +10 -0
- package/dist/get-can-extract-frames-fast.js +67 -0
- package/dist/get-codec-name.d.ts +1 -1
- package/dist/get-codec-name.js +5 -2
- package/dist/get-compositions-from-bundle.d.ts +7 -0
- package/dist/get-compositions-from-bundle.js +55 -0
- package/dist/get-compositions.d.ts +11 -4
- package/dist/get-compositions.js +30 -11
- package/dist/get-concurrency.d.ts +1 -1
- package/dist/get-concurrency.js +8 -1
- package/dist/get-duration-from-frame-range.d.ts +1 -2
- package/dist/get-duration-from-frame-range.js +13 -9
- package/dist/get-extension-from-codec.d.ts +2 -2
- package/dist/get-extension-from-codec.js +8 -5
- package/dist/get-extension-of-filename.d.ts +1 -1
- package/dist/get-extension-of-filename.js +8 -1
- package/dist/get-frame-of-video-slow.d.ts +15 -0
- package/dist/get-frame-of-video-slow.js +72 -0
- package/dist/get-frame-padded-index.d.ts +14 -0
- package/dist/get-frame-padded-index.js +34 -0
- package/dist/get-frame-to-render.d.ts +1 -1
- package/dist/get-frame-to-render.js +0 -0
- package/dist/get-local-browser-executable.d.ts +2 -1
- package/dist/get-local-browser-executable.js +8 -8
- package/dist/get-port.d.ts +4 -1
- package/dist/get-port.js +13 -22
- package/dist/get-prores-profile-name.d.ts +2 -1
- package/dist/get-prores-profile-name.js +0 -0
- package/dist/get-video-info.d.ts +8 -0
- package/dist/get-video-info.js +59 -0
- package/dist/get-video-signals.d.ts +2 -0
- package/dist/get-video-signals.js +28 -0
- package/dist/get-video-threads-flag.d.ts +1 -0
- package/dist/get-video-threads-flag.js +18 -0
- package/dist/guess-extension-for-media.d.ts +5 -0
- package/dist/guess-extension-for-media.js +28 -0
- package/dist/image-format.d.ts +6 -1
- package/dist/image-format.js +28 -1
- package/dist/index.d.ts +97 -37
- package/dist/index.js +92 -17
- package/dist/is-audio-codec.d.ts +2 -0
- package/dist/is-audio-codec.js +7 -0
- package/dist/is-beyond-last-frame.d.ts +3 -2
- package/dist/is-beyond-last-frame.js +5 -5
- package/dist/is-serve-url.d.ts +0 -0
- package/dist/is-serve-url.js +0 -0
- package/dist/last-frame-from-video-cache.d.ts +10 -2
- package/dist/last-frame-from-video-cache.js +23 -18
- 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 +4 -0
- package/dist/log-level.js +15 -0
- package/dist/make-cancel-signal.d.ts +7 -0
- package/dist/make-cancel-signal.js +20 -1
- package/dist/make-comp-manager-context.d.ts +2 -0
- package/dist/make-comp-manager-context.js +45 -0
- package/dist/make-timeline-context-value.d.ts +2 -0
- package/dist/make-timeline-context-value.js +20 -0
- package/dist/merge-audio-track.d.ts +4 -1
- package/dist/merge-audio-track.js +18 -7
- package/dist/mime-db.d.ts +6 -0
- package/dist/mime-db.js +8636 -0
- package/dist/mime-types.d.ts +3 -0
- package/dist/mime-types.js +94 -0
- package/dist/normalize-serve-url.d.ts +0 -0
- package/dist/normalize-serve-url.js +0 -0
- package/dist/offthread-video-server.d.ts +9 -5
- package/dist/offthread-video-server.js +30 -10
- package/dist/open-browser.d.ts +5 -3
- package/dist/open-browser.js +17 -26
- package/dist/overwrite.d.ts +1 -0
- package/dist/overwrite.js +4 -0
- package/dist/p-limit.d.ts +0 -0
- package/dist/p-limit.js +0 -0
- package/dist/parse-browser-error-stack.d.ts +0 -0
- package/dist/parse-browser-error-stack.js +0 -0
- package/dist/parse-ffmpeg-progress.d.ts +0 -0
- package/dist/parse-ffmpeg-progress.js +0 -0
- package/dist/perf.d.ts +5 -0
- package/dist/perf.js +35 -0
- package/dist/pixel-format.d.ts +5 -0
- package/dist/pixel-format.js +29 -0
- package/dist/pool.d.ts +0 -0
- package/dist/pool.js +0 -0
- package/dist/prepare-server.d.ts +7 -5
- package/dist/prepare-server.js +13 -5
- package/dist/preprocess-audio-track.d.ts +5 -2
- package/dist/preprocess-audio-track.js +5 -4
- package/dist/prespawn-ffmpeg.d.ts +10 -3
- package/dist/prespawn-ffmpeg.js +24 -16
- package/dist/prestitcher-memory-usage.d.ts +12 -0
- package/dist/prestitcher-memory-usage.js +30 -0
- package/dist/prores-profile.d.ts +8 -0
- package/dist/prores-profile.js +23 -0
- package/dist/provide-screenshot.d.ts +10 -5
- package/dist/provide-screenshot.js +4 -2
- package/dist/puppeteer-evaluate.d.ts +1 -1
- package/dist/puppeteer-evaluate.js +22 -15
- package/dist/puppeteer-screenshot.d.ts +13 -2
- package/dist/puppeteer-screenshot.js +11 -16
- package/dist/quality.d.ts +1 -0
- package/dist/quality.js +21 -0
- package/dist/redirect-status-codes.d.ts +1 -0
- package/dist/redirect-status-codes.js +6 -0
- package/dist/render-frames.d.ts +30 -12
- package/dist/render-frames.js +232 -138
- package/dist/render-media.d.ts +49 -12
- package/dist/render-media.js +152 -30
- package/dist/render-on-server.d.ts +3 -0
- package/dist/render-on-server.js +90 -0
- package/dist/render-still.d.ts +21 -9
- package/dist/render-still.js +75 -37
- package/dist/render-svg.d.ts +8 -0
- package/dist/render-svg.js +13 -0
- package/dist/render-video-layer.d.ts +9 -0
- package/dist/render-video-layer.js +23 -0
- package/dist/render-web-frame.d.ts +73 -0
- package/dist/render-web-frame.js +260 -0
- package/dist/replace-browser.d.ts +6 -0
- package/dist/replace-browser.js +47 -0
- package/dist/resolve-asset-src.d.ts +0 -0
- package/dist/resolve-asset-src.js +0 -0
- package/dist/sample-rate.d.ts +0 -0
- package/dist/sample-rate.js +0 -0
- package/dist/screenshot-dom-element.d.ts +12 -8
- package/dist/screenshot-dom-element.js +12 -7
- package/dist/screenshot-task.d.ts +14 -3
- package/dist/screenshot-task.js +55 -27
- package/dist/seek-to-frame.d.ts +3 -2
- package/dist/seek-to-frame.js +24 -3
- package/dist/serve-handler/index.d.ts +1 -1
- package/dist/serve-handler/index.js +6 -7
- package/dist/serve-handler/is-path-inside.d.ts +0 -0
- package/dist/serve-handler/is-path-inside.js +0 -0
- package/dist/serve-handler/range-parser.d.ts +0 -0
- package/dist/serve-handler/range-parser.js +0 -0
- package/dist/serve-static.d.ts +5 -3
- package/dist/serve-static.js +20 -4
- package/dist/set-props-and-env.d.ts +4 -2
- package/dist/set-props-and-env.js +41 -15
- package/dist/stitch-frames-to-video.d.ts +20 -7
- package/dist/stitch-frames-to-video.js +175 -59
- package/dist/stringify-ffmpeg-filter.d.ts +4 -3
- package/dist/stringify-ffmpeg-filter.js +15 -11
- package/dist/symbolicate-stacktrace.d.ts +1 -1
- package/dist/symbolicate-stacktrace.js +3 -3
- package/dist/take-frame-and-compose.d.ts +20 -0
- package/dist/take-frame-and-compose.js +96 -0
- package/dist/tmp-dir.d.ts +0 -0
- package/dist/tmp-dir.js +0 -0
- package/dist/truthy.d.ts +3 -0
- package/dist/truthy.js +7 -0
- package/dist/try-to-extract-frame-of-video-fast.d.ts +13 -0
- package/dist/try-to-extract-frame-of-video-fast.js +55 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +0 -0
- package/dist/validate-concurrency.d.ts +1 -0
- package/dist/validate-concurrency.js +29 -0
- package/dist/validate-even-dimensions-with-codec.d.ts +1 -1
- package/dist/validate-even-dimensions-with-codec.js +2 -2
- package/dist/validate-every-nth-frame.d.ts +2 -0
- package/dist/validate-every-nth-frame.js +28 -0
- package/dist/validate-ffmpeg-override.d.ts +2 -0
- package/dist/validate-ffmpeg-override.js +12 -0
- package/dist/validate-ffmpeg.d.ts +7 -2
- package/dist/validate-ffmpeg.js +48 -44
- package/dist/validate-frame.d.ts +1 -0
- package/dist/validate-frame.js +24 -0
- package/dist/validate-number-of-gif-loops.d.ts +2 -0
- package/dist/validate-number-of-gif-loops.js +24 -0
- package/dist/validate-opengl-renderer.d.ts +5 -0
- package/dist/validate-opengl-renderer.js +15 -0
- package/dist/validate-output-filename.d.ts +1 -1
- package/dist/validate-output-filename.js +5 -0
- package/dist/validate-puppeteer-timeout.d.ts +0 -0
- package/dist/validate-puppeteer-timeout.js +1 -1
- package/dist/validate-scale.d.ts +0 -0
- package/dist/validate-scale.js +0 -0
- package/dist/validate-videobitrate.d.ts +1 -0
- package/dist/validate-videobitrate.js +20 -0
- package/dist/wait-for-symbolication-error-to-be-done.d.ts +3 -0
- package/dist/wait-for-symbolication-error-to-be-done.js +8 -0
- package/dist/warn-about-ffmpeg-version.d.ts +5 -0
- package/dist/warn-about-ffmpeg-version.js +37 -0
- package/dist/ws/ws-types.d.ts +14 -0
- package/dist/ws/ws-types.js +11 -0
- package/package.json +30 -22
- package/types/ws/index.d.ts +509 -0
- package/.prettierrc.js +0 -14
- 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/cleanup-assets.d.ts +0 -2
- 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-audio-channels.d.ts.map +0 -1
- package/dist/assets/get-audio-channels.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/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/browser/Accessibility.d.ts +0 -175
- package/dist/browser/Accessibility.js +0 -423
- package/dist/browser/AriaQueryHandler.d.ts +0 -20
- package/dist/browser/AriaQueryHandler.js +0 -108
- package/dist/browser/ConnectionTransport.d.ts +0 -21
- package/dist/browser/ConnectionTransport.js +0 -17
- package/dist/browser/Coverage.d.ts +0 -180
- package/dist/browser/Coverage.js +0 -371
- package/dist/browser/Debug.d.ts +0 -19
- package/dist/browser/Debug.js +0 -42
- package/dist/browser/DeviceDescriptors.d.ts +0 -40
- package/dist/browser/DeviceDescriptors.js +0 -1407
- package/dist/browser/EmulationManager.d.ts +0 -7
- package/dist/browser/EmulationManager.js +0 -40
- package/dist/browser/FileChooser.d.ts +0 -56
- package/dist/browser/FileChooser.js +0 -86
- package/dist/browser/Input.d.ts +0 -355
- package/dist/browser/Input.js +0 -592
- package/dist/browser/NetworkConditions.d.ts +0 -26
- package/dist/browser/NetworkConditions.js +0 -33
- package/dist/browser/PDFOptions.d.ts +0 -165
- package/dist/browser/PDFOptions.js +0 -34
- package/dist/browser/PipeTransport.d.ts +0 -10
- package/dist/browser/PipeTransport.js +0 -86
- package/dist/browser/Puppeteer.d.ts +0 -35
- package/dist/browser/Puppeteer.js +0 -17
- package/dist/browser/QueryHandler.d.ts +0 -64
- package/dist/browser/QueryHandler.js +0 -183
- package/dist/browser/SecurityDetails.d.ts +0 -55
- package/dist/browser/SecurityDetails.js +0 -95
- package/dist/browser/Tracing.d.ts +0 -45
- package/dist/browser/Tracing.js +0 -136
- package/dist/browser/USKeyboardLayout.d.ts +0 -39
- package/dist/browser/USKeyboardLayout.js +0 -406
- package/dist/browser/WebWorker.d.ts +0 -96
- package/dist/browser/WebWorker.js +0 -122
- package/dist/browser/compat.d.ts +0 -2
- package/dist/browser/compat.js +0 -17
- package/dist/browser/dialog.d.ts +0 -70
- package/dist/browser/dialog.js +0 -114
- package/dist/browser/environment.d.ts +0 -16
- package/dist/browser/environment.js +0 -19
- package/dist/browser/fetch.d.ts +0 -16
- package/dist/browser/fetch.js +0 -46
- package/dist/browser/find-up.d.ts +0 -4
- package/dist/browser/find-up.js +0 -85
- package/dist/browser/pkg-dir.d.ts +0 -3
- package/dist/browser/pkg-dir.js +0 -13
- 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/chunk.d.ts.map +0 -1
- package/dist/chunk.js.map +0 -1
- package/dist/combine-videos.d.ts.map +0 -1
- package/dist/combine-videos.js.map +0 -1
- package/dist/convert-to-pcm.d.ts.map +0 -1
- package/dist/convert-to-pcm.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/create-ffmpeg-merge-filter.d.ts.map +0 -1
- package/dist/create-ffmpeg-merge-filter.js.map +0 -1
- package/dist/create-silent-audio.d.ts.map +0 -1
- package/dist/create-silent-audio.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-filter-file.d.ts.map +0 -1
- package/dist/ffmpeg-filter-file.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.map +0 -1
- 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-duration-from-frame-range.d.ts.map +0 -1
- package/dist/get-duration-from-frame-range.js.map +0 -1
- package/dist/get-duration-of-asset.d.ts +0 -7
- package/dist/get-duration-of-asset.js +0 -36
- 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/merge-audio-track.d.ts.map +0 -1
- package/dist/merge-audio-track.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/p-limit.d.ts.map +0 -1
- package/dist/p-limit.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/preprocess-audio-track.d.ts.map +0 -1
- package/dist/preprocess-audio-track.js.map +0 -1
- package/dist/prespawn-ffmpeg.d.ts.map +0 -1
- package/dist/prespawn-ffmpeg.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-frames.d.ts.map +0 -1
- package/dist/render-frames.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/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-handler/glob-slash.d.ts +0 -1
- package/dist/serve-handler/glob-slash.js +0 -12
- 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/stitch-frames-to-video.d.ts.map +0 -1
- package/dist/stitch-frames-to-video.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-fps-for-gif.d.ts +0 -2
- package/dist/validate-fps-for-gif.js +0 -9
- 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
|
@@ -3,35 +3,41 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ensurePresentationTimestamps = void 0;
|
|
6
|
+
exports.ensurePresentationTimestamps = exports.ensurePresentationTimestampWithoutCache = void 0;
|
|
7
7
|
const execa_1 = __importDefault(require("execa"));
|
|
8
|
-
const promises_1 = require("fs/promises");
|
|
9
8
|
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const
|
|
9
|
+
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
10
|
+
const guess_extension_for_media_1 = require("./guess-extension-for-media");
|
|
11
|
+
const truthy_1 = require("./truthy");
|
|
11
12
|
let callbacks = [];
|
|
12
|
-
const
|
|
13
|
-
if (ensureFileHasPresentationTimestamp[src] === 'encoding') {
|
|
14
|
-
return new Promise((resolve) => {
|
|
15
|
-
callbacks.push({
|
|
16
|
-
src,
|
|
17
|
-
fn: () => resolve,
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
if (ensureFileHasPresentationTimestamp[src] === 'done') {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
ensureFileHasPresentationTimestamp[src] = 'encoding';
|
|
13
|
+
const getTemporaryOutputName = async ({ src, remotionRoot, ffprobeBinary, }) => {
|
|
25
14
|
const parts = src.split(path_1.default.sep);
|
|
26
|
-
|
|
15
|
+
// If there is no file extension for the video, then we need to temporarily add an extension
|
|
16
|
+
const lastPart = parts[parts.length - 1];
|
|
17
|
+
const extraExtension = lastPart.includes('.')
|
|
18
|
+
? null
|
|
19
|
+
: await (0, guess_extension_for_media_1.guessExtensionForVideo)({
|
|
20
|
+
src,
|
|
21
|
+
remotionRoot,
|
|
22
|
+
ffprobeBinary,
|
|
23
|
+
});
|
|
24
|
+
return parts
|
|
27
25
|
.map((p, i) => {
|
|
28
26
|
if (i === parts.length - 1) {
|
|
29
|
-
return `pts-${p}
|
|
27
|
+
return [`pts-${p}`, extraExtension].filter(truthy_1.truthy).join('.');
|
|
30
28
|
}
|
|
31
29
|
return p;
|
|
32
30
|
})
|
|
33
31
|
.join(path_1.default.sep);
|
|
34
|
-
|
|
32
|
+
};
|
|
33
|
+
const ensurePresentationTimestampWithoutCache = async ({ src, remotionRoot, ffmpegExecutable, ffprobeExecutable, }) => {
|
|
34
|
+
// If there is no file extension for the video, then we need to tempoa
|
|
35
|
+
const output = await getTemporaryOutputName({
|
|
36
|
+
src,
|
|
37
|
+
remotionRoot,
|
|
38
|
+
ffprobeBinary: ffprobeExecutable,
|
|
39
|
+
});
|
|
40
|
+
await (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffmpegExecutable, remotionRoot, 'ffmpeg'), [
|
|
35
41
|
'-i',
|
|
36
42
|
src,
|
|
37
43
|
'-fflags',
|
|
@@ -43,15 +49,40 @@ const ensurePresentationTimestamps = async (src) => {
|
|
|
43
49
|
output,
|
|
44
50
|
'-y',
|
|
45
51
|
]);
|
|
46
|
-
|
|
47
|
-
|
|
52
|
+
return output;
|
|
53
|
+
};
|
|
54
|
+
exports.ensurePresentationTimestampWithoutCache = ensurePresentationTimestampWithoutCache;
|
|
55
|
+
const ensurePresentationTimestamps = async ({ downloadMap, src, remotionRoot, ffmpegExecutable, ffprobeExecutable, }) => {
|
|
56
|
+
const elem = downloadMap.ensureFileHasPresentationTimestamp[src];
|
|
57
|
+
if ((elem === null || elem === void 0 ? void 0 : elem.type) === 'encoding') {
|
|
58
|
+
return new Promise((resolve) => {
|
|
59
|
+
callbacks.push({
|
|
60
|
+
src,
|
|
61
|
+
fn: (newSrc) => resolve(newSrc),
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if ((elem === null || elem === void 0 ? void 0 : elem.type) === 'done') {
|
|
66
|
+
return elem.src;
|
|
67
|
+
}
|
|
68
|
+
downloadMap.ensureFileHasPresentationTimestamp[src] = { type: 'encoding' };
|
|
69
|
+
const output = await (0, exports.ensurePresentationTimestampWithoutCache)({
|
|
70
|
+
ffmpegExecutable,
|
|
71
|
+
ffprobeExecutable,
|
|
72
|
+
remotionRoot,
|
|
73
|
+
src,
|
|
74
|
+
});
|
|
48
75
|
callbacks = callbacks.filter((c) => {
|
|
49
76
|
if (c.src === src) {
|
|
50
|
-
c.fn();
|
|
77
|
+
c.fn(output);
|
|
51
78
|
return false;
|
|
52
79
|
}
|
|
53
80
|
return true;
|
|
54
81
|
});
|
|
55
|
-
ensureFileHasPresentationTimestamp[src] =
|
|
82
|
+
downloadMap.ensureFileHasPresentationTimestamp[src] = {
|
|
83
|
+
type: 'done',
|
|
84
|
+
src: output,
|
|
85
|
+
};
|
|
86
|
+
return output;
|
|
56
87
|
};
|
|
57
88
|
exports.ensurePresentationTimestamps = ensurePresentationTimestamps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Page } from '
|
|
2
|
-
import { SymbolicatedStackFrame } from '../symbolicate-stacktrace';
|
|
1
|
+
import type { Page } from '../browser/BrowserPage';
|
|
2
|
+
import type { SymbolicatedStackFrame } from '../symbolicate-stacktrace';
|
|
3
3
|
export declare class ErrorWithStackFrame extends Error {
|
|
4
4
|
symbolicatedStackFrames: SymbolicatedStackFrame[] | null;
|
|
5
5
|
frame: number | null;
|
|
@@ -41,8 +41,8 @@ const callFrameToStackFrame = (callFrame) => {
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
const handleJavascriptException = ({ page, onError, frame, }) => {
|
|
44
|
-
const client = page._client;
|
|
45
|
-
const handler =
|
|
44
|
+
const client = page._client();
|
|
45
|
+
const handler = (exception) => {
|
|
46
46
|
var _a, _b, _c;
|
|
47
47
|
const rawErrorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
|
|
48
48
|
const cleanErrorMessage = cleanUpErrorMessage(exception);
|
|
@@ -55,8 +55,7 @@ const handleJavascriptException = ({ page, onError, frame, }) => {
|
|
|
55
55
|
const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
|
|
56
56
|
const symbolicatedErr = new symbolicateable_error_1.SymbolicateableError({
|
|
57
57
|
message: removeDelayRenderStack(cleanErrorMessage),
|
|
58
|
-
stackFrame: exception.exceptionDetails.stackTrace
|
|
59
|
-
.callFrames.map((f) => callFrameToStackFrame(f)),
|
|
58
|
+
stackFrame: exception.exceptionDetails.stackTrace.callFrames.map((f) => callFrameToStackFrame(f)),
|
|
60
59
|
frame,
|
|
61
60
|
name: errorType,
|
|
62
61
|
stack: (_c = exception.exceptionDetails.exception) === null || _c === void 0 ? void 0 : _c.description,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ErrorWithStackFrame } from './handle-javascript-exception';
|
|
2
|
-
import { SymbolicateableError } from './symbolicateable-error';
|
|
2
|
+
import type { SymbolicateableError } from './symbolicateable-error';
|
|
3
3
|
export declare const symbolicateError: (symbolicateableError: SymbolicateableError) => Promise<ErrorWithStackFrame>;
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A symbolicateable error is an error that can be symolicated by fetching the original sources. By throwing a symbolicateable error, Remotion CLI will attempt to symplicate it
|
|
3
3
|
*/
|
|
4
|
-
import { UnsymbolicatedStackFrame } from '../parse-browser-error-stack';
|
|
4
|
+
import type { UnsymbolicatedStackFrame } from '../parse-browser-error-stack';
|
|
5
5
|
export declare class SymbolicateableError extends Error {
|
|
6
6
|
stackFrame: UnsymbolicatedStackFrame[] | null;
|
|
7
7
|
delayRenderCall: UnsymbolicatedStackFrame[] | null;
|
|
File without changes
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { OffthreadVideoImageFormat } from 'remotion';
|
|
3
|
+
import type { DownloadMap } from './assets/download-map';
|
|
4
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
5
|
+
import type { LastFrameOptions } from './last-frame-from-video-cache';
|
|
3
6
|
export declare const getLastFrameOfVideo: (options: LastFrameOptions) => Promise<Buffer>;
|
|
4
7
|
declare type Options = {
|
|
5
8
|
time: number;
|
|
6
9
|
src: string;
|
|
7
10
|
ffmpegExecutable: FfmpegExecutable;
|
|
8
11
|
ffprobeExecutable: FfmpegExecutable;
|
|
12
|
+
imageFormat: OffthreadVideoImageFormat;
|
|
13
|
+
downloadMap: DownloadMap;
|
|
14
|
+
remotionRoot: string;
|
|
9
15
|
};
|
|
10
16
|
export declare const extractFrameFromVideo: (options: Options) => Promise<Buffer>;
|
|
11
17
|
export {};
|
|
@@ -5,119 +5,71 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.extractFrameFromVideo = exports.getLastFrameOfVideo = void 0;
|
|
7
7
|
const execa_1 = __importDefault(require("execa"));
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const get_video_stream_duration_1 = require("./assets/get-video-stream-duration");
|
|
9
|
+
const determine_resize_params_1 = require("./determine-resize-params");
|
|
10
|
+
const determine_vcodec_ffmpeg_flags_1 = require("./determine-vcodec-ffmpeg-flags");
|
|
10
11
|
const ensure_presentation_timestamp_1 = require("./ensure-presentation-timestamp");
|
|
12
|
+
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
11
13
|
const frame_to_ffmpeg_timestamp_1 = require("./frame-to-ffmpeg-timestamp");
|
|
14
|
+
const get_can_extract_frames_fast_1 = require("./get-can-extract-frames-fast");
|
|
15
|
+
const get_frame_of_video_slow_1 = require("./get-frame-of-video-slow");
|
|
16
|
+
const get_video_info_1 = require("./get-video-info");
|
|
12
17
|
const is_beyond_last_frame_1 = require("./is-beyond-last-frame");
|
|
13
18
|
const last_frame_from_video_cache_1 = require("./last-frame-from-video-cache");
|
|
14
19
|
const p_limit_1 = require("./p-limit");
|
|
20
|
+
const perf_1 = require("./perf");
|
|
21
|
+
const truthy_1 = require("./truthy");
|
|
22
|
+
const try_to_extract_frame_of_video_fast_1 = require("./try-to-extract-frame-of-video-fast");
|
|
15
23
|
const lastFrameLimit = (0, p_limit_1.pLimit)(1);
|
|
16
24
|
const mainLimit = (0, p_limit_1.pLimit)(5);
|
|
17
|
-
// Uses no seeking, therefore the whole video has to be decoded. This is a last resort and should only happen
|
|
18
|
-
// if the video is corrupted
|
|
19
|
-
const getLastFrameOfVideoSlow = async ({ src, duration, ffmpegExecutable, }) => {
|
|
20
|
-
console.warn(`\nUsing a slow method to determine the last frame of ${src}. The render can be sped up by re-encoding the video properly.`);
|
|
21
|
-
const actualOffset = `-${duration * 1000}ms`;
|
|
22
|
-
const command = [
|
|
23
|
-
'-itsoffset',
|
|
24
|
-
actualOffset,
|
|
25
|
-
'-i',
|
|
26
|
-
src,
|
|
27
|
-
'-frames:v',
|
|
28
|
-
'1',
|
|
29
|
-
'-f',
|
|
30
|
-
'image2pipe',
|
|
31
|
-
'-',
|
|
32
|
-
];
|
|
33
|
-
const { stdout, stderr } = (0, execa_1.default)(ffmpegExecutable !== null && ffmpegExecutable !== void 0 ? ffmpegExecutable : 'ffmpeg', command);
|
|
34
|
-
if (!stderr) {
|
|
35
|
-
throw new Error('unexpectedly did not get stderr');
|
|
36
|
-
}
|
|
37
|
-
if (!stdout) {
|
|
38
|
-
throw new Error('unexpectedly did not get stdout');
|
|
39
|
-
}
|
|
40
|
-
const stderrChunks = [];
|
|
41
|
-
const stdoutChunks = [];
|
|
42
|
-
const stdErrString = new Promise((resolve, reject) => {
|
|
43
|
-
stderr.on('data', (d) => stderrChunks.push(d));
|
|
44
|
-
stderr.on('error', (err) => reject(err));
|
|
45
|
-
stderr.on('end', () => resolve(Buffer.concat(stderrChunks).toString('utf-8')));
|
|
46
|
-
});
|
|
47
|
-
const stdoutChunk = new Promise((resolve, reject) => {
|
|
48
|
-
stdout.on('data', (d) => stdoutChunks.push(d));
|
|
49
|
-
stdout.on('error', (err) => reject(err));
|
|
50
|
-
stdout.on('end', () => resolve(Buffer.concat(stdoutChunks)));
|
|
51
|
-
});
|
|
52
|
-
const [stdErr, stdoutBuffer] = await Promise.all([stdErrString, stdoutChunk]);
|
|
53
|
-
const isEmpty = stdErr.includes('Output file is empty');
|
|
54
|
-
if (isEmpty) {
|
|
55
|
-
throw new Error(`Could not get last frame of ${src}. Tried to seek to the end using the command "ffmpeg ${command.join(' ')}" but got no frame. Most likely this video is corrupted.`);
|
|
56
|
-
}
|
|
57
|
-
return stdoutBuffer;
|
|
58
|
-
};
|
|
59
25
|
const getLastFrameOfVideoFastUnlimited = async (options) => {
|
|
60
|
-
const { ffmpegExecutable, ffprobeExecutable, offset, src } = options;
|
|
26
|
+
const { ffmpegExecutable, ffprobeExecutable, offset, src, downloadMap } = options;
|
|
61
27
|
const fromCache = (0, last_frame_from_video_cache_1.getLastFrameFromCache)({ ...options, offset: 0 });
|
|
62
28
|
if (fromCache) {
|
|
63
29
|
return fromCache;
|
|
64
30
|
}
|
|
65
|
-
const { duration } = await (0,
|
|
31
|
+
const { duration, fps } = await (0, get_video_stream_duration_1.getVideoStreamDuration)(downloadMap, src, ffprobeExecutable, options.remotionRoot);
|
|
66
32
|
if (duration === null) {
|
|
67
33
|
throw new Error(`Could not determine the duration of ${src} using FFMPEG. The file is not supported.`);
|
|
68
34
|
}
|
|
69
|
-
if (
|
|
70
|
-
|
|
35
|
+
if (options.specialVCodecForTransparency === 'vp8' ||
|
|
36
|
+
offset > get_can_extract_frames_fast_1.ACCEPTABLE_OFFSET_THRESHOLD) {
|
|
37
|
+
const last = await (0, get_frame_of_video_slow_1.getFrameOfVideoSlow)({
|
|
71
38
|
duration,
|
|
72
39
|
ffmpegExecutable,
|
|
73
40
|
src,
|
|
41
|
+
imageFormat: options.imageFormat,
|
|
42
|
+
specialVCodecForTransparency: options.specialVCodecForTransparency,
|
|
43
|
+
needsResize: options.needsResize,
|
|
44
|
+
offset: offset - 1000 / (fps === null ? 10 : fps),
|
|
45
|
+
fps,
|
|
46
|
+
remotionRoot: options.remotionRoot,
|
|
74
47
|
});
|
|
75
48
|
return last;
|
|
76
49
|
}
|
|
77
|
-
const actualOffset = `${duration * 1000 - offset
|
|
78
|
-
const
|
|
79
|
-
'-ss',
|
|
50
|
+
const actualOffset = `${duration * 1000 - offset}ms`;
|
|
51
|
+
const [stdErr, stdoutBuffer] = await (0, try_to_extract_frame_of_video_fast_1.tryToExtractFrameOfVideoFast)({
|
|
80
52
|
actualOffset,
|
|
81
|
-
|
|
53
|
+
ffmpegExecutable,
|
|
54
|
+
imageFormat: options.imageFormat,
|
|
55
|
+
needsResize: options.needsResize,
|
|
56
|
+
remotionRoot: options.remotionRoot,
|
|
57
|
+
specialVCodecForTransparency: options.specialVCodecForTransparency,
|
|
82
58
|
src,
|
|
83
|
-
'-frames:v',
|
|
84
|
-
'1',
|
|
85
|
-
'-f',
|
|
86
|
-
'image2pipe',
|
|
87
|
-
'-',
|
|
88
|
-
]);
|
|
89
|
-
if (!stderr) {
|
|
90
|
-
throw new Error('unexpectedly did not get stderr');
|
|
91
|
-
}
|
|
92
|
-
if (!stdout) {
|
|
93
|
-
throw new Error('unexpectedly did not get stdout');
|
|
94
|
-
}
|
|
95
|
-
const stderrChunks = [];
|
|
96
|
-
const stdoutChunks = [];
|
|
97
|
-
const stdErrString = new Promise((resolve, reject) => {
|
|
98
|
-
stderr.on('data', (d) => stderrChunks.push(d));
|
|
99
|
-
stderr.on('error', (err) => reject(err));
|
|
100
|
-
stderr.on('end', () => resolve(Buffer.concat(stderrChunks).toString('utf-8')));
|
|
101
|
-
});
|
|
102
|
-
const stdoutChunk = new Promise((resolve, reject) => {
|
|
103
|
-
stdout.on('data', (d) => {
|
|
104
|
-
stdoutChunks.push(d);
|
|
105
|
-
});
|
|
106
|
-
stdout.on('error', (err) => {
|
|
107
|
-
reject(err);
|
|
108
|
-
});
|
|
109
|
-
stdout.on('end', () => {
|
|
110
|
-
resolve(Buffer.concat(stdoutChunks));
|
|
111
|
-
});
|
|
112
59
|
});
|
|
113
|
-
const [stdErr, stdoutBuffer] = await Promise.all([stdErrString, stdoutChunk]);
|
|
114
60
|
const isEmpty = stdErr.includes('Output file is empty');
|
|
115
61
|
if (isEmpty) {
|
|
116
62
|
const unlimited = await getLastFrameOfVideoFastUnlimited({
|
|
117
63
|
ffmpegExecutable,
|
|
118
|
-
|
|
64
|
+
// Decrement in 10ms increments, or 1 frame (e.g. fps = 25 --> 40ms)
|
|
65
|
+
offset: offset + (fps === null ? 10 : 1000 / fps),
|
|
119
66
|
src,
|
|
120
67
|
ffprobeExecutable,
|
|
68
|
+
imageFormat: options.imageFormat,
|
|
69
|
+
specialVCodecForTransparency: options.specialVCodecForTransparency,
|
|
70
|
+
needsResize: options.needsResize,
|
|
71
|
+
downloadMap: options.downloadMap,
|
|
72
|
+
remotionRoot: options.remotionRoot,
|
|
121
73
|
});
|
|
122
74
|
return unlimited;
|
|
123
75
|
}
|
|
@@ -129,29 +81,61 @@ const getLastFrameOfVideo = async (options) => {
|
|
|
129
81
|
return result;
|
|
130
82
|
};
|
|
131
83
|
exports.getLastFrameOfVideo = getLastFrameOfVideo;
|
|
132
|
-
const extractFrameFromVideoFn = async ({ time,
|
|
133
|
-
|
|
134
|
-
|
|
84
|
+
const extractFrameFromVideoFn = async ({ time, ffmpegExecutable, ffprobeExecutable, imageFormat, downloadMap, remotionRoot, ...options }) => {
|
|
85
|
+
// We make a new copy of the video only for video because the conversion may affect
|
|
86
|
+
// audio rendering, so we work with 2 different files
|
|
87
|
+
const src = await (0, ensure_presentation_timestamp_1.ensurePresentationTimestamps)({
|
|
88
|
+
downloadMap,
|
|
89
|
+
src: options.src,
|
|
90
|
+
remotionRoot,
|
|
91
|
+
ffmpegExecutable,
|
|
92
|
+
ffprobeExecutable,
|
|
93
|
+
});
|
|
94
|
+
const { specialVcodecForTransparency: specialVcodec, needsResize } = await (0, get_video_info_1.getVideoInfo)(downloadMap, src, ffprobeExecutable, remotionRoot);
|
|
95
|
+
if (specialVcodec === 'vp8') {
|
|
96
|
+
const { fps } = await (0, get_video_stream_duration_1.getVideoStreamDuration)(downloadMap, src, ffprobeExecutable, remotionRoot);
|
|
97
|
+
return (0, get_frame_of_video_slow_1.getFrameOfVideoSlow)({
|
|
98
|
+
ffmpegExecutable,
|
|
99
|
+
imageFormat,
|
|
100
|
+
specialVCodecForTransparency: specialVcodec,
|
|
101
|
+
src,
|
|
102
|
+
duration: time,
|
|
103
|
+
needsResize,
|
|
104
|
+
offset: 0,
|
|
105
|
+
fps,
|
|
106
|
+
remotionRoot,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
if ((0, is_beyond_last_frame_1.isBeyondLastFrame)(downloadMap, src, time)) {
|
|
135
110
|
const lastFrame = await (0, exports.getLastFrameOfVideo)({
|
|
136
111
|
ffmpegExecutable,
|
|
137
112
|
ffprobeExecutable,
|
|
138
113
|
offset: 0,
|
|
139
114
|
src,
|
|
115
|
+
imageFormat,
|
|
116
|
+
specialVCodecForTransparency: specialVcodec,
|
|
117
|
+
needsResize,
|
|
118
|
+
downloadMap,
|
|
119
|
+
remotionRoot,
|
|
140
120
|
});
|
|
141
121
|
return lastFrame;
|
|
142
122
|
}
|
|
143
123
|
const ffmpegTimestamp = (0, frame_to_ffmpeg_timestamp_1.frameToFfmpegTimestamp)(time);
|
|
144
|
-
const { stdout, stderr } = (0, execa_1.default)(
|
|
124
|
+
const { stdout, stderr } = (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffmpegExecutable, remotionRoot, 'ffmpeg'), [
|
|
145
125
|
'-ss',
|
|
146
126
|
ffmpegTimestamp,
|
|
127
|
+
...(0, determine_vcodec_ffmpeg_flags_1.determineVcodecFfmpegFlags)(specialVcodec),
|
|
147
128
|
'-i',
|
|
148
129
|
src,
|
|
149
130
|
'-frames:v',
|
|
150
131
|
'1',
|
|
151
132
|
'-f',
|
|
152
133
|
'image2pipe',
|
|
134
|
+
'-vcodec',
|
|
135
|
+
imageFormat === 'jpeg' ? 'mjpeg' : 'png',
|
|
136
|
+
...(0, determine_resize_params_1.determineResizeParams)(needsResize),
|
|
153
137
|
'-',
|
|
154
|
-
], {
|
|
138
|
+
].filter(truthy_1.truthy), {
|
|
155
139
|
buffer: false,
|
|
156
140
|
});
|
|
157
141
|
if (!stderr) {
|
|
@@ -177,21 +161,31 @@ const extractFrameFromVideoFn = async ({ time, src, ffmpegExecutable, ffprobeExe
|
|
|
177
161
|
stdoutBuffer,
|
|
178
162
|
]);
|
|
179
163
|
if (stderrStr.includes('Output file is empty')) {
|
|
180
|
-
(0, is_beyond_last_frame_1.markAsBeyondLastFrame)(src, time);
|
|
164
|
+
(0, is_beyond_last_frame_1.markAsBeyondLastFrame)(downloadMap, src, time);
|
|
181
165
|
const last = await (0, exports.getLastFrameOfVideo)({
|
|
182
166
|
ffmpegExecutable,
|
|
183
167
|
ffprobeExecutable,
|
|
184
168
|
offset: 0,
|
|
185
169
|
src,
|
|
170
|
+
imageFormat,
|
|
171
|
+
specialVCodecForTransparency: specialVcodec,
|
|
172
|
+
needsResize,
|
|
173
|
+
downloadMap,
|
|
174
|
+
remotionRoot,
|
|
186
175
|
});
|
|
187
176
|
return last;
|
|
188
177
|
}
|
|
178
|
+
if (stdOut.length === 0) {
|
|
179
|
+
console.log('FFMPEG Logs:');
|
|
180
|
+
console.log(stderrStr);
|
|
181
|
+
throw new Error("Couldn't extract frame from video - FFMPEG did not return any data. Check logs to see more information");
|
|
182
|
+
}
|
|
189
183
|
return stdOut;
|
|
190
184
|
};
|
|
191
185
|
const extractFrameFromVideo = async (options) => {
|
|
192
|
-
const perf =
|
|
186
|
+
const perf = (0, perf_1.startPerfMeasure)('extract-frame');
|
|
193
187
|
const res = await mainLimit(extractFrameFromVideoFn, options);
|
|
194
|
-
|
|
188
|
+
(0, perf_1.stopPerfMeasure)(perf);
|
|
195
189
|
return res;
|
|
196
190
|
};
|
|
197
191
|
exports.extractFrameFromVideo = extractFrameFromVideo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type FfmpegExecutable = string | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DownloadMap } from './assets/download-map';
|
|
2
|
+
export declare const makeFfmpegFilterFile: (complexFilter: string, downloadMap: DownloadMap) => Promise<{
|
|
2
3
|
file: string;
|
|
3
4
|
cleanup: () => void;
|
|
4
5
|
}>;
|
|
@@ -8,16 +8,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.makeFfmpegFilterFile = void 0;
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const tempPath = (0, tmp_dir_1.tmpDir)('remotion-complex-filter');
|
|
15
|
-
const filterFile = path_1.default.join(tempPath, 'complex-filter.txt');
|
|
11
|
+
const makeFfmpegFilterFile = async (complexFilter, downloadMap) => {
|
|
12
|
+
const random = Math.random().toString().replace('.', '');
|
|
13
|
+
const filterFile = path_1.default.join(downloadMap.complexFilter, 'complex-filter-' + random + '.txt');
|
|
16
14
|
await fs_1.default.promises.writeFile(filterFile, complexFilter);
|
|
17
15
|
return {
|
|
18
16
|
file: filterFile,
|
|
19
17
|
cleanup: () => {
|
|
20
|
-
|
|
18
|
+
fs_1.default.unlinkSync(filterFile);
|
|
21
19
|
},
|
|
22
20
|
};
|
|
23
21
|
};
|
package/dist/ffmpeg-flags.d.ts
CHANGED
|
@@ -1,13 +1,31 @@
|
|
|
1
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
1
2
|
export declare type FfmpegVersion = [number, number, number] | null;
|
|
2
3
|
export declare const getFfmpegBuildInfo: (options: {
|
|
3
4
|
ffmpegExecutable: string | null;
|
|
5
|
+
remotionRoot: string;
|
|
4
6
|
}) => Promise<string>;
|
|
5
|
-
export declare const
|
|
7
|
+
export declare const ffmpegInNodeModules: (remotionRoot: string, binary: 'ffmpeg' | 'ffprobe') => string | null;
|
|
8
|
+
export declare const ffmpegHasFeature: ({ ffmpegExecutable, feature, remotionRoot, }: {
|
|
6
9
|
ffmpegExecutable: string | null;
|
|
7
10
|
feature: 'enable-gpl' | 'enable-libx265' | 'enable-libvpx';
|
|
8
|
-
|
|
11
|
+
remotionRoot: string;
|
|
9
12
|
}) => Promise<boolean>;
|
|
10
13
|
export declare const parseFfmpegVersion: (buildconf: string) => FfmpegVersion;
|
|
11
14
|
export declare const getFfmpegVersion: (options: {
|
|
12
15
|
ffmpegExecutable: string | null;
|
|
16
|
+
remotionRoot: string;
|
|
13
17
|
}) => Promise<FfmpegVersion>;
|
|
18
|
+
export declare const downloadBinary: (remotionRoot: string, url: string, binary: 'ffmpeg' | 'ffprobe') => Promise<string>;
|
|
19
|
+
export declare const lambdaFfmpegPaths: {
|
|
20
|
+
readonly ffmpeg: "/opt/bin/ffmpeg";
|
|
21
|
+
readonly ffprobe: "/opt/bin/ffprobe";
|
|
22
|
+
};
|
|
23
|
+
export declare const getExecutableBinary: (ffmpegExecutable: FfmpegExecutable, remotionRoot: string, binary: 'ffmpeg' | 'ffprobe') => string | Promise<string>;
|
|
24
|
+
export declare const getBinaryDownloadUrl: (binary: 'ffmpeg' | 'ffprobe') => {
|
|
25
|
+
url: string;
|
|
26
|
+
contentLength: number;
|
|
27
|
+
} | null;
|
|
28
|
+
export declare const warnAboutFfmpegVersion: ({ ffmpegVersion, buildConf, }: {
|
|
29
|
+
ffmpegVersion: FfmpegVersion;
|
|
30
|
+
buildConf: string | null;
|
|
31
|
+
}) => null | undefined;
|