@remotion/renderer 4.1.0-alpha4 → 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.js +1 -1
- package/dist/browser/BrowserPage.js +30 -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/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/create-ffmpeg-merge-filter.js +1 -2
- package/dist/format-logs.js +1 -1
- package/dist/get-compositions.d.ts +3 -3
- package/dist/get-compositions.js +1 -1
- package/dist/index.d.ts +10 -7
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +2 -2
- 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 +3 -3
- package/dist/render-media.d.ts +3 -3
- package/dist/render-still.d.ts +3 -3
- package/dist/render-still.js +3 -3
- package/dist/screenshot-task.js +4 -2
- package/dist/seek-to-frame.js +1 -1
- package/dist/select-composition.d.ts +7 -3
- package/dist/select-composition.js +7 -6
- package/dist/set-props-and-env.js +5 -5
- 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,7 @@ 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");
|
|
42
43
|
class Page extends EventEmitter_1.EventEmitter {
|
|
43
44
|
static async _create({ client, target, defaultViewport, browser, sourcemapContext, logLevel, indent, }) {
|
|
44
45
|
const page = new Page({
|
|
@@ -123,7 +124,7 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
123
124
|
logLevel,
|
|
124
125
|
tag: [origPosition.name, file].filter(truthy_1.truthy).join('@'),
|
|
125
126
|
indent,
|
|
126
|
-
}, log.
|
|
127
|
+
}, log.previewString);
|
|
127
128
|
}
|
|
128
129
|
else {
|
|
129
130
|
logger_1.Log.verboseAdvanced({ logLevel, tag: `console.${log.type}`, indent }, log.text);
|
|
@@ -164,8 +165,8 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
164
165
|
mainFrame() {
|
|
165
166
|
return __classPrivateFieldGet(this, _Page_frameManager, "f").mainFrame();
|
|
166
167
|
}
|
|
167
|
-
setViewport(viewport) {
|
|
168
|
-
|
|
168
|
+
async setViewport(viewport) {
|
|
169
|
+
const { value } = await __classPrivateFieldGet(this, _Page_client, "f").send('Emulation.setDeviceMetricsOverride', {
|
|
169
170
|
mobile: false,
|
|
170
171
|
width: viewport.width,
|
|
171
172
|
height: viewport.height,
|
|
@@ -175,6 +176,7 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
175
176
|
type: 'portraitPrimary',
|
|
176
177
|
},
|
|
177
178
|
});
|
|
179
|
+
return value;
|
|
178
180
|
}
|
|
179
181
|
setDefaultNavigationTimeout(timeout) {
|
|
180
182
|
__classPrivateFieldGet(this, _Page_timeoutSettings, "f").setDefaultNavigationTimeout(timeout);
|
|
@@ -245,8 +247,21 @@ _Page_client = new WeakMap(), _Page_target = new WeakMap(), _Page_timeoutSetting
|
|
|
245
247
|
return (0, util_1.releaseObject)(__classPrivateFieldGet(this, _Page_client, "f"), arg);
|
|
246
248
|
});
|
|
247
249
|
}
|
|
250
|
+
const previewString = args
|
|
251
|
+
? args
|
|
252
|
+
.map((arg) => {
|
|
253
|
+
return (0, format_logs_1.formatRemoteObject)(arg);
|
|
254
|
+
})
|
|
255
|
+
.join(', ')
|
|
256
|
+
: '';
|
|
248
257
|
if (source !== 'worker') {
|
|
249
|
-
this.emit("console" /* PageEmittedEvents.Console */, new ConsoleMessage_1.ConsoleMessage(
|
|
258
|
+
this.emit("console" /* PageEmittedEvents.Console */, new ConsoleMessage_1.ConsoleMessage({
|
|
259
|
+
type: level,
|
|
260
|
+
text,
|
|
261
|
+
args: [],
|
|
262
|
+
stackTraceLocations: [{ url, lineNumber }],
|
|
263
|
+
previewString,
|
|
264
|
+
}));
|
|
250
265
|
}
|
|
251
266
|
}, _Page_onConsoleAPI = function _Page_onConsoleAPI(event) {
|
|
252
267
|
if (event.executionContextId === 0) {
|
|
@@ -317,6 +332,16 @@ _Page_client = new WeakMap(), _Page_target = new WeakMap(), _Page_timeoutSetting
|
|
|
317
332
|
});
|
|
318
333
|
}
|
|
319
334
|
}
|
|
320
|
-
const
|
|
335
|
+
const previewString = args
|
|
336
|
+
.map((a) => (0, format_logs_1.formatRemoteObject)(a._remoteObject))
|
|
337
|
+
.filter(Boolean)
|
|
338
|
+
.join(' ');
|
|
339
|
+
const message = new ConsoleMessage_1.ConsoleMessage({
|
|
340
|
+
type: eventType,
|
|
341
|
+
text: textTokens.join(' '),
|
|
342
|
+
args,
|
|
343
|
+
stackTraceLocations,
|
|
344
|
+
previewString,
|
|
345
|
+
});
|
|
321
346
|
this.emit("console" /* PageEmittedEvents.Console */, message);
|
|
322
347
|
};
|
|
@@ -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 {
|
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;
|
|
@@ -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,7 +45,7 @@ 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
51
|
return chalk_1.chalk.reset(`[ ${preview.properties.map((p) => formatProperty(p)).join(', ')} ]`);
|
|
@@ -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
|
},
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import execa from 'execa';
|
|
3
2
|
import { HeadlessBrowser } from './browser/Browser';
|
|
4
3
|
import { SymbolicateableError } from './error-handling/symbolicateable-error';
|
|
@@ -301,10 +300,10 @@ export declare const RenderInternals: {
|
|
|
301
300
|
validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
|
|
302
301
|
validVideoImageFormats: readonly ["png", "jpeg", "none"];
|
|
303
302
|
DEFAULT_STILL_IMAGE_FORMAT: "png" | "jpeg" | "pdf" | "webp";
|
|
304
|
-
DEFAULT_VIDEO_IMAGE_FORMAT: "
|
|
303
|
+
DEFAULT_VIDEO_IMAGE_FORMAT: "png" | "jpeg" | "none";
|
|
305
304
|
DEFAULT_JPEG_QUALITY: number;
|
|
306
305
|
chalk: {
|
|
307
|
-
enabled: boolean;
|
|
306
|
+
enabled: () => boolean;
|
|
308
307
|
visible: boolean;
|
|
309
308
|
styles: Record<string, {
|
|
310
309
|
codes: [number, number];
|
|
@@ -328,6 +327,7 @@ export declare const RenderInternals: {
|
|
|
328
327
|
yellow: (str: string) => string;
|
|
329
328
|
blue: (str: string) => string;
|
|
330
329
|
magenta: (str: string) => string;
|
|
330
|
+
cyan: (str: string) => string;
|
|
331
331
|
white: (str: string) => string;
|
|
332
332
|
gray: (str: string) => string;
|
|
333
333
|
bgBlack: (str: string) => string;
|
|
@@ -375,7 +375,7 @@ 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
380
|
prepareServer: ({ webpackConfigOrServeUrl, port, remotionRoot, concurrency, logLevel, indent, }: {
|
|
381
381
|
webpackConfigOrServeUrl: string;
|
|
@@ -400,7 +400,7 @@ 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>;
|
|
@@ -447,7 +447,10 @@ export declare const RenderInternals: {
|
|
|
447
447
|
logLevel: "verbose" | "info" | "warn" | "error";
|
|
448
448
|
serveUrl: string;
|
|
449
449
|
id: string;
|
|
450
|
-
}) => Promise<
|
|
450
|
+
}) => Promise<{
|
|
451
|
+
metadata: import("remotion").VideoConfig;
|
|
452
|
+
propsSize: number;
|
|
453
|
+
}>;
|
|
451
454
|
internalGetCompositions: ({ browserExecutable, chromiumOptions, envVariables, indent, inputProps, onBrowserLog, port, puppeteerInstance, serveUrlOrWebpackUrl, server, timeoutInMilliseconds, logLevel, }: {
|
|
452
455
|
inputProps: Record<string, unknown>;
|
|
453
456
|
envVariables: Record<string, string>;
|
|
@@ -461,7 +464,7 @@ export declare const RenderInternals: {
|
|
|
461
464
|
indent: boolean;
|
|
462
465
|
logLevel: "verbose" | "info" | "warn" | "error";
|
|
463
466
|
serveUrlOrWebpackUrl: string;
|
|
464
|
-
}) => Promise<import("remotion").
|
|
467
|
+
}) => Promise<import("remotion").VideoConfig[]>;
|
|
465
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>;
|
|
466
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<{
|
|
467
470
|
buffer: Buffer | null;
|
package/dist/logger.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ export declare const Log: {
|
|
|
18
18
|
warnAdvanced: (options: LogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
19
19
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
20
20
|
};
|
|
21
|
-
export declare const getLogLevel: () => "
|
|
21
|
+
export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn";
|
|
22
22
|
export declare const setLogLevel: (newLogLevel: LogLevel) => void;
|
|
23
23
|
export {};
|
package/dist/logger.js
CHANGED
|
@@ -7,11 +7,11 @@ const log_level_1 = require("./log-level");
|
|
|
7
7
|
const truthy_1 = require("./truthy");
|
|
8
8
|
exports.INDENT_TOKEN = chalk_1.chalk.gray('│');
|
|
9
9
|
const verboseTag = (str) => {
|
|
10
|
-
return is_color_supported_1.isColorSupported ? chalk_1.chalk.bgBlack(` ${str} `) : `[${str}]`;
|
|
10
|
+
return (0, is_color_supported_1.isColorSupported)() ? chalk_1.chalk.bgBlack(` ${str} `) : `[${str}]`;
|
|
11
11
|
};
|
|
12
12
|
exports.verboseTag = verboseTag;
|
|
13
13
|
const secondverboseTag = (str) => {
|
|
14
|
-
return is_color_supported_1.isColorSupported ? chalk_1.chalk.bgWhite(` ${str} `) : `[${str}]`;
|
|
14
|
+
return (0, is_color_supported_1.isColorSupported)() ? chalk_1.chalk.bgWhite(` ${str} `) : `[${str}]`;
|
|
15
15
|
};
|
|
16
16
|
exports.secondverboseTag = secondverboseTag;
|
|
17
17
|
exports.Log = {
|
|
@@ -39,13 +39,13 @@ async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, })
|
|
|
39
39
|
const expressionWithSourceUrl = SOURCE_URL_REGEX.test(expression)
|
|
40
40
|
? expression
|
|
41
41
|
: expression + '\n' + suffix;
|
|
42
|
-
const { exceptionDetails: exceptDetails, result: remotObject } =
|
|
42
|
+
const { value: { exceptionDetails: exceptDetails, result: remotObject }, size, } = await client.send('Runtime.evaluate', {
|
|
43
43
|
expression: expressionWithSourceUrl,
|
|
44
44
|
contextId,
|
|
45
45
|
returnByValue: true,
|
|
46
46
|
awaitPromise: true,
|
|
47
47
|
userGesture: true,
|
|
48
|
-
})
|
|
48
|
+
});
|
|
49
49
|
if (exceptDetails === null || exceptDetails === void 0 ? void 0 : exceptDetails.exception) {
|
|
50
50
|
const err = new symbolicateable_error_1.SymbolicateableError({
|
|
51
51
|
stack: exceptDetails.exception.description,
|
|
@@ -56,7 +56,7 @@ async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, })
|
|
|
56
56
|
});
|
|
57
57
|
throw err;
|
|
58
58
|
}
|
|
59
|
-
return valueFromRemoteObject(remotObject);
|
|
59
|
+
return { value: valueFromRemoteObject(remotObject), size };
|
|
60
60
|
}
|
|
61
61
|
if (typeof pageFunction !== 'function')
|
|
62
62
|
throw new Error(`Expected to get |string| or |function| as the first argument, but got "${pageFunction}" instead.`);
|
|
@@ -100,7 +100,7 @@ async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, })
|
|
|
100
100
|
throw error;
|
|
101
101
|
}
|
|
102
102
|
try {
|
|
103
|
-
const { exceptionDetails, result: remoteObject } = await callFunctionOnPromise;
|
|
103
|
+
const { value: { exceptionDetails, result: remoteObject }, size, } = await callFunctionOnPromise;
|
|
104
104
|
if (exceptionDetails) {
|
|
105
105
|
const err = new symbolicateable_error_1.SymbolicateableError({
|
|
106
106
|
stack: (_c = exceptionDetails.exception) === null || _c === void 0 ? void 0 : _c.description,
|
|
@@ -111,7 +111,7 @@ async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, })
|
|
|
111
111
|
});
|
|
112
112
|
throw err;
|
|
113
113
|
}
|
|
114
|
-
return valueFromRemoteObject(remoteObject);
|
|
114
|
+
return { size, value: valueFromRemoteObject(remoteObject) };
|
|
115
115
|
}
|
|
116
116
|
catch (error) {
|
|
117
117
|
if ((_h = error === null || error === void 0 ? void 0 : error.originalMessage) === null || _h === void 0 ? void 0 : _h.startsWith("Object couldn't be returned by value")) {
|
package/dist/render-frames.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { VideoConfig } from 'remotion';
|
|
3
3
|
import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
|
|
4
4
|
import type { BrowserExecutable } from './browser-executable';
|
|
5
5
|
import type { BrowserLog } from './browser-log';
|
|
@@ -31,7 +31,7 @@ export type InternalRenderFramesOptions = {
|
|
|
31
31
|
scale: number;
|
|
32
32
|
port: number | null;
|
|
33
33
|
cancelSignal: CancelSignal | undefined;
|
|
34
|
-
composition:
|
|
34
|
+
composition: VideoConfig;
|
|
35
35
|
indent: boolean;
|
|
36
36
|
server: RemotionServer | undefined;
|
|
37
37
|
muted: boolean;
|
|
@@ -72,7 +72,7 @@ export type RenderFramesOptions = {
|
|
|
72
72
|
scale?: number;
|
|
73
73
|
port?: number | null;
|
|
74
74
|
cancelSignal?: CancelSignal;
|
|
75
|
-
composition:
|
|
75
|
+
composition: VideoConfig;
|
|
76
76
|
muted?: boolean;
|
|
77
77
|
concurrency?: number | string | null;
|
|
78
78
|
serveUrl: string;
|