@remotion/renderer 4.1.0-alpha4 → 4.1.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/browser/Browser.js +1 -1
- package/dist/browser/BrowserPage.js +41 -5
- 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/NetworkManager.d.ts +4 -1
- package/dist/browser/devtools-types.d.ts +59 -0
- package/dist/browser/should-log-message.js +6 -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/compose.js +5 -0
- package/dist/compositor/compositor.js +3 -4
- package/dist/create-ffmpeg-merge-filter.js +1 -2
- package/dist/format-logs.js +7 -1
- package/dist/get-compositions.d.ts +3 -3
- package/dist/get-compositions.js +1 -1
- package/dist/index.d.ts +27 -23
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +9 -9
- package/dist/offthread-video-server.js +8 -0
- package/dist/options/crf.js +1 -1
- package/dist/options/video-codec.js +1 -1
- package/dist/puppeteer-evaluate.d.ts +4 -1
- package/dist/puppeteer-evaluate.js +5 -5
- package/dist/render-frames.d.ts +3 -3
- package/dist/render-frames.js +12 -7
- package/dist/render-media.d.ts +3 -3
- package/dist/render-media.js +7 -5
- package/dist/render-still.d.ts +3 -3
- package/dist/render-still.js +5 -6
- package/dist/screenshot-task.js +4 -2
- package/dist/seek-to-frame.d.ts +2 -1
- package/dist/seek-to-frame.js +5 -5
- package/dist/select-composition.d.ts +7 -3
- package/dist/select-composition.js +7 -6
- package/dist/set-props-and-env.js +8 -7
- package/dist/take-frame-and-compose.js +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 -4
- 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 -16
- 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 -17
- 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 -17
- 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 -12
- 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/browser/Browser.js
CHANGED
|
@@ -69,7 +69,7 @@ class HeadlessBrowser extends EventEmitter_1.EventEmitter {
|
|
|
69
69
|
return __classPrivateFieldGet(this, _HeadlessBrowser_defaultContext, "f").newPage(context, logLevel, indent);
|
|
70
70
|
}
|
|
71
71
|
async _createPageInContext(context, logLevel, indent) {
|
|
72
|
-
const { targetId } = await this.connection.send('Target.createTarget', {
|
|
72
|
+
const { value: { targetId }, } = await this.connection.send('Target.createTarget', {
|
|
73
73
|
url: 'about:blank',
|
|
74
74
|
browserContextId: undefined,
|
|
75
75
|
});
|
|
@@ -39,6 +39,15 @@ const JSHandle_1 = require("./JSHandle");
|
|
|
39
39
|
const TaskQueue_1 = require("./TaskQueue");
|
|
40
40
|
const TimeoutSettings_1 = require("./TimeoutSettings");
|
|
41
41
|
const util_1 = require("./util");
|
|
42
|
+
const format_logs_1 = require("../format-logs");
|
|
43
|
+
const shouldHideWarning = (log) => {
|
|
44
|
+
// Mixed Content warnings caused by localhost should not be displayed
|
|
45
|
+
if (log.text.includes('Mixed Content:') &&
|
|
46
|
+
log.text.includes('http://localhost:')) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
};
|
|
42
51
|
class Page extends EventEmitter_1.EventEmitter {
|
|
43
52
|
static async _create({ client, target, defaultViewport, browser, sourcemapContext, logLevel, indent, }) {
|
|
44
53
|
const page = new Page({
|
|
@@ -105,6 +114,9 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
105
114
|
this.on('console', (log) => {
|
|
106
115
|
var _a;
|
|
107
116
|
const { url, columnNumber, lineNumber } = log.location();
|
|
117
|
+
if (shouldHideWarning(log)) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
108
120
|
if ((url === null || url === void 0 ? void 0 : url.endsWith(remotion_1.Internals.bundleName)) &&
|
|
109
121
|
lineNumber &&
|
|
110
122
|
this.sourcemapContext) {
|
|
@@ -123,7 +135,7 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
123
135
|
logLevel,
|
|
124
136
|
tag: [origPosition.name, file].filter(truthy_1.truthy).join('@'),
|
|
125
137
|
indent,
|
|
126
|
-
}, log.
|
|
138
|
+
}, log.previewString);
|
|
127
139
|
}
|
|
128
140
|
else {
|
|
129
141
|
logger_1.Log.verboseAdvanced({ logLevel, tag: `console.${log.type}`, indent }, log.text);
|
|
@@ -164,8 +176,8 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
164
176
|
mainFrame() {
|
|
165
177
|
return __classPrivateFieldGet(this, _Page_frameManager, "f").mainFrame();
|
|
166
178
|
}
|
|
167
|
-
setViewport(viewport) {
|
|
168
|
-
|
|
179
|
+
async setViewport(viewport) {
|
|
180
|
+
const { value } = await __classPrivateFieldGet(this, _Page_client, "f").send('Emulation.setDeviceMetricsOverride', {
|
|
169
181
|
mobile: false,
|
|
170
182
|
width: viewport.width,
|
|
171
183
|
height: viewport.height,
|
|
@@ -175,6 +187,7 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
175
187
|
type: 'portraitPrimary',
|
|
176
188
|
},
|
|
177
189
|
});
|
|
190
|
+
return value;
|
|
178
191
|
}
|
|
179
192
|
setDefaultNavigationTimeout(timeout) {
|
|
180
193
|
__classPrivateFieldGet(this, _Page_timeoutSettings, "f").setDefaultNavigationTimeout(timeout);
|
|
@@ -245,8 +258,21 @@ _Page_client = new WeakMap(), _Page_target = new WeakMap(), _Page_timeoutSetting
|
|
|
245
258
|
return (0, util_1.releaseObject)(__classPrivateFieldGet(this, _Page_client, "f"), arg);
|
|
246
259
|
});
|
|
247
260
|
}
|
|
261
|
+
const previewString = args
|
|
262
|
+
? args
|
|
263
|
+
.map((arg) => {
|
|
264
|
+
return (0, format_logs_1.formatRemoteObject)(arg);
|
|
265
|
+
})
|
|
266
|
+
.join(', ')
|
|
267
|
+
: '';
|
|
248
268
|
if (source !== 'worker') {
|
|
249
|
-
this.emit("console" /* PageEmittedEvents.Console */, new ConsoleMessage_1.ConsoleMessage(
|
|
269
|
+
this.emit("console" /* PageEmittedEvents.Console */, new ConsoleMessage_1.ConsoleMessage({
|
|
270
|
+
type: level,
|
|
271
|
+
text,
|
|
272
|
+
args: [],
|
|
273
|
+
stackTraceLocations: [{ url, lineNumber }],
|
|
274
|
+
previewString,
|
|
275
|
+
}));
|
|
250
276
|
}
|
|
251
277
|
}, _Page_onConsoleAPI = function _Page_onConsoleAPI(event) {
|
|
252
278
|
if (event.executionContextId === 0) {
|
|
@@ -317,6 +343,16 @@ _Page_client = new WeakMap(), _Page_target = new WeakMap(), _Page_timeoutSetting
|
|
|
317
343
|
});
|
|
318
344
|
}
|
|
319
345
|
}
|
|
320
|
-
const
|
|
346
|
+
const previewString = args
|
|
347
|
+
.map((a) => (0, format_logs_1.formatRemoteObject)(a._remoteObject))
|
|
348
|
+
.filter(Boolean)
|
|
349
|
+
.join(' ');
|
|
350
|
+
const message = new ConsoleMessage_1.ConsoleMessage({
|
|
351
|
+
type: eventType,
|
|
352
|
+
text: textTokens.join(' '),
|
|
353
|
+
args,
|
|
354
|
+
stackTraceLocations,
|
|
355
|
+
previewString,
|
|
356
|
+
});
|
|
321
357
|
this.emit("console" /* PageEmittedEvents.Console */, message);
|
|
322
358
|
};
|
|
@@ -7,7 +7,10 @@ export declare class Connection extends EventEmitter {
|
|
|
7
7
|
constructor(transport: NodeWebSocketTransport);
|
|
8
8
|
static fromSession(session: CDPSession): Connection | undefined;
|
|
9
9
|
session(sessionId: string): CDPSession | null;
|
|
10
|
-
send<T extends keyof Commands>(method: T, ...paramArgs: Commands[T]['paramsType']): Promise<
|
|
10
|
+
send<T extends keyof Commands>(method: T, ...paramArgs: Commands[T]['paramsType']): Promise<{
|
|
11
|
+
value: Commands[T]['returnType'];
|
|
12
|
+
size: number;
|
|
13
|
+
}>;
|
|
11
14
|
_rawSend(message: Record<string, unknown>): number;
|
|
12
15
|
dispose(): void;
|
|
13
16
|
/**
|
|
@@ -34,8 +37,11 @@ export declare class CDPSession extends EventEmitter {
|
|
|
34
37
|
#private;
|
|
35
38
|
constructor(connection: Connection, targetType: string, sessionId: string);
|
|
36
39
|
connection(): Connection | undefined;
|
|
37
|
-
send<T extends keyof Commands>(method: T, ...paramArgs: Commands[T]['paramsType']): Promise<
|
|
38
|
-
|
|
40
|
+
send<T extends keyof Commands>(method: T, ...paramArgs: Commands[T]['paramsType']): Promise<{
|
|
41
|
+
value: Commands[T]['returnType'];
|
|
42
|
+
size: number;
|
|
43
|
+
}>;
|
|
44
|
+
_onMessage(object: CDPSessionOnMessageObject, size: number): void;
|
|
39
45
|
_onClosed(): void;
|
|
40
46
|
id(): string;
|
|
41
47
|
}
|
|
@@ -68,6 +68,7 @@ class Connection extends EventEmitter_1.EventEmitter {
|
|
|
68
68
|
reject,
|
|
69
69
|
error: new Errors_1.ProtocolError(),
|
|
70
70
|
method,
|
|
71
|
+
returnSize: true,
|
|
71
72
|
});
|
|
72
73
|
});
|
|
73
74
|
}
|
|
@@ -87,7 +88,7 @@ class Connection extends EventEmitter_1.EventEmitter {
|
|
|
87
88
|
* @returns The CDP session that is created
|
|
88
89
|
*/
|
|
89
90
|
async createSession(targetInfo) {
|
|
90
|
-
const { sessionId } = await this.send('Target.attachToTarget', {
|
|
91
|
+
const { value: { sessionId }, } = await this.send('Target.attachToTarget', {
|
|
91
92
|
targetId: targetInfo.targetId,
|
|
92
93
|
flatten: true,
|
|
93
94
|
});
|
|
@@ -126,7 +127,7 @@ _Connection_transport = new WeakMap(), _Connection_lastId = new WeakMap(), _Conn
|
|
|
126
127
|
if (object.sessionId) {
|
|
127
128
|
const session = __classPrivateFieldGet(this, _Connection_sessions, "f").get(object.sessionId);
|
|
128
129
|
if (session) {
|
|
129
|
-
session._onMessage(object);
|
|
130
|
+
session._onMessage(object, message.length);
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
133
|
else if (object.id) {
|
|
@@ -137,6 +138,9 @@ _Connection_transport = new WeakMap(), _Connection_lastId = new WeakMap(), _Conn
|
|
|
137
138
|
if (object.error) {
|
|
138
139
|
callback.reject(createProtocolError(callback.error, callback.method, object));
|
|
139
140
|
}
|
|
141
|
+
else if (callback.returnSize) {
|
|
142
|
+
callback.resolve({ value: object.result, size: message.length });
|
|
143
|
+
}
|
|
140
144
|
else {
|
|
141
145
|
callback.resolve(object.result);
|
|
142
146
|
}
|
|
@@ -195,16 +199,20 @@ class CDPSession extends EventEmitter_1.EventEmitter {
|
|
|
195
199
|
reject,
|
|
196
200
|
error: new Errors_1.ProtocolError(),
|
|
197
201
|
method,
|
|
202
|
+
returnSize: true,
|
|
198
203
|
});
|
|
199
204
|
});
|
|
200
205
|
}
|
|
201
|
-
_onMessage(object) {
|
|
206
|
+
_onMessage(object, size) {
|
|
202
207
|
const callback = object.id ? __classPrivateFieldGet(this, _CDPSession_callbacks, "f").get(object.id) : undefined;
|
|
203
208
|
if (object.id && callback) {
|
|
204
209
|
__classPrivateFieldGet(this, _CDPSession_callbacks, "f").delete(object.id);
|
|
205
210
|
if (object.error) {
|
|
206
211
|
callback.reject(createProtocolError(callback.error, callback.method, object));
|
|
207
212
|
}
|
|
213
|
+
else if (callback.returnSize) {
|
|
214
|
+
callback.resolve({ value: object.result, size });
|
|
215
|
+
}
|
|
208
216
|
else {
|
|
209
217
|
callback.resolve(object.result);
|
|
210
218
|
}
|
|
@@ -25,7 +25,14 @@ export declare class ConsoleMessage {
|
|
|
25
25
|
type: ConsoleMessageType;
|
|
26
26
|
text: string;
|
|
27
27
|
args: JSHandle[];
|
|
28
|
-
|
|
28
|
+
previewString: string;
|
|
29
|
+
constructor({ type, text, args, stackTraceLocations, previewString, }: {
|
|
30
|
+
type: ConsoleMessageType;
|
|
31
|
+
text: string;
|
|
32
|
+
args: JSHandle[];
|
|
33
|
+
stackTraceLocations: ConsoleMessageLocation[];
|
|
34
|
+
previewString: string;
|
|
35
|
+
});
|
|
29
36
|
location(): ConsoleMessageLocation;
|
|
30
37
|
stackTrace(): ConsoleMessageLocation[];
|
|
31
38
|
}
|
|
@@ -29,11 +29,12 @@ var _ConsoleMessage_stackTraceLocations;
|
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
exports.ConsoleMessage = void 0;
|
|
31
31
|
class ConsoleMessage {
|
|
32
|
-
constructor(type, text, args, stackTraceLocations) {
|
|
32
|
+
constructor({ type, text, args, stackTraceLocations, previewString, }) {
|
|
33
33
|
_ConsoleMessage_stackTraceLocations.set(this, void 0);
|
|
34
34
|
this.type = type;
|
|
35
35
|
this.text = text;
|
|
36
36
|
this.args = args;
|
|
37
|
+
this.previewString = previewString;
|
|
37
38
|
__classPrivateFieldSet(this, _ConsoleMessage_stackTraceLocations, stackTraceLocations, "f");
|
|
38
39
|
}
|
|
39
40
|
location() {
|
|
@@ -55,7 +55,7 @@ _ExecutionContext_instances = new WeakSet(), _ExecutionContext_evaluate = async
|
|
|
55
55
|
const expressionWithSourceUrl = SOURCE_URL_REGEX.test(expression)
|
|
56
56
|
? expression
|
|
57
57
|
: expression + '\n' + suffix;
|
|
58
|
-
const { exceptionDetails: _details, result: _remoteObject } = await this._client
|
|
58
|
+
const { value: { exceptionDetails: _details, result: _remoteObject }, } = await this._client
|
|
59
59
|
.send('Runtime.evaluate', {
|
|
60
60
|
expression: expressionWithSourceUrl,
|
|
61
61
|
contextId,
|
|
@@ -114,7 +114,7 @@ _ExecutionContext_instances = new WeakSet(), _ExecutionContext_evaluate = async
|
|
|
114
114
|
}
|
|
115
115
|
throw error;
|
|
116
116
|
}
|
|
117
|
-
const { exceptionDetails, result: remoteObject } = await callFunctionOnPromise.catch(rewriteError);
|
|
117
|
+
const { value: { exceptionDetails, result: remoteObject }, } = await callFunctionOnPromise.catch(rewriteError);
|
|
118
118
|
if (exceptionDetails) {
|
|
119
119
|
throw new Error('Evaluation failed: ' + (0, util_1.getExceptionMessage)(exceptionDetails));
|
|
120
120
|
}
|
|
@@ -160,10 +160,10 @@ _ExecutionContext_instances = new WeakSet(), _ExecutionContext_evaluate = async
|
|
|
160
160
|
}
|
|
161
161
|
function rewriteError(error) {
|
|
162
162
|
if (error.message.includes('Object reference chain is too long')) {
|
|
163
|
-
return { result: { type: 'undefined' } };
|
|
163
|
+
return { value: { result: { type: 'undefined' } }, size: 1 };
|
|
164
164
|
}
|
|
165
165
|
if (error.message.includes("Object couldn't be returned by value")) {
|
|
166
|
-
return { result: { type: 'undefined' } };
|
|
166
|
+
return { value: { result: { type: 'undefined' } }, size: 1 };
|
|
167
167
|
}
|
|
168
168
|
if (error.message.endsWith('Cannot find context with specified id') ||
|
|
169
169
|
error.message.endsWith('Inspected target navigated or closed')) {
|
|
@@ -122,7 +122,7 @@ class FrameManager extends EventEmitter_1.EventEmitter {
|
|
|
122
122
|
flatten: true,
|
|
123
123
|
}),
|
|
124
124
|
]);
|
|
125
|
-
const { frameTree } = result[1];
|
|
125
|
+
const { value: { frameTree }, } = result[1];
|
|
126
126
|
__classPrivateFieldGet(this, _FrameManager_instances, "m", _FrameManager_handleFrameTree).call(this, client, frameTree);
|
|
127
127
|
await Promise.all([
|
|
128
128
|
client.send('Page.setLifecycleEventsEnabled', { enabled: true }),
|
|
@@ -166,7 +166,7 @@ class FrameManager extends EventEmitter_1.EventEmitter {
|
|
|
166
166
|
return watcher.navigationResponse();
|
|
167
167
|
async function navigate(client, _url, referrer, frameId) {
|
|
168
168
|
try {
|
|
169
|
-
const response = await client.send('Page.navigate', {
|
|
169
|
+
const { value: response } = await client.send('Page.navigate', {
|
|
170
170
|
url: _url,
|
|
171
171
|
referrer,
|
|
172
172
|
frameId,
|
|
@@ -20,7 +20,10 @@ export declare const NetworkManagerEmittedEvents: {
|
|
|
20
20
|
readonly Request: symbol;
|
|
21
21
|
};
|
|
22
22
|
interface CDPSession extends EventEmitter {
|
|
23
|
-
send<T extends keyof Commands>(method: T, ...paramArgs: Commands[T]['paramsType']): Promise<
|
|
23
|
+
send<T extends keyof Commands>(method: T, ...paramArgs: Commands[T]['paramsType']): Promise<{
|
|
24
|
+
value: Commands[T]['returnType'];
|
|
25
|
+
size: number;
|
|
26
|
+
}>;
|
|
24
27
|
}
|
|
25
28
|
interface FrameManager {
|
|
26
29
|
frame(frameId: string): Frame | null;
|
|
@@ -44,6 +44,65 @@ export interface DevtoolsRemoteObject {
|
|
|
44
44
|
* Unique object identifier (for non-primitive values).
|
|
45
45
|
*/
|
|
46
46
|
objectId?: RemoteObjectId;
|
|
47
|
+
preview?: ObjectPreview;
|
|
48
|
+
}
|
|
49
|
+
export interface ObjectPreview {
|
|
50
|
+
/**
|
|
51
|
+
* Object type. (ObjectPreviewType enum)
|
|
52
|
+
*/
|
|
53
|
+
type: 'object' | 'function' | 'undefined' | 'string' | 'number' | 'boolean' | 'symbol' | 'bigint';
|
|
54
|
+
/**
|
|
55
|
+
* Object subtype hint. Specified for `object` type values only. (ObjectPreviewSubtype enum)
|
|
56
|
+
*/
|
|
57
|
+
subtype?: 'array' | 'null' | 'node' | 'regexp' | 'date' | 'map' | 'set' | 'weakmap' | 'weakset' | 'iterator' | 'generator' | 'error' | 'proxy' | 'promise' | 'typedarray' | 'arraybuffer' | 'dataview' | 'webassemblymemory' | 'wasmvalue';
|
|
58
|
+
/**
|
|
59
|
+
* String representation of the object.
|
|
60
|
+
*/
|
|
61
|
+
description?: string;
|
|
62
|
+
/**
|
|
63
|
+
* True iff some of the properties or entries of the original object did not fit.
|
|
64
|
+
*/
|
|
65
|
+
overflow: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* List of the properties.
|
|
68
|
+
*/
|
|
69
|
+
properties: PropertyPreview[];
|
|
70
|
+
/**
|
|
71
|
+
* List of the entries. Specified for `map` and `set` subtype values only.
|
|
72
|
+
*/
|
|
73
|
+
entries?: EntryPreview[];
|
|
74
|
+
}
|
|
75
|
+
export interface EntryPreview {
|
|
76
|
+
/**
|
|
77
|
+
* Preview of the key. Specified for map-like collection entries.
|
|
78
|
+
*/
|
|
79
|
+
key?: ObjectPreview;
|
|
80
|
+
/**
|
|
81
|
+
* Preview of the value.
|
|
82
|
+
*/
|
|
83
|
+
value: ObjectPreview;
|
|
84
|
+
}
|
|
85
|
+
export interface PropertyPreview {
|
|
86
|
+
/**
|
|
87
|
+
* Property name.
|
|
88
|
+
*/
|
|
89
|
+
name: string;
|
|
90
|
+
/**
|
|
91
|
+
* Object type. Accessor means that the property itself is an accessor property. (PropertyPreviewType enum)
|
|
92
|
+
*/
|
|
93
|
+
type: 'object' | 'function' | 'undefined' | 'string' | 'number' | 'boolean' | 'symbol' | 'accessor' | 'bigint';
|
|
94
|
+
/**
|
|
95
|
+
* User-friendly property value string.
|
|
96
|
+
*/
|
|
97
|
+
value?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Nested value preview.
|
|
100
|
+
*/
|
|
101
|
+
valuePreview?: ObjectPreview;
|
|
102
|
+
/**
|
|
103
|
+
* Object subtype hint. Specified for `object` type values only. (PropertyPreviewSubtype enum)
|
|
104
|
+
*/
|
|
105
|
+
subtype?: 'array' | 'null' | 'node' | 'regexp' | 'date' | 'map' | 'set' | 'weakmap' | 'weakset' | 'iterator' | 'generator' | 'error' | 'proxy' | 'promise' | 'typedarray' | 'arraybuffer' | 'dataview' | 'webassemblymemory' | 'wasmvalue';
|
|
47
106
|
}
|
|
48
107
|
type TargetID = string;
|
|
49
108
|
export interface TargetInfo {
|
|
@@ -18,6 +18,12 @@ const shouldLogBrowserMessage = (message) => {
|
|
|
18
18
|
if (message.includes('Failed to send GpuControl.CreateCommandBuffer')) {
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
|
+
if (message.includes('CreatePlatformSocket() failed: Address family not supported by protocol')) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
if (message.includes('Fontconfig error: No writable cache directories')) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
21
27
|
return true;
|
|
22
28
|
};
|
|
23
29
|
exports.shouldLogBrowserMessage = shouldLogBrowserMessage;
|
package/dist/chalk/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ type Style = {
|
|
|
5
5
|
};
|
|
6
6
|
type Method = (str: string) => string;
|
|
7
7
|
type Colors = {
|
|
8
|
-
enabled: boolean;
|
|
8
|
+
enabled: () => boolean;
|
|
9
9
|
visible: boolean;
|
|
10
10
|
styles: Record<string, Style>;
|
|
11
11
|
keys: Record<string, string[]>;
|
|
@@ -26,6 +26,7 @@ type ColorsWithMethods = Colors & {
|
|
|
26
26
|
yellow: Method;
|
|
27
27
|
blue: Method;
|
|
28
28
|
magenta: Method;
|
|
29
|
+
cyan: Method;
|
|
29
30
|
white: Method;
|
|
30
31
|
gray: Method;
|
|
31
32
|
bgBlack: Method;
|
package/dist/chalk/index.js
CHANGED
|
@@ -2,15 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.chalk = void 0;
|
|
4
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
5
|
exports.chalk = (() => {
|
|
12
6
|
const colors = {
|
|
13
|
-
enabled:
|
|
7
|
+
enabled: () => (0, is_color_supported_1.isColorSupported)(),
|
|
14
8
|
visible: true,
|
|
15
9
|
styles: {},
|
|
16
10
|
keys: {},
|
|
@@ -37,7 +31,7 @@ exports.chalk = (() => {
|
|
|
37
31
|
const style = (input, stack) => {
|
|
38
32
|
if (input === '' || input === null || input === undefined)
|
|
39
33
|
return '';
|
|
40
|
-
if (colors.enabled === false)
|
|
34
|
+
if (colors.enabled() === false)
|
|
41
35
|
return input;
|
|
42
36
|
if (colors.visible === false)
|
|
43
37
|
return '';
|
|
@@ -81,6 +75,7 @@ exports.chalk = (() => {
|
|
|
81
75
|
define('yellow', [33, 39], 'color');
|
|
82
76
|
define('blue', [34, 39], 'color');
|
|
83
77
|
define('magenta', [35, 39], 'color');
|
|
78
|
+
define('cyan', [36, 39], 'color');
|
|
84
79
|
define('white', [37, 39], 'color');
|
|
85
80
|
define('gray', [90, 39], 'color');
|
|
86
81
|
define('grey', [90, 39], 'color');
|
|
@@ -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;
|
|
@@ -75,6 +75,11 @@ const callCompositor = (payload) => {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
+
if (child.stdin.closed) {
|
|
79
|
+
reject(new Error('Compositor stdin closed unexpectedly,' +
|
|
80
|
+
Buffer.concat(stderrChunks).toString('utf-8')));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
78
83
|
child.stdin.write(payload);
|
|
79
84
|
child.stdin.end();
|
|
80
85
|
});
|
|
@@ -19,9 +19,9 @@ const getIdealMaximumFrameCacheItems = () => {
|
|
|
19
19
|
// Assuming 1 frame is approximately 6MB
|
|
20
20
|
// Assuming only half the available memory should be used
|
|
21
21
|
const max = Math.floor(freeMemory / (1024 * 1024 * 6));
|
|
22
|
-
// Never store more than
|
|
23
|
-
// But
|
|
24
|
-
return Math.max(
|
|
22
|
+
// Never store more than 2000 frames
|
|
23
|
+
// But 500 is needed even if it's going to swap
|
|
24
|
+
return Math.max(500, Math.min(max, 2000));
|
|
25
25
|
};
|
|
26
26
|
exports.getIdealMaximumFrameCacheItems = getIdealMaximumFrameCacheItems;
|
|
27
27
|
const startLongRunningCompositor = (maximumFrameCacheItems, logLevel, indent) => {
|
|
@@ -206,7 +206,6 @@ const startCompositor = (type, payload, logLevel, indent) => {
|
|
|
206
206
|
params,
|
|
207
207
|
},
|
|
208
208
|
};
|
|
209
|
-
// TODO: Should have a way to error out a single task
|
|
210
209
|
child.stdin.write(JSON.stringify(composed) + '\n');
|
|
211
210
|
waiters.set(nonce, {
|
|
212
211
|
resolve: _resolve,
|
|
@@ -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;
|
package/dist/format-logs.js
CHANGED
|
@@ -45,9 +45,12 @@ const formatObjectPreview = (preview) => {
|
|
|
45
45
|
return chalk_1.chalk.reset(`Date { ${chalk_1.chalk.magenta(String(preview.description))} }`);
|
|
46
46
|
}
|
|
47
47
|
const properties = preview.properties.map((property) => {
|
|
48
|
-
return `${property.name}: ${formatProperty(property)}
|
|
48
|
+
return chalk_1.chalk.reset(`${property.name}: ${formatProperty(property)}`);
|
|
49
49
|
});
|
|
50
50
|
if (preview.subtype === 'array') {
|
|
51
|
+
if (preview.overflow) {
|
|
52
|
+
return chalk_1.chalk.reset(`[ ${preview.properties.map((p) => formatProperty(p)).join(', ')}, …]`);
|
|
53
|
+
}
|
|
51
54
|
return chalk_1.chalk.reset(`[ ${preview.properties.map((p) => formatProperty(p)).join(', ')} ]`);
|
|
52
55
|
}
|
|
53
56
|
if (preview.subtype === 'arraybuffer') {
|
|
@@ -104,6 +107,9 @@ const formatObjectPreview = (preview) => {
|
|
|
104
107
|
if (properties.length === 0) {
|
|
105
108
|
return chalk_1.chalk.reset('{}');
|
|
106
109
|
}
|
|
110
|
+
if (preview.overflow) {
|
|
111
|
+
return chalk_1.chalk.reset(`{ ${properties.join(', ')}, …}`);
|
|
112
|
+
}
|
|
107
113
|
return chalk_1.chalk.reset(`{ ${properties.join(', ')} }`);
|
|
108
114
|
}
|
|
109
115
|
return '';
|
|
@@ -1,4 +1,4 @@
|
|
|
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';
|
|
@@ -30,10 +30,10 @@ export type GetCompositionsOptions = {
|
|
|
30
30
|
port?: number | null;
|
|
31
31
|
logLevel?: LogLevel;
|
|
32
32
|
};
|
|
33
|
-
export declare const internalGetCompositions: ({ browserExecutable, chromiumOptions, envVariables, indent, inputProps, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, }: InternalGetCompositionsOptions) => Promise<
|
|
33
|
+
export declare const internalGetCompositions: ({ browserExecutable, chromiumOptions, envVariables, indent, inputProps, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, }: InternalGetCompositionsOptions) => Promise<VideoConfig[]>;
|
|
34
34
|
/**
|
|
35
35
|
* @description Gets the compositions defined in a Remotion project based on a Webpack bundle.
|
|
36
36
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/get-compositions)
|
|
37
37
|
*/
|
|
38
|
-
export declare const getCompositions: (serveUrlOrWebpackUrl: string, config?: GetCompositionsOptions) => Promise<
|
|
38
|
+
export declare const getCompositions: (serveUrlOrWebpackUrl: string, config?: GetCompositionsOptions) => Promise<VideoConfig[]>;
|
|
39
39
|
export {};
|
package/dist/get-compositions.js
CHANGED
|
@@ -45,7 +45,7 @@ const innerGetCompositions = async ({ envVariables, inputProps, onBrowserLog, pa
|
|
|
45
45
|
args: [],
|
|
46
46
|
});
|
|
47
47
|
await (0, seek_to_frame_1.waitForReady)(page);
|
|
48
|
-
const result = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
48
|
+
const { value: result } = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
49
49
|
pageFunction: () => {
|
|
50
50
|
return window.getStaticCompositions();
|
|
51
51
|
},
|