@remotion/renderer 4.0.0-reorg.8 → 4.0.0-retry.8
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/dist/assets/calculate-asset-positions.d.ts +0 -0
- package/dist/assets/calculate-asset-positions.js +0 -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 +3 -2
- package/dist/assets/convert-assets-to-file-urls.js +2 -2
- package/dist/assets/download-and-map-assets-to-file.d.ts +8 -6
- package/dist/assets/download-and-map-assets-to-file.js +91 -50
- package/dist/assets/download-file.d.ts +1 -1
- package/dist/assets/download-file.js +4 -2
- package/dist/assets/download-map.d.ts +64 -0
- package/dist/assets/download-map.js +73 -0
- package/dist/assets/ffmpeg-volume-expression.d.ts +0 -0
- package/dist/assets/ffmpeg-volume-expression.js +0 -0
- 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 -6
- package/dist/assets/get-audio-channels.js +6 -7
- package/dist/assets/get-video-stream-duration.d.ts +3 -5
- package/dist/assets/get-video-stream-duration.js +39 -14
- package/dist/assets/read-file.d.ts +0 -0
- package/dist/assets/read-file.js +0 -0
- 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 +0 -0
- package/dist/assets/types.js +0 -0
- package/dist/browser/Browser.d.ts +1 -0
- package/dist/browser/Browser.js +9 -10
- package/dist/browser/BrowserConnector.d.ts +0 -0
- package/dist/browser/BrowserConnector.js +0 -0
- package/dist/browser/BrowserFetcher.d.ts +0 -0
- package/dist/browser/BrowserFetcher.js +12 -10
- package/dist/browser/BrowserPage.d.ts +0 -0
- package/dist/browser/BrowserPage.js +0 -0
- package/dist/browser/BrowserRunner.d.ts +1 -4
- package/dist/browser/BrowserRunner.js +28 -71
- package/dist/browser/Connection.d.ts +0 -0
- package/dist/browser/Connection.js +1 -1
- package/dist/browser/ConsoleMessage.d.ts +0 -0
- package/dist/browser/ConsoleMessage.js +0 -0
- package/dist/browser/DOMWorld.d.ts +0 -0
- package/dist/browser/DOMWorld.js +0 -0
- package/dist/browser/Errors.d.ts +0 -0
- package/dist/browser/Errors.js +0 -0
- package/dist/browser/EvalTypes.d.ts +0 -0
- package/dist/browser/EvalTypes.js +0 -0
- package/dist/browser/EventEmitter.d.ts +0 -0
- package/dist/browser/EventEmitter.js +0 -0
- package/dist/browser/ExecutionContext.d.ts +0 -0
- package/dist/browser/ExecutionContext.js +0 -0
- package/dist/browser/FrameManager.d.ts +0 -0
- package/dist/browser/FrameManager.js +0 -0
- package/dist/browser/HTTPRequest.d.ts +0 -0
- package/dist/browser/HTTPRequest.js +0 -0
- package/dist/browser/HTTPResponse.d.ts +0 -0
- package/dist/browser/HTTPResponse.js +0 -0
- package/dist/browser/JSHandle.d.ts +0 -0
- package/dist/browser/JSHandle.js +0 -0
- package/dist/browser/LaunchOptions.d.ts +0 -4
- package/dist/browser/LaunchOptions.js +0 -0
- package/dist/browser/Launcher.d.ts +1 -1
- package/dist/browser/Launcher.js +5 -363
- package/dist/browser/LifecycleWatcher.d.ts +0 -0
- package/dist/browser/LifecycleWatcher.js +0 -0
- package/dist/browser/NetworkEventManager.d.ts +0 -0
- package/dist/browser/NetworkEventManager.js +0 -0
- package/dist/browser/NetworkManager.d.ts +0 -0
- package/dist/browser/NetworkManager.js +0 -0
- package/dist/browser/NodeWebSocketTransport.d.ts +0 -0
- package/dist/browser/NodeWebSocketTransport.js +1 -1
- package/dist/browser/Product.d.ts +0 -0
- package/dist/browser/Product.js +0 -0
- package/dist/browser/PuppeteerNode.d.ts +0 -0
- package/dist/browser/PuppeteerNode.js +1 -4
- package/dist/browser/PuppeteerViewport.d.ts +0 -0
- package/dist/browser/PuppeteerViewport.js +0 -0
- package/dist/browser/ScreenshotOptions.d.ts +0 -0
- package/dist/browser/ScreenshotOptions.js +0 -0
- package/dist/browser/Target.d.ts +0 -0
- package/dist/browser/Target.js +0 -0
- package/dist/browser/TaskQueue.d.ts +0 -0
- package/dist/browser/TaskQueue.js +0 -0
- package/dist/browser/TimeoutSettings.d.ts +0 -0
- package/dist/browser/TimeoutSettings.js +0 -0
- package/dist/browser/assert.d.ts +0 -0
- package/dist/browser/assert.js +0 -0
- package/dist/browser/create-browser-fetcher.d.ts +0 -0
- package/dist/browser/create-browser-fetcher.js +2 -44
- package/dist/browser/devtools-commands.d.ts +0 -0
- package/dist/browser/devtools-commands.js +0 -0
- package/dist/browser/devtools-types.d.ts +0 -0
- package/dist/browser/devtools-types.js +0 -0
- package/dist/browser/get-download-destination.d.ts +0 -0
- package/dist/browser/get-download-destination.js +0 -0
- package/dist/browser/mitt/index.d.ts +0 -0
- package/dist/browser/mitt/index.js +0 -0
- package/dist/browser/node.d.ts +0 -0
- package/dist/browser/node.js +0 -0
- package/dist/browser/revisions.d.ts +0 -1
- package/dist/browser/revisions.js +0 -1
- package/dist/browser/util.d.ts +0 -0
- package/dist/browser/util.js +0 -0
- package/dist/browser-executable.d.ts +0 -0
- package/dist/browser-executable.js +0 -0
- package/dist/browser-log.d.ts +0 -0
- package/dist/browser-log.js +0 -0
- package/dist/browser.d.ts +0 -0
- package/dist/browser.js +0 -0
- package/dist/calculate-ffmpeg-filters.d.ts +0 -0
- package/dist/calculate-ffmpeg-filters.js +0 -0
- package/dist/calculate-sar-dar-pixels.d.ts +0 -0
- package/dist/calculate-sar-dar-pixels.js +0 -0
- package/dist/can-use-parallel-encoding.d.ts +0 -0
- package/dist/can-use-parallel-encoding.js +0 -0
- package/dist/check-apple-silicon.d.ts +1 -0
- package/dist/check-apple-silicon.js +55 -0
- package/dist/chunk.d.ts +0 -0
- package/dist/chunk.js +0 -0
- package/dist/codec-supports-media.d.ts +1 -0
- package/dist/codec-supports-media.js +8 -1
- package/dist/codec.d.ts +0 -0
- package/dist/codec.js +0 -0
- package/dist/combine-videos.d.ts +0 -0
- package/dist/combine-videos.js +1 -1
- package/dist/compress-assets.d.ts +0 -0
- package/dist/compress-assets.js +0 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.d.ts +0 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.js +0 -0
- package/dist/convert-to-pcm.d.ts +0 -0
- package/dist/convert-to-pcm.js +0 -0
- package/dist/convert-to-positive-frame-index.d.ts +4 -0
- package/dist/convert-to-positive-frame-index.js +8 -0
- package/dist/create-ffmpeg-complex-filter.d.ts +2 -1
- package/dist/create-ffmpeg-complex-filter.js +2 -11
- package/dist/create-ffmpeg-merge-filter.d.ts +0 -0
- package/dist/create-ffmpeg-merge-filter.js +0 -0
- package/dist/create-silent-audio.d.ts +0 -0
- package/dist/create-silent-audio.js +0 -0
- package/dist/crf.d.ts +5 -1
- package/dist/crf.js +33 -6
- package/dist/cycle-browser-tabs.d.ts +0 -0
- package/dist/cycle-browser-tabs.js +0 -0
- 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 +0 -0
- package/dist/delete-directory.js +0 -0
- package/dist/ensure-frames-in-order.d.ts +0 -0
- package/dist/ensure-frames-in-order.js +0 -0
- package/dist/ensure-output-directory.d.ts +0 -0
- package/dist/ensure-output-directory.js +0 -0
- package/dist/ensure-presentation-timestamp.d.ts +2 -1
- package/dist/ensure-presentation-timestamp.js +7 -5
- package/dist/error-handling/handle-javascript-exception.d.ts +0 -0
- package/dist/error-handling/handle-javascript-exception.js +0 -0
- package/dist/error-handling/symbolicate-error.d.ts +0 -0
- package/dist/error-handling/symbolicate-error.js +0 -0
- package/dist/error-handling/symbolicateable-error.d.ts +0 -0
- package/dist/error-handling/symbolicateable-error.js +0 -0
- package/dist/extract-frame-from-video.d.ts +2 -0
- package/dist/extract-frame-from-video.js +42 -15
- package/dist/ffmpeg-executable.d.ts +0 -0
- package/dist/ffmpeg-executable.js +0 -0
- package/dist/ffmpeg-filter-file.d.ts +2 -1
- package/dist/ffmpeg-filter-file.js +4 -6
- package/dist/ffmpeg-flags.d.ts +5 -2
- package/dist/ffmpeg-flags.js +37 -7
- package/dist/ffmpeg-override.d.ts +4 -0
- package/dist/ffmpeg-override.js +2 -0
- package/dist/frame-range.d.ts +0 -0
- package/dist/frame-range.js +0 -0
- package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -0
- package/dist/frame-to-ffmpeg-timestamp.js +0 -0
- package/dist/get-audio-codec-name.d.ts +0 -0
- package/dist/get-audio-codec-name.js +0 -0
- package/dist/get-browser-instance.d.ts +0 -0
- package/dist/get-browser-instance.js +0 -0
- package/dist/get-codec-name.d.ts +0 -0
- package/dist/get-codec-name.js +0 -0
- package/dist/get-compositions.d.ts +5 -0
- package/dist/get-compositions.js +14 -6
- package/dist/get-concurrency.d.ts +0 -0
- package/dist/get-concurrency.js +0 -0
- 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 +1 -1
- package/dist/get-extension-from-codec.js +0 -0
- package/dist/get-extension-of-filename.d.ts +0 -0
- package/dist/get-extension-of-filename.js +0 -0
- package/dist/get-frame-padded-index.d.ts +0 -0
- package/dist/get-frame-padded-index.js +0 -0
- package/dist/get-frame-to-render.d.ts +0 -0
- package/dist/get-frame-to-render.js +0 -0
- package/dist/get-local-browser-executable.d.ts +0 -0
- package/dist/get-local-browser-executable.js +1 -3
- package/dist/get-port.d.ts +0 -0
- package/dist/get-port.js +0 -0
- package/dist/get-prores-profile-name.d.ts +0 -0
- package/dist/get-prores-profile-name.js +0 -0
- package/dist/get-video-info.d.ts +2 -7
- package/dist/get-video-info.js +7 -8
- 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 +1 -1
- package/dist/guess-extension-for-media.js +1 -1
- package/dist/image-format.d.ts +1 -1
- package/dist/image-format.js +3 -0
- package/dist/index.d.ts +19 -28
- package/dist/index.js +16 -24
- package/dist/is-audio-codec.d.ts +0 -0
- package/dist/is-audio-codec.js +0 -0
- package/dist/is-beyond-last-frame.d.ts +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 +3 -2
- package/dist/last-frame-from-video-cache.js +17 -17
- package/dist/legacy-webpack-config.d.ts +0 -0
- package/dist/legacy-webpack-config.js +0 -0
- package/dist/log-level.d.ts +0 -0
- package/dist/log-level.js +0 -0
- package/dist/make-cancel-signal.d.ts +0 -0
- package/dist/make-cancel-signal.js +0 -0
- package/dist/merge-audio-track.d.ts +2 -0
- package/dist/merge-audio-track.js +6 -3
- package/dist/mime-db.d.ts +0 -0
- package/dist/mime-db.js +0 -0
- package/dist/mime-types.d.ts +1 -0
- package/dist/mime-types.js +6 -1
- package/dist/normalize-serve-url.d.ts +0 -0
- package/dist/normalize-serve-url.js +0 -0
- package/dist/offthread-video-server.d.ts +3 -2
- package/dist/offthread-video-server.js +14 -2
- package/dist/open-browser.d.ts +0 -0
- package/dist/open-browser.js +3 -12
- package/dist/overwrite.d.ts +0 -0
- package/dist/overwrite.js +0 -0
- package/dist/p-limit.d.ts +0 -0
- package/dist/p-limit.js +0 -0
- package/dist/parse-browser-error-stack.d.ts +0 -0
- package/dist/parse-browser-error-stack.js +0 -0
- package/dist/parse-ffmpeg-progress.d.ts +0 -0
- package/dist/parse-ffmpeg-progress.js +0 -0
- package/dist/perf.d.ts +0 -0
- package/dist/perf.js +0 -0
- package/dist/pixel-format.d.ts +1 -1
- package/dist/pixel-format.js +3 -0
- package/dist/pool.d.ts +0 -0
- package/dist/pool.js +0 -0
- package/dist/prepare-server.d.ts +3 -2
- package/dist/prepare-server.js +3 -3
- package/dist/preprocess-audio-track.d.ts +2 -0
- package/dist/preprocess-audio-track.js +3 -3
- package/dist/prespawn-ffmpeg.d.ts +3 -0
- package/dist/prespawn-ffmpeg.js +15 -11
- package/dist/prestitcher-memory-usage.d.ts +12 -0
- package/dist/prestitcher-memory-usage.js +30 -0
- package/dist/prores-profile.d.ts +4 -1
- package/dist/prores-profile.js +6 -6
- package/dist/provide-screenshot.d.ts +0 -0
- package/dist/provide-screenshot.js +0 -0
- package/dist/puppeteer-evaluate.d.ts +0 -0
- package/dist/puppeteer-evaluate.js +0 -0
- package/dist/puppeteer-screenshot.d.ts +0 -0
- package/dist/puppeteer-screenshot.js +0 -0
- package/dist/quality.d.ts +0 -0
- package/dist/quality.js +0 -0
- package/dist/render-frames.d.ts +16 -3
- package/dist/render-frames.js +98 -30
- package/dist/render-media.d.ts +30 -4
- package/dist/render-media.js +123 -20
- package/dist/render-still.d.ts +6 -1
- package/dist/render-still.js +37 -11
- 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 +0 -0
- package/dist/screenshot-dom-element.js +0 -0
- package/dist/screenshot-task.d.ts +0 -0
- package/dist/screenshot-task.js +30 -15
- package/dist/seek-to-frame.d.ts +0 -0
- package/dist/seek-to-frame.js +0 -0
- package/dist/serve-handler/index.d.ts +0 -0
- package/dist/serve-handler/index.js +0 -0
- package/dist/serve-handler/is-path-inside.d.ts +0 -0
- package/dist/serve-handler/is-path-inside.js +0 -0
- package/dist/serve-handler/range-parser.d.ts +0 -0
- package/dist/serve-handler/range-parser.js +0 -0
- package/dist/serve-static.d.ts +2 -1
- package/dist/serve-static.js +14 -1
- package/dist/set-props-and-env.d.ts +3 -1
- package/dist/set-props-and-env.js +34 -8
- package/dist/stitch-frames-to-video.d.ts +7 -7
- package/dist/stitch-frames-to-video.js +68 -57
- package/dist/stringify-ffmpeg-filter.d.ts +0 -0
- package/dist/stringify-ffmpeg-filter.js +0 -0
- package/dist/symbolicate-stacktrace.d.ts +0 -0
- package/dist/symbolicate-stacktrace.js +0 -0
- package/dist/tmp-dir.d.ts +0 -0
- package/dist/tmp-dir.js +0 -0
- package/dist/truthy.d.ts +0 -0
- package/dist/truthy.js +0 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +0 -0
- package/dist/validate-concurrency.d.ts +0 -0
- package/dist/validate-concurrency.js +0 -0
- package/dist/validate-even-dimensions-with-codec.d.ts +0 -0
- package/dist/validate-even-dimensions-with-codec.js +0 -0
- package/dist/validate-every-nth-frame.d.ts +2 -1
- package/dist/validate-every-nth-frame.js +8 -1
- package/dist/validate-ffmpeg-override.d.ts +2 -0
- package/dist/validate-ffmpeg-override.js +12 -0
- package/dist/validate-ffmpeg.d.ts +4 -1
- package/dist/validate-ffmpeg.js +23 -7
- package/dist/validate-frame.d.ts +0 -0
- package/dist/validate-frame.js +3 -3
- package/dist/validate-number-of-gif-loops.d.ts +2 -0
- package/dist/validate-number-of-gif-loops.js +24 -0
- package/dist/validate-opengl-renderer.d.ts +0 -0
- package/dist/validate-opengl-renderer.js +0 -0
- package/dist/validate-output-filename.d.ts +0 -0
- package/dist/validate-output-filename.js +0 -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 +0 -0
- package/dist/wait-for-symbolication-error-to-be-done.js +0 -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 +0 -0
- package/dist/ws/ws-types.js +0 -0
- package/package.json +7 -7
- package/dist/make-assets-download-dir.d.ts +0 -1
- package/dist/make-assets-download-dir.js +0 -13
- package/vitest.config.ts +0 -8
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.checkNodeVersionAndWarnAboutRosetta = void 0;
|
|
27
|
+
const os = __importStar(require("os"));
|
|
28
|
+
const checkNodeVersionAndWarnAboutRosetta = () => {
|
|
29
|
+
// see https://github.com/nodejs/node/issues/41900#issuecomment-1113511254
|
|
30
|
+
const cpus = os.cpus();
|
|
31
|
+
const isAppleSilicon = cpus[0].model.includes('Apple');
|
|
32
|
+
const isArm64 = os.arch() === 'arm64';
|
|
33
|
+
const version = process.version.replace('v', '').split('.');
|
|
34
|
+
const majorVersion = Number(version[0]);
|
|
35
|
+
const requiredNodeVersion = 14;
|
|
36
|
+
if (majorVersion < 13) {
|
|
37
|
+
throw new Error(`Remotion requires at least Node ${requiredNodeVersion}. You currently have ${process.version}. Update your node version to ${requiredNodeVersion} to use Remotion.`);
|
|
38
|
+
}
|
|
39
|
+
if (isAppleSilicon && !isArm64) {
|
|
40
|
+
const recommendedNodeVersion = 16;
|
|
41
|
+
const recommendNodeUpgrade = majorVersion < recommendedNodeVersion;
|
|
42
|
+
console.warn([
|
|
43
|
+
`⚠️ Apple Silicon detected but Node.JS running under Rosetta. This will cause performance issues.\n`,
|
|
44
|
+
`Recommended actions:\n`,
|
|
45
|
+
recommendNodeUpgrade
|
|
46
|
+
? ` - Upgrade to Node ${recommendedNodeVersion} or later\n`
|
|
47
|
+
: ' - Run Node using `arch -arm64` architecture\n',
|
|
48
|
+
'See https://remotion.dev/docs/troubleshooting/rosetta for more information.',
|
|
49
|
+
'---',
|
|
50
|
+
]
|
|
51
|
+
.filter(Boolean)
|
|
52
|
+
.join('\n'));
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
exports.checkNodeVersionAndWarnAboutRosetta = checkNodeVersionAndWarnAboutRosetta;
|
package/dist/chunk.d.ts
CHANGED
|
File without changes
|
package/dist/chunk.js
CHANGED
|
File without changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.codecSupportsMedia = void 0;
|
|
3
|
+
exports.codecSupportsCrf = exports.codecSupportsMedia = void 0;
|
|
4
|
+
const get_codec_name_1 = require("./get-codec-name");
|
|
4
5
|
const support = {
|
|
5
6
|
'h264-mkv': {
|
|
6
7
|
audio: true,
|
|
@@ -47,3 +48,9 @@ const codecSupportsMedia = (codec) => {
|
|
|
47
48
|
return support[codec];
|
|
48
49
|
};
|
|
49
50
|
exports.codecSupportsMedia = codecSupportsMedia;
|
|
51
|
+
const codecSupportsCrf = (codec) => {
|
|
52
|
+
const encoderName = (0, get_codec_name_1.getCodecName)(codec);
|
|
53
|
+
const supportsCrf = encoderName && codec !== 'prores';
|
|
54
|
+
return supportsCrf;
|
|
55
|
+
};
|
|
56
|
+
exports.codecSupportsCrf = codecSupportsCrf;
|
package/dist/codec.d.ts
CHANGED
|
File without changes
|
package/dist/codec.js
CHANGED
|
File without changes
|
package/dist/combine-videos.d.ts
CHANGED
|
File without changes
|
package/dist/combine-videos.js
CHANGED
|
@@ -37,7 +37,7 @@ const combineVideos = async ({ files, filelistDir, output, onProgress, numberOfF
|
|
|
37
37
|
(0, is_audio_codec_1.isAudioCodec)(codec) ? null : codec === 'gif' ? 'gif' : 'copy',
|
|
38
38
|
'-c:a',
|
|
39
39
|
(0, get_audio_codec_name_1.getAudioCodecName)(codec),
|
|
40
|
-
// Set max bitrate up to
|
|
40
|
+
// Set max bitrate up to 512kbps, will choose lower if that's too much
|
|
41
41
|
'-b:a',
|
|
42
42
|
'512K',
|
|
43
43
|
codec === 'h264' ? '-movflags' : null,
|
|
File without changes
|
package/dist/compress-assets.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/convert-to-pcm.d.ts
CHANGED
|
File without changes
|
package/dist/convert-to-pcm.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertToPositiveFrameIndex = void 0;
|
|
4
|
+
// Handle negative indices (e.g. -1 being the last frame)
|
|
5
|
+
const convertToPositiveFrameIndex = ({ frame, durationInFrames, }) => {
|
|
6
|
+
return frame < 0 ? durationInFrames - frame : frame;
|
|
7
|
+
};
|
|
8
|
+
exports.convertToPositiveFrameIndex = convertToPositiveFrameIndex;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DownloadMap } from './assets/download-map';
|
|
2
|
+
export declare const createFfmpegComplexFilter: (filters: number, downloadMap: DownloadMap) => Promise<{
|
|
2
3
|
complexFilterFlag: [string, string] | null;
|
|
3
4
|
cleanup: () => void;
|
|
4
5
|
}>;
|
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.createFfmpegComplexFilter = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
4
|
const create_ffmpeg_merge_filter_1 = require("./create-ffmpeg-merge-filter");
|
|
10
5
|
const ffmpeg_filter_file_1 = require("./ffmpeg-filter-file");
|
|
11
|
-
const
|
|
12
|
-
const createFfmpegComplexFilter = async (filters) => {
|
|
6
|
+
const createFfmpegComplexFilter = async (filters, downloadMap) => {
|
|
13
7
|
if (filters === 0) {
|
|
14
8
|
return { complexFilterFlag: null, cleanup: () => undefined };
|
|
15
9
|
}
|
|
16
10
|
const complexFilter = (0, create_ffmpeg_merge_filter_1.createFfmpegMergeFilter)(filters);
|
|
17
|
-
const { file, cleanup } = await (0, ffmpeg_filter_file_1.makeFfmpegFilterFile)(complexFilter);
|
|
18
|
-
const tempPath = (0, tmp_dir_1.tmpDir)('remotion-complex-filter-script');
|
|
19
|
-
const filterFile = path_1.default.join(tempPath, 'complex-filter.txt');
|
|
20
|
-
await fs_1.default.promises.writeFile(filterFile, complexFilter);
|
|
11
|
+
const { file, cleanup } = await (0, ffmpeg_filter_file_1.makeFfmpegFilterFile)(complexFilter, downloadMap);
|
|
21
12
|
return {
|
|
22
13
|
complexFilterFlag: ['-filter_complex_script', file],
|
|
23
14
|
cleanup,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/crf.d.ts
CHANGED
|
@@ -2,4 +2,8 @@ import type { Codec } from './codec';
|
|
|
2
2
|
export declare type Crf = number | undefined;
|
|
3
3
|
export declare const getDefaultCrfForCodec: (codec: Codec) => number;
|
|
4
4
|
export declare const getValidCrfRanges: (codec: Codec) => [number, number];
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const validateQualitySettings: ({ codec, crf, videoBitrate, }: {
|
|
6
|
+
crf: unknown;
|
|
7
|
+
codec: Codec;
|
|
8
|
+
videoBitrate: string | null | undefined;
|
|
9
|
+
}) => string[];
|
package/dist/crf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.validateQualitySettings = exports.getValidCrfRanges = exports.getDefaultCrfForCodec = void 0;
|
|
4
4
|
const is_audio_codec_1 = require("./is-audio-codec");
|
|
5
5
|
const getDefaultCrfForCodec = (codec) => {
|
|
6
6
|
if ((0, is_audio_codec_1.isAudioCodec)(codec)) {
|
|
@@ -46,19 +46,46 @@ const getValidCrfRanges = (codec) => {
|
|
|
46
46
|
throw new TypeError(`Got unexpected codec "${codec}"`);
|
|
47
47
|
};
|
|
48
48
|
exports.getValidCrfRanges = getValidCrfRanges;
|
|
49
|
-
const
|
|
50
|
-
if (crf
|
|
51
|
-
|
|
49
|
+
const validateQualitySettings = ({ codec, crf, videoBitrate, }) => {
|
|
50
|
+
if (crf && videoBitrate) {
|
|
51
|
+
throw new Error('"crf" and "videoBitrate" can not both be set. Choose one of either.');
|
|
52
|
+
}
|
|
53
|
+
if (videoBitrate) {
|
|
54
|
+
if (codec === 'prores') {
|
|
55
|
+
console.warn('ProRes does not support videoBitrate. Ignoring.');
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
if ((0, is_audio_codec_1.isAudioCodec)(codec)) {
|
|
59
|
+
console.warn(`${codec} does not support videoBitrate. Ignoring.`);
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
return ['-b:v', videoBitrate];
|
|
63
|
+
}
|
|
64
|
+
if (crf === null || typeof crf === 'undefined') {
|
|
65
|
+
const actualCrf = (0, exports.getDefaultCrfForCodec)(codec);
|
|
66
|
+
return ['-crf', String(actualCrf)];
|
|
52
67
|
}
|
|
53
68
|
if (typeof crf !== 'number') {
|
|
54
69
|
throw new TypeError('Expected CRF to be a number, but is ' + JSON.stringify(crf));
|
|
55
70
|
}
|
|
56
71
|
const range = (0, exports.getValidCrfRanges)(codec);
|
|
57
72
|
if (crf === 0 && (codec === 'h264' || codec === 'h264-mkv')) {
|
|
58
|
-
throw new TypeError("Setting the CRF to 0 with a H264 codec is not supported anymore because of it's inconsistencies between platforms. Videos with CRF 0 cannot be played on iOS/macOS. 0 is a extreme value with inefficient settings which you probably want. Set CRF to a higher value to fix this error.");
|
|
73
|
+
throw new TypeError("Setting the CRF to 0 with a H264 codec is not supported anymore because of it's inconsistencies between platforms. Videos with CRF 0 cannot be played on iOS/macOS. 0 is a extreme value with inefficient settings which you probably do not want. Set CRF to a higher value to fix this error.");
|
|
59
74
|
}
|
|
60
75
|
if (crf < range[0] || crf > range[1]) {
|
|
76
|
+
if (range[0] === 0 && range[1] === 0) {
|
|
77
|
+
throw new TypeError(`The "${codec}" codec does not support the --crf option.`);
|
|
78
|
+
}
|
|
61
79
|
throw new TypeError(`CRF must be between ${range[0]} and ${range[1]} for codec ${codec}. Passed: ${crf}`);
|
|
62
80
|
}
|
|
81
|
+
if (codec === 'prores') {
|
|
82
|
+
console.warn('ProRes does not support the "crf" option. Ignoring.');
|
|
83
|
+
return [];
|
|
84
|
+
}
|
|
85
|
+
if ((0, is_audio_codec_1.isAudioCodec)(codec)) {
|
|
86
|
+
console.warn(`${codec} does not support the "crf" option. Ignoring.`);
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
return ['-crf', String(crf)];
|
|
63
90
|
};
|
|
64
|
-
exports.
|
|
91
|
+
exports.validateQualitySettings = validateQualitySettings;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/delete-directory.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DownloadMap } from './assets/download-map';
|
|
2
|
+
export declare const ensurePresentationTimestamps: (downloadMap: DownloadMap, src: string) => Promise<string>;
|
|
@@ -8,7 +8,6 @@ const execa_1 = __importDefault(require("execa"));
|
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const guess_extension_for_media_1 = require("./guess-extension-for-media");
|
|
10
10
|
const truthy_1 = require("./truthy");
|
|
11
|
-
const ensureFileHasPresentationTimestamp = {};
|
|
12
11
|
let callbacks = [];
|
|
13
12
|
const getTemporaryOutputName = async (src) => {
|
|
14
13
|
const parts = src.split(path_1.default.sep);
|
|
@@ -26,8 +25,8 @@ const getTemporaryOutputName = async (src) => {
|
|
|
26
25
|
})
|
|
27
26
|
.join(path_1.default.sep);
|
|
28
27
|
};
|
|
29
|
-
const ensurePresentationTimestamps = async (src) => {
|
|
30
|
-
const elem = ensureFileHasPresentationTimestamp[src];
|
|
28
|
+
const ensurePresentationTimestamps = async (downloadMap, src) => {
|
|
29
|
+
const elem = downloadMap.ensureFileHasPresentationTimestamp[src];
|
|
31
30
|
if ((elem === null || elem === void 0 ? void 0 : elem.type) === 'encoding') {
|
|
32
31
|
return new Promise((resolve) => {
|
|
33
32
|
callbacks.push({
|
|
@@ -39,7 +38,7 @@ const ensurePresentationTimestamps = async (src) => {
|
|
|
39
38
|
if ((elem === null || elem === void 0 ? void 0 : elem.type) === 'done') {
|
|
40
39
|
return elem.src;
|
|
41
40
|
}
|
|
42
|
-
ensureFileHasPresentationTimestamp[src] = { type: 'encoding' };
|
|
41
|
+
downloadMap.ensureFileHasPresentationTimestamp[src] = { type: 'encoding' };
|
|
43
42
|
// If there is no file extension for the video, then we need to tempoa
|
|
44
43
|
const output = await getTemporaryOutputName(src);
|
|
45
44
|
await (0, execa_1.default)('ffmpeg', [
|
|
@@ -61,7 +60,10 @@ const ensurePresentationTimestamps = async (src) => {
|
|
|
61
60
|
}
|
|
62
61
|
return true;
|
|
63
62
|
});
|
|
64
|
-
ensureFileHasPresentationTimestamp[src] = {
|
|
63
|
+
downloadMap.ensureFileHasPresentationTimestamp[src] = {
|
|
64
|
+
type: 'done',
|
|
65
|
+
src: output,
|
|
66
|
+
};
|
|
65
67
|
return output;
|
|
66
68
|
};
|
|
67
69
|
exports.ensurePresentationTimestamps = ensurePresentationTimestamps;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { OffthreadVideoImageFormat } from 'remotion';
|
|
3
|
+
import type { DownloadMap } from './assets/download-map';
|
|
3
4
|
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
4
5
|
import type { LastFrameOptions } from './last-frame-from-video-cache';
|
|
5
6
|
export declare const getLastFrameOfVideo: (options: LastFrameOptions) => Promise<Buffer>;
|
|
@@ -9,6 +10,7 @@ declare type Options = {
|
|
|
9
10
|
ffmpegExecutable: FfmpegExecutable;
|
|
10
11
|
ffprobeExecutable: FfmpegExecutable;
|
|
11
12
|
imageFormat: OffthreadVideoImageFormat;
|
|
13
|
+
downloadMap: DownloadMap;
|
|
12
14
|
};
|
|
13
15
|
export declare const extractFrameFromVideo: (options: Options) => Promise<Buffer>;
|
|
14
16
|
export {};
|
|
@@ -32,9 +32,9 @@ const determineResizeParams = (needsResize) => {
|
|
|
32
32
|
};
|
|
33
33
|
// Uses no seeking, therefore the whole video has to be decoded. This is a last resort and should only happen
|
|
34
34
|
// if the video is corrupted
|
|
35
|
-
const getFrameOfVideoSlow = async ({ src,
|
|
36
|
-
console.warn(`\nUsing a slow method to extract the frame at ${
|
|
37
|
-
const actualOffset = `-${
|
|
35
|
+
const getFrameOfVideoSlow = async ({ src, duration, ffmpegExecutable, imageFormat, specialVCodecForTransparency, needsResize, offset, fps, }) => {
|
|
36
|
+
console.warn(`\nUsing a slow method to extract the frame at ${duration}ms of ${src}. See https://remotion.dev/docs/slow-method-to-extract-frame for advice`);
|
|
37
|
+
const actualOffset = `-${duration * 1000 - offset}ms`;
|
|
38
38
|
const command = [
|
|
39
39
|
'-itsoffset',
|
|
40
40
|
actualOffset,
|
|
@@ -72,32 +72,47 @@ const getFrameOfVideoSlow = async ({ src, timestamp, ffmpegExecutable, imageForm
|
|
|
72
72
|
const [stdErr, stdoutBuffer] = await Promise.all([stdErrString, stdoutChunk]);
|
|
73
73
|
const isEmpty = stdErr.includes('Output file is empty');
|
|
74
74
|
if (isEmpty) {
|
|
75
|
-
|
|
75
|
+
if (offset > 70) {
|
|
76
|
+
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.`);
|
|
77
|
+
}
|
|
78
|
+
return getFrameOfVideoSlow({
|
|
79
|
+
ffmpegExecutable,
|
|
80
|
+
duration,
|
|
81
|
+
// Decrement in 10ms increments, or 1 frame (e.g. fps = 25 --> 40ms)
|
|
82
|
+
offset: offset + (fps === null ? 10 : 1000 / fps),
|
|
83
|
+
src,
|
|
84
|
+
imageFormat,
|
|
85
|
+
specialVCodecForTransparency,
|
|
86
|
+
needsResize,
|
|
87
|
+
fps,
|
|
88
|
+
});
|
|
76
89
|
}
|
|
77
90
|
return stdoutBuffer;
|
|
78
91
|
};
|
|
79
92
|
const getLastFrameOfVideoFastUnlimited = async (options) => {
|
|
80
|
-
const { ffmpegExecutable, ffprobeExecutable, offset, src } = options;
|
|
93
|
+
const { ffmpegExecutable, ffprobeExecutable, offset, src, downloadMap } = options;
|
|
81
94
|
const fromCache = (0, last_frame_from_video_cache_1.getLastFrameFromCache)({ ...options, offset: 0 });
|
|
82
95
|
if (fromCache) {
|
|
83
96
|
return fromCache;
|
|
84
97
|
}
|
|
85
|
-
const { duration } = await (0, get_video_stream_duration_1.getVideoStreamDuration)(src, ffprobeExecutable);
|
|
98
|
+
const { duration, fps } = await (0, get_video_stream_duration_1.getVideoStreamDuration)(downloadMap, src, ffprobeExecutable);
|
|
86
99
|
if (duration === null) {
|
|
87
100
|
throw new Error(`Could not determine the duration of ${src} using FFMPEG. The file is not supported.`);
|
|
88
101
|
}
|
|
89
102
|
if (options.specialVCodecForTransparency === 'vp8' || offset > 40) {
|
|
90
103
|
const last = await getFrameOfVideoSlow({
|
|
91
|
-
|
|
104
|
+
duration,
|
|
92
105
|
ffmpegExecutable,
|
|
93
106
|
src,
|
|
94
107
|
imageFormat: options.imageFormat,
|
|
95
108
|
specialVCodecForTransparency: options.specialVCodecForTransparency,
|
|
96
109
|
needsResize: options.needsResize,
|
|
110
|
+
offset: offset - 1000 / (fps === null ? 10 : fps),
|
|
111
|
+
fps,
|
|
97
112
|
});
|
|
98
113
|
return last;
|
|
99
114
|
}
|
|
100
|
-
const actualOffset = `${duration * 1000 - offset
|
|
115
|
+
const actualOffset = `${duration * 1000 - offset}ms`;
|
|
101
116
|
const { stdout, stderr } = (0, execa_1.default)(ffmpegExecutable !== null && ffmpegExecutable !== void 0 ? ffmpegExecutable : 'ffmpeg', [
|
|
102
117
|
'-ss',
|
|
103
118
|
actualOffset,
|
|
@@ -142,12 +157,14 @@ const getLastFrameOfVideoFastUnlimited = async (options) => {
|
|
|
142
157
|
if (isEmpty) {
|
|
143
158
|
const unlimited = await getLastFrameOfVideoFastUnlimited({
|
|
144
159
|
ffmpegExecutable,
|
|
145
|
-
|
|
160
|
+
// Decrement in 10ms increments, or 1 frame (e.g. fps = 25 --> 40ms)
|
|
161
|
+
offset: offset + (fps === null ? 10 : 1000 / fps),
|
|
146
162
|
src,
|
|
147
163
|
ffprobeExecutable,
|
|
148
164
|
imageFormat: options.imageFormat,
|
|
149
165
|
specialVCodecForTransparency: options.specialVCodecForTransparency,
|
|
150
166
|
needsResize: options.needsResize,
|
|
167
|
+
downloadMap: options.downloadMap,
|
|
151
168
|
});
|
|
152
169
|
return unlimited;
|
|
153
170
|
}
|
|
@@ -159,22 +176,25 @@ const getLastFrameOfVideo = async (options) => {
|
|
|
159
176
|
return result;
|
|
160
177
|
};
|
|
161
178
|
exports.getLastFrameOfVideo = getLastFrameOfVideo;
|
|
162
|
-
const extractFrameFromVideoFn = async ({ time, ffmpegExecutable, ffprobeExecutable, imageFormat, ...options }) => {
|
|
179
|
+
const extractFrameFromVideoFn = async ({ time, ffmpegExecutable, ffprobeExecutable, imageFormat, downloadMap, ...options }) => {
|
|
163
180
|
// We make a new copy of the video only for video because the conversion may affect
|
|
164
181
|
// audio rendering, so we work with 2 different files
|
|
165
|
-
const src = await (0, ensure_presentation_timestamp_1.ensurePresentationTimestamps)(options.src);
|
|
166
|
-
const { specialVcodec, needsResize } = await (0, get_video_info_1.getVideoInfo)(src, ffprobeExecutable);
|
|
182
|
+
const src = await (0, ensure_presentation_timestamp_1.ensurePresentationTimestamps)(downloadMap, options.src);
|
|
183
|
+
const { specialVcodec, needsResize } = await (0, get_video_info_1.getVideoInfo)(downloadMap, src, ffprobeExecutable);
|
|
167
184
|
if (specialVcodec === 'vp8') {
|
|
185
|
+
const { fps } = await (0, get_video_stream_duration_1.getVideoStreamDuration)(downloadMap, src, ffprobeExecutable);
|
|
168
186
|
return getFrameOfVideoSlow({
|
|
169
187
|
ffmpegExecutable,
|
|
170
188
|
imageFormat,
|
|
171
189
|
specialVCodecForTransparency: specialVcodec,
|
|
172
190
|
src,
|
|
173
|
-
|
|
191
|
+
duration: time,
|
|
174
192
|
needsResize,
|
|
193
|
+
offset: 0,
|
|
194
|
+
fps,
|
|
175
195
|
});
|
|
176
196
|
}
|
|
177
|
-
if ((0, is_beyond_last_frame_1.isBeyondLastFrame)(src, time)) {
|
|
197
|
+
if ((0, is_beyond_last_frame_1.isBeyondLastFrame)(downloadMap, src, time)) {
|
|
178
198
|
const lastFrame = await (0, exports.getLastFrameOfVideo)({
|
|
179
199
|
ffmpegExecutable,
|
|
180
200
|
ffprobeExecutable,
|
|
@@ -183,6 +203,7 @@ const extractFrameFromVideoFn = async ({ time, ffmpegExecutable, ffprobeExecutab
|
|
|
183
203
|
imageFormat,
|
|
184
204
|
specialVCodecForTransparency: specialVcodec,
|
|
185
205
|
needsResize,
|
|
206
|
+
downloadMap,
|
|
186
207
|
});
|
|
187
208
|
return lastFrame;
|
|
188
209
|
}
|
|
@@ -227,7 +248,7 @@ const extractFrameFromVideoFn = async ({ time, ffmpegExecutable, ffprobeExecutab
|
|
|
227
248
|
stdoutBuffer,
|
|
228
249
|
]);
|
|
229
250
|
if (stderrStr.includes('Output file is empty')) {
|
|
230
|
-
(0, is_beyond_last_frame_1.markAsBeyondLastFrame)(src, time);
|
|
251
|
+
(0, is_beyond_last_frame_1.markAsBeyondLastFrame)(downloadMap, src, time);
|
|
231
252
|
const last = await (0, exports.getLastFrameOfVideo)({
|
|
232
253
|
ffmpegExecutable,
|
|
233
254
|
ffprobeExecutable,
|
|
@@ -236,9 +257,15 @@ const extractFrameFromVideoFn = async ({ time, ffmpegExecutable, ffprobeExecutab
|
|
|
236
257
|
imageFormat,
|
|
237
258
|
specialVCodecForTransparency: specialVcodec,
|
|
238
259
|
needsResize,
|
|
260
|
+
downloadMap,
|
|
239
261
|
});
|
|
240
262
|
return last;
|
|
241
263
|
}
|
|
264
|
+
if (stdOut.length === 0) {
|
|
265
|
+
console.log('FFMPEG Logs:');
|
|
266
|
+
console.log(stderrStr);
|
|
267
|
+
throw new Error("Couldn't extract frame from video - FFMPEG did not return any data. Check logs to see more information");
|
|
268
|
+
}
|
|
242
269
|
return stdOut;
|
|
243
270
|
};
|
|
244
271
|
const extractFrameFromVideo = async (options) => {
|
|
File without changes
|
|
File without changes
|
|
@@ -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
|
@@ -2,12 +2,15 @@ export declare type FfmpegVersion = [number, number, number] | null;
|
|
|
2
2
|
export declare const getFfmpegBuildInfo: (options: {
|
|
3
3
|
ffmpegExecutable: string | null;
|
|
4
4
|
}) => Promise<string>;
|
|
5
|
-
export declare const ffmpegHasFeature: ({ ffmpegExecutable, feature,
|
|
5
|
+
export declare const ffmpegHasFeature: ({ ffmpegExecutable, feature, }: {
|
|
6
6
|
ffmpegExecutable: string | null;
|
|
7
7
|
feature: 'enable-gpl' | 'enable-libx265' | 'enable-libvpx';
|
|
8
|
-
isLambda: boolean;
|
|
9
8
|
}) => Promise<boolean>;
|
|
10
9
|
export declare const parseFfmpegVersion: (buildconf: string) => FfmpegVersion;
|
|
11
10
|
export declare const getFfmpegVersion: (options: {
|
|
12
11
|
ffmpegExecutable: string | null;
|
|
13
12
|
}) => Promise<FfmpegVersion>;
|
|
13
|
+
export declare const warnAboutFfmpegVersion: ({ ffmpegVersion, buildConf, }: {
|
|
14
|
+
ffmpegVersion: FfmpegVersion;
|
|
15
|
+
buildConf: string | null;
|
|
16
|
+
}) => null | undefined;
|
package/dist/ffmpeg-flags.js
CHANGED
|
@@ -3,7 +3,7 @@ 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.getFfmpegVersion = exports.parseFfmpegVersion = exports.ffmpegHasFeature = exports.getFfmpegBuildInfo = void 0;
|
|
6
|
+
exports.warnAboutFfmpegVersion = exports.getFfmpegVersion = exports.parseFfmpegVersion = exports.ffmpegHasFeature = exports.getFfmpegBuildInfo = void 0;
|
|
7
7
|
const execa_1 = __importDefault(require("execa"));
|
|
8
8
|
const validate_ffmpeg_1 = require("./validate-ffmpeg");
|
|
9
9
|
let buildConfig = null;
|
|
@@ -19,12 +19,8 @@ const getFfmpegBuildInfo = async (options) => {
|
|
|
19
19
|
return buildConfig;
|
|
20
20
|
};
|
|
21
21
|
exports.getFfmpegBuildInfo = getFfmpegBuildInfo;
|
|
22
|
-
const ffmpegHasFeature = async ({ ffmpegExecutable, feature,
|
|
23
|
-
if (
|
|
24
|
-
// When rendering in the cloud, we don't need a local binary
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
if (!(await (0, validate_ffmpeg_1.binaryExists)('ffmpeg', ffmpegExecutable))) {
|
|
22
|
+
const ffmpegHasFeature = async ({ ffmpegExecutable, feature, }) => {
|
|
23
|
+
if (!(0, validate_ffmpeg_1.binaryExists)('ffmpeg', ffmpegExecutable)) {
|
|
28
24
|
return false;
|
|
29
25
|
}
|
|
30
26
|
const config = await (0, exports.getFfmpegBuildInfo)({ ffmpegExecutable });
|
|
@@ -47,3 +43,37 @@ const getFfmpegVersion = async (options) => {
|
|
|
47
43
|
return (0, exports.parseFfmpegVersion)(buildInfo);
|
|
48
44
|
};
|
|
49
45
|
exports.getFfmpegVersion = getFfmpegVersion;
|
|
46
|
+
const printMessage = (ffmpegVersion) => {
|
|
47
|
+
console.warn('⚠️Old FFMPEG version detected: ' + ffmpegVersion.join('.'));
|
|
48
|
+
console.warn(' For audio support, you need at least version 4.1.0.');
|
|
49
|
+
console.warn(' Upgrade FFMPEG to get rid of this warning.');
|
|
50
|
+
};
|
|
51
|
+
const printBuildConfMessage = () => {
|
|
52
|
+
console.error('⚠️ Unsupported FFMPEG version detected.');
|
|
53
|
+
console.error(" Your version doesn't support the -buildconf flag");
|
|
54
|
+
console.error(' Audio will not be supported and you may experience other issues.');
|
|
55
|
+
console.error(' Upgrade FFMPEG to at least v4.1.0 to get rid of this warning.');
|
|
56
|
+
};
|
|
57
|
+
const warnAboutFfmpegVersion = ({ ffmpegVersion, buildConf, }) => {
|
|
58
|
+
if (buildConf === null) {
|
|
59
|
+
printBuildConfMessage();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (ffmpegVersion === null) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const [major, minor] = ffmpegVersion;
|
|
66
|
+
// 3.x and below definitely is too old
|
|
67
|
+
if (major < 4) {
|
|
68
|
+
printMessage(ffmpegVersion);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
// 5.x will be all good
|
|
72
|
+
if (major > 4) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (minor < 1) {
|
|
76
|
+
printMessage(ffmpegVersion);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
exports.warnAboutFfmpegVersion = warnAboutFfmpegVersion;
|
package/dist/frame-range.d.ts
CHANGED
|
File without changes
|
package/dist/frame-range.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|