@remotion/renderer 4.1.0-alpha3 → 4.1.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/dist/browser/Browser.d.ts +7 -6
- package/dist/browser/Browser.js +13 -13
- package/dist/browser/BrowserPage.d.ts +13 -2
- package/dist/browser/BrowserPage.js +45 -13
- package/dist/browser/BrowserRunner.js +2 -2
- package/dist/browser/Connection.d.ts +9 -3
- package/dist/browser/Connection.js +11 -3
- package/dist/browser/ConsoleMessage.d.ts +8 -1
- package/dist/browser/ConsoleMessage.js +2 -1
- package/dist/browser/ExecutionContext.js +4 -4
- package/dist/browser/FrameManager.js +2 -2
- package/dist/browser/LaunchOptions.d.ts +2 -0
- package/dist/browser/Launcher.js +2 -1
- package/dist/browser/NetworkManager.d.ts +4 -1
- package/dist/browser/Target.d.ts +2 -1
- package/dist/browser/Target.js +3 -1
- package/dist/browser/devtools-types.d.ts +59 -0
- package/dist/browser/should-log-message.js +8 -0
- package/dist/chalk/index.d.ts +2 -1
- package/dist/chalk/index.js +3 -8
- package/dist/chalk/is-color-supported.d.ts +1 -1
- package/dist/chalk/is-color-supported.js +18 -10
- package/dist/compositor/compositor.d.ts +3 -2
- package/dist/compositor/compositor.js +6 -5
- package/dist/create-ffmpeg-merge-filter.js +1 -2
- package/dist/cycle-browser-tabs.d.ts +2 -1
- package/dist/cycle-browser-tabs.js +2 -2
- package/dist/format-logs.d.ts +3 -0
- package/dist/format-logs.js +201 -0
- package/dist/get-browser-instance.d.ts +3 -2
- package/dist/get-browser-instance.js +5 -5
- package/dist/get-compositions.d.ts +6 -5
- package/dist/get-compositions.js +7 -6
- package/dist/index.d.ts +21 -19
- package/dist/logger.d.ts +1 -2
- package/dist/logger.js +7 -12
- package/dist/offthread-video-server.d.ts +3 -2
- package/dist/offthread-video-server.js +4 -3
- package/dist/open-browser.d.ts +3 -2
- package/dist/open-browser.js +7 -5
- package/dist/perf.js +4 -2
- package/dist/prepare-server.d.ts +3 -2
- package/dist/prepare-server.js +4 -4
- package/dist/prespawn-ffmpeg.d.ts +2 -1
- package/dist/prespawn-ffmpeg.js +2 -30
- package/dist/puppeteer-evaluate.d.ts +4 -1
- package/dist/puppeteer-evaluate.js +5 -5
- package/dist/render-frames.d.ts +14 -7
- package/dist/render-frames.js +18 -14
- package/dist/render-media.d.ts +14 -7
- package/dist/render-media.js +12 -14
- package/dist/render-still.d.ts +11 -5
- package/dist/render-still.js +11 -11
- package/dist/replace-browser.d.ts +2 -1
- package/dist/replace-browser.js +2 -2
- package/dist/screenshot-task.js +4 -2
- package/dist/seek-to-frame.js +1 -1
- package/dist/select-composition.d.ts +9 -4
- package/dist/select-composition.js +15 -14
- package/dist/serve-static.d.ts +2 -1
- package/dist/serve-static.js +1 -1
- package/dist/set-props-and-env.js +5 -5
- package/dist/stitch-frames-to-video.d.ts +2 -1
- package/dist/stitch-frames-to-video.js +12 -22
- package/dist/take-frame-and-compose.js +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const isColorSupported: boolean;
|
|
1
|
+
export declare const isColorSupported: () => boolean;
|
|
@@ -22,16 +22,24 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var _a;
|
|
26
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
26
|
exports.isColorSupported = void 0;
|
|
28
27
|
const tty = __importStar(require("tty"));
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
const isColorSupported = () => {
|
|
29
|
+
var _a;
|
|
30
|
+
const env = process.env || {};
|
|
31
|
+
const isForceDisabled = 'NO_COLOR' in env;
|
|
32
|
+
if (isForceDisabled) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
const isForced = 'FORCE_COLOR' in env;
|
|
36
|
+
if (isForced) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
const isWindows = process.platform === 'win32';
|
|
40
|
+
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';
|
|
41
|
+
const isCI = 'CI' in env &&
|
|
42
|
+
('GITHUB_ACTIONS' in env || 'GITLAB_CI' in env || 'CIRCLECI' in env);
|
|
43
|
+
return isWindows || isCompatibleTerminal || isCI;
|
|
44
|
+
};
|
|
45
|
+
exports.isColorSupported = isColorSupported;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { CompositorCommand } from './payloads';
|
|
3
|
+
import type { LogLevel } from '../log-level';
|
|
3
4
|
export type Compositor = {
|
|
4
5
|
finishCommands: () => void;
|
|
5
6
|
executeCommand: <T extends keyof CompositorCommand>(type: T, payload: CompositorCommand[T]) => Promise<Buffer>;
|
|
@@ -7,5 +8,5 @@ export type Compositor = {
|
|
|
7
8
|
pid: number | null;
|
|
8
9
|
};
|
|
9
10
|
export declare const getIdealMaximumFrameCacheItems: () => number;
|
|
10
|
-
export declare const startLongRunningCompositor: (maximumFrameCacheItems: number,
|
|
11
|
-
export declare const startCompositor: <T extends keyof CompositorCommand>(type: T, payload: CompositorCommand[T], indent: boolean) => Compositor;
|
|
11
|
+
export declare const startLongRunningCompositor: (maximumFrameCacheItems: number, logLevel: LogLevel, indent: boolean) => Compositor;
|
|
12
|
+
export declare const startCompositor: <T extends keyof CompositorCommand>(type: T, payload: CompositorCommand[T], logLevel: LogLevel, indent: boolean) => Compositor;
|
|
@@ -13,6 +13,7 @@ const logger_1 = require("../logger");
|
|
|
13
13
|
const compose_1 = require("./compose");
|
|
14
14
|
const get_executable_path_1 = require("./get-executable-path");
|
|
15
15
|
const make_nonce_1 = require("./make-nonce");
|
|
16
|
+
const log_level_1 = require("../log-level");
|
|
16
17
|
const getIdealMaximumFrameCacheItems = () => {
|
|
17
18
|
const freeMemory = node_os_1.default.freemem();
|
|
18
19
|
// Assuming 1 frame is approximately 6MB
|
|
@@ -23,15 +24,15 @@ const getIdealMaximumFrameCacheItems = () => {
|
|
|
23
24
|
return Math.max(100, Math.min(max, 1000));
|
|
24
25
|
};
|
|
25
26
|
exports.getIdealMaximumFrameCacheItems = getIdealMaximumFrameCacheItems;
|
|
26
|
-
const startLongRunningCompositor = (maximumFrameCacheItems,
|
|
27
|
+
const startLongRunningCompositor = (maximumFrameCacheItems, logLevel, indent) => {
|
|
27
28
|
return (0, exports.startCompositor)('StartLongRunningProcess', {
|
|
28
29
|
concurrency: (0, get_concurrency_1.getActualConcurrency)(null),
|
|
29
30
|
maximum_frame_cache_items: maximumFrameCacheItems,
|
|
30
|
-
verbose,
|
|
31
|
-
}, indent);
|
|
31
|
+
verbose: (0, log_level_1.isEqualOrBelowLogLevel)(logLevel, 'verbose'),
|
|
32
|
+
}, logLevel, indent);
|
|
32
33
|
};
|
|
33
34
|
exports.startLongRunningCompositor = startLongRunningCompositor;
|
|
34
|
-
const startCompositor = (type, payload, indent) => {
|
|
35
|
+
const startCompositor = (type, payload, logLevel, indent) => {
|
|
35
36
|
var _a;
|
|
36
37
|
const bin = (0, get_executable_path_1.getExecutablePath)('compositor');
|
|
37
38
|
if (!process.env.READ_ONLY_FS) {
|
|
@@ -45,7 +46,7 @@ const startCompositor = (type, payload, indent) => {
|
|
|
45
46
|
const waiters = new Map();
|
|
46
47
|
const onMessage = (statusType, nonce, data) => {
|
|
47
48
|
if (nonce === '0') {
|
|
48
|
-
logger_1.Log.verboseAdvanced({ indent, logLevel
|
|
49
|
+
logger_1.Log.verboseAdvanced({ indent, logLevel, tag: 'compositor' }, data.toString('utf8'));
|
|
49
50
|
}
|
|
50
51
|
if (waiters.has(nonce)) {
|
|
51
52
|
if (statusType === 'error') {
|
|
@@ -12,7 +12,6 @@ const createFfmpegMergeFilter = ({ inputs, }) => {
|
|
|
12
12
|
];
|
|
13
13
|
return `[${index}:a]${filters.filter(truthy_1.truthy).join(',')}[padded${index}]`;
|
|
14
14
|
});
|
|
15
|
-
const normalize = ':normalize=0';
|
|
16
15
|
return [
|
|
17
16
|
...pads,
|
|
18
17
|
`${new Array(inputs.length)
|
|
@@ -20,7 +19,7 @@ const createFfmpegMergeFilter = ({ inputs, }) => {
|
|
|
20
19
|
.map((_, i) => {
|
|
21
20
|
return `[padded${i}]`;
|
|
22
21
|
})
|
|
23
|
-
.join('')}amix=inputs=${inputs.length}:dropout_transition=0
|
|
22
|
+
.join('')}amix=inputs=${inputs.length}:dropout_transition=0:normalize=0[${exports.OUTPUT_FILTER_NAME}]`,
|
|
24
23
|
].join(';');
|
|
25
24
|
};
|
|
26
25
|
exports.createFfmpegMergeFilter = createFfmpegMergeFilter;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import type { LogLevel } from './log-level';
|
|
1
2
|
import type { BrowserReplacer } from './replace-browser';
|
|
2
|
-
export declare const cycleBrowserTabs: (puppeteerInstance: BrowserReplacer, concurrency: number) => {
|
|
3
|
+
export declare const cycleBrowserTabs: (puppeteerInstance: BrowserReplacer, concurrency: number, logLevel: LogLevel, indent: boolean) => {
|
|
3
4
|
stopCycling: () => void;
|
|
4
5
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cycleBrowserTabs = void 0;
|
|
4
|
-
const cycleBrowserTabs = (puppeteerInstance, concurrency) => {
|
|
4
|
+
const cycleBrowserTabs = (puppeteerInstance, concurrency, logLevel, indent) => {
|
|
5
5
|
if (concurrency <= 1) {
|
|
6
6
|
return {
|
|
7
7
|
stopCycling: () => undefined,
|
|
@@ -14,7 +14,7 @@ const cycleBrowserTabs = (puppeteerInstance, concurrency) => {
|
|
|
14
14
|
interval = setTimeout(() => {
|
|
15
15
|
puppeteerInstance
|
|
16
16
|
.getBrowser()
|
|
17
|
-
.pages()
|
|
17
|
+
.pages(logLevel, indent)
|
|
18
18
|
.then((pages) => {
|
|
19
19
|
if (pages.length === 0) {
|
|
20
20
|
return;
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatObjectPreview = exports.formatRemoteObject = void 0;
|
|
4
|
+
const chalk_1 = require("./chalk");
|
|
5
|
+
const formatRemoteObject = (remoteObject) => {
|
|
6
|
+
if (remoteObject.preview) {
|
|
7
|
+
return (0, exports.formatObjectPreview)(remoteObject.preview);
|
|
8
|
+
}
|
|
9
|
+
if (remoteObject.type === 'string') {
|
|
10
|
+
return chalk_1.chalk.reset(`${remoteObject.value}`);
|
|
11
|
+
}
|
|
12
|
+
if (remoteObject.type === 'number') {
|
|
13
|
+
return chalk_1.chalk.yellow(`${remoteObject.value}`);
|
|
14
|
+
}
|
|
15
|
+
if (remoteObject.type === 'bigint') {
|
|
16
|
+
return chalk_1.chalk.yellow(`${remoteObject.description}`);
|
|
17
|
+
}
|
|
18
|
+
if (remoteObject.type === 'boolean') {
|
|
19
|
+
return chalk_1.chalk.yellow(`${remoteObject.value}`);
|
|
20
|
+
}
|
|
21
|
+
if (remoteObject.type === 'function') {
|
|
22
|
+
return chalk_1.chalk.cyan(String(remoteObject.description));
|
|
23
|
+
}
|
|
24
|
+
if (remoteObject.type === 'object') {
|
|
25
|
+
if (remoteObject.subtype === 'null') {
|
|
26
|
+
return chalk_1.chalk.white(`null`);
|
|
27
|
+
}
|
|
28
|
+
return chalk_1.chalk.reset(`Object`);
|
|
29
|
+
}
|
|
30
|
+
if (remoteObject.type === 'symbol') {
|
|
31
|
+
return chalk_1.chalk.green(`${remoteObject.description}`);
|
|
32
|
+
}
|
|
33
|
+
if (remoteObject.type === 'undefined') {
|
|
34
|
+
return chalk_1.chalk.gray(`undefined`);
|
|
35
|
+
}
|
|
36
|
+
throw new Error('unhandled remote object');
|
|
37
|
+
};
|
|
38
|
+
exports.formatRemoteObject = formatRemoteObject;
|
|
39
|
+
const formatObjectPreview = (preview) => {
|
|
40
|
+
if (typeof preview === 'undefined') {
|
|
41
|
+
return '';
|
|
42
|
+
}
|
|
43
|
+
if (preview.type === 'object') {
|
|
44
|
+
if (preview.subtype === 'date') {
|
|
45
|
+
return chalk_1.chalk.reset(`Date { ${chalk_1.chalk.magenta(String(preview.description))} }`);
|
|
46
|
+
}
|
|
47
|
+
const properties = preview.properties.map((property) => {
|
|
48
|
+
return chalk_1.chalk.reset(`${property.name}: ${formatProperty(property)}`);
|
|
49
|
+
});
|
|
50
|
+
if (preview.subtype === 'array') {
|
|
51
|
+
return chalk_1.chalk.reset(`[ ${preview.properties.map((p) => formatProperty(p)).join(', ')} ]`);
|
|
52
|
+
}
|
|
53
|
+
if (preview.subtype === 'arraybuffer') {
|
|
54
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
55
|
+
}
|
|
56
|
+
if (preview.subtype === 'dataview') {
|
|
57
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
58
|
+
}
|
|
59
|
+
if (preview.subtype === 'generator') {
|
|
60
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
61
|
+
}
|
|
62
|
+
if (preview.subtype === 'iterator') {
|
|
63
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
64
|
+
}
|
|
65
|
+
if (preview.subtype === 'map') {
|
|
66
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
67
|
+
}
|
|
68
|
+
if (preview.subtype === 'node') {
|
|
69
|
+
return chalk_1.chalk.magenta(`<${preview.description}>`);
|
|
70
|
+
}
|
|
71
|
+
if (preview.subtype === 'null') {
|
|
72
|
+
return chalk_1.chalk.white(String(preview.description));
|
|
73
|
+
}
|
|
74
|
+
if (preview.subtype === 'promise') {
|
|
75
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
76
|
+
}
|
|
77
|
+
if (preview.subtype === 'proxy') {
|
|
78
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
79
|
+
}
|
|
80
|
+
if (preview.subtype === 'regexp') {
|
|
81
|
+
return chalk_1.chalk.red(String(preview.description));
|
|
82
|
+
}
|
|
83
|
+
if (preview.subtype === 'set') {
|
|
84
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
85
|
+
}
|
|
86
|
+
if (preview.subtype === 'typedarray') {
|
|
87
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
88
|
+
}
|
|
89
|
+
if (preview.subtype === 'error') {
|
|
90
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
91
|
+
}
|
|
92
|
+
if (preview.subtype === 'wasmvalue') {
|
|
93
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
94
|
+
}
|
|
95
|
+
if (preview.subtype === 'weakmap') {
|
|
96
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
97
|
+
}
|
|
98
|
+
if (preview.subtype === 'weakset') {
|
|
99
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
100
|
+
}
|
|
101
|
+
if (preview.subtype === 'webassemblymemory') {
|
|
102
|
+
return chalk_1.chalk.reset(String(preview.description));
|
|
103
|
+
}
|
|
104
|
+
if (properties.length === 0) {
|
|
105
|
+
return chalk_1.chalk.reset('{}');
|
|
106
|
+
}
|
|
107
|
+
return chalk_1.chalk.reset(`{ ${properties.join(', ')} }`);
|
|
108
|
+
}
|
|
109
|
+
return '';
|
|
110
|
+
};
|
|
111
|
+
exports.formatObjectPreview = formatObjectPreview;
|
|
112
|
+
const formatProperty = (property) => {
|
|
113
|
+
if (property.type === 'string') {
|
|
114
|
+
return chalk_1.chalk.green(`"${property.value}"`);
|
|
115
|
+
}
|
|
116
|
+
if (property.type === 'object') {
|
|
117
|
+
if (!property.subtype && property.value === 'Object') {
|
|
118
|
+
return chalk_1.chalk.reset(`{…}`);
|
|
119
|
+
}
|
|
120
|
+
if (property.subtype === 'date') {
|
|
121
|
+
return chalk_1.chalk.reset(`Date { ${chalk_1.chalk.magenta(String(property.value))} }`);
|
|
122
|
+
}
|
|
123
|
+
if (property.subtype === 'arraybuffer') {
|
|
124
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
125
|
+
}
|
|
126
|
+
if (property.subtype === 'array') {
|
|
127
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
128
|
+
}
|
|
129
|
+
if (property.subtype === 'dataview') {
|
|
130
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
131
|
+
}
|
|
132
|
+
if (property.subtype === 'error') {
|
|
133
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
134
|
+
}
|
|
135
|
+
if (property.subtype === 'generator') {
|
|
136
|
+
return chalk_1.chalk.reset(`[generator ${property.value}]`);
|
|
137
|
+
}
|
|
138
|
+
if (property.subtype === 'iterator') {
|
|
139
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
140
|
+
}
|
|
141
|
+
if (property.subtype === 'map') {
|
|
142
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
143
|
+
}
|
|
144
|
+
if (property.subtype === 'node') {
|
|
145
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
146
|
+
}
|
|
147
|
+
if (property.subtype === 'null') {
|
|
148
|
+
return chalk_1.chalk.white(`${property.value}`);
|
|
149
|
+
}
|
|
150
|
+
if (property.subtype === 'promise') {
|
|
151
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
152
|
+
}
|
|
153
|
+
if (property.subtype === 'proxy') {
|
|
154
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
155
|
+
}
|
|
156
|
+
if (property.subtype === 'regexp') {
|
|
157
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
158
|
+
}
|
|
159
|
+
if (property.subtype === 'set') {
|
|
160
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
161
|
+
}
|
|
162
|
+
if (property.subtype === 'typedarray') {
|
|
163
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
164
|
+
}
|
|
165
|
+
if (property.subtype === 'wasmvalue') {
|
|
166
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
167
|
+
}
|
|
168
|
+
if (property.subtype === 'webassemblymemory') {
|
|
169
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
170
|
+
}
|
|
171
|
+
if (property.subtype === 'weakmap') {
|
|
172
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
173
|
+
}
|
|
174
|
+
if (property.subtype === 'weakset') {
|
|
175
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
176
|
+
}
|
|
177
|
+
return chalk_1.chalk.reset(`${property.value}`);
|
|
178
|
+
}
|
|
179
|
+
if (property.type === 'accessor') {
|
|
180
|
+
return chalk_1.chalk.gray(`get()`);
|
|
181
|
+
}
|
|
182
|
+
if (property.type === 'bigint') {
|
|
183
|
+
return chalk_1.chalk.yellow(`${property.value}`);
|
|
184
|
+
}
|
|
185
|
+
if (property.type === 'boolean') {
|
|
186
|
+
return chalk_1.chalk.yellow(`${property.value}`);
|
|
187
|
+
}
|
|
188
|
+
if (property.type === 'function') {
|
|
189
|
+
return chalk_1.chalk.cyan(`Function`);
|
|
190
|
+
}
|
|
191
|
+
if (property.type === 'number') {
|
|
192
|
+
return chalk_1.chalk.yellow(`${property.value}`);
|
|
193
|
+
}
|
|
194
|
+
if (property.type === 'symbol') {
|
|
195
|
+
return chalk_1.chalk.green(`${property.value}`);
|
|
196
|
+
}
|
|
197
|
+
if (property.type === 'undefined') {
|
|
198
|
+
return chalk_1.chalk.gray(`undefined`);
|
|
199
|
+
}
|
|
200
|
+
throw new Error('unexpected property type ' + JSON.stringify(property));
|
|
201
|
+
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import type { BrowserExecutable } from './browser-executable';
|
|
2
2
|
import type { HeadlessBrowser } from './browser/Browser';
|
|
3
3
|
import type { Page } from './browser/BrowserPage';
|
|
4
|
+
import type { LogLevel } from './log-level';
|
|
4
5
|
import type { ChromiumOptions } from './open-browser';
|
|
5
6
|
import type { AnySourceMapConsumer } from './symbolicate-stacktrace';
|
|
6
|
-
export declare const getPageAndCleanupFn: ({ passedInInstance, browserExecutable, chromiumOptions, context, forceDeviceScaleFactor, indent,
|
|
7
|
+
export declare const getPageAndCleanupFn: ({ passedInInstance, browserExecutable, chromiumOptions, context, forceDeviceScaleFactor, indent, logLevel, }: {
|
|
7
8
|
passedInInstance: HeadlessBrowser | undefined;
|
|
8
9
|
browserExecutable: BrowserExecutable | null;
|
|
9
10
|
chromiumOptions: ChromiumOptions;
|
|
10
11
|
context: AnySourceMapConsumer | null;
|
|
11
12
|
indent: boolean;
|
|
12
13
|
forceDeviceScaleFactor: number | undefined;
|
|
13
|
-
|
|
14
|
+
logLevel: LogLevel;
|
|
14
15
|
}) => Promise<{
|
|
15
16
|
cleanup: () => void;
|
|
16
17
|
page: Page;
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getPageAndCleanupFn = void 0;
|
|
4
4
|
const browser_1 = require("./browser");
|
|
5
5
|
const open_browser_1 = require("./open-browser");
|
|
6
|
-
const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromiumOptions, context, forceDeviceScaleFactor, indent,
|
|
6
|
+
const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromiumOptions, context, forceDeviceScaleFactor, indent, logLevel, }) => {
|
|
7
7
|
if (passedInInstance) {
|
|
8
|
-
const page = await passedInInstance.newPage(context);
|
|
8
|
+
const page = await passedInInstance.newPage(context, logLevel, indent);
|
|
9
9
|
return {
|
|
10
10
|
page,
|
|
11
11
|
cleanup: () => {
|
|
@@ -23,15 +23,15 @@ const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromi
|
|
|
23
23
|
chromiumOptions,
|
|
24
24
|
forceDeviceScaleFactor,
|
|
25
25
|
indent,
|
|
26
|
-
shouldDumpIo,
|
|
27
26
|
viewport: null,
|
|
27
|
+
logLevel,
|
|
28
28
|
});
|
|
29
|
-
const browserPage = await browserInstance.newPage(context);
|
|
29
|
+
const browserPage = await browserInstance.newPage(context, logLevel, indent);
|
|
30
30
|
return {
|
|
31
31
|
page: browserPage,
|
|
32
32
|
cleanup: () => {
|
|
33
33
|
// Close whole browser that was just created and don't wait for it to finish.
|
|
34
|
-
browserInstance.close(true).catch((err) => {
|
|
34
|
+
browserInstance.close(true, logLevel, indent).catch((err) => {
|
|
35
35
|
console.error('Was not able to close puppeteer page', err);
|
|
36
36
|
});
|
|
37
37
|
},
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { VideoConfig } from 'remotion';
|
|
2
2
|
import type { BrowserExecutable } from './browser-executable';
|
|
3
3
|
import type { BrowserLog } from './browser-log';
|
|
4
4
|
import type { HeadlessBrowser } from './browser/Browser';
|
|
5
5
|
import type { ChromiumOptions } from './open-browser';
|
|
6
6
|
import type { RemotionServer } from './prepare-server';
|
|
7
|
+
import { type LogLevel } from './log-level';
|
|
7
8
|
type InternalGetCompositionsOptions = {
|
|
8
9
|
inputProps: Record<string, unknown>;
|
|
9
10
|
envVariables: Record<string, string>;
|
|
@@ -15,7 +16,7 @@ type InternalGetCompositionsOptions = {
|
|
|
15
16
|
port: number | null;
|
|
16
17
|
server: RemotionServer | undefined;
|
|
17
18
|
indent: boolean;
|
|
18
|
-
|
|
19
|
+
logLevel: LogLevel;
|
|
19
20
|
serveUrlOrWebpackUrl: string;
|
|
20
21
|
};
|
|
21
22
|
export type GetCompositionsOptions = {
|
|
@@ -27,12 +28,12 @@ export type GetCompositionsOptions = {
|
|
|
27
28
|
timeoutInMilliseconds?: number;
|
|
28
29
|
chromiumOptions?: ChromiumOptions;
|
|
29
30
|
port?: number | null;
|
|
30
|
-
|
|
31
|
+
logLevel?: LogLevel;
|
|
31
32
|
};
|
|
32
|
-
export declare const internalGetCompositions: ({ browserExecutable, chromiumOptions, envVariables, indent, inputProps, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds,
|
|
33
|
+
export declare const internalGetCompositions: ({ browserExecutable, chromiumOptions, envVariables, indent, inputProps, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, }: InternalGetCompositionsOptions) => Promise<VideoConfig[]>;
|
|
33
34
|
/**
|
|
34
35
|
* @description Gets the compositions defined in a Remotion project based on a Webpack bundle.
|
|
35
36
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/get-compositions)
|
|
36
37
|
*/
|
|
37
|
-
export declare const getCompositions: (serveUrlOrWebpackUrl: string, config?: GetCompositionsOptions) => Promise<
|
|
38
|
+
export declare const getCompositions: (serveUrlOrWebpackUrl: string, config?: GetCompositionsOptions) => Promise<VideoConfig[]>;
|
|
38
39
|
export {};
|
package/dist/get-compositions.js
CHANGED
|
@@ -10,6 +10,7 @@ const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
|
10
10
|
const seek_to_frame_1 = require("./seek-to-frame");
|
|
11
11
|
const set_props_and_env_1 = require("./set-props-and-env");
|
|
12
12
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
13
|
+
const logger_1 = require("./logger");
|
|
13
14
|
const innerGetCompositions = async ({ envVariables, inputProps, onBrowserLog, page, proxyPort, serveUrl, timeoutInMilliseconds, }) => {
|
|
14
15
|
if (onBrowserLog) {
|
|
15
16
|
page.on('console', (log) => {
|
|
@@ -44,7 +45,7 @@ const innerGetCompositions = async ({ envVariables, inputProps, onBrowserLog, pa
|
|
|
44
45
|
args: [],
|
|
45
46
|
});
|
|
46
47
|
await (0, seek_to_frame_1.waitForReady)(page);
|
|
47
|
-
const result = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
48
|
+
const { value: result } = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
48
49
|
pageFunction: () => {
|
|
49
50
|
return window.getStaticCompositions();
|
|
50
51
|
},
|
|
@@ -54,7 +55,7 @@ const innerGetCompositions = async ({ envVariables, inputProps, onBrowserLog, pa
|
|
|
54
55
|
});
|
|
55
56
|
return result;
|
|
56
57
|
};
|
|
57
|
-
const internalGetCompositions = async ({ browserExecutable, chromiumOptions, envVariables, indent, inputProps, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds,
|
|
58
|
+
const internalGetCompositions = async ({ browserExecutable, chromiumOptions, envVariables, indent, inputProps, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, }) => {
|
|
58
59
|
const { page, cleanup: cleanupPage } = await (0, get_browser_instance_1.getPageAndCleanupFn)({
|
|
59
60
|
passedInInstance: puppeteerInstance,
|
|
60
61
|
browserExecutable,
|
|
@@ -62,7 +63,7 @@ const internalGetCompositions = async ({ browserExecutable, chromiumOptions, env
|
|
|
62
63
|
context: null,
|
|
63
64
|
forceDeviceScaleFactor: undefined,
|
|
64
65
|
indent,
|
|
65
|
-
|
|
66
|
+
logLevel,
|
|
66
67
|
});
|
|
67
68
|
const cleanup = [cleanupPage];
|
|
68
69
|
return new Promise((resolve, reject) => {
|
|
@@ -77,7 +78,7 @@ const internalGetCompositions = async ({ browserExecutable, chromiumOptions, env
|
|
|
77
78
|
port,
|
|
78
79
|
remotionRoot: (0, find_closest_package_json_1.findRemotionRoot)(),
|
|
79
80
|
concurrency: 1,
|
|
80
|
-
|
|
81
|
+
logLevel,
|
|
81
82
|
indent,
|
|
82
83
|
}, {
|
|
83
84
|
onDownload: () => undefined,
|
|
@@ -115,7 +116,7 @@ exports.internalGetCompositions = internalGetCompositions;
|
|
|
115
116
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/get-compositions)
|
|
116
117
|
*/
|
|
117
118
|
const getCompositions = (serveUrlOrWebpackUrl, config) => {
|
|
118
|
-
const { browserExecutable, chromiumOptions, envVariables, inputProps, onBrowserLog, port, puppeteerInstance, timeoutInMilliseconds,
|
|
119
|
+
const { browserExecutable, chromiumOptions, envVariables, inputProps, onBrowserLog, port, puppeteerInstance, timeoutInMilliseconds, logLevel, } = config !== null && config !== void 0 ? config : {};
|
|
119
120
|
return (0, exports.internalGetCompositions)({
|
|
120
121
|
browserExecutable: browserExecutable !== null && browserExecutable !== void 0 ? browserExecutable : null,
|
|
121
122
|
chromiumOptions: chromiumOptions !== null && chromiumOptions !== void 0 ? chromiumOptions : {},
|
|
@@ -128,7 +129,7 @@ const getCompositions = (serveUrlOrWebpackUrl, config) => {
|
|
|
128
129
|
serveUrlOrWebpackUrl,
|
|
129
130
|
server: undefined,
|
|
130
131
|
timeoutInMilliseconds: timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT,
|
|
131
|
-
|
|
132
|
+
logLevel: logLevel !== null && logLevel !== void 0 ? logLevel : (0, logger_1.getLogLevel)(),
|
|
132
133
|
});
|
|
133
134
|
};
|
|
134
135
|
exports.getCompositions = getCompositions;
|
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export declare const RenderInternals: {
|
|
|
42
42
|
downloadMap: import("./assets/download-map").DownloadMap;
|
|
43
43
|
remotionRoot: string;
|
|
44
44
|
concurrency: number;
|
|
45
|
-
|
|
45
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
46
46
|
indent: boolean;
|
|
47
47
|
}) => Promise<{
|
|
48
48
|
port: number;
|
|
@@ -303,7 +303,7 @@ export declare const RenderInternals: {
|
|
|
303
303
|
DEFAULT_VIDEO_IMAGE_FORMAT: "png" | "jpeg" | "none";
|
|
304
304
|
DEFAULT_JPEG_QUALITY: number;
|
|
305
305
|
chalk: {
|
|
306
|
-
enabled: boolean;
|
|
306
|
+
enabled: () => boolean;
|
|
307
307
|
visible: boolean;
|
|
308
308
|
styles: Record<string, {
|
|
309
309
|
codes: [number, number];
|
|
@@ -327,6 +327,7 @@ export declare const RenderInternals: {
|
|
|
327
327
|
yellow: (str: string) => string;
|
|
328
328
|
blue: (str: string) => string;
|
|
329
329
|
magenta: (str: string) => string;
|
|
330
|
+
cyan: (str: string) => string;
|
|
330
331
|
white: (str: string) => string;
|
|
331
332
|
gray: (str: string) => string;
|
|
332
333
|
bgBlack: (str: string) => string;
|
|
@@ -358,7 +359,6 @@ export declare const RenderInternals: {
|
|
|
358
359
|
logLevel: "verbose" | "info" | "warn" | "error";
|
|
359
360
|
} & {
|
|
360
361
|
tag?: string | undefined;
|
|
361
|
-
secondTag?: string | undefined;
|
|
362
362
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
363
363
|
info: (message?: any, ...optionalParams: any[]) => void;
|
|
364
364
|
infoAdvanced: (options: {
|
|
@@ -375,14 +375,14 @@ export declare const RenderInternals: {
|
|
|
375
375
|
getLogLevel: () => "verbose" | "info" | "warn" | "error";
|
|
376
376
|
setLogLevel: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
|
|
377
377
|
INDENT_TOKEN: string;
|
|
378
|
-
isColorSupported: boolean;
|
|
378
|
+
isColorSupported: () => boolean;
|
|
379
379
|
HeadlessBrowser: typeof HeadlessBrowser;
|
|
380
|
-
prepareServer: ({ webpackConfigOrServeUrl, port, remotionRoot, concurrency,
|
|
380
|
+
prepareServer: ({ webpackConfigOrServeUrl, port, remotionRoot, concurrency, logLevel, indent, }: {
|
|
381
381
|
webpackConfigOrServeUrl: string;
|
|
382
382
|
port: number | null;
|
|
383
383
|
remotionRoot: string;
|
|
384
384
|
concurrency: number;
|
|
385
|
-
|
|
385
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
386
386
|
indent: boolean;
|
|
387
387
|
}) => Promise<import("./prepare-server").RemotionServer>;
|
|
388
388
|
makeOrReuseServer: (server: import("./prepare-server").RemotionServer | undefined, config: {
|
|
@@ -390,7 +390,7 @@ export declare const RenderInternals: {
|
|
|
390
390
|
port: number | null;
|
|
391
391
|
remotionRoot: string;
|
|
392
392
|
concurrency: number;
|
|
393
|
-
|
|
393
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
394
394
|
indent: boolean;
|
|
395
395
|
}, { onDownload, onError, }: {
|
|
396
396
|
onError: (err: Error) => void;
|
|
@@ -400,14 +400,13 @@ export declare const RenderInternals: {
|
|
|
400
400
|
cleanupServer: (force: boolean) => Promise<unknown>;
|
|
401
401
|
}>;
|
|
402
402
|
internalRenderStill: (options: {
|
|
403
|
-
composition: import("remotion").
|
|
403
|
+
composition: import("remotion").VideoConfig;
|
|
404
404
|
output: string | null;
|
|
405
405
|
frame: number;
|
|
406
406
|
inputProps: Record<string, unknown>;
|
|
407
407
|
imageFormat: "png" | "jpeg" | "pdf" | "webp";
|
|
408
408
|
jpegQuality: number;
|
|
409
409
|
puppeteerInstance: HeadlessBrowser | null;
|
|
410
|
-
dumpBrowserLogs: boolean;
|
|
411
410
|
envVariables: Record<string, string>;
|
|
412
411
|
overwrite: boolean;
|
|
413
412
|
browserExecutable: import("./browser-executable").BrowserExecutable;
|
|
@@ -419,20 +418,20 @@ export declare const RenderInternals: {
|
|
|
419
418
|
cancelSignal: import("./make-cancel-signal").CancelSignal | null;
|
|
420
419
|
indent: boolean;
|
|
421
420
|
server: import("./prepare-server").RemotionServer | undefined;
|
|
422
|
-
|
|
421
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
423
422
|
serveUrl: string;
|
|
424
423
|
port: number | null;
|
|
425
424
|
}) => Promise<{
|
|
426
425
|
buffer: Buffer | null;
|
|
427
426
|
}>;
|
|
428
|
-
internalOpenBrowser: ({ browser, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent,
|
|
429
|
-
shouldDumpIo: boolean;
|
|
427
|
+
internalOpenBrowser: ({ browser, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent, viewport, logLevel, }: {
|
|
430
428
|
browserExecutable: string | null;
|
|
431
429
|
chromiumOptions: import("./open-browser").ChromiumOptions;
|
|
432
430
|
forceDeviceScaleFactor: number | undefined;
|
|
433
431
|
viewport: import("./browser/PuppeteerViewport").Viewport | null;
|
|
434
432
|
indent: boolean;
|
|
435
433
|
browser: import("./browser").Browser;
|
|
434
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
436
435
|
}) => Promise<HeadlessBrowser>;
|
|
437
436
|
internalSelectComposition: (options: {
|
|
438
437
|
inputProps: Record<string, unknown>;
|
|
@@ -445,11 +444,14 @@ export declare const RenderInternals: {
|
|
|
445
444
|
port: number | null;
|
|
446
445
|
indent: boolean;
|
|
447
446
|
server: import("./prepare-server").RemotionServer | undefined;
|
|
448
|
-
|
|
447
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
449
448
|
serveUrl: string;
|
|
450
449
|
id: string;
|
|
451
|
-
}) => Promise<
|
|
452
|
-
|
|
450
|
+
}) => Promise<{
|
|
451
|
+
metadata: import("remotion").VideoConfig;
|
|
452
|
+
propsSize: number;
|
|
453
|
+
}>;
|
|
454
|
+
internalGetCompositions: ({ browserExecutable, chromiumOptions, envVariables, indent, inputProps, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, }: {
|
|
453
455
|
inputProps: Record<string, unknown>;
|
|
454
456
|
envVariables: Record<string, string>;
|
|
455
457
|
puppeteerInstance: HeadlessBrowser | undefined;
|
|
@@ -460,11 +462,11 @@ export declare const RenderInternals: {
|
|
|
460
462
|
port: number | null;
|
|
461
463
|
server: import("./prepare-server").RemotionServer | undefined;
|
|
462
464
|
indent: boolean;
|
|
463
|
-
|
|
465
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
464
466
|
serveUrlOrWebpackUrl: string;
|
|
465
|
-
}) => Promise<import("remotion").
|
|
466
|
-
internalRenderFrames: ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency,
|
|
467
|
-
internalRenderMedia: ({ proResProfile, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload,
|
|
467
|
+
}) => Promise<import("remotion").VideoConfig[]>;
|
|
468
|
+
internalRenderFrames: ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, inputProps, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, }: import("./render-frames").InternalRenderFramesOptions) => Promise<import("./types").RenderFramesOutput>;
|
|
469
|
+
internalRenderMedia: ({ proResProfile, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, }: import("./render-media").InternalRenderMediaOptions) => Promise<{
|
|
468
470
|
buffer: Buffer | null;
|
|
469
471
|
slowestFrames: import("./render-media").SlowFrame[];
|
|
470
472
|
}>;
|
package/dist/logger.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ type LogOptions = {
|
|
|
6
6
|
};
|
|
7
7
|
type VerboseLogOptions = LogOptions & {
|
|
8
8
|
tag?: string;
|
|
9
|
-
secondTag?: string;
|
|
10
9
|
};
|
|
11
10
|
export declare const verboseTag: (str: string) => string;
|
|
12
11
|
export declare const secondverboseTag: (str: string) => string;
|
|
@@ -19,6 +18,6 @@ export declare const Log: {
|
|
|
19
18
|
warnAdvanced: (options: LogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
20
19
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
21
20
|
};
|
|
22
|
-
export declare const getLogLevel: () => "
|
|
21
|
+
export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn";
|
|
23
22
|
export declare const setLogLevel: (newLogLevel: LogLevel) => void;
|
|
24
23
|
export {};
|