@remotion/renderer 4.0.0-alpha6 → 4.0.0-alpha7
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/dist/audio-codec.d.ts +1 -1
- package/dist/browser/BrowserRunner.js +7 -20
- package/dist/browser/LaunchOptions.d.ts +1 -2
- package/dist/browser/Launcher.js +3 -11
- package/dist/call-ffmpeg.js +3 -1
- package/dist/chalk/index.d.ts +54 -0
- package/dist/chalk/index.js +135 -0
- package/dist/chalk/is-color-supported.d.ts +1 -0
- package/dist/chalk/is-color-supported.js +37 -0
- package/dist/client.d.ts +45 -57
- package/dist/compositor/compose.js +5 -3
- package/dist/compositor/compositor.d.ts +2 -2
- package/dist/compositor/compositor.js +8 -5
- package/dist/compositor/get-executable-path.js +1 -10
- package/dist/create-ffmpeg-complex-filter.d.ts +1 -4
- package/dist/file-extensions.js +1 -7
- package/dist/get-compositions.d.ts +4 -0
- package/dist/get-compositions.js +2 -1
- package/dist/get-extension-from-codec.d.ts +2 -2
- package/dist/index.d.ts +111 -48
- package/dist/index.js +9 -0
- package/dist/logger.d.ts +22 -0
- package/dist/logger.js +61 -0
- package/dist/offthread-video-server.d.ts +2 -1
- package/dist/offthread-video-server.js +2 -2
- package/dist/open-browser.d.ts +1 -1
- package/dist/open-browser.js +1 -1
- package/dist/prepare-server.d.ts +2 -1
- package/dist/prepare-server.js +3 -1
- package/dist/prespawn-ffmpeg.d.ts +1 -0
- package/dist/prespawn-ffmpeg.js +37 -14
- package/dist/provide-screenshot.d.ts +1 -0
- package/dist/puppeteer-screenshot.d.ts +1 -0
- package/dist/render-frames.d.ts +4 -0
- package/dist/render-frames.js +4 -2
- package/dist/render-media.d.ts +4 -1
- package/dist/render-media.js +38 -17
- package/dist/render-still.d.ts +4 -0
- package/dist/render-still.js +3 -1
- package/dist/screenshot-dom-element.d.ts +1 -0
- package/dist/screenshot-task.d.ts +1 -0
- package/dist/serve-static.d.ts +1 -0
- package/dist/serve-static.js +1 -0
- package/dist/stitch-frames-to-video.d.ts +2 -0
- package/dist/stitch-frames-to-video.js +49 -26
- package/dist/take-frame-and-compose.d.ts +1 -0
- package/dist/validate-output-filename.d.ts +1 -1
- package/package.json +9 -9
- package/dist/assets/get-video-stream-duration.d.ts +0 -9
- package/dist/assets/get-video-stream-duration.js +0 -71
- package/dist/calculate-sar-dar-pixels.d.ts +0 -9
- package/dist/calculate-sar-dar-pixels.js +0 -19
- package/dist/determine-resize-params.d.ts +0 -1
- package/dist/determine-resize-params.js +0 -10
- package/dist/determine-vcodec-ffmpeg-flags.d.ts +0 -2
- package/dist/determine-vcodec-ffmpeg-flags.js +0 -13
- package/dist/ensure-ffmpeg.d.ts +0 -18
- package/dist/ensure-ffmpeg.js +0 -58
- package/dist/ensure-presentation-timestamp.d.ts +0 -15
- package/dist/ensure-presentation-timestamp.js +0 -88
- package/dist/extract-frame-from-video.d.ts +0 -17
- package/dist/extract-frame-from-video.js +0 -191
- package/dist/ffmpeg-executable.d.ts +0 -1
- package/dist/ffmpeg-executable.js +0 -2
- package/dist/ffmpeg-flags.d.ts +0 -31
- package/dist/ffmpeg-flags.js +0 -245
- package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -1
- package/dist/frame-to-ffmpeg-timestamp.js +0 -8
- package/dist/get-can-extract-frames-fast.d.ts +0 -14
- package/dist/get-can-extract-frames-fast.js +0 -71
- package/dist/get-frame-of-video-slow.d.ts +0 -15
- package/dist/get-frame-of-video-slow.js +0 -72
- package/dist/get-video-info.d.ts +0 -8
- package/dist/get-video-info.js +0 -59
- package/dist/is-beyond-last-frame.d.ts +0 -3
- package/dist/is-beyond-last-frame.js +0 -12
- package/dist/last-frame-from-video-cache.d.ts +0 -18
- package/dist/last-frame-from-video-cache.js +0 -55
- package/dist/legacy-webpack-config.d.ts +0 -9
- package/dist/legacy-webpack-config.js +0 -13
- package/dist/quality.d.ts +0 -1
- package/dist/quality.js +0 -21
- package/dist/try-to-extract-frame-of-video-fast.d.ts +0 -13
- package/dist/try-to-extract-frame-of-video-fast.js +0 -55
- package/dist/validate-ffmpeg.d.ts +0 -7
- package/dist/validate-ffmpeg.js +0 -77
- package/dist/warn-about-ffmpeg-version.d.ts +0 -5
- package/dist/warn-about-ffmpeg-version.js +0 -37
package/dist/audio-codec.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const supportedAudioCodecs: {
|
|
|
5
5
|
readonly h264: readonly ["aac", "pcm-16"];
|
|
6
6
|
readonly 'h264-mkv': readonly ["pcm-16"];
|
|
7
7
|
readonly aac: readonly ["aac", "pcm-16"];
|
|
8
|
-
readonly gif:
|
|
8
|
+
readonly gif: const[];
|
|
9
9
|
readonly h265: readonly ["aac", "pcm-16"];
|
|
10
10
|
readonly mp3: readonly ["mp3", "pcm-16"];
|
|
11
11
|
readonly prores: readonly ["aac", "pcm-16"];
|
|
@@ -55,6 +55,7 @@ const childProcess = __importStar(require("node:child_process"));
|
|
|
55
55
|
const fs = __importStar(require("node:fs"));
|
|
56
56
|
const readline = __importStar(require("readline"));
|
|
57
57
|
const delete_directory_1 = require("../delete-directory");
|
|
58
|
+
const logger_1 = require("../logger");
|
|
58
59
|
const assert_1 = require("./assert");
|
|
59
60
|
const Connection_1 = require("./Connection");
|
|
60
61
|
const Errors_1 = require("./Errors");
|
|
@@ -78,22 +79,10 @@ class BrowserRunner {
|
|
|
78
79
|
}
|
|
79
80
|
start(options) {
|
|
80
81
|
var _a, _b;
|
|
81
|
-
const { dumpio, env
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
stdio = ['ignore', 'pipe', 'pipe', 'pipe', 'pipe'];
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
stdio = ['ignore', 'ignore', 'ignore', 'pipe', 'pipe'];
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else if (dumpio) {
|
|
92
|
-
stdio = ['pipe', 'pipe', 'pipe'];
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
stdio = ['pipe', 'ignore', 'pipe'];
|
|
96
|
-
}
|
|
82
|
+
const { dumpio, env } = options;
|
|
83
|
+
const stdio = dumpio
|
|
84
|
+
? ['ignore', 'pipe', 'pipe']
|
|
85
|
+
: ['pipe', 'ignore', 'pipe'];
|
|
97
86
|
(0, assert_1.assert)(!this.proc, 'This process has previously been started.');
|
|
98
87
|
this.proc = childProcess.spawn(__classPrivateFieldGet(this, _BrowserRunner_executablePath, "f"), __classPrivateFieldGet(this, _BrowserRunner_processArguments, "f"), {
|
|
99
88
|
// On non-windows platforms, `detached: true` makes child process a
|
|
@@ -106,12 +95,10 @@ class BrowserRunner {
|
|
|
106
95
|
});
|
|
107
96
|
if (dumpio) {
|
|
108
97
|
(_a = this.proc.stdout) === null || _a === void 0 ? void 0 : _a.on('data', (d) => {
|
|
109
|
-
|
|
110
|
-
process.stdout.write(d.toString().trimStart());
|
|
98
|
+
logger_1.Log.verboseAdvanced({ indent: options.indent, logLevel: (0, logger_1.getLogLevel)(), tag: 'chrome' }, d.toString().trim());
|
|
111
99
|
});
|
|
112
100
|
(_b = this.proc.stderr) === null || _b === void 0 ? void 0 : _b.on('data', (d) => {
|
|
113
|
-
|
|
114
|
-
process.stderr.write(d.toString().trimStart());
|
|
101
|
+
logger_1.Log.verboseAdvanced({ indent: options.indent, logLevel: (0, logger_1.getLogLevel)(), tag: 'chrome' }, d.toString().trim());
|
|
115
102
|
});
|
|
116
103
|
}
|
|
117
104
|
__classPrivateFieldSet(this, _BrowserRunner_closed, false, "f");
|
|
@@ -27,8 +27,7 @@ export interface LaunchOptions {
|
|
|
27
27
|
timeout?: number;
|
|
28
28
|
dumpio?: boolean;
|
|
29
29
|
env?: Record<string, string | undefined>;
|
|
30
|
-
pipe?: boolean;
|
|
31
30
|
product?: Product;
|
|
32
|
-
|
|
31
|
+
indent: boolean;
|
|
33
32
|
}
|
|
34
33
|
export declare type PuppeteerNodeLaunchOptions = BrowserLaunchArgumentOptions & LaunchOptions & BrowserConnectOptions;
|
package/dist/browser/Launcher.js
CHANGED
|
@@ -45,7 +45,6 @@ exports.ChromeLauncher = void 0;
|
|
|
45
45
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
46
46
|
const os = __importStar(require("node:os"));
|
|
47
47
|
const path = __importStar(require("node:path"));
|
|
48
|
-
const assert_1 = require("./assert");
|
|
49
48
|
const Browser_1 = require("./Browser");
|
|
50
49
|
const BrowserRunner_1 = require("./BrowserRunner");
|
|
51
50
|
const BrowserFetcher_1 = require("./BrowserFetcher");
|
|
@@ -57,18 +56,12 @@ class ChromeLauncher {
|
|
|
57
56
|
this._preferredRevision = preferredRevision;
|
|
58
57
|
}
|
|
59
58
|
async launch(options) {
|
|
60
|
-
const { args = [], dumpio = false, executablePath,
|
|
59
|
+
const { args = [], dumpio = false, executablePath, env = process.env, defaultViewport, timeout = 60000, debuggingPort, indent, } = options;
|
|
61
60
|
const chromeArguments = args;
|
|
62
61
|
if (!chromeArguments.some((argument) => {
|
|
63
62
|
return argument.startsWith('--remote-debugging-');
|
|
64
63
|
})) {
|
|
65
|
-
|
|
66
|
-
(0, assert_1.assert)(!debuggingPort, 'Browser should be launched with either pipe or debugging port - not both.');
|
|
67
|
-
chromeArguments.push('--remote-debugging-pipe');
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
chromeArguments.push(`--remote-debugging-port=${debuggingPort || 0}`);
|
|
71
|
-
}
|
|
64
|
+
chromeArguments.push(`--remote-debugging-port=${debuggingPort || 0}`);
|
|
72
65
|
}
|
|
73
66
|
// Check for the user data dir argument, which will always be set even
|
|
74
67
|
// with a custom directory specified via the userDataDir option.
|
|
@@ -90,8 +83,7 @@ class ChromeLauncher {
|
|
|
90
83
|
runner.start({
|
|
91
84
|
dumpio,
|
|
92
85
|
env,
|
|
93
|
-
|
|
94
|
-
indentationString,
|
|
86
|
+
indent,
|
|
95
87
|
});
|
|
96
88
|
let browser;
|
|
97
89
|
try {
|
package/dist/call-ffmpeg.js
CHANGED
|
@@ -31,7 +31,9 @@ const dynamicLibraryPathOptions = () => {
|
|
|
31
31
|
exports.dynamicLibraryPathOptions = dynamicLibraryPathOptions;
|
|
32
32
|
const callFf = (bin, args, options) => {
|
|
33
33
|
const executablePath = (0, get_executable_path_1.getExecutablePath)(bin);
|
|
34
|
-
(
|
|
34
|
+
if (!process.env.READ_ONLY_FS) {
|
|
35
|
+
(0, node_fs_1.chmodSync)(executablePath, 0o755);
|
|
36
|
+
}
|
|
35
37
|
return (0, execa_1.default)(executablePath, args.filter(truthy_1.truthy), {
|
|
36
38
|
...(0, exports.dynamicLibraryPathOptions)(),
|
|
37
39
|
...options,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
declare type Style = {
|
|
2
|
+
codes: [number, number];
|
|
3
|
+
name: string;
|
|
4
|
+
wrap?: (input: string, newline: boolean) => string;
|
|
5
|
+
};
|
|
6
|
+
declare type Method = (str: string) => string;
|
|
7
|
+
declare type Colors = {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
visible: boolean;
|
|
10
|
+
styles: Record<string, Style>;
|
|
11
|
+
keys: Record<string, string[]>;
|
|
12
|
+
alias?: (name: string, col: string) => void;
|
|
13
|
+
};
|
|
14
|
+
declare type ColorsWithMethods = Colors & {
|
|
15
|
+
reset: Method;
|
|
16
|
+
bold: Method;
|
|
17
|
+
dim: Method;
|
|
18
|
+
italic: Method;
|
|
19
|
+
underline: Method;
|
|
20
|
+
inverse: Method;
|
|
21
|
+
hidden: Method;
|
|
22
|
+
strikethrough: Method;
|
|
23
|
+
black: Method;
|
|
24
|
+
red: Method;
|
|
25
|
+
green: Method;
|
|
26
|
+
yellow: Method;
|
|
27
|
+
blue: Method;
|
|
28
|
+
magenta: Method;
|
|
29
|
+
white: Method;
|
|
30
|
+
gray: Method;
|
|
31
|
+
bgBlack: Method;
|
|
32
|
+
bgRed: Method;
|
|
33
|
+
bgGreen: Method;
|
|
34
|
+
bgYellow: Method;
|
|
35
|
+
bgBlue: Method;
|
|
36
|
+
bgMagenta: Method;
|
|
37
|
+
bgWhite: Method;
|
|
38
|
+
blackBright: Method;
|
|
39
|
+
redBright: Method;
|
|
40
|
+
greenBright: Method;
|
|
41
|
+
yellowBright: Method;
|
|
42
|
+
blueBright: Method;
|
|
43
|
+
magentaBright: Method;
|
|
44
|
+
whiteBright: Method;
|
|
45
|
+
bgBlackBright: Method;
|
|
46
|
+
bgRedBright: Method;
|
|
47
|
+
bgGreenBright: Method;
|
|
48
|
+
bgYellowBright: Method;
|
|
49
|
+
bgBlueBright: Method;
|
|
50
|
+
bgMagentaBright: Method;
|
|
51
|
+
bgWhiteBright: Method;
|
|
52
|
+
};
|
|
53
|
+
export declare const chalk: ColorsWithMethods;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.chalk = void 0;
|
|
4
|
+
const is_color_supported_1 = require("./is-color-supported");
|
|
5
|
+
const hasColor = () => {
|
|
6
|
+
if (typeof process !== 'undefined' && process.env.FORCE_COLOR) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
return is_color_supported_1.isColorSupported;
|
|
10
|
+
};
|
|
11
|
+
exports.chalk = (() => {
|
|
12
|
+
const colors = {
|
|
13
|
+
enabled: hasColor(),
|
|
14
|
+
visible: true,
|
|
15
|
+
styles: {},
|
|
16
|
+
keys: {},
|
|
17
|
+
};
|
|
18
|
+
const ansi = (st) => {
|
|
19
|
+
const open = `\u001b[${st.codes[0]}m`;
|
|
20
|
+
const close = `\u001b[${st.codes[1]}m`;
|
|
21
|
+
const regex = new RegExp(`\\u001b\\[${st.codes[1]}m`, 'g');
|
|
22
|
+
st.wrap = (input, newline) => {
|
|
23
|
+
if (input.includes(close))
|
|
24
|
+
input = input.replace(regex, close + open);
|
|
25
|
+
const output = open + input + close;
|
|
26
|
+
// see https://github.com/chalk/chalk/pull/92, thanks to the
|
|
27
|
+
// chalk contributors for this fix. However, we've confirmed that
|
|
28
|
+
// this issue is also present in Windows terminals
|
|
29
|
+
return newline ? output.replace(/\r*\n/g, `${close}$&${open}`) : output;
|
|
30
|
+
};
|
|
31
|
+
return st;
|
|
32
|
+
};
|
|
33
|
+
const wrap = (sty, input, newline) => {
|
|
34
|
+
var _a;
|
|
35
|
+
return (_a = sty.wrap) === null || _a === void 0 ? void 0 : _a.call(sty, input, newline);
|
|
36
|
+
};
|
|
37
|
+
const style = (input, stack) => {
|
|
38
|
+
if (input === '' || input === null || input === undefined)
|
|
39
|
+
return '';
|
|
40
|
+
if (colors.enabled === false)
|
|
41
|
+
return input;
|
|
42
|
+
if (colors.visible === false)
|
|
43
|
+
return '';
|
|
44
|
+
let str = String(input);
|
|
45
|
+
const nl = str.includes('\n');
|
|
46
|
+
let n = stack.length;
|
|
47
|
+
while (n-- > 0)
|
|
48
|
+
str = wrap(colors.styles[stack[n]], str, nl);
|
|
49
|
+
return str;
|
|
50
|
+
};
|
|
51
|
+
const define = (name, codes, type) => {
|
|
52
|
+
colors.styles[name] = ansi({ name, codes });
|
|
53
|
+
const keys = colors.keys[type] || (colors.keys[type] = []);
|
|
54
|
+
keys.push(name);
|
|
55
|
+
Reflect.defineProperty(colors, name, {
|
|
56
|
+
configurable: true,
|
|
57
|
+
enumerable: true,
|
|
58
|
+
set(value) {
|
|
59
|
+
var _a;
|
|
60
|
+
(_a = colors.alias) === null || _a === void 0 ? void 0 : _a.call(colors, name, value);
|
|
61
|
+
},
|
|
62
|
+
get() {
|
|
63
|
+
const color = (input) => style(input, color.stack);
|
|
64
|
+
Reflect.setPrototypeOf(color, colors);
|
|
65
|
+
color.stack = this.stack ? this.stack.concat(name) : [name];
|
|
66
|
+
return color;
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
define('reset', [0, 0], 'modifier');
|
|
71
|
+
define('bold', [1, 22], 'modifier');
|
|
72
|
+
define('dim', [2, 22], 'modifier');
|
|
73
|
+
define('italic', [3, 23], 'modifier');
|
|
74
|
+
define('underline', [4, 24], 'modifier');
|
|
75
|
+
define('inverse', [7, 27], 'modifier');
|
|
76
|
+
define('hidden', [8, 28], 'modifier');
|
|
77
|
+
define('strikethrough', [9, 29], 'modifier');
|
|
78
|
+
define('black', [30, 39], 'color');
|
|
79
|
+
define('red', [31, 39], 'color');
|
|
80
|
+
define('green', [32, 39], 'color');
|
|
81
|
+
define('yellow', [33, 39], 'color');
|
|
82
|
+
define('blue', [34, 39], 'color');
|
|
83
|
+
define('magenta', [35, 39], 'color');
|
|
84
|
+
define('white', [37, 39], 'color');
|
|
85
|
+
define('gray', [90, 39], 'color');
|
|
86
|
+
define('grey', [90, 39], 'color');
|
|
87
|
+
define('bgBlack', [40, 49], 'bg');
|
|
88
|
+
define('bgRed', [41, 49], 'bg');
|
|
89
|
+
define('bgGreen', [42, 49], 'bg');
|
|
90
|
+
define('bgYellow', [43, 49], 'bg');
|
|
91
|
+
define('bgBlue', [44, 49], 'bg');
|
|
92
|
+
define('bgMagenta', [45, 49], 'bg');
|
|
93
|
+
define('bgWhite', [47, 49], 'bg');
|
|
94
|
+
define('blackBright', [90, 39], 'bright');
|
|
95
|
+
define('redBright', [91, 39], 'bright');
|
|
96
|
+
define('greenBright', [92, 39], 'bright');
|
|
97
|
+
define('yellowBright', [93, 39], 'bright');
|
|
98
|
+
define('blueBright', [94, 39], 'bright');
|
|
99
|
+
define('magentaBright', [95, 39], 'bright');
|
|
100
|
+
define('whiteBright', [97, 39], 'bright');
|
|
101
|
+
define('bgBlackBright', [100, 49], 'bgBright');
|
|
102
|
+
define('bgRedBright', [101, 49], 'bgBright');
|
|
103
|
+
define('bgGreenBright', [102, 49], 'bgBright');
|
|
104
|
+
define('bgYellowBright', [103, 49], 'bgBright');
|
|
105
|
+
define('bgBlueBright', [104, 49], 'bgBright');
|
|
106
|
+
define('bgMagentaBright', [105, 49], 'bgBright');
|
|
107
|
+
define('bgWhiteBright', [107, 49], 'bgBright');
|
|
108
|
+
colors.alias = (name, color) => {
|
|
109
|
+
// @ts-expect-error
|
|
110
|
+
const fn = colors[color];
|
|
111
|
+
if (typeof fn !== 'function') {
|
|
112
|
+
throw new TypeError('Expected alias to be the name of an existing color (string) or a function');
|
|
113
|
+
}
|
|
114
|
+
if (!fn.stack) {
|
|
115
|
+
Reflect.defineProperty(fn, 'name', { value: name });
|
|
116
|
+
colors.styles[name] = fn;
|
|
117
|
+
fn.stack = [name];
|
|
118
|
+
}
|
|
119
|
+
Reflect.defineProperty(colors, name, {
|
|
120
|
+
configurable: true,
|
|
121
|
+
enumerable: true,
|
|
122
|
+
set(value) {
|
|
123
|
+
var _a;
|
|
124
|
+
(_a = colors.alias) === null || _a === void 0 ? void 0 : _a.call(colors, name, value);
|
|
125
|
+
},
|
|
126
|
+
get() {
|
|
127
|
+
const col = (input) => style(input, col.stack);
|
|
128
|
+
Reflect.setPrototypeOf(col, colors);
|
|
129
|
+
col.stack = this.stack ? this.stack.concat(fn.stack) : fn.stack;
|
|
130
|
+
return col;
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
return colors;
|
|
135
|
+
})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isColorSupported: boolean;
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
var _a;
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.isColorSupported = void 0;
|
|
28
|
+
const tty = __importStar(require("tty"));
|
|
29
|
+
const argv = process.argv || [];
|
|
30
|
+
const env = process.env || {};
|
|
31
|
+
const isDisabled = 'NO_COLOR' in env || argv.includes('--no-color');
|
|
32
|
+
const isForced = 'FORCE_COLOR' in env || argv.includes('--color');
|
|
33
|
+
const isWindows = process.platform === 'win32';
|
|
34
|
+
const isCompatibleTerminal = ((_a = tty === null || tty === void 0 ? void 0 : tty.isatty) === null || _a === void 0 ? void 0 : _a.call(tty, 1)) && env.TERM && env.TERM !== 'dumb';
|
|
35
|
+
const isCI = 'CI' in env &&
|
|
36
|
+
('GITHUB_ACTIONS' in env || 'GITLAB_CI' in env || 'CIRCLECI' in env);
|
|
37
|
+
exports.isColorSupported = !isDisabled && (isForced || isWindows || isCompatibleTerminal || isCI);
|
package/dist/client.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const BrowserSafeApis: {
|
|
2
|
-
getFileExtensionFromCodec: <T extends "
|
|
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
4
|
validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
|
|
5
|
-
getDefaultCrfForCodec: (codec: "
|
|
6
|
-
getValidCrfRanges: (codec: "
|
|
7
|
-
isAudioCodec: (codec: "
|
|
5
|
+
getDefaultCrfForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => number;
|
|
6
|
+
getValidCrfRanges: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => [number, number];
|
|
7
|
+
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | undefined) => boolean;
|
|
8
8
|
proResProfileOptions: readonly ["4444-xq", "4444", "hq", "standard", "light", "proxy"];
|
|
9
9
|
validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
10
10
|
DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
@@ -12,7 +12,7 @@ export declare const BrowserSafeApis: {
|
|
|
12
12
|
readonly h264: readonly ["aac", "pcm-16"];
|
|
13
13
|
readonly 'h264-mkv': readonly ["pcm-16"];
|
|
14
14
|
readonly aac: readonly ["aac", "pcm-16"];
|
|
15
|
-
readonly gif:
|
|
15
|
+
readonly gif: const[];
|
|
16
16
|
readonly h265: readonly ["aac", "pcm-16"];
|
|
17
17
|
readonly mp3: readonly ["mp3", "pcm-16"];
|
|
18
18
|
readonly prores: readonly ["aac", "pcm-16"];
|
|
@@ -21,79 +21,79 @@ export declare const BrowserSafeApis: {
|
|
|
21
21
|
readonly wav: readonly ["pcm-16"];
|
|
22
22
|
};
|
|
23
23
|
defaultFileExtensionMap: {
|
|
24
|
-
|
|
24
|
+
h264: {
|
|
25
25
|
default: import("./file-extensions").FileExtension;
|
|
26
26
|
forAudioCodec: {
|
|
27
|
-
|
|
27
|
+
aac: {
|
|
28
28
|
possible: import("./file-extensions").FileExtension[];
|
|
29
29
|
default: import("./file-extensions").FileExtension;
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
"pcm-16": {
|
|
32
32
|
possible: import("./file-extensions").FileExtension[];
|
|
33
33
|
default: import("./file-extensions").FileExtension;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
h265: {
|
|
38
38
|
default: import("./file-extensions").FileExtension;
|
|
39
39
|
forAudioCodec: {
|
|
40
|
-
|
|
40
|
+
aac: {
|
|
41
41
|
possible: import("./file-extensions").FileExtension[];
|
|
42
42
|
default: import("./file-extensions").FileExtension;
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
"pcm-16": {
|
|
45
45
|
possible: import("./file-extensions").FileExtension[];
|
|
46
46
|
default: import("./file-extensions").FileExtension;
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
vp8: {
|
|
51
51
|
default: import("./file-extensions").FileExtension;
|
|
52
52
|
forAudioCodec: {
|
|
53
53
|
"pcm-16": {
|
|
54
54
|
possible: import("./file-extensions").FileExtension[];
|
|
55
55
|
default: import("./file-extensions").FileExtension;
|
|
56
56
|
};
|
|
57
|
-
|
|
57
|
+
opus: {
|
|
58
58
|
possible: import("./file-extensions").FileExtension[];
|
|
59
59
|
default: import("./file-extensions").FileExtension;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
|
-
|
|
63
|
+
vp9: {
|
|
64
64
|
default: import("./file-extensions").FileExtension;
|
|
65
65
|
forAudioCodec: {
|
|
66
66
|
"pcm-16": {
|
|
67
67
|
possible: import("./file-extensions").FileExtension[];
|
|
68
68
|
default: import("./file-extensions").FileExtension;
|
|
69
69
|
};
|
|
70
|
-
|
|
70
|
+
opus: {
|
|
71
71
|
possible: import("./file-extensions").FileExtension[];
|
|
72
72
|
default: import("./file-extensions").FileExtension;
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
|
-
|
|
76
|
+
mp3: {
|
|
77
77
|
default: import("./file-extensions").FileExtension;
|
|
78
78
|
forAudioCodec: {
|
|
79
|
-
|
|
79
|
+
mp3: {
|
|
80
80
|
possible: import("./file-extensions").FileExtension[];
|
|
81
81
|
default: import("./file-extensions").FileExtension;
|
|
82
82
|
};
|
|
83
|
-
|
|
83
|
+
"pcm-16": {
|
|
84
84
|
possible: import("./file-extensions").FileExtension[];
|
|
85
85
|
default: import("./file-extensions").FileExtension;
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
-
|
|
89
|
+
aac: {
|
|
90
90
|
default: import("./file-extensions").FileExtension;
|
|
91
91
|
forAudioCodec: {
|
|
92
|
-
|
|
92
|
+
aac: {
|
|
93
93
|
possible: import("./file-extensions").FileExtension[];
|
|
94
94
|
default: import("./file-extensions").FileExtension;
|
|
95
95
|
};
|
|
96
|
-
|
|
96
|
+
"pcm-16": {
|
|
97
97
|
possible: import("./file-extensions").FileExtension[];
|
|
98
98
|
default: import("./file-extensions").FileExtension;
|
|
99
99
|
};
|
|
@@ -111,11 +111,11 @@ export declare const BrowserSafeApis: {
|
|
|
111
111
|
prores: {
|
|
112
112
|
default: import("./file-extensions").FileExtension;
|
|
113
113
|
forAudioCodec: {
|
|
114
|
-
|
|
114
|
+
aac: {
|
|
115
115
|
possible: import("./file-extensions").FileExtension[];
|
|
116
116
|
default: import("./file-extensions").FileExtension;
|
|
117
117
|
};
|
|
118
|
-
|
|
118
|
+
"pcm-16": {
|
|
119
119
|
possible: import("./file-extensions").FileExtension[];
|
|
120
120
|
default: import("./file-extensions").FileExtension;
|
|
121
121
|
};
|
|
@@ -133,19 +133,7 @@ export declare const BrowserSafeApis: {
|
|
|
133
133
|
gif: {
|
|
134
134
|
default: import("./file-extensions").FileExtension;
|
|
135
135
|
forAudioCodec: {
|
|
136
|
-
|
|
137
|
-
possible: import("./file-extensions").FileExtension[];
|
|
138
|
-
default: import("./file-extensions").FileExtension;
|
|
139
|
-
};
|
|
140
|
-
aac: {
|
|
141
|
-
possible: import("./file-extensions").FileExtension[];
|
|
142
|
-
default: import("./file-extensions").FileExtension;
|
|
143
|
-
};
|
|
144
|
-
mp3: {
|
|
145
|
-
possible: import("./file-extensions").FileExtension[];
|
|
146
|
-
default: import("./file-extensions").FileExtension;
|
|
147
|
-
};
|
|
148
|
-
opus: {
|
|
136
|
+
[x: string]: {
|
|
149
137
|
possible: import("./file-extensions").FileExtension[];
|
|
150
138
|
default: import("./file-extensions").FileExtension;
|
|
151
139
|
};
|
|
@@ -153,21 +141,13 @@ export declare const BrowserSafeApis: {
|
|
|
153
141
|
};
|
|
154
142
|
};
|
|
155
143
|
defaultAudioCodecs: {
|
|
156
|
-
aac: {
|
|
157
|
-
compressed: "pcm-16" | "aac" | null;
|
|
158
|
-
lossless: "pcm-16" | "aac" | null;
|
|
159
|
-
};
|
|
160
|
-
mp3: {
|
|
161
|
-
compressed: "pcm-16" | "mp3" | null;
|
|
162
|
-
lossless: "pcm-16" | "mp3" | null;
|
|
163
|
-
};
|
|
164
144
|
h264: {
|
|
165
|
-
compressed: "
|
|
166
|
-
lossless: "
|
|
145
|
+
compressed: "aac" | "pcm-16" | null;
|
|
146
|
+
lossless: "aac" | "pcm-16" | null;
|
|
167
147
|
};
|
|
168
148
|
h265: {
|
|
169
|
-
compressed: "
|
|
170
|
-
lossless: "
|
|
149
|
+
compressed: "aac" | "pcm-16" | null;
|
|
150
|
+
lossless: "aac" | "pcm-16" | null;
|
|
171
151
|
};
|
|
172
152
|
vp8: {
|
|
173
153
|
compressed: "pcm-16" | "opus" | null;
|
|
@@ -177,27 +157,35 @@ export declare const BrowserSafeApis: {
|
|
|
177
157
|
compressed: "pcm-16" | "opus" | null;
|
|
178
158
|
lossless: "pcm-16" | "opus" | null;
|
|
179
159
|
};
|
|
160
|
+
mp3: {
|
|
161
|
+
compressed: "mp3" | "pcm-16" | null;
|
|
162
|
+
lossless: "mp3" | "pcm-16" | null;
|
|
163
|
+
};
|
|
164
|
+
aac: {
|
|
165
|
+
compressed: "aac" | "pcm-16" | null;
|
|
166
|
+
lossless: "aac" | "pcm-16" | null;
|
|
167
|
+
};
|
|
180
168
|
wav: {
|
|
181
169
|
compressed: "pcm-16" | null;
|
|
182
170
|
lossless: "pcm-16" | null;
|
|
183
171
|
};
|
|
184
172
|
prores: {
|
|
185
|
-
compressed: "
|
|
186
|
-
lossless: "
|
|
173
|
+
compressed: "aac" | "pcm-16" | null;
|
|
174
|
+
lossless: "aac" | "pcm-16" | null;
|
|
187
175
|
};
|
|
188
176
|
"h264-mkv": {
|
|
189
177
|
compressed: "pcm-16" | null;
|
|
190
178
|
lossless: "pcm-16" | null;
|
|
191
179
|
};
|
|
192
180
|
gif: {
|
|
193
|
-
compressed:
|
|
194
|
-
lossless:
|
|
181
|
+
compressed: any;
|
|
182
|
+
lossless: any;
|
|
195
183
|
};
|
|
196
184
|
};
|
|
197
|
-
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "
|
|
198
|
-
validateOutputFilename: <T_1 extends "
|
|
185
|
+
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, }: {
|
|
199
187
|
codec: T_1;
|
|
200
|
-
audioCodec: "
|
|
188
|
+
audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
201
189
|
extension: string;
|
|
202
190
|
preferLossless: boolean;
|
|
203
191
|
}) => void;
|
|
@@ -211,6 +199,6 @@ export declare const BrowserSafeApis: {
|
|
|
211
199
|
muteOption: import(".").RemotionOption;
|
|
212
200
|
videoCodecOption: import(".").RemotionOption;
|
|
213
201
|
};
|
|
214
|
-
codecSupportsCrf: (codec: "
|
|
215
|
-
codecSupportsVideoBitrate: (codec: "
|
|
202
|
+
codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
|
|
203
|
+
codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
|
|
216
204
|
};
|
|
@@ -41,10 +41,10 @@ exports.compose = compose;
|
|
|
41
41
|
const callCompositor = (payload) => {
|
|
42
42
|
return new Promise((resolve, reject) => {
|
|
43
43
|
const execPath = (0, get_executable_path_1.getExecutablePath)('compositor');
|
|
44
|
-
(
|
|
44
|
+
if (!process.env.READ_ONLY_FS) {
|
|
45
|
+
(0, node_fs_1.chmodSync)(execPath, 0o755);
|
|
46
|
+
}
|
|
45
47
|
const child = (0, node_child_process_1.spawn)(execPath, [payload], (0, call_ffmpeg_1.dynamicLibraryPathOptions)());
|
|
46
|
-
child.stdin.write(payload);
|
|
47
|
-
child.stdin.end();
|
|
48
48
|
const stderrChunks = [];
|
|
49
49
|
child.stderr.on('data', (d) => stderrChunks.push(d));
|
|
50
50
|
child.on('close', (code) => {
|
|
@@ -65,6 +65,8 @@ const callCompositor = (payload) => {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
|
+
child.stdin.write(payload);
|
|
69
|
+
child.stdin.end();
|
|
68
70
|
});
|
|
69
71
|
};
|
|
70
72
|
exports.callCompositor = callCompositor;
|
|
@@ -7,6 +7,6 @@ declare type Compositor = {
|
|
|
7
7
|
pid: number | null;
|
|
8
8
|
};
|
|
9
9
|
export declare const getIdealMaximumFrameCacheItems: () => number;
|
|
10
|
-
export declare const startLongRunningCompositor: (maximumFrameCacheItems: number, verbose: boolean) => Compositor;
|
|
11
|
-
export declare const startCompositor: <T extends keyof CompositorCommand>(type: T, payload: CompositorCommand[T]) => Compositor;
|
|
10
|
+
export declare const startLongRunningCompositor: (maximumFrameCacheItems: number, verbose: boolean, indent: boolean) => Compositor;
|
|
11
|
+
export declare const startCompositor: <T extends keyof CompositorCommand>(type: T, payload: CompositorCommand[T], indent: boolean) => Compositor;
|
|
12
12
|
export {};
|