@remotion/renderer 4.0.138 → 4.0.140
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/BrowserPage.js +1 -1
- package/dist/client.d.ts +16 -15
- package/dist/client.js +2 -0
- package/dist/cycle-browser-tabs.js +2 -1
- package/dist/error-handling/handle-javascript-exception.js +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/is-delay-render-error-with.retry.d.ts +2 -0
- package/dist/is-delay-render-error-with.retry.js +37 -0
- package/dist/options/gl.d.ts +3 -3
- package/dist/options/index.d.ts +6 -6
- package/dist/options/options-map.d.ts +9 -9
- package/dist/options/throw-if-site-exists.d.ts +15 -0
- package/dist/options/throw-if-site-exists.js +28 -0
- package/dist/options/x264-preset.d.ts +2 -2
- package/dist/print-useful-error-message.d.ts +1 -1
- package/dist/print-useful-error-message.js +28 -29
- package/dist/puppeteer-evaluate.js +1 -0
- package/dist/pure.d.ts +4 -1
- package/dist/render-frames.js +37 -12
- package/dist/render-still.js +1 -0
- package/dist/replace-browser.js +3 -2
- package/dist/seek-to-frame.d.ts +2 -1
- package/dist/seek-to-frame.js +4 -4
- package/dist/select-composition.js +1 -1
- package/dist/set-props-and-env.js +3 -0
- package/dist/wrap-with-error-handling.d.ts +6 -1
- package/dist/wrap-with-error-handling.js +3 -1
- package/package.json +9 -9
|
@@ -96,7 +96,7 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
96
96
|
.send('Target.detachFromTarget', {
|
|
97
97
|
sessionId: event.sessionId,
|
|
98
98
|
})
|
|
99
|
-
.catch((err) =>
|
|
99
|
+
.catch((err) => logger_1.Log.error({ indent, logLevel }, err));
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
client.on('Runtime.consoleAPICalled', (event) => {
|
package/dist/client.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare const BrowserSafeApis: {
|
|
|
15
15
|
validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
|
|
16
16
|
DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
17
17
|
DEFAULT_TIMEOUT: number;
|
|
18
|
+
DEFAULT_JPEG_QUALITY: number;
|
|
18
19
|
supportedAudioCodecs: {
|
|
19
20
|
readonly h264: readonly ["aac", "pcm-16", "mp3"];
|
|
20
21
|
readonly 'h264-mkv': readonly ["pcm-16", "mp3"];
|
|
@@ -464,19 +465,19 @@ export declare const BrowserSafeApis: {
|
|
|
464
465
|
cliFlag: "gl";
|
|
465
466
|
docLink: string;
|
|
466
467
|
name: string;
|
|
467
|
-
type: "
|
|
468
|
+
type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
468
469
|
ssrName: string;
|
|
469
470
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
470
471
|
getValue: ({ commandLine }: {
|
|
471
472
|
commandLine: Record<string, unknown>;
|
|
472
473
|
}) => {
|
|
473
|
-
value: "
|
|
474
|
+
value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
|
|
474
475
|
source: string;
|
|
475
476
|
} | {
|
|
476
477
|
value: null;
|
|
477
478
|
source: string;
|
|
478
479
|
};
|
|
479
|
-
setConfig: (value: "
|
|
480
|
+
setConfig: (value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
|
|
480
481
|
};
|
|
481
482
|
enableLambdaInsights: {
|
|
482
483
|
name: string;
|
|
@@ -601,17 +602,17 @@ export declare const BrowserSafeApis: {
|
|
|
601
602
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
602
603
|
ssrName: "x264Preset";
|
|
603
604
|
docLink: string;
|
|
604
|
-
type: "
|
|
605
|
+
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
605
606
|
getValue: ({ commandLine }: {
|
|
606
607
|
commandLine: Record<string, unknown>;
|
|
607
608
|
}) => {
|
|
608
|
-
value: "
|
|
609
|
+
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
|
|
609
610
|
source: string;
|
|
610
611
|
} | {
|
|
611
612
|
value: null;
|
|
612
613
|
source: string;
|
|
613
614
|
};
|
|
614
|
-
setConfig: (profile: "
|
|
615
|
+
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
615
616
|
};
|
|
616
617
|
logLevelOption: {
|
|
617
618
|
cliFlag: "log";
|
|
@@ -846,17 +847,17 @@ export declare const BrowserSafeApis: {
|
|
|
846
847
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
847
848
|
ssrName: "x264Preset";
|
|
848
849
|
docLink: string;
|
|
849
|
-
type: "
|
|
850
|
+
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
850
851
|
getValue: ({ commandLine }: {
|
|
851
852
|
commandLine: Record<string, unknown>;
|
|
852
853
|
}) => {
|
|
853
|
-
value: "
|
|
854
|
+
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
|
|
854
855
|
source: string;
|
|
855
856
|
} | {
|
|
856
857
|
value: null;
|
|
857
858
|
source: string;
|
|
858
859
|
};
|
|
859
|
-
setConfig: (profile: "
|
|
860
|
+
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
860
861
|
};
|
|
861
862
|
readonly audioBitrate: {
|
|
862
863
|
name: string;
|
|
@@ -1568,17 +1569,17 @@ export declare const BrowserSafeApis: {
|
|
|
1568
1569
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1569
1570
|
ssrName: "x264Preset";
|
|
1570
1571
|
docLink: string;
|
|
1571
|
-
type: "
|
|
1572
|
+
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
1572
1573
|
getValue: ({ commandLine }: {
|
|
1573
1574
|
commandLine: Record<string, unknown>;
|
|
1574
1575
|
}) => {
|
|
1575
|
-
value: "
|
|
1576
|
+
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
|
|
1576
1577
|
source: string;
|
|
1577
1578
|
} | {
|
|
1578
1579
|
value: null;
|
|
1579
1580
|
source: string;
|
|
1580
1581
|
};
|
|
1581
|
-
setConfig: (profile: "
|
|
1582
|
+
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
1582
1583
|
};
|
|
1583
1584
|
readonly encodingMaxRate: {
|
|
1584
1585
|
name: string;
|
|
@@ -1934,17 +1935,17 @@ export declare const BrowserSafeApis: {
|
|
|
1934
1935
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1935
1936
|
ssrName: "x264Preset";
|
|
1936
1937
|
docLink: string;
|
|
1937
|
-
type: "
|
|
1938
|
+
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
1938
1939
|
getValue: ({ commandLine }: {
|
|
1939
1940
|
commandLine: Record<string, unknown>;
|
|
1940
1941
|
}) => {
|
|
1941
|
-
value: "
|
|
1942
|
+
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
|
|
1942
1943
|
source: string;
|
|
1943
1944
|
} | {
|
|
1944
1945
|
value: null;
|
|
1945
1946
|
source: string;
|
|
1946
1947
|
};
|
|
1947
|
-
setConfig: (profile: "
|
|
1948
|
+
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
1948
1949
|
};
|
|
1949
1950
|
readonly encodingMaxRate: {
|
|
1950
1951
|
name: string;
|
package/dist/client.js
CHANGED
|
@@ -8,6 +8,7 @@ const crf_1 = require("./crf");
|
|
|
8
8
|
const file_extensions_1 = require("./file-extensions");
|
|
9
9
|
const get_extension_from_codec_1 = require("./get-extension-from-codec");
|
|
10
10
|
const image_format_1 = require("./image-format");
|
|
11
|
+
const jpeg_quality_1 = require("./jpeg-quality");
|
|
11
12
|
const log_level_1 = require("./log-level");
|
|
12
13
|
const options_1 = require("./options");
|
|
13
14
|
const audio_codec_1 = require("./options/audio-codec");
|
|
@@ -35,6 +36,7 @@ exports.BrowserSafeApis = {
|
|
|
35
36
|
validStillImageFormats: image_format_1.validStillImageFormats,
|
|
36
37
|
DEFAULT_PIXEL_FORMAT: pixel_format_1.DEFAULT_PIXEL_FORMAT,
|
|
37
38
|
DEFAULT_TIMEOUT: TimeoutSettings_1.DEFAULT_TIMEOUT,
|
|
39
|
+
DEFAULT_JPEG_QUALITY: jpeg_quality_1.DEFAULT_JPEG_QUALITY,
|
|
38
40
|
supportedAudioCodecs: audio_codec_1.supportedAudioCodecs,
|
|
39
41
|
defaultFileExtensionMap: file_extensions_1.defaultFileExtensionMap,
|
|
40
42
|
defaultAudioCodecs: audio_codec_1.defaultAudioCodecs,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cycleBrowserTabs = void 0;
|
|
4
|
+
const logger_1 = require("./logger");
|
|
4
5
|
const cycleBrowserTabs = (puppeteerInstance, concurrency, logLevel, indent) => {
|
|
5
6
|
if (concurrency <= 1) {
|
|
6
7
|
return {
|
|
@@ -27,7 +28,7 @@ const cycleBrowserTabs = (puppeteerInstance, concurrency, logLevel, indent) => {
|
|
|
27
28
|
return currentPage.bringToFront();
|
|
28
29
|
}
|
|
29
30
|
})
|
|
30
|
-
.catch((err) =>
|
|
31
|
+
.catch((err) => logger_1.Log.error({ indent, logLevel }, err))
|
|
31
32
|
.finally(() => {
|
|
32
33
|
if (!stopped) {
|
|
33
34
|
set();
|
|
@@ -65,6 +65,7 @@ const handleJavascriptException = ({ page, onError, frame, }) => {
|
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
|
|
68
|
+
page.close();
|
|
68
69
|
const symbolicatedErr = new symbolicateable_error_1.SymbolicateableError({
|
|
69
70
|
message: removeDelayRenderStack(cleanErrorMessage),
|
|
70
71
|
stackFrame: exception.exceptionDetails.stackTrace.callFrames.map((f) => callFrameToStackFrame(f)),
|
package/dist/index.d.ts
CHANGED
|
@@ -140,8 +140,8 @@ export declare const RenderInternals: {
|
|
|
140
140
|
validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
141
141
|
DEFAULT_BROWSER: "chrome";
|
|
142
142
|
validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
|
|
143
|
-
DEFAULT_OPENGL_RENDERER: "
|
|
144
|
-
validateOpenGlRenderer: (option: unknown) => "
|
|
143
|
+
DEFAULT_OPENGL_RENDERER: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
144
|
+
validateOpenGlRenderer: (option: unknown) => "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
145
145
|
validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "h264-ts", "gif"];
|
|
146
146
|
DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
147
147
|
validateJpegQuality: (q: unknown) => void;
|
|
@@ -352,8 +352,8 @@ export declare const RenderInternals: {
|
|
|
352
352
|
}) => execa.ExecaChildProcess<string>;
|
|
353
353
|
validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
|
|
354
354
|
validVideoImageFormats: readonly ["png", "jpeg", "none"];
|
|
355
|
-
DEFAULT_STILL_IMAGE_FORMAT: "
|
|
356
|
-
DEFAULT_VIDEO_IMAGE_FORMAT: "
|
|
355
|
+
DEFAULT_STILL_IMAGE_FORMAT: "png" | "jpeg" | "pdf" | "webp";
|
|
356
|
+
DEFAULT_VIDEO_IMAGE_FORMAT: "png" | "jpeg" | "none";
|
|
357
357
|
DEFAULT_JPEG_QUALITY: number;
|
|
358
358
|
chalk: {
|
|
359
359
|
enabled: () => boolean;
|
|
@@ -452,7 +452,7 @@ export declare const RenderInternals: {
|
|
|
452
452
|
frame: number;
|
|
453
453
|
serializedInputPropsWithCustomSchema: string;
|
|
454
454
|
serializedResolvedPropsWithCustomSchema: string;
|
|
455
|
-
imageFormat: "
|
|
455
|
+
imageFormat: "png" | "jpeg" | "pdf" | "webp";
|
|
456
456
|
jpegQuality: number;
|
|
457
457
|
puppeteerInstance: HeadlessBrowser | null;
|
|
458
458
|
envVariables: Record<string, string>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRetriesLeftFromError = exports.isDelayRenderErrorWithRetry = void 0;
|
|
4
|
+
const no_react_1 = require("remotion/no-react");
|
|
5
|
+
const isDelayRenderErrorWithRetry = (error) => {
|
|
6
|
+
var _a;
|
|
7
|
+
if (!error) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
const shouldRetryError = (_a = error.stack) === null || _a === void 0 ? void 0 : _a.includes(no_react_1.NoReactInternals.DELAY_RENDER_RETRY_TOKEN);
|
|
11
|
+
return shouldRetryError;
|
|
12
|
+
};
|
|
13
|
+
exports.isDelayRenderErrorWithRetry = isDelayRenderErrorWithRetry;
|
|
14
|
+
const getRetriesLeftFromError = (error) => {
|
|
15
|
+
if (!error) {
|
|
16
|
+
throw new Error('Expected stack');
|
|
17
|
+
}
|
|
18
|
+
const { stack } = error;
|
|
19
|
+
if (!stack) {
|
|
20
|
+
throw new Error('Expected stack: ' + JSON.stringify(error));
|
|
21
|
+
}
|
|
22
|
+
const beforeIndex = stack.indexOf(no_react_1.NoReactInternals.DELAY_RENDER_ATTEMPT_TOKEN);
|
|
23
|
+
if (beforeIndex === -1) {
|
|
24
|
+
throw new Error('Expected to find attempt token in stack');
|
|
25
|
+
}
|
|
26
|
+
const afterIndex = stack.indexOf(no_react_1.NoReactInternals.DELAY_RENDER_RETRY_TOKEN);
|
|
27
|
+
if (afterIndex === -1) {
|
|
28
|
+
throw new Error('Expected to find retry token in stack');
|
|
29
|
+
}
|
|
30
|
+
const inbetween = stack.substring(beforeIndex + no_react_1.NoReactInternals.DELAY_RENDER_ATTEMPT_TOKEN.length, afterIndex);
|
|
31
|
+
const parsed = Number(inbetween);
|
|
32
|
+
if (Number.isNaN(parsed)) {
|
|
33
|
+
throw new Error(`Expected to find a number in the stack ${stack}`);
|
|
34
|
+
}
|
|
35
|
+
return parsed;
|
|
36
|
+
};
|
|
37
|
+
exports.getRetriesLeftFromError = getRetriesLeftFromError;
|
package/dist/options/gl.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare const validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader", "vulkan", "angle-egl"];
|
|
2
2
|
export type OpenGlRenderer = (typeof validOpenGlRenderers)[number];
|
|
3
3
|
export declare const DEFAULT_OPENGL_RENDERER: OpenGlRenderer | null;
|
|
4
|
-
export declare const getChromiumOpenGlRenderer: () => "
|
|
4
|
+
export declare const getChromiumOpenGlRenderer: () => "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
5
5
|
export declare const setChromiumOpenGlRenderer: (renderer: OpenGlRenderer) => void;
|
|
6
6
|
export declare const glOption: {
|
|
7
7
|
cliFlag: "gl";
|
|
8
8
|
docLink: string;
|
|
9
9
|
name: string;
|
|
10
|
-
type: "
|
|
10
|
+
type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
11
11
|
ssrName: string;
|
|
12
12
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
getValue: ({ commandLine }: {
|
|
14
14
|
commandLine: Record<string, unknown>;
|
|
15
15
|
}) => {
|
|
16
|
-
value: "
|
|
16
|
+
value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
|
|
17
17
|
source: string;
|
|
18
18
|
} | {
|
|
19
19
|
value: null;
|
package/dist/options/index.d.ts
CHANGED
|
@@ -245,19 +245,19 @@ export declare const allOptions: {
|
|
|
245
245
|
cliFlag: "gl";
|
|
246
246
|
docLink: string;
|
|
247
247
|
name: string;
|
|
248
|
-
type: "
|
|
248
|
+
type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
|
|
249
249
|
ssrName: string;
|
|
250
250
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
251
251
|
getValue: ({ commandLine }: {
|
|
252
252
|
commandLine: Record<string, unknown>;
|
|
253
253
|
}) => {
|
|
254
|
-
value: "
|
|
254
|
+
value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
|
|
255
255
|
source: string;
|
|
256
256
|
} | {
|
|
257
257
|
value: null;
|
|
258
258
|
source: string;
|
|
259
259
|
};
|
|
260
|
-
setConfig: (value: "
|
|
260
|
+
setConfig: (value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
|
|
261
261
|
};
|
|
262
262
|
enableLambdaInsights: {
|
|
263
263
|
name: string;
|
|
@@ -382,17 +382,17 @@ export declare const allOptions: {
|
|
|
382
382
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
383
383
|
ssrName: "x264Preset";
|
|
384
384
|
docLink: string;
|
|
385
|
-
type: "
|
|
385
|
+
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
386
386
|
getValue: ({ commandLine }: {
|
|
387
387
|
commandLine: Record<string, unknown>;
|
|
388
388
|
}) => {
|
|
389
|
-
value: "
|
|
389
|
+
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
|
|
390
390
|
source: string;
|
|
391
391
|
} | {
|
|
392
392
|
value: null;
|
|
393
393
|
source: string;
|
|
394
394
|
};
|
|
395
|
-
setConfig: (profile: "
|
|
395
|
+
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
396
396
|
};
|
|
397
397
|
logLevelOption: {
|
|
398
398
|
cliFlag: "log";
|
|
@@ -72,17 +72,17 @@ export declare const optionsMap: {
|
|
|
72
72
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
73
73
|
ssrName: "x264Preset";
|
|
74
74
|
docLink: string;
|
|
75
|
-
type: "
|
|
75
|
+
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
76
76
|
getValue: ({ commandLine }: {
|
|
77
77
|
commandLine: Record<string, unknown>;
|
|
78
78
|
}) => {
|
|
79
|
-
value: "
|
|
79
|
+
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
|
|
80
80
|
source: string;
|
|
81
81
|
} | {
|
|
82
82
|
value: null;
|
|
83
83
|
source: string;
|
|
84
84
|
};
|
|
85
|
-
setConfig: (profile: "
|
|
85
|
+
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
86
86
|
};
|
|
87
87
|
readonly audioBitrate: {
|
|
88
88
|
name: string;
|
|
@@ -794,17 +794,17 @@ export declare const optionsMap: {
|
|
|
794
794
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
795
795
|
ssrName: "x264Preset";
|
|
796
796
|
docLink: string;
|
|
797
|
-
type: "
|
|
797
|
+
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
798
798
|
getValue: ({ commandLine }: {
|
|
799
799
|
commandLine: Record<string, unknown>;
|
|
800
800
|
}) => {
|
|
801
|
-
value: "
|
|
801
|
+
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
|
|
802
802
|
source: string;
|
|
803
803
|
} | {
|
|
804
804
|
value: null;
|
|
805
805
|
source: string;
|
|
806
806
|
};
|
|
807
|
-
setConfig: (profile: "
|
|
807
|
+
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
808
808
|
};
|
|
809
809
|
readonly encodingMaxRate: {
|
|
810
810
|
name: string;
|
|
@@ -1160,17 +1160,17 @@ export declare const optionsMap: {
|
|
|
1160
1160
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1161
1161
|
ssrName: "x264Preset";
|
|
1162
1162
|
docLink: string;
|
|
1163
|
-
type: "
|
|
1163
|
+
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
1164
1164
|
getValue: ({ commandLine }: {
|
|
1165
1165
|
commandLine: Record<string, unknown>;
|
|
1166
1166
|
}) => {
|
|
1167
|
-
value: "
|
|
1167
|
+
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
|
|
1168
1168
|
source: string;
|
|
1169
1169
|
} | {
|
|
1170
1170
|
value: null;
|
|
1171
1171
|
source: string;
|
|
1172
1172
|
};
|
|
1173
|
-
setConfig: (profile: "
|
|
1173
|
+
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
1174
1174
|
};
|
|
1175
1175
|
readonly encodingMaxRate: {
|
|
1176
1176
|
name: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const throwIfSiteExistsOption: {
|
|
2
|
+
cliFlag: string;
|
|
3
|
+
description: () => string;
|
|
4
|
+
docLink: string;
|
|
5
|
+
getValue: ({ commandLine }: {
|
|
6
|
+
commandLine: Record<string, unknown>;
|
|
7
|
+
}) => {
|
|
8
|
+
source: string;
|
|
9
|
+
value: boolean;
|
|
10
|
+
};
|
|
11
|
+
name: string;
|
|
12
|
+
setConfig: () => never;
|
|
13
|
+
ssrName: string;
|
|
14
|
+
type: boolean;
|
|
15
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.throwIfSiteExistsOption = void 0;
|
|
4
|
+
const DEFAULT = false;
|
|
5
|
+
const cliFlag = 'throw-if-site-exists';
|
|
6
|
+
exports.throwIfSiteExistsOption = {
|
|
7
|
+
cliFlag,
|
|
8
|
+
description: () => `Prevents accidential update of an existing site. If there are any files in the subfolder where the site should be placed, the function will throw.`,
|
|
9
|
+
docLink: 'https://remotion.dev/docs/lambda/deploy-site',
|
|
10
|
+
getValue: ({ commandLine }) => {
|
|
11
|
+
if (commandLine[cliFlag]) {
|
|
12
|
+
return {
|
|
13
|
+
source: 'cli',
|
|
14
|
+
value: commandLine[cliFlag],
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
source: 'default',
|
|
19
|
+
value: DEFAULT,
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
name: 'Throw if site exists',
|
|
23
|
+
setConfig: () => {
|
|
24
|
+
throw new Error('Not implemented');
|
|
25
|
+
},
|
|
26
|
+
ssrName: 'throwIfSiteExists',
|
|
27
|
+
type: false,
|
|
28
|
+
};
|
|
@@ -11,11 +11,11 @@ export declare const x264Option: {
|
|
|
11
11
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
ssrName: "x264Preset";
|
|
13
13
|
docLink: string;
|
|
14
|
-
type: "
|
|
14
|
+
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
15
15
|
getValue: ({ commandLine }: {
|
|
16
16
|
commandLine: Record<string, unknown>;
|
|
17
17
|
}) => {
|
|
18
|
-
value: "
|
|
18
|
+
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
|
|
19
19
|
source: string;
|
|
20
20
|
} | {
|
|
21
21
|
value: null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { LogLevel } from './log-level';
|
|
2
|
-
export declare const printUsefulErrorMessage: (err: Error, logLevel: LogLevel) => void;
|
|
2
|
+
export declare const printUsefulErrorMessage: (err: Error, logLevel: LogLevel, indent: boolean) => void;
|
|
@@ -4,75 +4,74 @@ exports.printUsefulErrorMessage = void 0;
|
|
|
4
4
|
const logger_1 = require("./logger");
|
|
5
5
|
const truthy_1 = require("./truthy");
|
|
6
6
|
const alreadyPrinted = [];
|
|
7
|
-
|
|
8
|
-
const printUsefulErrorMessage = (err, logLevel) => {
|
|
7
|
+
const printUsefulErrorMessage = (err, logLevel, indent) => {
|
|
9
8
|
var _a, _b;
|
|
10
9
|
if (alreadyPrinted.includes(err)) {
|
|
11
10
|
return;
|
|
12
11
|
}
|
|
13
12
|
alreadyPrinted.push(err);
|
|
14
13
|
if (err.message.includes('Could not play video with')) {
|
|
15
|
-
logger_1.Log.info({ indent
|
|
16
|
-
logger_1.Log.info({ indent
|
|
14
|
+
logger_1.Log.info({ indent, logLevel });
|
|
15
|
+
logger_1.Log.info({ indent, logLevel }, '💡 Get help for this issue at https://remotion.dev/docs/media-playback-error');
|
|
17
16
|
}
|
|
18
17
|
if (err.message.includes('A delayRender()') &&
|
|
19
18
|
err.message.includes('was called but not cleared after')) {
|
|
20
|
-
logger_1.Log.info({ indent
|
|
19
|
+
logger_1.Log.info({ indent, logLevel });
|
|
21
20
|
if (err.message.includes('/proxy')) {
|
|
22
|
-
logger_1.Log.info({ indent
|
|
21
|
+
logger_1.Log.info({ indent, logLevel }, '💡 Get help for this issue at https://remotion.dev/docs/troubleshooting/delay-render-proxy');
|
|
23
22
|
}
|
|
24
|
-
logger_1.Log.info({ indent
|
|
23
|
+
logger_1.Log.info({ indent, logLevel }, '💡 Get help for this issue at https://remotion.dev/docs/timeout');
|
|
25
24
|
}
|
|
26
25
|
if (err.message.includes('Target closed')) {
|
|
27
|
-
logger_1.Log.info({ indent
|
|
28
|
-
logger_1.Log.info({ indent
|
|
26
|
+
logger_1.Log.info({ indent, logLevel });
|
|
27
|
+
logger_1.Log.info({ indent, logLevel }, '💡 Get help for this issue at https://remotion.dev/docs/target-closed');
|
|
29
28
|
}
|
|
30
29
|
if (err.message.includes('Timed out evaluating')) {
|
|
31
|
-
logger_1.Log.info({ indent
|
|
32
|
-
logger_1.Log.info({ indent
|
|
30
|
+
logger_1.Log.info({ indent, logLevel });
|
|
31
|
+
logger_1.Log.info({ indent, logLevel }, '💡 Get help for this issue at https://remotion.dev/docs/troubleshooting/timed-out-page-function');
|
|
33
32
|
}
|
|
34
33
|
if (err.message.includes('ENAMETOOLONG')) {
|
|
35
|
-
logger_1.Log.info({ indent
|
|
36
|
-
logger_1.Log.info({ indent
|
|
34
|
+
logger_1.Log.info({ indent, logLevel });
|
|
35
|
+
logger_1.Log.info({ indent, logLevel }, '💡 Get help for this issue at https://remotion.dev/docs/enametoolong');
|
|
37
36
|
}
|
|
38
37
|
if (err.message.includes('Member must have value less than or equal to 3008')) {
|
|
39
|
-
logger_1.Log.info({ indent
|
|
40
|
-
logger_1.Log.info({ indent
|
|
38
|
+
logger_1.Log.info({ indent, logLevel });
|
|
39
|
+
logger_1.Log.info({ indent, logLevel }, '💡 This error indicates that you have a AWS account on the free tier or have been limited by your organization. Often times this can be solved by adding a credit card. See also: https://repost.aws/questions/QUKruWYNDYTSmP17jCnIz6IQ/questions/QUKruWYNDYTSmP17jCnIz6IQ/unable-to-set-lambda-memory-over-3008mb');
|
|
41
40
|
}
|
|
42
41
|
if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('TooManyRequestsException: Rate Exceeded.')) {
|
|
43
|
-
logger_1.Log.info({ indent
|
|
44
|
-
logger_1.Log.info({ indent
|
|
42
|
+
logger_1.Log.info({ indent, logLevel });
|
|
43
|
+
logger_1.Log.info({ indent, logLevel }, '💡 This error indicates that your Lambda concurrency limit is too low. See: https://www.remotion.dev/docs/lambda/troubleshooting/rate-limit');
|
|
45
44
|
}
|
|
46
45
|
if (err.message.includes('Error creating WebGL context')) {
|
|
47
|
-
logger_1.Log.info({ indent
|
|
46
|
+
logger_1.Log.info({ indent, logLevel });
|
|
48
47
|
console.warn('💡 You might need to set the OpenGL renderer to "angle-egl", "angle" (or "swangle" if rendering on lambda). Learn why at https://www.remotion.dev/docs/three');
|
|
49
48
|
console.warn("💡 Check how it's done at https://www.remotion.dev/docs/chromium-flags#--gl");
|
|
50
49
|
}
|
|
51
50
|
if (err.message.includes('The bucket does not allow ACLs')) {
|
|
52
|
-
logger_1.Log.info({ indent
|
|
53
|
-
logger_1.Log.info({ indent
|
|
51
|
+
logger_1.Log.info({ indent, logLevel });
|
|
52
|
+
logger_1.Log.info({ indent, logLevel }, '💡 Fix for this issue: https://remotion.dev/docs/lambda/troubleshooting/bucket-disallows-acl');
|
|
54
53
|
}
|
|
55
54
|
if (err.message.includes('Minified React error #306')) {
|
|
56
55
|
const componentName = (_b = err.message.match(/<\w+>/)) === null || _b === void 0 ? void 0 : _b[0];
|
|
57
|
-
logger_1.Log.info({ indent
|
|
56
|
+
logger_1.Log.info({ indent, logLevel }, [
|
|
58
57
|
'💡 This error indicates that the component',
|
|
59
58
|
componentName ? `(${componentName})` : null,
|
|
60
59
|
'you are trying to render is not imported correctly.',
|
|
61
60
|
]
|
|
62
61
|
.filter(truthy_1.truthy)
|
|
63
62
|
.join(' '));
|
|
64
|
-
logger_1.Log.info({ indent
|
|
65
|
-
logger_1.Log.info({ indent
|
|
66
|
-
logger_1.Log.info({ indent
|
|
67
|
-
logger_1.Log.info({ indent
|
|
63
|
+
logger_1.Log.info({ indent, logLevel });
|
|
64
|
+
logger_1.Log.info({ indent, logLevel }, ' Check the root file and ensure that the component is not undefined.');
|
|
65
|
+
logger_1.Log.info({ indent, logLevel }, ' Oftentimes, this happens if the component is missing the `export` keyword');
|
|
66
|
+
logger_1.Log.info({ indent, logLevel }, ' or if the component was renamed and the import statement not properly adjusted.');
|
|
68
67
|
}
|
|
69
68
|
if (err.message.includes('GLIBC_')) {
|
|
70
|
-
logger_1.Log.info({ indent
|
|
71
|
-
logger_1.Log.info({ indent
|
|
69
|
+
logger_1.Log.info({ indent, logLevel }, '💡 Remotion requires at least Libc 2.35.');
|
|
70
|
+
logger_1.Log.info({ indent, logLevel }, '💡 Get help for this issue: https://github.com/remotion-dev/remotion/issues/2439');
|
|
72
71
|
}
|
|
73
72
|
if (err.message.includes('EBADF')) {
|
|
74
|
-
logger_1.Log.info({ indent
|
|
75
|
-
logger_1.Log.info({ indent
|
|
73
|
+
logger_1.Log.info({ indent, logLevel }, '💡 This error might be fixed by changing your Node version:');
|
|
74
|
+
logger_1.Log.info({ indent, logLevel }, ' https://github.com/remotion-dev/remotion/issues/2452');
|
|
76
75
|
}
|
|
77
76
|
};
|
|
78
77
|
exports.printUsefulErrorMessage = printUsefulErrorMessage;
|
|
@@ -108,6 +108,7 @@ async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, })
|
|
|
108
108
|
frame,
|
|
109
109
|
stackFrame: (0, parse_browser_error_stack_1.parseStack)(((_e = exceptionDetails.exception) === null || _e === void 0 ? void 0 : _e.description).split('\n')),
|
|
110
110
|
});
|
|
111
|
+
page.close();
|
|
111
112
|
throw err;
|
|
112
113
|
}
|
|
113
114
|
return { size, value: valueFromRemoteObject(remoteObject) };
|
package/dist/pure.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export declare const NoReactAPIs: {
|
|
2
|
-
wrapWithErrorHandling: <A extends
|
|
2
|
+
wrapWithErrorHandling: <A extends [{
|
|
3
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
4
|
+
indent: boolean;
|
|
5
|
+
}, ...unknown[]], R>(fn: (...args: A) => Promise<R>) => (...args: A) => Promise<R>;
|
|
3
6
|
getExtensionOfFilename: (filename: string | null) => string | null;
|
|
4
7
|
getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">(codec: T, audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => import("./file-extensions").FileExtension;
|
|
5
8
|
validateOutputFilename: <T_1 extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">({ codec, audioCodecSetting, extension, preferLossless, separateAudioTo, }: {
|
package/dist/render-frames.js
CHANGED
|
@@ -22,6 +22,7 @@ const get_duration_from_frame_range_1 = require("./get-duration-from-frame-range
|
|
|
22
22
|
const get_extra_frames_to_capture_1 = require("./get-extra-frames-to-capture");
|
|
23
23
|
const get_frame_padded_index_1 = require("./get-frame-padded-index");
|
|
24
24
|
const get_frame_to_render_1 = require("./get-frame-to-render");
|
|
25
|
+
const is_delay_render_error_with_retry_1 = require("./is-delay-render-error-with.retry");
|
|
25
26
|
const jpeg_quality_1 = require("./jpeg-quality");
|
|
26
27
|
const logger_1 = require("./logger");
|
|
27
28
|
const make_cancel_signal_1 = require("./make-cancel-signal");
|
|
@@ -150,7 +151,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
|
|
|
150
151
|
stopped = true;
|
|
151
152
|
});
|
|
152
153
|
const frameDir = outputDir !== null && outputDir !== void 0 ? outputDir : downloadMap.compositingDir;
|
|
153
|
-
const renderFrameWithOptionToReject = async ({ frame, index, reject, width, height, compId, assetsOnly, }) => {
|
|
154
|
+
const renderFrameWithOptionToReject = async ({ frame, index, reject, width, height, compId, assetsOnly, attempt, }) => {
|
|
154
155
|
const pool = await poolPromise;
|
|
155
156
|
const freePage = await pool.acquire();
|
|
156
157
|
if (stopped) {
|
|
@@ -174,6 +175,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
|
|
|
174
175
|
timeoutInMilliseconds,
|
|
175
176
|
indent,
|
|
176
177
|
logLevel,
|
|
178
|
+
attempt,
|
|
177
179
|
});
|
|
178
180
|
const timeToSeek = Date.now() - startSeeking;
|
|
179
181
|
if (timeToSeek > 1000) {
|
|
@@ -243,7 +245,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
|
|
|
243
245
|
freePage.off('error', errorCallbackOnFrame);
|
|
244
246
|
pool.release(freePage);
|
|
245
247
|
};
|
|
246
|
-
const renderFrame = (frame, index, assetsOnly) => {
|
|
248
|
+
const renderFrame = ({ frame, index, assetsOnly, attempt, }) => {
|
|
247
249
|
return new Promise((resolve, reject) => {
|
|
248
250
|
renderFrameWithOptionToReject({
|
|
249
251
|
frame,
|
|
@@ -253,6 +255,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
|
|
|
253
255
|
height: composition.height,
|
|
254
256
|
compId: composition.id,
|
|
255
257
|
assetsOnly,
|
|
258
|
+
attempt,
|
|
256
259
|
})
|
|
257
260
|
.then(() => {
|
|
258
261
|
resolve();
|
|
@@ -263,9 +266,10 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
|
|
|
263
266
|
});
|
|
264
267
|
};
|
|
265
268
|
const renderFrameAndRetryTargetClose = async ({ frame, index, retriesLeft, attempt, assetsOnly, }) => {
|
|
269
|
+
var _a;
|
|
266
270
|
try {
|
|
267
271
|
await Promise.race([
|
|
268
|
-
renderFrame(frame, index, assetsOnly),
|
|
272
|
+
renderFrame({ frame, index, assetsOnly, attempt }),
|
|
269
273
|
new Promise((_, reject) => {
|
|
270
274
|
cancelSignal === null || cancelSignal === void 0 ? void 0 : cancelSignal(() => {
|
|
271
275
|
reject(new Error(make_cancel_signal_1.cancelErrorMessages.renderFrames));
|
|
@@ -274,20 +278,41 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
|
|
|
274
278
|
]);
|
|
275
279
|
}
|
|
276
280
|
catch (err) {
|
|
277
|
-
|
|
281
|
+
const isTargetClosedError = (0, is_target_closed_err_1.isTargetClosedErr)(err);
|
|
282
|
+
const shouldRetryError = (_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes(no_react_1.NoReactInternals.DELAY_RENDER_RETRY_TOKEN);
|
|
283
|
+
if ((0, make_cancel_signal_1.isUserCancelledRender)(err) && !shouldRetryError) {
|
|
278
284
|
throw err;
|
|
279
285
|
}
|
|
280
|
-
if (!
|
|
286
|
+
if (!isTargetClosedError && !shouldRetryError) {
|
|
281
287
|
throw err;
|
|
282
288
|
}
|
|
283
289
|
if (stopped) {
|
|
284
290
|
return;
|
|
285
291
|
}
|
|
286
292
|
if (retriesLeft === 0) {
|
|
287
|
-
|
|
293
|
+
logger_1.Log.warn({
|
|
294
|
+
indent,
|
|
295
|
+
logLevel,
|
|
296
|
+
}, `The browser crashed ${attempt} times while rendering frame ${frame}. Not retrying anymore. Learn more about this error under https://www.remotion.dev/docs/target-closed`);
|
|
288
297
|
throw err;
|
|
289
298
|
}
|
|
290
|
-
|
|
299
|
+
if (shouldRetryError) {
|
|
300
|
+
const pool = await poolPromise;
|
|
301
|
+
// Replace the closed page
|
|
302
|
+
const newPage = await makePage(sourceMapGetter);
|
|
303
|
+
pool.release(newPage);
|
|
304
|
+
logger_1.Log.warn({ indent, logLevel }, `delayRender() timed out while rendering frame ${frame}: ${err.message}`);
|
|
305
|
+
const actualRetriesLeft = (0, is_delay_render_error_with_retry_1.getRetriesLeftFromError)(err);
|
|
306
|
+
return renderFrameAndRetryTargetClose({
|
|
307
|
+
frame,
|
|
308
|
+
index,
|
|
309
|
+
retriesLeft: actualRetriesLeft,
|
|
310
|
+
attempt: attempt + 1,
|
|
311
|
+
assetsOnly,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
logger_1.Log.warn({ indent, logLevel }, `The browser crashed while rendering frame ${frame}, retrying ${retriesLeft} more times. Learn more about this error under https://www.remotion.dev/docs/target-closed`);
|
|
315
|
+
// Replace the entire browser
|
|
291
316
|
await browserReplacer.replaceBrowser(makeBrowser, async () => {
|
|
292
317
|
const pages = new Array(actualConcurrency)
|
|
293
318
|
.fill(true)
|
|
@@ -468,7 +493,7 @@ const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOpti
|
|
|
468
493
|
if ((0, is_target_closed_err_1.isTargetClosedErr)(err)) {
|
|
469
494
|
return;
|
|
470
495
|
}
|
|
471
|
-
|
|
496
|
+
logger_1.Log.error({ indent, logLevel }, 'Unable to close browser tab', err);
|
|
472
497
|
});
|
|
473
498
|
}
|
|
474
499
|
else {
|
|
@@ -478,7 +503,7 @@ const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOpti
|
|
|
478
503
|
})
|
|
479
504
|
.catch((err) => {
|
|
480
505
|
if (!(err === null || err === void 0 ? void 0 : err.message.includes('Target closed'))) {
|
|
481
|
-
|
|
506
|
+
logger_1.Log.error({ indent, logLevel }, 'Unable to close browser', err);
|
|
482
507
|
}
|
|
483
508
|
});
|
|
484
509
|
}
|
|
@@ -502,11 +527,11 @@ const renderFrames = (options) => {
|
|
|
502
527
|
if (typeof jpegQuality !== 'undefined' && imageFormat !== 'jpeg') {
|
|
503
528
|
throw new Error("You can only pass the `quality` option if `imageFormat` is 'jpeg'.");
|
|
504
529
|
}
|
|
505
|
-
if (quality) {
|
|
506
|
-
console.warn('Passing `quality()` to `renderStill` is deprecated. Use `jpegQuality` instead.');
|
|
507
|
-
}
|
|
508
530
|
const logLevel = verbose || dumpBrowserLogs ? 'verbose' : passedLogLevel !== null && passedLogLevel !== void 0 ? passedLogLevel : 'info';
|
|
509
531
|
const indent = false;
|
|
532
|
+
if (quality) {
|
|
533
|
+
logger_1.Log.warn({ indent, logLevel }, 'Passing `quality()` to `renderStill` is deprecated. Use `jpegQuality` instead.');
|
|
534
|
+
}
|
|
510
535
|
return (0, exports.internalRenderFrames)({
|
|
511
536
|
browserExecutable: browserExecutable !== null && browserExecutable !== void 0 ? browserExecutable : null,
|
|
512
537
|
cancelSignal,
|
package/dist/render-still.js
CHANGED
|
@@ -184,6 +184,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
184
184
|
timeoutInMilliseconds,
|
|
185
185
|
indent,
|
|
186
186
|
logLevel,
|
|
187
|
+
attempt: 0,
|
|
187
188
|
});
|
|
188
189
|
const { buffer } = await (0, take_frame_and_compose_1.takeFrameAndCompose)({
|
|
189
190
|
frame: stillFrame,
|
package/dist/replace-browser.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handleBrowserCrash = void 0;
|
|
4
|
+
const logger_1 = require("./logger");
|
|
4
5
|
const handleBrowserCrash = (instance, logLevel, indent) => {
|
|
5
6
|
let _instance = instance;
|
|
6
7
|
const waiters = [];
|
|
@@ -22,7 +23,7 @@ const handleBrowserCrash = (instance, logLevel, indent) => {
|
|
|
22
23
|
await _instance
|
|
23
24
|
.close(true, logLevel, indent)
|
|
24
25
|
.then(() => {
|
|
25
|
-
|
|
26
|
+
logger_1.Log.info({ indent, logLevel }, 'Killed previous browser and making new one');
|
|
26
27
|
})
|
|
27
28
|
.catch(() => {
|
|
28
29
|
// Ignore as browser crashed
|
|
@@ -31,7 +32,7 @@ const handleBrowserCrash = (instance, logLevel, indent) => {
|
|
|
31
32
|
_instance = browser;
|
|
32
33
|
await makeNewPages();
|
|
33
34
|
waiters.forEach((w) => w.resolve(browser));
|
|
34
|
-
|
|
35
|
+
logger_1.Log.info({ indent, logLevel }, 'Made new browser');
|
|
35
36
|
return browser;
|
|
36
37
|
}
|
|
37
38
|
catch (err) {
|
package/dist/seek-to-frame.d.ts
CHANGED
|
@@ -7,11 +7,12 @@ export declare const waitForReady: ({ page, timeoutInMilliseconds, frame, indent
|
|
|
7
7
|
indent: boolean;
|
|
8
8
|
logLevel: LogLevel;
|
|
9
9
|
}) => Promise<unknown>;
|
|
10
|
-
export declare const seekToFrame: ({ frame, page, composition, timeoutInMilliseconds, logLevel, indent, }: {
|
|
10
|
+
export declare const seekToFrame: ({ frame, page, composition, timeoutInMilliseconds, logLevel, indent, attempt, }: {
|
|
11
11
|
frame: number;
|
|
12
12
|
composition: string;
|
|
13
13
|
page: Page;
|
|
14
14
|
timeoutInMilliseconds: number;
|
|
15
15
|
logLevel: LogLevel;
|
|
16
16
|
indent: boolean;
|
|
17
|
+
attempt: number;
|
|
17
18
|
}) => Promise<void>;
|
package/dist/seek-to-frame.js
CHANGED
|
@@ -114,7 +114,7 @@ const waitForReady = ({ page, timeoutInMilliseconds, frame, indent, logLevel, })
|
|
|
114
114
|
});
|
|
115
115
|
};
|
|
116
116
|
exports.waitForReady = waitForReady;
|
|
117
|
-
const seekToFrame = async ({ frame, page, composition, timeoutInMilliseconds, logLevel, indent, }) => {
|
|
117
|
+
const seekToFrame = async ({ frame, page, composition, timeoutInMilliseconds, logLevel, indent, attempt, }) => {
|
|
118
118
|
await (0, exports.waitForReady)({
|
|
119
119
|
page,
|
|
120
120
|
timeoutInMilliseconds,
|
|
@@ -123,10 +123,10 @@ const seekToFrame = async ({ frame, page, composition, timeoutInMilliseconds, lo
|
|
|
123
123
|
logLevel,
|
|
124
124
|
});
|
|
125
125
|
await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatchAndTimeout)({
|
|
126
|
-
pageFunction: (f, c) => {
|
|
127
|
-
window.remotion_setFrame(f, c);
|
|
126
|
+
pageFunction: (f, c, a) => {
|
|
127
|
+
window.remotion_setFrame(f, c, a);
|
|
128
128
|
},
|
|
129
|
-
args: [frame, composition],
|
|
129
|
+
args: [frame, composition, attempt],
|
|
130
130
|
frame,
|
|
131
131
|
page,
|
|
132
132
|
timeoutInMilliseconds,
|
|
@@ -161,7 +161,7 @@ const internalSelectCompositionRaw = async (options) => {
|
|
|
161
161
|
// Must prevent unhandled exception in cleanup function.
|
|
162
162
|
// Promise has already been resolved, so we can't reject it.
|
|
163
163
|
c().catch((err) => {
|
|
164
|
-
|
|
164
|
+
logger_1.Log.error({ indent, logLevel }, 'Cleanup error:', err);
|
|
165
165
|
});
|
|
166
166
|
});
|
|
167
167
|
});
|
|
@@ -28,6 +28,9 @@ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVa
|
|
|
28
28
|
await page.evaluateOnNewDocument((key) => {
|
|
29
29
|
window.remotion_initialFrame = key;
|
|
30
30
|
}, initialFrame);
|
|
31
|
+
await page.evaluateOnNewDocument(() => {
|
|
32
|
+
window.remotion_attempt = 1;
|
|
33
|
+
}, initialFrame);
|
|
31
34
|
await page.evaluateOnNewDocument((port) => {
|
|
32
35
|
window.remotion_proxyPort = port;
|
|
33
36
|
}, proxyPort);
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import type { LogLevel } from './log-level';
|
|
1
2
|
type AsyncFunction<A extends unknown[], R> = (...args: A) => Promise<R>;
|
|
2
|
-
|
|
3
|
+
type LogLevelAndIndentApi = {
|
|
4
|
+
logLevel: LogLevel;
|
|
5
|
+
indent: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const wrapWithErrorHandling: <A extends [LogLevelAndIndentApi, ...unknown[]], R>(fn: AsyncFunction<A, R>) => AsyncFunction<A, R>;
|
|
3
8
|
export {};
|
|
@@ -8,7 +8,9 @@ const wrapWithErrorHandling = (fn) => {
|
|
|
8
8
|
return await fn(...args);
|
|
9
9
|
}
|
|
10
10
|
catch (err) {
|
|
11
|
-
|
|
11
|
+
const { indent } = args[0];
|
|
12
|
+
const { logLevel } = args[0];
|
|
13
|
+
(0, print_useful_error_message_1.printUsefulErrorMessage)(err, logLevel, indent);
|
|
12
14
|
throw err;
|
|
13
15
|
}
|
|
14
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/renderer",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.140",
|
|
4
4
|
"description": "Renderer for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"extract-zip": "2.0.1",
|
|
19
19
|
"source-map": "^0.8.0-beta.0",
|
|
20
20
|
"ws": "8.7.0",
|
|
21
|
-
"remotion": "4.0.
|
|
21
|
+
"remotion": "4.0.140"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": ">=16.8.0",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"@types/ws": "8.5.10"
|
|
42
42
|
},
|
|
43
43
|
"optionalDependencies": {
|
|
44
|
-
"@remotion/compositor-
|
|
45
|
-
"@remotion/compositor-
|
|
46
|
-
"@remotion/compositor-
|
|
47
|
-
"@remotion/compositor-linux-
|
|
48
|
-
"@remotion/compositor-linux-x64-
|
|
49
|
-
"@remotion/compositor-win32-x64-msvc": "4.0.
|
|
50
|
-
"@remotion/compositor-
|
|
44
|
+
"@remotion/compositor-darwin-arm64": "4.0.140",
|
|
45
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.140",
|
|
46
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.140",
|
|
47
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.140",
|
|
48
|
+
"@remotion/compositor-linux-x64-musl": "4.0.140",
|
|
49
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.140",
|
|
50
|
+
"@remotion/compositor-darwin-x64": "4.0.140"
|
|
51
51
|
},
|
|
52
52
|
"keywords": [
|
|
53
53
|
"remotion",
|