@remotion/renderer 4.0.0-alpha4 → 4.0.0-alpha5
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/README.md +5 -43
- package/dist/assets/download-map.d.ts +0 -26
- package/dist/assets/download-map.js +0 -5
- package/dist/assets/get-audio-channels.d.ts +1 -2
- package/dist/assets/get-audio-channels.js +5 -9
- package/dist/audio-codec.d.ts +4 -3
- package/dist/audio-codec.js +3 -9
- package/dist/browser/BrowserFetcher.d.ts +0 -1
- package/dist/browser/BrowserFetcher.js +1 -2
- package/dist/browser/BrowserRunner.js +8 -2
- package/dist/browser/FrameManager.js +2 -3
- package/dist/browser/LaunchOptions.d.ts +1 -0
- package/dist/browser/Launcher.js +2 -1
- package/dist/browser/devtools-commands.d.ts +5 -1
- package/dist/browser/devtools-types.d.ts +78 -0
- package/dist/browser/is-target-closed-err.d.ts +1 -0
- package/dist/browser/is-target-closed-err.js +9 -0
- package/dist/call-ffmpeg.d.ts +14 -0
- package/dist/call-ffmpeg.js +37 -0
- package/dist/check-apple-silicon.js +2 -45
- package/dist/client.d.ts +67 -42
- package/dist/client.js +27 -1
- package/dist/codec-supports-media.d.ts +2 -1
- package/dist/codec-supports-media.js +20 -5
- package/dist/combine-videos.d.ts +0 -3
- package/dist/combine-videos.js +5 -9
- package/dist/compositor/compose.d.ts +3 -1
- package/dist/compositor/compose.js +34 -14
- package/dist/compositor/compositor.d.ts +12 -0
- package/dist/compositor/compositor.js +202 -0
- package/dist/compositor/get-executable-path.d.ts +1 -1
- package/dist/compositor/get-executable-path.js +27 -8
- package/dist/compositor/make-nonce.d.ts +1 -0
- package/dist/compositor/make-nonce.js +8 -0
- package/dist/compositor/payloads.d.ts +34 -7
- package/dist/create-ffmpeg-complex-filter.d.ts +5 -5
- package/dist/create-ffmpeg-complex-filter.js +2 -4
- package/dist/create-ffmpeg-merge-filter.d.ts +2 -5
- package/dist/create-ffmpeg-merge-filter.js +2 -10
- package/dist/create-silent-audio.d.ts +1 -4
- package/dist/create-silent-audio.js +3 -7
- package/dist/crf.js +8 -2
- package/dist/delete-directory.js +16 -16
- package/dist/file-extensions.d.ts +1 -12
- package/dist/file-extensions.js +1 -13
- package/dist/get-compositions.d.ts +3 -5
- package/dist/get-compositions.js +8 -11
- package/dist/get-extension-from-codec.d.ts +2 -2
- package/dist/get-frame-padded-index.d.ts +2 -1
- package/dist/guess-extension-for-media.d.ts +1 -3
- package/dist/guess-extension-for-media.js +4 -8
- package/dist/image-format.d.ts +12 -6
- package/dist/image-format.js +16 -13
- package/dist/index.d.ts +66 -59
- package/dist/index.js +15 -17
- package/dist/jpeg-quality.d.ts +1 -0
- package/dist/jpeg-quality.js +21 -0
- package/dist/merge-audio-track.d.ts +0 -2
- package/dist/merge-audio-track.js +3 -10
- package/dist/offthread-video-server.d.ts +8 -8
- package/dist/offthread-video-server.js +63 -56
- package/dist/open-browser.d.ts +1 -0
- package/dist/open-browser.js +7 -6
- package/dist/options/audio-bitrate.d.ts +2 -0
- package/dist/options/audio-bitrate.js +11 -0
- package/dist/options/crf.d.ts +2 -0
- package/dist/options/crf.js +11 -0
- package/dist/options/enforce-audio.d.ts +2 -0
- package/dist/options/enforce-audio.js +11 -0
- package/dist/options/jpeg-quality.d.ts +2 -0
- package/dist/options/jpeg-quality.js +11 -0
- package/dist/options/mute.d.ts +2 -0
- package/dist/options/mute.js +11 -0
- package/dist/options/option.d.ts +8 -0
- package/dist/options/option.js +2 -0
- package/dist/options/scale.d.ts +2 -0
- package/dist/options/scale.js +11 -0
- package/dist/options/video-bitrate.d.ts +2 -0
- package/dist/options/video-bitrate.js +11 -0
- package/dist/options/video-codec.d.ts +2 -0
- package/dist/options/video-codec.js +11 -0
- package/dist/perf.d.ts +1 -1
- package/dist/perf.js +9 -7
- package/dist/prepare-server.d.ts +3 -4
- package/dist/prepare-server.js +5 -5
- package/dist/preprocess-audio-track.d.ts +0 -4
- package/dist/preprocess-audio-track.js +4 -8
- package/dist/prespawn-ffmpeg.d.ts +6 -9
- package/dist/prespawn-ffmpeg.js +7 -12
- package/dist/prestitcher-memory-usage.d.ts +0 -4
- package/dist/prestitcher-memory-usage.js +2 -3
- package/dist/prores-profile.d.ts +1 -2
- package/dist/prores-profile.js +4 -4
- package/dist/provide-screenshot.d.ts +4 -5
- package/dist/provide-screenshot.js +2 -2
- package/dist/puppeteer-screenshot.d.ts +3 -3
- package/dist/puppeteer-screenshot.js +9 -32
- package/dist/render-frames.d.ts +13 -25
- package/dist/render-frames.js +29 -40
- package/dist/render-media.d.ts +16 -18
- package/dist/render-media.js +33 -43
- package/dist/render-still.d.ts +10 -8
- package/dist/render-still.js +14 -13
- package/dist/screenshot-dom-element.d.ts +4 -5
- package/dist/screenshot-dom-element.js +6 -3
- package/dist/screenshot-task.d.ts +2 -3
- package/dist/screenshot-task.js +38 -23
- package/dist/serve-handler/index.js +6 -4
- package/dist/serve-static.d.ts +2 -3
- package/dist/serve-static.js +24 -20
- package/dist/stitch-frames-to-video.d.ts +2 -12
- package/dist/stitch-frames-to-video.js +24 -33
- package/dist/take-frame-and-compose.d.ts +4 -5
- package/dist/take-frame-and-compose.js +12 -6
- package/dist/tmp-dir.js +1 -2
- package/dist/validate-concurrency.d.ts +2 -0
- package/dist/validate-concurrency.js +11 -5
- package/dist/validate-output-filename.d.ts +1 -1
- package/dist/validate-puppeteer-timeout.js +1 -0
- package/install-toolchain.mjs +36 -0
- package/package.json +11 -10
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { RequestListener } from 'http';
|
|
2
|
-
import type { OffthreadVideoImageFormat } from 'remotion';
|
|
3
2
|
import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
|
|
4
3
|
import type { DownloadMap } from './assets/download-map';
|
|
5
|
-
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
6
4
|
export declare const extractUrlAndSourceFromUrl: (url: string) => {
|
|
7
5
|
src: string;
|
|
8
6
|
time: number;
|
|
9
|
-
|
|
7
|
+
transparent: boolean;
|
|
10
8
|
};
|
|
11
|
-
export declare const startOffthreadVideoServer: ({
|
|
12
|
-
ffmpegExecutable: FfmpegExecutable;
|
|
13
|
-
ffprobeExecutable: FfmpegExecutable;
|
|
9
|
+
export declare const startOffthreadVideoServer: ({ onDownload, onError, downloadMap, concurrency, verbose, }: {
|
|
14
10
|
onDownload: RenderMediaOnDownload;
|
|
15
11
|
onError: (err: Error) => void;
|
|
16
12
|
downloadMap: DownloadMap;
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
concurrency: number;
|
|
14
|
+
verbose: boolean;
|
|
15
|
+
}) => {
|
|
16
|
+
listener: RequestListener;
|
|
17
|
+
close: () => Promise<void>;
|
|
18
|
+
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.startOffthreadVideoServer = exports.extractUrlAndSourceFromUrl = void 0;
|
|
4
|
-
const remotion_1 = require("remotion");
|
|
5
4
|
const url_1 = require("url");
|
|
6
5
|
const download_and_map_assets_to_file_1 = require("./assets/download-and-map-assets-to-file");
|
|
7
|
-
const
|
|
6
|
+
const compositor_1 = require("./compositor/compositor");
|
|
8
7
|
const extractUrlAndSourceFromUrl = (url) => {
|
|
9
8
|
const parsed = new URL(url, 'http://localhost');
|
|
10
9
|
const query = parsed.search;
|
|
@@ -20,68 +19,76 @@ const extractUrlAndSourceFromUrl = (url) => {
|
|
|
20
19
|
if (!time) {
|
|
21
20
|
throw new Error('Did not get `time` parameter');
|
|
22
21
|
}
|
|
23
|
-
const
|
|
24
|
-
if (!imageFormat) {
|
|
25
|
-
throw new TypeError('Did not get `imageFormat` parameter');
|
|
26
|
-
}
|
|
27
|
-
remotion_1.Internals.validateOffthreadVideoImageFormat(imageFormat);
|
|
22
|
+
const transparent = params.get('transparent');
|
|
28
23
|
return {
|
|
29
24
|
src,
|
|
30
25
|
time: parseFloat(time),
|
|
31
|
-
|
|
26
|
+
transparent: transparent === 'true',
|
|
32
27
|
};
|
|
33
28
|
};
|
|
34
29
|
exports.extractUrlAndSourceFromUrl = extractUrlAndSourceFromUrl;
|
|
35
|
-
const startOffthreadVideoServer = ({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// https://support.google.com/chrome/a/answer/7679408?hl=en
|
|
50
|
-
// Chrome sends Private Network Access preflights for subresources
|
|
51
|
-
if (req.method === 'OPTIONS') {
|
|
52
|
-
res.statusCode = 200;
|
|
53
|
-
if (req.headers['access-control-request-private-network']) {
|
|
54
|
-
res.setHeader('Access-Control-Allow-Private-Network', 'true');
|
|
30
|
+
const startOffthreadVideoServer = ({ onDownload, onError, downloadMap, concurrency, verbose, }) => {
|
|
31
|
+
const compositor = (0, compositor_1.startCompositor)('StartLongRunningProcess', {
|
|
32
|
+
concurrency,
|
|
33
|
+
maximum_frame_cache_items: (0, compositor_1.getIdealMaximumFrameCacheItems)(),
|
|
34
|
+
verbose,
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
close: () => {
|
|
38
|
+
compositor.finishCommands();
|
|
39
|
+
return compositor.waitForDone();
|
|
40
|
+
},
|
|
41
|
+
listener: (req, res) => {
|
|
42
|
+
if (!req.url) {
|
|
43
|
+
throw new Error('Request came in without URL');
|
|
55
44
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
ffprobeExecutable,
|
|
66
|
-
imageFormat,
|
|
67
|
-
downloadMap,
|
|
68
|
-
remotionRoot,
|
|
69
|
-
});
|
|
70
|
-
})
|
|
71
|
-
.then((readable) => {
|
|
72
|
-
if (!readable) {
|
|
73
|
-
throw new Error('no readable from ffmpeg');
|
|
45
|
+
if (!req.url.startsWith('/proxy')) {
|
|
46
|
+
res.writeHead(404);
|
|
47
|
+
res.end();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const { src, time, transparent } = (0, exports.extractUrlAndSourceFromUrl)(req.url);
|
|
51
|
+
res.setHeader('access-control-allow-origin', '*');
|
|
52
|
+
if (transparent) {
|
|
53
|
+
res.setHeader('content-type', `image/png`);
|
|
74
54
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
55
|
+
else {
|
|
56
|
+
res.setHeader('content-type', `image/bmp`);
|
|
57
|
+
}
|
|
58
|
+
// Handling this case on Lambda:
|
|
59
|
+
// https://support.google.com/chrome/a/answer/7679408?hl=en
|
|
60
|
+
// Chrome sends Private Network Access preflights for subresources
|
|
61
|
+
if (req.method === 'OPTIONS') {
|
|
62
|
+
res.statusCode = 200;
|
|
63
|
+
if (req.headers['access-control-request-private-network']) {
|
|
64
|
+
res.setHeader('Access-Control-Allow-Private-Network', 'true');
|
|
65
|
+
}
|
|
66
|
+
res.end();
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
(0, download_and_map_assets_to_file_1.downloadAsset)({ src, onDownload, downloadMap })
|
|
70
|
+
.then((to) => {
|
|
71
|
+
return compositor.executeCommand('ExtractFrame', {
|
|
72
|
+
input: to,
|
|
73
|
+
time,
|
|
74
|
+
transparent,
|
|
75
|
+
});
|
|
76
|
+
})
|
|
77
|
+
.then((readable) => {
|
|
78
|
+
if (!readable) {
|
|
79
|
+
throw new Error('no readable from ffmpeg');
|
|
80
|
+
}
|
|
81
|
+
res.writeHead(200);
|
|
82
|
+
res.write(readable);
|
|
83
|
+
res.end();
|
|
84
|
+
})
|
|
85
|
+
.catch((err) => {
|
|
86
|
+
res.writeHead(500);
|
|
87
|
+
res.end();
|
|
88
|
+
onError(err);
|
|
89
|
+
console.log('Error occurred', err);
|
|
90
|
+
});
|
|
91
|
+
},
|
|
85
92
|
};
|
|
86
93
|
};
|
|
87
94
|
exports.startOffthreadVideoServer = startOffthreadVideoServer;
|
package/dist/open-browser.d.ts
CHANGED
package/dist/open-browser.js
CHANGED
|
@@ -32,7 +32,7 @@ exports.killAllBrowsers = killAllBrowsers;
|
|
|
32
32
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/open-browser)
|
|
33
33
|
*/
|
|
34
34
|
const openBrowser = async (browser, options) => {
|
|
35
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
36
36
|
if (browser === 'firefox') {
|
|
37
37
|
throw new TypeError('Firefox supported is not yet turned on. Stay tuned for the future.');
|
|
38
38
|
}
|
|
@@ -43,6 +43,7 @@ const openBrowser = async (browser, options) => {
|
|
|
43
43
|
executablePath,
|
|
44
44
|
product: browser,
|
|
45
45
|
dumpio: (_e = options === null || options === void 0 ? void 0 : options.shouldDumpIo) !== null && _e !== void 0 ? _e : false,
|
|
46
|
+
indentationString: (_f = options === null || options === void 0 ? void 0 : options.indentationString) !== null && _f !== void 0 ? _f : '',
|
|
46
47
|
args: [
|
|
47
48
|
'about:blank',
|
|
48
49
|
'--allow-pre-commit-input',
|
|
@@ -75,7 +76,7 @@ const openBrowser = async (browser, options) => {
|
|
|
75
76
|
'--enable-blink-features=IdleDetection',
|
|
76
77
|
'--export-tagged-pdf',
|
|
77
78
|
'--intensive-wake-up-throttling-policy=0',
|
|
78
|
-
((
|
|
79
|
+
((_h = (_g = options === null || options === void 0 ? void 0 : options.chromiumOptions) === null || _g === void 0 ? void 0 : _g.headless) !== null && _h !== void 0 ? _h : true) ? '--headless' : null,
|
|
79
80
|
'--no-sandbox',
|
|
80
81
|
'--disable-setuid-sandbox',
|
|
81
82
|
...customGlRenderer,
|
|
@@ -96,17 +97,17 @@ const openBrowser = async (browser, options) => {
|
|
|
96
97
|
(options === null || options === void 0 ? void 0 : options.forceDeviceScaleFactor)
|
|
97
98
|
? `--force-device-scale-factor=${options.forceDeviceScaleFactor}`
|
|
98
99
|
: null,
|
|
99
|
-
((
|
|
100
|
+
((_j = options === null || options === void 0 ? void 0 : options.chromiumOptions) === null || _j === void 0 ? void 0 : _j.ignoreCertificateErrors)
|
|
100
101
|
? '--ignore-certificate-errors'
|
|
101
102
|
: null,
|
|
102
|
-
...(((
|
|
103
|
+
...(((_k = options === null || options === void 0 ? void 0 : options.chromiumOptions) === null || _k === void 0 ? void 0 : _k.disableWebSecurity)
|
|
103
104
|
? ['--disable-web-security']
|
|
104
105
|
: []),
|
|
105
|
-
((
|
|
106
|
+
((_l = options === null || options === void 0 ? void 0 : options.chromiumOptions) === null || _l === void 0 ? void 0 : _l.userAgent)
|
|
106
107
|
? `--user-agent="${options.chromiumOptions.userAgent}"`
|
|
107
108
|
: null,
|
|
108
109
|
].filter(Boolean),
|
|
109
|
-
defaultViewport: (
|
|
110
|
+
defaultViewport: (_m = options === null || options === void 0 ? void 0 : options.viewport) !== null && _m !== void 0 ? _m : {
|
|
110
111
|
height: 720,
|
|
111
112
|
width: 1280,
|
|
112
113
|
deviceScaleFactor: 1,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.audioBitrateOption = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
exports.audioBitrateOption = {
|
|
6
|
+
name: 'Audio Bitrate',
|
|
7
|
+
cliFlag: '--audio-bitrate',
|
|
8
|
+
description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Specify the target bitrate for the generated video. The syntax for FFMPEGs", (0, jsx_runtime_1.jsx)("code", { children: "-b:a" }), " parameter should be used. FFMPEG may encode the video in a way that will not result in the exact audio bitrate specified. Example values: ", (0, jsx_runtime_1.jsx)("code", { children: "512K" }), " for 512 kbps, ", (0, jsx_runtime_1.jsx)("code", { children: "1M" }), " for 1 Mbps. Default: ", (0, jsx_runtime_1.jsx)("code", { children: "320k" })] })),
|
|
9
|
+
ssrName: 'audioBitrate',
|
|
10
|
+
docLink: 'https://www.remotion.dev/docs/renderer/render-media#audiobitrate-',
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.crfOption = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
exports.crfOption = {
|
|
6
|
+
name: 'CRF',
|
|
7
|
+
cliFlag: '--crf',
|
|
8
|
+
description: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "No matter which codec you end up using, there's always a tradeoff between file size and video quality. You can control it by setting the so called CRF (Constant Rate Factor). The lower the number, the better the quality, the higher the number, the smaller the file is \u2013 of course at the cost of quality." })),
|
|
9
|
+
ssrName: 'crf',
|
|
10
|
+
docLink: 'https://www.remotion.dev/docs/encoding/#controlling-quality-using-the-crf-setting',
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enforceAudioOption = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
exports.enforceAudioOption = {
|
|
6
|
+
name: 'Enforce Audio Track',
|
|
7
|
+
cliFlag: '--enforce-audio-track',
|
|
8
|
+
description: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Render a silent audio track if there would be none otherwise." })),
|
|
9
|
+
ssrName: 'enforceAudioTrack',
|
|
10
|
+
docLink: 'https://www.remotion.dev/docs/config#setenforceaudiotrack-',
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jpegQualityOption = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
exports.jpegQualityOption = {
|
|
6
|
+
name: 'JPEG Quality',
|
|
7
|
+
cliFlag: '--jpeg-quality',
|
|
8
|
+
description: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Sets the quality of the generated JPEG images. Must be an integer between 0 and 100. Default is to leave it up to the browser, current default is 80." })),
|
|
9
|
+
ssrName: 'jpegQuality',
|
|
10
|
+
docLink: 'https://www.remotion.dev/docs/renderer/render-media#jpeg-quality',
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.muteOption = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
exports.muteOption = {
|
|
6
|
+
name: 'Muted',
|
|
7
|
+
cliFlag: '--muted',
|
|
8
|
+
description: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "The Audio of the video will be omitted." }),
|
|
9
|
+
ssrName: 'muted',
|
|
10
|
+
docLink: 'https://www.remotion.dev/docs/using-audio/#muted-property',
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scaleOption = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
exports.scaleOption = {
|
|
6
|
+
name: 'Scale',
|
|
7
|
+
cliFlag: '--scale',
|
|
8
|
+
description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Scales the output by a factor. For example, a 1280x720px frame will become a 1920x1080px frame with a scale factor of ", (0, jsx_runtime_1.jsx)("code", { children: "1.5" }), ". Vector elements like fonts and HTML markups will be rendered with extra details."] })),
|
|
9
|
+
ssrName: 'scale',
|
|
10
|
+
docLink: 'https://www.remotion.dev/docs/scaling',
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.videoBitrate = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
exports.videoBitrate = {
|
|
6
|
+
name: 'Video Bitrate',
|
|
7
|
+
cliFlag: '--video-bitrate',
|
|
8
|
+
description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Specify the target bitrate for the generated video. The syntax for FFMPEGs", (0, jsx_runtime_1.jsx)("code", { children: "-b:v" }), " parameter should be used. FFMPEG may encode the video in a way that will not result in the exact video bitrate specified. Example values: ", (0, jsx_runtime_1.jsx)("code", { children: "512K" }), " for 512 kbps, ", (0, jsx_runtime_1.jsx)("code", { children: "1M" }), " for 1 Mbps."] })),
|
|
9
|
+
ssrName: 'videoBitrate',
|
|
10
|
+
docLink: 'https://www.remotion.dev/docs/renderer/render-media#videobitrate-',
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.videoCodecOption = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
exports.videoCodecOption = {
|
|
6
|
+
name: 'Codec',
|
|
7
|
+
cliFlag: '--codec',
|
|
8
|
+
description: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Remotion supports 5 video codecs: h264 (default), h265, vp8, vp9 and prores. While H264 will work well in most cases, sometimes it's worth going for a different codec. Follow the link below for an overview." })),
|
|
9
|
+
ssrName: 'codec',
|
|
10
|
+
docLink: 'https://www.remotion.dev/docs/encoding/#choosing-a-codec',
|
|
11
|
+
};
|
package/dist/perf.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare type PerfId = 'activate-target' | 'capture' | 'save' | 'extract-frame' | 'piping';
|
|
2
2
|
export declare const startPerfMeasure: (marker: PerfId) => number;
|
|
3
3
|
export declare const stopPerfMeasure: (id: number) => void;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const getPerf: () => string[];
|
|
5
5
|
export {};
|
package/dist/perf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getPerf = exports.stopPerfMeasure = exports.startPerfMeasure = void 0;
|
|
4
4
|
const perf = {
|
|
5
5
|
'activate-target': [],
|
|
6
6
|
capture: [],
|
|
@@ -26,10 +26,12 @@ const stopPerfMeasure = (id) => {
|
|
|
26
26
|
delete map[id];
|
|
27
27
|
};
|
|
28
28
|
exports.stopPerfMeasure = stopPerfMeasure;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const getPerf = () => {
|
|
30
|
+
return [
|
|
31
|
+
'Render performance:',
|
|
32
|
+
...Object.keys(perf).map((p) => {
|
|
33
|
+
return ` ${p} => ${perf[p].reduce((a, b) => a + b, 0) / perf[p].length} (n = ${perf[p].length})`;
|
|
34
|
+
}),
|
|
35
|
+
];
|
|
34
36
|
};
|
|
35
|
-
exports.
|
|
37
|
+
exports.getPerf = getPerf;
|
package/dist/prepare-server.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
|
|
2
2
|
import type { DownloadMap } from './assets/download-map';
|
|
3
|
-
|
|
4
|
-
export declare const prepareServer: ({ ffmpegExecutable, ffprobeExecutable, onDownload, onError, webpackConfigOrServeUrl, port, downloadMap, remotionRoot, }: {
|
|
3
|
+
export declare const prepareServer: ({ onDownload, onError, webpackConfigOrServeUrl, port, downloadMap, remotionRoot, concurrency, verbose, }: {
|
|
5
4
|
webpackConfigOrServeUrl: string;
|
|
6
5
|
onDownload: RenderMediaOnDownload;
|
|
7
6
|
onError: (err: Error) => void;
|
|
8
|
-
ffmpegExecutable: FfmpegExecutable;
|
|
9
|
-
ffprobeExecutable: FfmpegExecutable;
|
|
10
7
|
port: number | null;
|
|
11
8
|
downloadMap: DownloadMap;
|
|
12
9
|
remotionRoot: string;
|
|
10
|
+
concurrency: number;
|
|
11
|
+
verbose: boolean;
|
|
13
12
|
}) => Promise<{
|
|
14
13
|
serveUrl: string;
|
|
15
14
|
closeServer: (force: boolean) => Promise<unknown>;
|
package/dist/prepare-server.js
CHANGED
|
@@ -9,16 +9,16 @@ const path_1 = __importDefault(require("path"));
|
|
|
9
9
|
const is_serve_url_1 = require("./is-serve-url");
|
|
10
10
|
const serve_static_1 = require("./serve-static");
|
|
11
11
|
const wait_for_symbolication_error_to_be_done_1 = require("./wait-for-symbolication-error-to-be-done");
|
|
12
|
-
const prepareServer = async ({
|
|
12
|
+
const prepareServer = async ({ onDownload, onError, webpackConfigOrServeUrl, port, downloadMap, remotionRoot, concurrency, verbose, }) => {
|
|
13
13
|
if ((0, is_serve_url_1.isServeUrl)(webpackConfigOrServeUrl)) {
|
|
14
14
|
const { port: offthreadPort, close: closeProxy } = await (0, serve_static_1.serveStatic)(null, {
|
|
15
15
|
onDownload,
|
|
16
16
|
onError,
|
|
17
|
-
ffmpegExecutable,
|
|
18
|
-
ffprobeExecutable,
|
|
19
17
|
port,
|
|
20
18
|
downloadMap,
|
|
21
19
|
remotionRoot,
|
|
20
|
+
concurrency,
|
|
21
|
+
verbose,
|
|
22
22
|
});
|
|
23
23
|
return Promise.resolve({
|
|
24
24
|
serveUrl: webpackConfigOrServeUrl,
|
|
@@ -37,11 +37,11 @@ const prepareServer = async ({ ffmpegExecutable, ffprobeExecutable, onDownload,
|
|
|
37
37
|
const { port: serverPort, close } = await (0, serve_static_1.serveStatic)(webpackConfigOrServeUrl, {
|
|
38
38
|
onDownload,
|
|
39
39
|
onError,
|
|
40
|
-
ffmpegExecutable,
|
|
41
|
-
ffprobeExecutable,
|
|
42
40
|
port,
|
|
43
41
|
downloadMap,
|
|
44
42
|
remotionRoot,
|
|
43
|
+
concurrency,
|
|
44
|
+
verbose,
|
|
45
45
|
});
|
|
46
46
|
return Promise.resolve({
|
|
47
47
|
closeServer: async (force) => {
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import type { DownloadMap } from './assets/download-map';
|
|
2
2
|
import type { MediaAsset } from './assets/types';
|
|
3
|
-
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
4
3
|
import type { ProcessedTrack } from './stringify-ffmpeg-filter';
|
|
5
4
|
declare type Options = {
|
|
6
|
-
ffmpegExecutable: FfmpegExecutable;
|
|
7
|
-
ffprobeExecutable: FfmpegExecutable;
|
|
8
5
|
outName: string;
|
|
9
6
|
asset: MediaAsset;
|
|
10
7
|
expectedFrames: number;
|
|
11
8
|
fps: number;
|
|
12
9
|
downloadMap: DownloadMap;
|
|
13
|
-
remotionRoot: string;
|
|
14
10
|
};
|
|
15
11
|
export declare type PreprocessedAudioTrack = {
|
|
16
12
|
outName: string;
|
|
@@ -1,19 +1,15 @@
|
|
|
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.preprocessAudioTrack = void 0;
|
|
7
|
-
const execa_1 = __importDefault(require("execa"));
|
|
8
4
|
const get_audio_channels_1 = require("./assets/get-audio-channels");
|
|
9
5
|
const calculate_ffmpeg_filters_1 = require("./calculate-ffmpeg-filters");
|
|
6
|
+
const call_ffmpeg_1 = require("./call-ffmpeg");
|
|
10
7
|
const ffmpeg_filter_file_1 = require("./ffmpeg-filter-file");
|
|
11
|
-
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
12
8
|
const p_limit_1 = require("./p-limit");
|
|
13
9
|
const resolve_asset_src_1 = require("./resolve-asset-src");
|
|
14
10
|
const sample_rate_1 = require("./sample-rate");
|
|
15
|
-
const preprocessAudioTrackUnlimited = async ({
|
|
16
|
-
const { channels, duration } = await (0, get_audio_channels_1.getAudioChannelsAndDuration)(downloadMap, (0, resolve_asset_src_1.resolveAssetSrc)(asset.src)
|
|
11
|
+
const preprocessAudioTrackUnlimited = async ({ outName, asset, expectedFrames, fps, downloadMap, }) => {
|
|
12
|
+
const { channels, duration } = await (0, get_audio_channels_1.getAudioChannelsAndDuration)(downloadMap, (0, resolve_asset_src_1.resolveAssetSrc)(asset.src));
|
|
17
13
|
const filter = (0, calculate_ffmpeg_filters_1.calculateFfmpegFilter)({
|
|
18
14
|
asset,
|
|
19
15
|
durationInFrames: expectedFrames,
|
|
@@ -33,7 +29,7 @@ const preprocessAudioTrackUnlimited = async ({ ffmpegExecutable, ffprobeExecutab
|
|
|
33
29
|
['-ar', String(sample_rate_1.DEFAULT_SAMPLE_RATE)],
|
|
34
30
|
['-y', outName],
|
|
35
31
|
].flat(2);
|
|
36
|
-
await (0,
|
|
32
|
+
await (0, call_ffmpeg_1.callFf)('ffmpeg', args);
|
|
37
33
|
cleanup();
|
|
38
34
|
return { outName, filter };
|
|
39
35
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import execa from 'execa';
|
|
2
1
|
import type { Codec } from './codec';
|
|
3
|
-
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
4
2
|
import type { FfmpegOverrideFn } from './ffmpeg-override';
|
|
5
|
-
import type {
|
|
3
|
+
import type { VideoImageFormat } from './image-format';
|
|
6
4
|
import type { CancelSignal } from './make-cancel-signal';
|
|
7
5
|
import type { PixelFormat } from './pixel-format';
|
|
8
6
|
import type { ProResProfile } from './prores-profile';
|
|
9
|
-
declare type
|
|
7
|
+
declare type PreStitcherOptions = {
|
|
10
8
|
fps: number;
|
|
11
9
|
width: number;
|
|
12
10
|
height: number;
|
|
@@ -17,14 +15,13 @@ declare type PreSticherOptions = {
|
|
|
17
15
|
onProgress: (progress: number) => void;
|
|
18
16
|
proResProfile: ProResProfile | undefined;
|
|
19
17
|
verbose: boolean;
|
|
20
|
-
|
|
21
|
-
imageFormat: ImageFormat;
|
|
18
|
+
imageFormat: VideoImageFormat;
|
|
22
19
|
ffmpegOverride: FfmpegOverrideFn;
|
|
23
20
|
signal: CancelSignal;
|
|
24
21
|
videoBitrate: string | null;
|
|
25
22
|
};
|
|
26
|
-
export declare const prespawnFfmpeg: (options:
|
|
27
|
-
task: execa.ExecaChildProcess<string>;
|
|
23
|
+
export declare const prespawnFfmpeg: (options: PreStitcherOptions) => {
|
|
24
|
+
task: import("execa").ExecaChildProcess<string>;
|
|
28
25
|
getLogs: () => string;
|
|
29
|
-
}
|
|
26
|
+
};
|
|
30
27
|
export {};
|
package/dist/prespawn-ffmpeg.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
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.prespawnFfmpeg = void 0;
|
|
7
|
-
const execa_1 = __importDefault(require("execa"));
|
|
8
4
|
const remotion_1 = require("remotion");
|
|
5
|
+
const call_ffmpeg_1 = require("./call-ffmpeg");
|
|
9
6
|
const codec_1 = require("./codec");
|
|
7
|
+
const get_executable_path_1 = require("./compositor/get-executable-path");
|
|
10
8
|
const crf_1 = require("./crf");
|
|
11
|
-
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
12
9
|
const get_codec_name_1 = require("./get-codec-name");
|
|
13
10
|
const get_prores_profile_name_1 = require("./get-prores-profile-name");
|
|
14
11
|
const parse_ffmpeg_progress_1 = require("./parse-ffmpeg-progress");
|
|
15
12
|
const pixel_format_1 = require("./pixel-format");
|
|
16
13
|
const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
var _a, _b, _c, _d, _e, _f;
|
|
14
|
+
const prespawnFfmpeg = (options) => {
|
|
15
|
+
var _a, _b, _c;
|
|
20
16
|
remotion_1.Internals.validateDimension(options.height, 'height', 'passed to `stitchFramesToVideo()`');
|
|
21
17
|
remotion_1.Internals.validateDimension(options.width, 'width', 'passed to `stitchFramesToVideo()`');
|
|
22
18
|
const codec = (_a = options.codec) !== null && _a !== void 0 ? _a : codec_1.DEFAULT_CODEC;
|
|
@@ -28,7 +24,6 @@ const prespawnFfmpeg = async (options, remotionRoot) => {
|
|
|
28
24
|
scale: 1,
|
|
29
25
|
});
|
|
30
26
|
const pixelFormat = (_b = options.pixelFormat) !== null && _b !== void 0 ? _b : pixel_format_1.DEFAULT_PIXEL_FORMAT;
|
|
31
|
-
await (0, validate_ffmpeg_1.validateFfmpeg)((_c = options.ffmpegExecutable) !== null && _c !== void 0 ? _c : null, remotionRoot, 'ffmpeg');
|
|
32
27
|
const encoderName = (0, get_codec_name_1.getCodecName)(codec);
|
|
33
28
|
const proResProfileName = (0, get_prores_profile_name_1.getProResProfileName)(codec, options.proResProfile);
|
|
34
29
|
if (encoderName === null) {
|
|
@@ -36,7 +31,7 @@ const prespawnFfmpeg = async (options, remotionRoot) => {
|
|
|
36
31
|
}
|
|
37
32
|
const supportsCrf = codec !== 'prores';
|
|
38
33
|
if (options.verbose) {
|
|
39
|
-
console.log('[verbose] ffmpeg', (
|
|
34
|
+
console.log('[verbose] ffmpeg', (0, get_executable_path_1.getExecutablePath)('ffmpeg'));
|
|
40
35
|
console.log('[verbose] encoder', encoderName);
|
|
41
36
|
console.log('[verbose] pixelFormat', pixelFormat);
|
|
42
37
|
if (supportsCrf) {
|
|
@@ -80,12 +75,12 @@ const prespawnFfmpeg = async (options, remotionRoot) => {
|
|
|
80
75
|
const finalFfmpegString = options.ffmpegOverride
|
|
81
76
|
? options.ffmpegOverride({ type: 'pre-stitcher', args: ffmpegString })
|
|
82
77
|
: ffmpegString;
|
|
83
|
-
const task = (0,
|
|
78
|
+
const task = (0, call_ffmpeg_1.callFf)('ffmpeg', finalFfmpegString);
|
|
84
79
|
options.signal(() => {
|
|
85
80
|
task.kill();
|
|
86
81
|
});
|
|
87
82
|
let ffmpegOutput = '';
|
|
88
|
-
(
|
|
83
|
+
(_c = task.stderr) === null || _c === void 0 ? void 0 : _c.on('data', (data) => {
|
|
89
84
|
const str = data.toString();
|
|
90
85
|
ffmpegOutput += str;
|
|
91
86
|
if (options.onProgress) {
|