@remotion/renderer 4.0.0-alpha.217 → 4.0.0-alpha4
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 +18 -12
- package/dist/assets/get-audio-channels.d.ts +2 -1
- package/dist/assets/get-audio-channels.js +9 -5
- package/dist/assets/get-video-stream-duration.d.ts +5 -2
- package/dist/assets/get-video-stream-duration.js +12 -6
- package/dist/audio-codec.d.ts +3 -4
- package/dist/audio-codec.js +9 -3
- package/dist/browser/BrowserFetcher.d.ts +16 -63
- package/dist/browser/BrowserFetcher.js +126 -213
- package/dist/browser/BrowserRunner.js +2 -8
- package/dist/browser/FrameManager.js +3 -2
- package/dist/browser/LaunchOptions.d.ts +0 -1
- package/dist/browser/Launcher.js +3 -9
- package/dist/browser/PuppeteerNode.d.ts +0 -3
- package/dist/browser/PuppeteerNode.js +0 -5
- package/dist/browser/create-browser-fetcher.js +34 -48
- package/dist/browser/devtools-commands.d.ts +1 -5
- package/dist/browser/devtools-types.d.ts +0 -78
- package/dist/check-apple-silicon.js +45 -2
- package/dist/client.d.ts +5 -29
- package/dist/client.js +1 -26
- package/dist/codec-supports-media.d.ts +1 -1
- package/dist/codec-supports-media.js +1 -1
- package/dist/combine-videos.d.ts +3 -0
- package/dist/combine-videos.js +9 -5
- package/dist/compositor/compose.js +2 -3
- package/dist/compositor/get-executable-path.d.ts +1 -1
- package/dist/compositor/get-executable-path.js +8 -15
- package/dist/create-ffmpeg-complex-filter.d.ts +4 -1
- package/dist/create-ffmpeg-complex-filter.js +4 -2
- package/dist/create-ffmpeg-merge-filter.d.ts +5 -2
- package/dist/create-ffmpeg-merge-filter.js +10 -2
- package/dist/create-silent-audio.d.ts +4 -1
- package/dist/create-silent-audio.js +7 -3
- package/dist/delete-directory.js +16 -16
- package/dist/ensure-presentation-timestamp.d.ts +9 -2
- package/dist/ensure-presentation-timestamp.js +13 -5
- package/dist/extract-frame-from-video.d.ts +3 -0
- package/dist/extract-frame-from-video.js +29 -7
- package/dist/file-extensions.d.ts +12 -1
- package/dist/file-extensions.js +13 -1
- package/dist/get-can-extract-frames-fast.d.ts +4 -1
- package/dist/get-can-extract-frames-fast.js +12 -1
- package/dist/get-compositions.d.ts +5 -2
- package/dist/get-compositions.js +11 -6
- package/dist/get-frame-of-video-slow.d.ts +4 -1
- package/dist/get-frame-of-video-slow.js +11 -3
- package/dist/get-frame-padded-index.d.ts +1 -2
- package/dist/get-local-browser-executable.js +3 -12
- package/dist/get-video-info.d.ts +5 -2
- package/dist/get-video-info.js +12 -6
- package/dist/guess-extension-for-media.d.ts +3 -1
- package/dist/guess-extension-for-media.js +8 -4
- package/dist/image-format.d.ts +6 -12
- package/dist/image-format.js +13 -16
- package/dist/index.d.ts +25 -36
- package/dist/index.js +15 -17
- package/dist/last-frame-from-video-cache.d.ts +4 -0
- package/dist/last-frame-from-video-cache.js +1 -0
- package/dist/merge-audio-track.d.ts +2 -0
- package/dist/merge-audio-track.js +10 -3
- package/dist/offthread-video-server.d.ts +4 -1
- package/dist/offthread-video-server.js +3 -1
- package/dist/open-browser.d.ts +0 -1
- package/dist/open-browser.js +6 -7
- package/dist/perf.d.ts +1 -1
- package/dist/perf.js +7 -9
- package/dist/prepare-server.d.ts +4 -1
- package/dist/prepare-server.js +5 -1
- package/dist/preprocess-audio-track.d.ts +4 -0
- package/dist/preprocess-audio-track.js +8 -4
- package/dist/prespawn-ffmpeg.d.ts +9 -6
- package/dist/prespawn-ffmpeg.js +12 -7
- package/dist/prestitcher-memory-usage.d.ts +4 -0
- package/dist/prestitcher-memory-usage.js +3 -2
- package/dist/prores-profile.d.ts +2 -1
- package/dist/prores-profile.js +4 -4
- package/dist/provide-screenshot.d.ts +4 -4
- package/dist/provide-screenshot.js +2 -2
- package/dist/puppeteer-screenshot.d.ts +2 -3
- package/dist/puppeteer-screenshot.js +32 -9
- package/dist/render-frames.d.ts +25 -12
- package/dist/render-frames.js +40 -27
- package/dist/render-media.d.ts +18 -16
- package/dist/render-media.js +43 -31
- package/dist/render-still.d.ts +8 -9
- package/dist/render-still.js +13 -12
- package/dist/screenshot-dom-element.d.ts +4 -4
- package/dist/screenshot-dom-element.js +3 -6
- package/dist/screenshot-task.d.ts +2 -2
- package/dist/screenshot-task.js +23 -38
- package/dist/serve-handler/index.js +4 -6
- package/dist/serve-static.d.ts +3 -0
- package/dist/serve-static.js +3 -3
- package/dist/stitch-frames-to-video.d.ts +11 -2
- package/dist/stitch-frames-to-video.js +33 -24
- package/dist/take-frame-and-compose.d.ts +4 -4
- package/dist/take-frame-and-compose.js +6 -12
- package/dist/tmp-dir.js +2 -1
- package/dist/try-to-extract-frame-of-video-fast.d.ts +4 -1
- package/dist/try-to-extract-frame-of-video-fast.js +7 -3
- package/dist/validate-concurrency.d.ts +0 -2
- package/dist/validate-concurrency.js +5 -11
- package/dist/validate-puppeteer-timeout.js +0 -1
- package/package.json +68 -71
- package/dist/browser/is-target-closed-err.d.ts +0 -1
- package/dist/browser/is-target-closed-err.js +0 -9
- package/dist/call-ffmpeg.d.ts +0 -17
- package/dist/call-ffmpeg.js +0 -34
- package/dist/compositor/compositor.d.ts +0 -15
- package/dist/compositor/compositor.js +0 -193
- package/dist/compositor/make-nonce.d.ts +0 -1
- package/dist/compositor/make-nonce.js +0 -8
- package/dist/jpeg-quality.d.ts +0 -1
- package/dist/jpeg-quality.js +0 -21
- package/dist/options/audio-bitrate.d.ts +0 -2
- package/dist/options/audio-bitrate.js +0 -11
- package/dist/options/crf.d.ts +0 -2
- package/dist/options/crf.js +0 -11
- package/dist/options/enforce-audio.d.ts +0 -2
- package/dist/options/enforce-audio.js +0 -11
- package/dist/options/jpeg-quality.d.ts +0 -2
- package/dist/options/jpeg-quality.js +0 -11
- package/dist/options/mute.d.ts +0 -2
- package/dist/options/mute.js +0 -11
- package/dist/options/option.d.ts +0 -8
- package/dist/options/option.js +0 -2
- package/dist/options/scale.d.ts +0 -2
- package/dist/options/scale.js +0 -11
- package/dist/options/video-bitrate.d.ts +0 -2
- package/dist/options/video-bitrate.js +0 -11
- package/dist/options/video-codec.d.ts +0 -2
- package/dist/options/video-codec.js +0 -11
- package/ffmpeg/SOURCE.md +0 -1
- package/ffmpeg/linux-arm-musl.gz +0 -0
- package/ffmpeg/linux-arm.gz +0 -0
- package/ffmpeg/linux-x64-musl.gz +0 -0
- package/ffmpeg/linux-x64.gz +0 -0
- package/ffmpeg/macos-arm.gz +0 -0
- package/ffmpeg/macos-x64.gz +0 -0
- package/ffmpeg/windows.gz +0 -0
- package/install-toolchain.mjs +0 -42
|
@@ -537,84 +537,6 @@ export interface CaptureScreenshotResponse {
|
|
|
537
537
|
*/
|
|
538
538
|
data: string;
|
|
539
539
|
}
|
|
540
|
-
export interface PrintPDFRequest {
|
|
541
|
-
/**
|
|
542
|
-
* Paper orientation. Defaults to false.
|
|
543
|
-
*/
|
|
544
|
-
landscape?: boolean;
|
|
545
|
-
/**
|
|
546
|
-
* Display header and footer. Defaults to false.
|
|
547
|
-
*/
|
|
548
|
-
displayHeaderFooter?: boolean;
|
|
549
|
-
/**
|
|
550
|
-
* Print background graphics. Defaults to false.
|
|
551
|
-
*/
|
|
552
|
-
printBackground?: boolean;
|
|
553
|
-
/**
|
|
554
|
-
* Scale of the webpage rendering. Defaults to 1.
|
|
555
|
-
*/
|
|
556
|
-
scale?: number;
|
|
557
|
-
/**
|
|
558
|
-
* Paper width in inches. Defaults to 8.5 inches.
|
|
559
|
-
*/
|
|
560
|
-
paperWidth?: number;
|
|
561
|
-
/**
|
|
562
|
-
* Paper height in inches. Defaults to 11 inches.
|
|
563
|
-
*/
|
|
564
|
-
paperHeight?: number;
|
|
565
|
-
/**
|
|
566
|
-
* Top margin in inches. Defaults to 1cm (~0.4 inches).
|
|
567
|
-
*/
|
|
568
|
-
marginTop?: number;
|
|
569
|
-
/**
|
|
570
|
-
* Bottom margin in inches. Defaults to 1cm (~0.4 inches).
|
|
571
|
-
*/
|
|
572
|
-
marginBottom?: number;
|
|
573
|
-
/**
|
|
574
|
-
* Left margin in inches. Defaults to 1cm (~0.4 inches).
|
|
575
|
-
*/
|
|
576
|
-
marginLeft?: number;
|
|
577
|
-
/**
|
|
578
|
-
* Right margin in inches. Defaults to 1cm (~0.4 inches).
|
|
579
|
-
*/
|
|
580
|
-
marginRight?: number;
|
|
581
|
-
/**
|
|
582
|
-
* Paper ranges to print, one based, e.g., '1-5, 8, 11-13'.
|
|
583
|
-
* Pages are printed in the document order, not in the order specified,
|
|
584
|
-
* and no more than once. Defaults to empty string,
|
|
585
|
-
* which implies the entire document is printed.
|
|
586
|
-
* The page numbers are quietly capped to actual page count of the document,
|
|
587
|
-
* and ranges beyond the end of the document are ignored.
|
|
588
|
-
* If this results in no pages to print, an error is reported.
|
|
589
|
-
* It is an error to specify a range with start greater than end.
|
|
590
|
-
*/
|
|
591
|
-
pageRanges?: string;
|
|
592
|
-
/**
|
|
593
|
-
* HTML template for the print header.
|
|
594
|
-
* Should be valid HTML markup with following classes used to inject printing values into them:
|
|
595
|
-
* date: formatted print date
|
|
596
|
-
* title: document title
|
|
597
|
-
* url: document location
|
|
598
|
-
* pageNumber: current page number
|
|
599
|
-
* totalPages: total pages in the document
|
|
600
|
-
* For example, <span class=title></span> would generate span containing the title.
|
|
601
|
-
*/
|
|
602
|
-
headerTemplate?: string;
|
|
603
|
-
/**
|
|
604
|
-
* HTML template for the print footer. Should use the same format as the headerTemplate.
|
|
605
|
-
*/
|
|
606
|
-
footerTemplate?: string;
|
|
607
|
-
/**
|
|
608
|
-
* Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
|
|
609
|
-
*/
|
|
610
|
-
preferCSSPageSize?: boolean;
|
|
611
|
-
}
|
|
612
|
-
export interface PrintPDFResponse {
|
|
613
|
-
/**
|
|
614
|
-
* Base64-encoded pdf data. Empty if |returnAsStream| is specified. (Encoded as a base64 string when passed over JSON)
|
|
615
|
-
*/
|
|
616
|
-
data: string;
|
|
617
|
-
}
|
|
618
540
|
export interface RequestWillBeSentEvent {
|
|
619
541
|
/**
|
|
620
542
|
* Request identifier.
|
|
@@ -1,12 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.checkNodeVersionAndWarnAboutRosetta = void 0;
|
|
27
|
+
const os = __importStar(require("os"));
|
|
4
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';
|
|
5
33
|
const version = process.version.replace('v', '').split('.');
|
|
6
34
|
const majorVersion = Number(version[0]);
|
|
7
|
-
const requiredNodeVersion =
|
|
8
|
-
if (majorVersion <
|
|
35
|
+
const requiredNodeVersion = 14;
|
|
36
|
+
if (majorVersion < 13) {
|
|
9
37
|
throw new Error(`Remotion requires at least Node ${requiredNodeVersion}. You currently have ${process.version}. Update your node version to ${requiredNodeVersion} to use Remotion.`);
|
|
10
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
|
+
}
|
|
11
54
|
};
|
|
12
55
|
exports.checkNodeVersionAndWarnAboutRosetta = checkNodeVersionAndWarnAboutRosetta;
|
package/dist/client.d.ts
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
export declare const BrowserSafeApis: {
|
|
2
2
|
getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">(codec: T, audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => import("./file-extensions").FileExtension;
|
|
3
3
|
validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "gif"];
|
|
4
|
-
validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
|
|
5
4
|
getDefaultCrfForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => number;
|
|
6
5
|
getValidCrfRanges: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => [number, number];
|
|
7
6
|
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | undefined) => boolean;
|
|
8
|
-
proResProfileOptions: readonly ["4444-xq", "4444", "hq", "standard", "light", "proxy"];
|
|
9
7
|
validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
10
8
|
DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
11
9
|
supportedAudioCodecs: {
|
|
12
10
|
readonly h264: readonly ["aac", "pcm-16"];
|
|
13
11
|
readonly 'h264-mkv': readonly ["pcm-16"];
|
|
14
12
|
readonly aac: readonly ["aac", "pcm-16"];
|
|
15
|
-
readonly gif:
|
|
13
|
+
readonly gif: readonly [];
|
|
16
14
|
readonly h265: readonly ["aac", "pcm-16"];
|
|
17
15
|
readonly mp3: readonly ["mp3", "pcm-16"];
|
|
18
|
-
readonly prores: readonly ["
|
|
16
|
+
readonly prores: readonly ["pcm-16", "aac"];
|
|
19
17
|
readonly vp8: readonly ["opus", "pcm-16"];
|
|
20
18
|
readonly vp9: readonly ["opus", "pcm-16"];
|
|
21
19
|
readonly wav: readonly ["pcm-16"];
|
|
@@ -132,12 +130,7 @@ export declare const BrowserSafeApis: {
|
|
|
132
130
|
};
|
|
133
131
|
gif: {
|
|
134
132
|
default: import("./file-extensions").FileExtension;
|
|
135
|
-
forAudioCodec: {
|
|
136
|
-
[x: string]: {
|
|
137
|
-
possible: import("./file-extensions").FileExtension[];
|
|
138
|
-
default: import("./file-extensions").FileExtension;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
133
|
+
forAudioCodec: {};
|
|
141
134
|
};
|
|
142
135
|
};
|
|
143
136
|
defaultAudioCodecs: {
|
|
@@ -178,26 +171,9 @@ export declare const BrowserSafeApis: {
|
|
|
178
171
|
lossless: "pcm-16" | null;
|
|
179
172
|
};
|
|
180
173
|
gif: {
|
|
181
|
-
compressed:
|
|
182
|
-
lossless:
|
|
174
|
+
compressed: null;
|
|
175
|
+
lossless: null;
|
|
183
176
|
};
|
|
184
177
|
};
|
|
185
178
|
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">;
|
|
186
|
-
validateOutputFilename: <T_1 extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">({ codec, audioCodec, extension, preferLossless, }: {
|
|
187
|
-
codec: T_1;
|
|
188
|
-
audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
189
|
-
extension: string;
|
|
190
|
-
preferLossless: boolean;
|
|
191
|
-
}) => void;
|
|
192
|
-
options: {
|
|
193
|
-
scaleOption: import(".").RemotionOption;
|
|
194
|
-
crfOption: import(".").RemotionOption;
|
|
195
|
-
jpegQualityOption: import(".").RemotionOption;
|
|
196
|
-
videoBitrate: import(".").RemotionOption;
|
|
197
|
-
audioBitrateOption: import(".").RemotionOption;
|
|
198
|
-
enforceAudioOption: import(".").RemotionOption;
|
|
199
|
-
muteOption: import(".").RemotionOption;
|
|
200
|
-
videoCodecOption: import(".").RemotionOption;
|
|
201
|
-
};
|
|
202
|
-
codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
|
|
203
179
|
};
|
package/dist/client.js
CHANGED
|
@@ -3,46 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BrowserSafeApis = void 0;
|
|
4
4
|
const audio_codec_1 = require("./audio-codec");
|
|
5
5
|
const codec_1 = require("./codec");
|
|
6
|
-
const codec_supports_media_1 = require("./codec-supports-media");
|
|
7
6
|
const crf_1 = require("./crf");
|
|
8
7
|
const file_extensions_1 = require("./file-extensions");
|
|
9
8
|
const get_extension_from_codec_1 = require("./get-extension-from-codec");
|
|
10
9
|
const is_audio_codec_1 = require("./is-audio-codec");
|
|
11
|
-
const audio_bitrate_1 = require("./options/audio-bitrate");
|
|
12
|
-
const crf_2 = require("./options/crf");
|
|
13
|
-
const enforce_audio_1 = require("./options/enforce-audio");
|
|
14
|
-
const jpeg_quality_1 = require("./options/jpeg-quality");
|
|
15
|
-
const mute_1 = require("./options/mute");
|
|
16
|
-
const scale_1 = require("./options/scale");
|
|
17
|
-
const video_bitrate_1 = require("./options/video-bitrate");
|
|
18
|
-
const video_codec_1 = require("./options/video-codec");
|
|
19
10
|
const pixel_format_1 = require("./pixel-format");
|
|
20
|
-
const prores_profile_1 = require("./prores-profile");
|
|
21
|
-
const validate_output_filename_1 = require("./validate-output-filename");
|
|
22
11
|
exports.BrowserSafeApis = {
|
|
23
12
|
getFileExtensionFromCodec: get_extension_from_codec_1.getFileExtensionFromCodec,
|
|
24
13
|
validCodecs: codec_1.validCodecs,
|
|
25
|
-
validAudioCodecs: audio_codec_1.validAudioCodecs,
|
|
26
14
|
getDefaultCrfForCodec: crf_1.getDefaultCrfForCodec,
|
|
27
15
|
getValidCrfRanges: crf_1.getValidCrfRanges,
|
|
28
16
|
isAudioCodec: is_audio_codec_1.isAudioCodec,
|
|
29
|
-
proResProfileOptions: prores_profile_1.proResProfileOptions,
|
|
30
17
|
validPixelFormats: pixel_format_1.validPixelFormats,
|
|
31
18
|
DEFAULT_PIXEL_FORMAT: pixel_format_1.DEFAULT_PIXEL_FORMAT,
|
|
32
|
-
supportedAudioCodecs:
|
|
19
|
+
supportedAudioCodecs: file_extensions_1.supportedAudioCodecs,
|
|
33
20
|
defaultFileExtensionMap: file_extensions_1.defaultFileExtensionMap,
|
|
34
21
|
defaultAudioCodecs: audio_codec_1.defaultAudioCodecs,
|
|
35
22
|
defaultCodecsForFileExtension: get_extension_from_codec_1.defaultCodecsForFileExtension,
|
|
36
|
-
validateOutputFilename: validate_output_filename_1.validateOutputFilename,
|
|
37
|
-
options: {
|
|
38
|
-
scaleOption: scale_1.scaleOption,
|
|
39
|
-
crfOption: crf_2.crfOption,
|
|
40
|
-
jpegQualityOption: jpeg_quality_1.jpegQualityOption,
|
|
41
|
-
videoBitrate: video_bitrate_1.videoBitrate,
|
|
42
|
-
audioBitrateOption: audio_bitrate_1.audioBitrateOption,
|
|
43
|
-
enforceAudioOption: enforce_audio_1.enforceAudioOption,
|
|
44
|
-
muteOption: mute_1.muteOption,
|
|
45
|
-
videoCodecOption: video_codec_1.videoCodecOption,
|
|
46
|
-
},
|
|
47
|
-
codecSupportsCrf: codec_supports_media_1.codecSupportsCrf,
|
|
48
23
|
};
|
|
@@ -4,5 +4,5 @@ declare type MediaSupport = {
|
|
|
4
4
|
audio: boolean;
|
|
5
5
|
};
|
|
6
6
|
export declare const codecSupportsMedia: (codec: Codec) => MediaSupport;
|
|
7
|
-
export declare const codecSupportsCrf: (codec: Codec) => boolean;
|
|
7
|
+
export declare const codecSupportsCrf: (codec: Codec) => boolean | "" | null;
|
|
8
8
|
export {};
|
|
@@ -50,7 +50,7 @@ const codecSupportsMedia = (codec) => {
|
|
|
50
50
|
exports.codecSupportsMedia = codecSupportsMedia;
|
|
51
51
|
const codecSupportsCrf = (codec) => {
|
|
52
52
|
const encoderName = (0, get_codec_name_1.getCodecName)(codec);
|
|
53
|
-
const supportsCrf =
|
|
53
|
+
const supportsCrf = encoderName && codec !== 'prores';
|
|
54
54
|
return supportsCrf;
|
|
55
55
|
};
|
|
56
56
|
exports.codecSupportsCrf = codecSupportsCrf;
|
package/dist/combine-videos.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AudioCodec } from './audio-codec';
|
|
2
2
|
import type { Codec } from './codec';
|
|
3
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
3
4
|
declare type Options = {
|
|
4
5
|
files: string[];
|
|
5
6
|
filelistDir: string;
|
|
@@ -9,6 +10,8 @@ declare type Options = {
|
|
|
9
10
|
codec: Codec;
|
|
10
11
|
fps: number;
|
|
11
12
|
numberOfGifLoops: number | null;
|
|
13
|
+
remotionRoot: string;
|
|
14
|
+
ffmpegExecutable: FfmpegExecutable;
|
|
12
15
|
audioCodec: AudioCodec | null;
|
|
13
16
|
};
|
|
14
17
|
export declare const combineVideos: (options: Options) => Promise<void>;
|
package/dist/combine-videos.js
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Combine multiple video chunks, useful for decentralized rendering
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
3
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
7
|
exports.combineVideos = void 0;
|
|
8
|
+
const execa_1 = __importDefault(require("execa"));
|
|
5
9
|
const fs_1 = require("fs");
|
|
6
10
|
const path_1 = require("path");
|
|
7
11
|
const audio_codec_1 = require("./audio-codec");
|
|
8
|
-
const
|
|
12
|
+
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
9
13
|
const is_audio_codec_1 = require("./is-audio-codec");
|
|
10
14
|
const parse_ffmpeg_progress_1 = require("./parse-ffmpeg-progress");
|
|
11
15
|
const truthy_1 = require("./truthy");
|
|
12
16
|
const combineVideos = async (options) => {
|
|
13
17
|
var _a;
|
|
14
|
-
const { files, filelistDir, output, onProgress, numberOfFrames, codec, fps, numberOfGifLoops, audioCodec, } = options;
|
|
18
|
+
const { files, filelistDir, output, onProgress, numberOfFrames, codec, fps, numberOfGifLoops, ffmpegExecutable, remotionRoot, audioCodec, } = options;
|
|
15
19
|
const fileList = files.map((p) => `file '${p}'`).join('\n');
|
|
16
20
|
const fileListTxt = (0, path_1.join)(filelistDir, 'files.txt');
|
|
17
21
|
(0, fs_1.writeFileSync)(fileListTxt, fileList);
|
|
18
22
|
const resolvedAudioCodec = audioCodec !== null && audioCodec !== void 0 ? audioCodec : (0, audio_codec_1.getDefaultAudioCodec)({ codec, preferLossless: false });
|
|
19
23
|
try {
|
|
20
|
-
const task = (0,
|
|
24
|
+
const task = (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffmpegExecutable, remotionRoot, 'ffmpeg'), [
|
|
21
25
|
(0, is_audio_codec_1.isAudioCodec)(codec) ? null : '-r',
|
|
22
26
|
(0, is_audio_codec_1.isAudioCodec)(codec) ? null : String(fps),
|
|
23
27
|
'-f',
|
|
@@ -56,10 +60,10 @@ const combineVideos = async (options) => {
|
|
|
56
60
|
});
|
|
57
61
|
await task;
|
|
58
62
|
onProgress(numberOfFrames);
|
|
59
|
-
(0
|
|
63
|
+
(fs_1.rmSync !== null && fs_1.rmSync !== void 0 ? fs_1.rmSync : fs_1.rmdirSync)(filelistDir, { recursive: true });
|
|
60
64
|
}
|
|
61
65
|
catch (err) {
|
|
62
|
-
(0
|
|
66
|
+
(fs_1.rmSync !== null && fs_1.rmSync !== void 0 ? fs_1.rmSync : fs_1.rmdirSync)(filelistDir, { recursive: true });
|
|
63
67
|
throw err;
|
|
64
68
|
}
|
|
65
69
|
};
|
|
@@ -4,13 +4,12 @@ exports.compose = void 0;
|
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const crypto_1 = require("crypto");
|
|
6
6
|
const promises_1 = require("fs/promises");
|
|
7
|
-
const call_ffmpeg_1 = require("../call-ffmpeg");
|
|
8
7
|
const get_executable_path_1 = require("./get-executable-path");
|
|
9
8
|
const getCompositorHash = ({ ...input }) => {
|
|
10
9
|
return (0, crypto_1.createHash)('sha256').update(JSON.stringify(input)).digest('base64');
|
|
11
10
|
};
|
|
12
11
|
const compose = async ({ height, width, layers, output, downloadMap, imageFormat, }) => {
|
|
13
|
-
const bin = (0, get_executable_path_1.getExecutablePath)(
|
|
12
|
+
const bin = (0, get_executable_path_1.getExecutablePath)();
|
|
14
13
|
const hash = getCompositorHash({ height, width, layers, imageFormat });
|
|
15
14
|
if (downloadMap.compositorCache[hash]) {
|
|
16
15
|
await (0, promises_1.copyFile)(downloadMap.compositorCache[hash], output);
|
|
@@ -25,7 +24,7 @@ const compose = async ({ height, width, layers, output, downloadMap, imageFormat
|
|
|
25
24
|
output_format: imageFormat,
|
|
26
25
|
};
|
|
27
26
|
await new Promise((resolve, reject) => {
|
|
28
|
-
const child = (0, child_process_1.spawn)(bin
|
|
27
|
+
const child = (0, child_process_1.spawn)(bin);
|
|
29
28
|
child.stdin.write(JSON.stringify(payload));
|
|
30
29
|
child.stdin.end();
|
|
31
30
|
const stderrChunks = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getExecutablePath: (
|
|
1
|
+
export declare const getExecutablePath: () => any;
|
|
@@ -7,28 +7,21 @@ function isMusl() {
|
|
|
7
7
|
const { glibcVersionRuntime } = process.report.getReport().header;
|
|
8
8
|
return !glibcVersionRuntime;
|
|
9
9
|
}
|
|
10
|
-
const getExecutablePath = (
|
|
11
|
-
const key = type === 'compositor'
|
|
12
|
-
? 'binaryPath'
|
|
13
|
-
: type === 'ffmpeg'
|
|
14
|
-
? 'ffmpegPath'
|
|
15
|
-
: type === 'ffprobe'
|
|
16
|
-
? 'ffprobePath'
|
|
17
|
-
: 'ffmpegCwd';
|
|
10
|
+
const getExecutablePath = () => {
|
|
18
11
|
switch (process.platform) {
|
|
19
12
|
case 'win32':
|
|
20
13
|
switch (process.arch) {
|
|
21
14
|
case 'x64':
|
|
22
|
-
return require('@remotion/compositor-win32-x64-msvc')
|
|
15
|
+
return require('@remotion/compositor-win32-x64-msvc').binaryPath;
|
|
23
16
|
default:
|
|
24
17
|
throw new Error(`Unsupported architecture on Windows: ${process.arch}`);
|
|
25
18
|
}
|
|
26
19
|
case 'darwin':
|
|
27
20
|
switch (process.arch) {
|
|
28
21
|
case 'x64':
|
|
29
|
-
return require('@remotion/compositor-darwin-x64')
|
|
22
|
+
return require('@remotion/compositor-darwin-x64').binaryPath;
|
|
30
23
|
case 'arm64':
|
|
31
|
-
return require('@remotion/compositor-darwin-arm64')
|
|
24
|
+
return require('@remotion/compositor-darwin-arm64').binaryPath;
|
|
32
25
|
default:
|
|
33
26
|
throw new Error(`Unsupported architecture on macOS: ${process.arch}`);
|
|
34
27
|
}
|
|
@@ -36,14 +29,14 @@ const getExecutablePath = (type) => {
|
|
|
36
29
|
switch (process.arch) {
|
|
37
30
|
case 'x64':
|
|
38
31
|
if (isMusl()) {
|
|
39
|
-
return require('@remotion/compositor-linux-x64-musl')
|
|
32
|
+
return require('@remotion/compositor-linux-x64-musl').binaryPath;
|
|
40
33
|
}
|
|
41
|
-
return require('@remotion/compositor-linux-x64-gnu')
|
|
34
|
+
return require('@remotion/compositor-linux-x64-gnu').binaryPath;
|
|
42
35
|
case 'arm64':
|
|
43
36
|
if (isMusl()) {
|
|
44
|
-
return require('@remotion/compositor-linux-arm64-musl')
|
|
37
|
+
return require('@remotion/compositor-linux-arm64-musl').binaryPath;
|
|
45
38
|
}
|
|
46
|
-
return require('@remotion/compositor-linux-arm64-gnu')
|
|
39
|
+
return require('@remotion/compositor-linux-arm64-gnu').binaryPath;
|
|
47
40
|
default:
|
|
48
41
|
throw new Error(`Unsupported architecture on Linux: ${process.arch}`);
|
|
49
42
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { DownloadMap } from './assets/download-map';
|
|
2
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
2
3
|
import type { PreprocessedAudioTrack } from './preprocess-audio-track';
|
|
3
|
-
export declare const createFfmpegComplexFilter: ({ filters, downloadMap, }: {
|
|
4
|
+
export declare const createFfmpegComplexFilter: ({ filters, downloadMap, ffmpegExecutable, remotionRoot, }: {
|
|
4
5
|
filters: PreprocessedAudioTrack[];
|
|
5
6
|
downloadMap: DownloadMap;
|
|
7
|
+
ffmpegExecutable: FfmpegExecutable;
|
|
8
|
+
remotionRoot: string;
|
|
6
9
|
}) => Promise<{
|
|
7
10
|
complexFilterFlag: [string, string] | null;
|
|
8
11
|
cleanup: () => void;
|
|
@@ -3,12 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createFfmpegComplexFilter = void 0;
|
|
4
4
|
const create_ffmpeg_merge_filter_1 = require("./create-ffmpeg-merge-filter");
|
|
5
5
|
const ffmpeg_filter_file_1 = require("./ffmpeg-filter-file");
|
|
6
|
-
const createFfmpegComplexFilter = async ({ filters, downloadMap, }) => {
|
|
6
|
+
const createFfmpegComplexFilter = async ({ filters, downloadMap, ffmpegExecutable, remotionRoot, }) => {
|
|
7
7
|
if (filters.length === 0) {
|
|
8
8
|
return { complexFilterFlag: null, cleanup: () => undefined };
|
|
9
9
|
}
|
|
10
|
-
const complexFilter = (0, create_ffmpeg_merge_filter_1.createFfmpegMergeFilter)({
|
|
10
|
+
const complexFilter = await (0, create_ffmpeg_merge_filter_1.createFfmpegMergeFilter)({
|
|
11
11
|
inputs: filters,
|
|
12
|
+
ffmpegExecutable,
|
|
13
|
+
remotionRoot,
|
|
12
14
|
});
|
|
13
15
|
const { file, cleanup } = await (0, ffmpeg_filter_file_1.makeFfmpegFilterFileStr)(complexFilter, downloadMap);
|
|
14
16
|
return {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
1
2
|
import type { PreprocessedAudioTrack } from './preprocess-audio-track';
|
|
2
3
|
export declare const OUTPUT_FILTER_NAME = "outputaudio";
|
|
3
|
-
export declare const createFfmpegMergeFilter: ({ inputs, }: {
|
|
4
|
+
export declare const createFfmpegMergeFilter: ({ inputs, ffmpegExecutable, remotionRoot, }: {
|
|
4
5
|
inputs: PreprocessedAudioTrack[];
|
|
5
|
-
|
|
6
|
+
ffmpegExecutable: FfmpegExecutable;
|
|
7
|
+
remotionRoot: string;
|
|
8
|
+
}) => Promise<string>;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createFfmpegMergeFilter = exports.OUTPUT_FILTER_NAME = void 0;
|
|
4
|
+
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
4
5
|
const truthy_1 = require("./truthy");
|
|
5
6
|
exports.OUTPUT_FILTER_NAME = 'outputaudio';
|
|
6
|
-
const createFfmpegMergeFilter = ({ inputs, }) => {
|
|
7
|
+
const createFfmpegMergeFilter = async ({ inputs, ffmpegExecutable, remotionRoot, }) => {
|
|
8
|
+
const ffmpegVersion = await (0, ffmpeg_flags_1.getFfmpegVersion)({
|
|
9
|
+
ffmpegExecutable,
|
|
10
|
+
remotionRoot,
|
|
11
|
+
});
|
|
12
|
+
const supportsNormalize = ffmpegVersion === null ||
|
|
13
|
+
(ffmpegVersion[0] === 4 && ffmpegVersion[1] >= 4) ||
|
|
14
|
+
ffmpegVersion[0] >= 5;
|
|
7
15
|
const pads = inputs.map((input, index) => {
|
|
8
16
|
const filters = [
|
|
9
17
|
input.filter.pad_start ? input.filter.pad_start : null,
|
|
@@ -12,7 +20,7 @@ const createFfmpegMergeFilter = ({ inputs, }) => {
|
|
|
12
20
|
];
|
|
13
21
|
return `[${index}:a]${filters.filter(truthy_1.truthy).join(',')}[padded${index}]`;
|
|
14
22
|
});
|
|
15
|
-
const normalize = ':normalize=0';
|
|
23
|
+
const normalize = supportsNormalize ? ':normalize=0' : '';
|
|
16
24
|
return [
|
|
17
25
|
...pads,
|
|
18
26
|
`${new Array(inputs.length)
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
2
|
+
export declare const createSilentAudio: ({ ffmpegExecutable, numberOfSeconds, outName, remotionRoot, }: {
|
|
3
|
+
ffmpegExecutable: FfmpegExecutable;
|
|
2
4
|
numberOfSeconds: number;
|
|
3
5
|
outName: string;
|
|
6
|
+
remotionRoot: string;
|
|
4
7
|
}) => Promise<void>;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.createSilentAudio = void 0;
|
|
4
|
-
const
|
|
7
|
+
const execa_1 = __importDefault(require("execa"));
|
|
8
|
+
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
5
9
|
const sample_rate_1 = require("./sample-rate");
|
|
6
|
-
const createSilentAudio = async ({ numberOfSeconds, outName, }) => {
|
|
7
|
-
await (0,
|
|
10
|
+
const createSilentAudio = async ({ ffmpegExecutable, numberOfSeconds, outName, remotionRoot, }) => {
|
|
11
|
+
await (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffmpegExecutable, remotionRoot, 'ffmpeg'), [
|
|
8
12
|
'-f',
|
|
9
13
|
'lavfi',
|
|
10
14
|
'-i',
|
package/dist/delete-directory.js
CHANGED
|
@@ -22,37 +22,37 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.deleteDirectory = void 0;
|
|
30
|
+
const execa_1 = __importDefault(require("execa"));
|
|
27
31
|
const fs_1 = __importStar(require("fs"));
|
|
28
32
|
const is_serve_url_1 = require("./is-serve-url");
|
|
29
33
|
const deleteDirectory = (directory) => {
|
|
34
|
+
var _a;
|
|
30
35
|
if ((0, is_serve_url_1.isServeUrl)(directory)) {
|
|
31
36
|
return;
|
|
32
37
|
}
|
|
33
38
|
if (!(0, fs_1.existsSync)(directory)) {
|
|
34
39
|
return;
|
|
35
40
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// This is a workaround for this issue.
|
|
41
|
-
let retries = 2;
|
|
42
|
-
while (retries >= 0) {
|
|
41
|
+
if (process.platform === 'win32') {
|
|
42
|
+
// We use del before to remove all files inside the directories otherwise
|
|
43
|
+
// rmdir will throw an error.
|
|
44
|
+
execa_1.default.sync('cmd', ['/c', 'del', '/f', '/s', '/q', directory]);
|
|
43
45
|
try {
|
|
44
|
-
|
|
45
|
-
maxRetries: 2,
|
|
46
|
-
recursive: true,
|
|
47
|
-
force: true,
|
|
48
|
-
retryDelay: 100,
|
|
49
|
-
});
|
|
46
|
+
execa_1.default.sync('cmd', ['/c', 'rmdir', '/s', '/q', directory]);
|
|
50
47
|
}
|
|
51
48
|
catch (err) {
|
|
52
|
-
|
|
53
|
-
continue;
|
|
49
|
+
// Is not a directory
|
|
54
50
|
}
|
|
55
|
-
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
((_a = fs_1.default.rmSync) !== null && _a !== void 0 ? _a : fs_1.default.rmdirSync)(directory, {
|
|
54
|
+
recursive: true,
|
|
55
|
+
});
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
exports.deleteDirectory = deleteDirectory;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import type { DownloadMap } from './assets/download-map';
|
|
2
|
-
|
|
2
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
3
|
+
export declare const ensurePresentationTimestampWithoutCache: ({ src, remotionRoot, ffmpegExecutable, ffprobeExecutable, }: {
|
|
3
4
|
src: string;
|
|
5
|
+
remotionRoot: string;
|
|
6
|
+
ffmpegExecutable: FfmpegExecutable;
|
|
7
|
+
ffprobeExecutable: FfmpegExecutable;
|
|
4
8
|
}) => Promise<string>;
|
|
5
|
-
export declare const ensurePresentationTimestamps: ({ downloadMap, src, }: {
|
|
9
|
+
export declare const ensurePresentationTimestamps: ({ downloadMap, src, remotionRoot, ffmpegExecutable, ffprobeExecutable, }: {
|
|
6
10
|
downloadMap: DownloadMap;
|
|
7
11
|
src: string;
|
|
12
|
+
remotionRoot: string;
|
|
13
|
+
ffmpegExecutable: FfmpegExecutable;
|
|
14
|
+
ffprobeExecutable: FfmpegExecutable;
|
|
8
15
|
}) => Promise<string>;
|