@remotion/renderer 4.0.139 → 4.0.141
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/assets/calculate-asset-positions.js +1 -0
- package/dist/assets/types.d.ts +1 -1
- package/dist/browser/BrowserPage.js +1 -1
- package/dist/client.d.ts +60 -12
- 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 +2 -2
- 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/index.d.ts +18 -3
- package/dist/options/index.js +2 -0
- package/dist/options/options-map.d.ts +41 -9
- package/dist/options/options-map.js +5 -0
- 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 +4 -1
- package/dist/stringify-ffmpeg-filter.d.ts +2 -1
- package/dist/stringify-ffmpeg-filter.js +34 -7
- package/dist/wrap-with-error-handling.d.ts +6 -1
- package/dist/wrap-with-error-handling.js +3 -1
- package/package.json +9 -9
|
@@ -44,6 +44,7 @@ const calculateAssetPositions = (frames) => {
|
|
|
44
44
|
playbackRate: asset.playbackRate,
|
|
45
45
|
allowAmplificationDuringRender: asset.allowAmplificationDuringRender,
|
|
46
46
|
toneFrequency: asset.toneFrequency,
|
|
47
|
+
audioStartFrame: asset.audioStartFrame,
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
50
|
const found = assets.find((a) => a.duration === null && areEqual(a, asset));
|
package/dist/assets/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TRenderAsset } from 'remotion/no-react';
|
|
2
|
-
export type UnsafeAsset = Omit<TRenderAsset, 'frame' | 'id' | 'volume' | 'mediaFrame'> & {
|
|
2
|
+
export type UnsafeAsset = Omit<TRenderAsset, 'frame' | 'id' | 'volume' | 'mediaFrame' | 'audioStartFrom'> & {
|
|
3
3
|
startInVideo: number;
|
|
4
4
|
duration: number | null;
|
|
5
5
|
trimLeft: number;
|
|
@@ -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"];
|
|
@@ -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: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
605
|
+
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
605
606
|
getValue: ({ commandLine }: {
|
|
606
607
|
commandLine: Record<string, unknown>;
|
|
607
608
|
}) => {
|
|
608
|
-
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
609
|
+
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
609
610
|
source: string;
|
|
610
611
|
} | {
|
|
611
612
|
value: null;
|
|
612
613
|
source: string;
|
|
613
614
|
};
|
|
614
|
-
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
615
|
+
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
615
616
|
};
|
|
616
617
|
logLevelOption: {
|
|
617
618
|
cliFlag: "log";
|
|
@@ -770,6 +771,21 @@ export declare const BrowserSafeApis: {
|
|
|
770
771
|
getValue: () => never;
|
|
771
772
|
setConfig: () => never;
|
|
772
773
|
};
|
|
774
|
+
throwIfSiteExistsOption: {
|
|
775
|
+
cliFlag: string;
|
|
776
|
+
description: () => string;
|
|
777
|
+
docLink: string;
|
|
778
|
+
getValue: ({ commandLine }: {
|
|
779
|
+
commandLine: Record<string, unknown>;
|
|
780
|
+
}) => {
|
|
781
|
+
source: string;
|
|
782
|
+
value: boolean;
|
|
783
|
+
};
|
|
784
|
+
name: string;
|
|
785
|
+
setConfig: () => never;
|
|
786
|
+
ssrName: string;
|
|
787
|
+
type: boolean;
|
|
788
|
+
};
|
|
773
789
|
};
|
|
774
790
|
validColorSpaces: readonly ["default", "bt709", "bt2020-ncl"];
|
|
775
791
|
optionsMap: {
|
|
@@ -846,17 +862,17 @@ export declare const BrowserSafeApis: {
|
|
|
846
862
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
847
863
|
ssrName: "x264Preset";
|
|
848
864
|
docLink: string;
|
|
849
|
-
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
865
|
+
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
850
866
|
getValue: ({ commandLine }: {
|
|
851
867
|
commandLine: Record<string, unknown>;
|
|
852
868
|
}) => {
|
|
853
|
-
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
869
|
+
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
854
870
|
source: string;
|
|
855
871
|
} | {
|
|
856
872
|
value: null;
|
|
857
873
|
source: string;
|
|
858
874
|
};
|
|
859
|
-
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
875
|
+
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
860
876
|
};
|
|
861
877
|
readonly audioBitrate: {
|
|
862
878
|
name: string;
|
|
@@ -1568,17 +1584,17 @@ export declare const BrowserSafeApis: {
|
|
|
1568
1584
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1569
1585
|
ssrName: "x264Preset";
|
|
1570
1586
|
docLink: string;
|
|
1571
|
-
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1587
|
+
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
1572
1588
|
getValue: ({ commandLine }: {
|
|
1573
1589
|
commandLine: Record<string, unknown>;
|
|
1574
1590
|
}) => {
|
|
1575
|
-
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1591
|
+
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
1576
1592
|
source: string;
|
|
1577
1593
|
} | {
|
|
1578
1594
|
value: null;
|
|
1579
1595
|
source: string;
|
|
1580
1596
|
};
|
|
1581
|
-
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1597
|
+
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
1582
1598
|
};
|
|
1583
1599
|
readonly encodingMaxRate: {
|
|
1584
1600
|
name: string;
|
|
@@ -1934,17 +1950,17 @@ export declare const BrowserSafeApis: {
|
|
|
1934
1950
|
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1935
1951
|
ssrName: "x264Preset";
|
|
1936
1952
|
docLink: string;
|
|
1937
|
-
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1953
|
+
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
1938
1954
|
getValue: ({ commandLine }: {
|
|
1939
1955
|
commandLine: Record<string, unknown>;
|
|
1940
1956
|
}) => {
|
|
1941
|
-
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1957
|
+
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
1942
1958
|
source: string;
|
|
1943
1959
|
} | {
|
|
1944
1960
|
value: null;
|
|
1945
1961
|
source: string;
|
|
1946
1962
|
};
|
|
1947
|
-
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1963
|
+
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
1948
1964
|
};
|
|
1949
1965
|
readonly encodingMaxRate: {
|
|
1950
1966
|
name: string;
|
|
@@ -2198,6 +2214,38 @@ export declare const BrowserSafeApis: {
|
|
|
2198
2214
|
setConfig: () => never;
|
|
2199
2215
|
};
|
|
2200
2216
|
};
|
|
2217
|
+
readonly deploySiteLambda: {
|
|
2218
|
+
readonly logLevel: {
|
|
2219
|
+
cliFlag: "log";
|
|
2220
|
+
name: string;
|
|
2221
|
+
ssrName: string;
|
|
2222
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
2223
|
+
docLink: string;
|
|
2224
|
+
getValue: ({ commandLine }: {
|
|
2225
|
+
commandLine: Record<string, unknown>;
|
|
2226
|
+
}) => {
|
|
2227
|
+
value: "verbose" | "info" | "warn" | "error";
|
|
2228
|
+
source: string;
|
|
2229
|
+
};
|
|
2230
|
+
setConfig: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
|
|
2231
|
+
type: "verbose" | "info" | "warn" | "error";
|
|
2232
|
+
};
|
|
2233
|
+
readonly throwIfSiteExists: {
|
|
2234
|
+
cliFlag: string;
|
|
2235
|
+
description: () => string;
|
|
2236
|
+
docLink: string;
|
|
2237
|
+
getValue: ({ commandLine }: {
|
|
2238
|
+
commandLine: Record<string, unknown>;
|
|
2239
|
+
}) => {
|
|
2240
|
+
source: string;
|
|
2241
|
+
value: boolean;
|
|
2242
|
+
};
|
|
2243
|
+
name: string;
|
|
2244
|
+
setConfig: () => never;
|
|
2245
|
+
ssrName: string;
|
|
2246
|
+
type: boolean;
|
|
2247
|
+
};
|
|
2248
|
+
};
|
|
2201
2249
|
};
|
|
2202
2250
|
codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => boolean;
|
|
2203
2251
|
codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => boolean;
|
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
|
@@ -336,7 +336,7 @@ export declare const RenderInternals: {
|
|
|
336
336
|
makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif")[]>;
|
|
337
337
|
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">;
|
|
338
338
|
getExecutablePath: ({ indent, logLevel, type, binariesDirectory, }: {
|
|
339
|
-
type: "
|
|
339
|
+
type: "compositor" | "ffmpeg" | "ffprobe";
|
|
340
340
|
indent: boolean;
|
|
341
341
|
logLevel: "verbose" | "info" | "warn" | "error";
|
|
342
342
|
binariesDirectory: string | null;
|
|
@@ -783,7 +783,7 @@ export declare const RenderInternals: {
|
|
|
783
783
|
assetsInfo: import("./assets/download-map").RenderAssetInfo | null;
|
|
784
784
|
enforceAudioTrack: boolean;
|
|
785
785
|
muted: boolean;
|
|
786
|
-
}) => "
|
|
786
|
+
}) => "no" | "yes" | "maybe";
|
|
787
787
|
codecSupportsMedia: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => {
|
|
788
788
|
video: boolean;
|
|
789
789
|
audio: boolean;
|
|
@@ -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/index.d.ts
CHANGED
|
@@ -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: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
385
|
+
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
386
386
|
getValue: ({ commandLine }: {
|
|
387
387
|
commandLine: Record<string, unknown>;
|
|
388
388
|
}) => {
|
|
389
|
-
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
389
|
+
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
390
390
|
source: string;
|
|
391
391
|
} | {
|
|
392
392
|
value: null;
|
|
393
393
|
source: string;
|
|
394
394
|
};
|
|
395
|
-
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
395
|
+
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
396
396
|
};
|
|
397
397
|
logLevelOption: {
|
|
398
398
|
cliFlag: "log";
|
|
@@ -551,6 +551,21 @@ export declare const allOptions: {
|
|
|
551
551
|
getValue: () => never;
|
|
552
552
|
setConfig: () => never;
|
|
553
553
|
};
|
|
554
|
+
throwIfSiteExistsOption: {
|
|
555
|
+
cliFlag: string;
|
|
556
|
+
description: () => string;
|
|
557
|
+
docLink: string;
|
|
558
|
+
getValue: ({ commandLine }: {
|
|
559
|
+
commandLine: Record<string, unknown>;
|
|
560
|
+
}) => {
|
|
561
|
+
source: string;
|
|
562
|
+
value: boolean;
|
|
563
|
+
};
|
|
564
|
+
name: string;
|
|
565
|
+
setConfig: () => never;
|
|
566
|
+
ssrName: string;
|
|
567
|
+
type: boolean;
|
|
568
|
+
};
|
|
554
569
|
};
|
|
555
570
|
export type AvailableOptions = keyof typeof allOptions;
|
|
556
571
|
export type TypeOfOption<Type> = Type extends AnyRemotionOption<infer X> ? X : never;
|
package/dist/options/index.js
CHANGED
|
@@ -30,6 +30,7 @@ const public_path_1 = require("./public-path");
|
|
|
30
30
|
const repro_1 = require("./repro");
|
|
31
31
|
const scale_1 = require("./scale");
|
|
32
32
|
const separate_audio_1 = require("./separate-audio");
|
|
33
|
+
const throw_if_site_exists_1 = require("./throw-if-site-exists");
|
|
33
34
|
const timeout_1 = require("./timeout");
|
|
34
35
|
const video_bitrate_1 = require("./video-bitrate");
|
|
35
36
|
const video_codec_1 = require("./video-codec");
|
|
@@ -70,4 +71,5 @@ exports.allOptions = {
|
|
|
70
71
|
publicPathOption: public_path_1.publicPathOption,
|
|
71
72
|
publicDirOption: public_dir_1.publicDirOption,
|
|
72
73
|
onBrowserDownloadOption: on_browser_download_1.onBrowserDownloadOption,
|
|
74
|
+
throwIfSiteExistsOption: throw_if_site_exists_1.throwIfSiteExistsOption,
|
|
73
75
|
};
|
|
@@ -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: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
75
|
+
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
76
76
|
getValue: ({ commandLine }: {
|
|
77
77
|
commandLine: Record<string, unknown>;
|
|
78
78
|
}) => {
|
|
79
|
-
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
79
|
+
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
80
80
|
source: string;
|
|
81
81
|
} | {
|
|
82
82
|
value: null;
|
|
83
83
|
source: string;
|
|
84
84
|
};
|
|
85
|
-
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
85
|
+
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "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: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
797
|
+
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
798
798
|
getValue: ({ commandLine }: {
|
|
799
799
|
commandLine: Record<string, unknown>;
|
|
800
800
|
}) => {
|
|
801
|
-
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
801
|
+
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
802
802
|
source: string;
|
|
803
803
|
} | {
|
|
804
804
|
value: null;
|
|
805
805
|
source: string;
|
|
806
806
|
};
|
|
807
|
-
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
807
|
+
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "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: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1163
|
+
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
1164
1164
|
getValue: ({ commandLine }: {
|
|
1165
1165
|
commandLine: Record<string, unknown>;
|
|
1166
1166
|
}) => {
|
|
1167
|
-
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1167
|
+
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
1168
1168
|
source: string;
|
|
1169
1169
|
} | {
|
|
1170
1170
|
value: null;
|
|
1171
1171
|
source: string;
|
|
1172
1172
|
};
|
|
1173
|
-
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
1173
|
+
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
|
|
1174
1174
|
};
|
|
1175
1175
|
readonly encodingMaxRate: {
|
|
1176
1176
|
name: string;
|
|
@@ -1424,4 +1424,36 @@ export declare const optionsMap: {
|
|
|
1424
1424
|
setConfig: () => never;
|
|
1425
1425
|
};
|
|
1426
1426
|
};
|
|
1427
|
+
readonly deploySiteLambda: {
|
|
1428
|
+
readonly logLevel: {
|
|
1429
|
+
cliFlag: "log";
|
|
1430
|
+
name: string;
|
|
1431
|
+
ssrName: string;
|
|
1432
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
1433
|
+
docLink: string;
|
|
1434
|
+
getValue: ({ commandLine }: {
|
|
1435
|
+
commandLine: Record<string, unknown>;
|
|
1436
|
+
}) => {
|
|
1437
|
+
value: "verbose" | "info" | "warn" | "error";
|
|
1438
|
+
source: string;
|
|
1439
|
+
};
|
|
1440
|
+
setConfig: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
|
|
1441
|
+
type: "verbose" | "info" | "warn" | "error";
|
|
1442
|
+
};
|
|
1443
|
+
readonly throwIfSiteExists: {
|
|
1444
|
+
cliFlag: string;
|
|
1445
|
+
description: () => string;
|
|
1446
|
+
docLink: string;
|
|
1447
|
+
getValue: ({ commandLine }: {
|
|
1448
|
+
commandLine: Record<string, unknown>;
|
|
1449
|
+
}) => {
|
|
1450
|
+
source: string;
|
|
1451
|
+
value: boolean;
|
|
1452
|
+
};
|
|
1453
|
+
name: string;
|
|
1454
|
+
setConfig: () => never;
|
|
1455
|
+
ssrName: string;
|
|
1456
|
+
type: boolean;
|
|
1457
|
+
};
|
|
1458
|
+
};
|
|
1427
1459
|
};
|
|
@@ -21,6 +21,7 @@ const prefer_lossless_1 = require("./prefer-lossless");
|
|
|
21
21
|
const repro_1 = require("./repro");
|
|
22
22
|
const scale_1 = require("./scale");
|
|
23
23
|
const separate_audio_1 = require("./separate-audio");
|
|
24
|
+
const throw_if_site_exists_1 = require("./throw-if-site-exists");
|
|
24
25
|
const timeout_1 = require("./timeout");
|
|
25
26
|
const video_bitrate_1 = require("./video-bitrate");
|
|
26
27
|
const video_codec_1 = require("./video-codec");
|
|
@@ -138,4 +139,8 @@ exports.optionsMap = {
|
|
|
138
139
|
logLevel: log_level_1.logLevelOption,
|
|
139
140
|
onBrowserDownload: on_browser_download_1.onBrowserDownloadOption,
|
|
140
141
|
},
|
|
142
|
+
deploySiteLambda: {
|
|
143
|
+
logLevel: log_level_1.logLevelOption,
|
|
144
|
+
throwIfSiteExists: throw_if_site_exists_1.throwIfSiteExistsOption,
|
|
145
|
+
},
|
|
141
146
|
};
|
|
@@ -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: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
14
|
+
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
|
|
15
15
|
getValue: ({ commandLine }: {
|
|
16
16
|
commandLine: Record<string, unknown>;
|
|
17
17
|
}) => {
|
|
18
|
-
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
18
|
+
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "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);
|
|
@@ -140,7 +143,7 @@ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVa
|
|
|
140
143
|
page,
|
|
141
144
|
timeoutInMilliseconds: actualTimeout,
|
|
142
145
|
});
|
|
143
|
-
const requiredVersion = '
|
|
146
|
+
const requiredVersion = '11';
|
|
144
147
|
if (siteVersion !== requiredVersion) {
|
|
145
148
|
throw new Error([
|
|
146
149
|
`Incompatible site: When visiting ${urlToVisit}, a bundle was found, but one that is not compatible with this version of Remotion. Found version: ${siteVersion} - Required version: ${requiredVersion}. To resolve this error:`,
|
|
@@ -6,10 +6,11 @@ export type ProcessedTrack = {
|
|
|
6
6
|
pad_start: string | null;
|
|
7
7
|
pad_end: string | null;
|
|
8
8
|
};
|
|
9
|
-
export declare const getActualTrimLeft: ({ asset, fps, trimLeftOffset, }: {
|
|
9
|
+
export declare const getActualTrimLeft: ({ asset, fps, trimLeftOffset, seamless, }: {
|
|
10
10
|
asset: MediaAsset;
|
|
11
11
|
fps: number;
|
|
12
12
|
trimLeftOffset: number;
|
|
13
|
+
seamless: boolean;
|
|
13
14
|
}) => number;
|
|
14
15
|
export declare const stringifyFfmpegFilter: ({ channels, volume, fps, assetDuration, chunkLengthInSeconds, forSeamlessAacConcatenation, trimLeftOffset, trimRightOffset, asset, }: {
|
|
15
16
|
channels: number;
|
|
@@ -14,7 +14,20 @@ const stringifyTrim = (trim) => {
|
|
|
14
14
|
}
|
|
15
15
|
return asString;
|
|
16
16
|
};
|
|
17
|
-
const getActualTrimLeft = ({ asset, fps, trimLeftOffset, }) =>
|
|
17
|
+
const getActualTrimLeft = ({ asset, fps, trimLeftOffset, seamless, }) => {
|
|
18
|
+
const sinceStart = asset.trimLeft - asset.audioStartFrame;
|
|
19
|
+
if (!seamless) {
|
|
20
|
+
return (asset.audioStartFrame / fps +
|
|
21
|
+
(sinceStart / fps) * asset.playbackRate +
|
|
22
|
+
trimLeftOffset);
|
|
23
|
+
}
|
|
24
|
+
if (seamless) {
|
|
25
|
+
return (asset.audioStartFrame / fps / asset.playbackRate +
|
|
26
|
+
sinceStart / fps +
|
|
27
|
+
trimLeftOffset);
|
|
28
|
+
}
|
|
29
|
+
throw new Error('This should never happen');
|
|
30
|
+
};
|
|
18
31
|
exports.getActualTrimLeft = getActualTrimLeft;
|
|
19
32
|
const trimAndSetTempo = ({ forSeamlessAacConcatenation, assetDuration, asset, trimLeftOffset, trimRightOffset, fps, }) => {
|
|
20
33
|
// If we need seamless AAC stitching, we need to apply the tempo filter first
|
|
@@ -22,8 +35,13 @@ const trimAndSetTempo = ({ forSeamlessAacConcatenation, assetDuration, asset, tr
|
|
|
22
35
|
// and the offset needs to be the same for all audio tracks, before processing it further.
|
|
23
36
|
// This also affects the trimLeft and trimRight values, as they need to be adjusted.
|
|
24
37
|
if (forSeamlessAacConcatenation) {
|
|
25
|
-
const trimLeft = (0, exports.getActualTrimLeft)({
|
|
26
|
-
|
|
38
|
+
const trimLeft = (0, exports.getActualTrimLeft)({
|
|
39
|
+
asset,
|
|
40
|
+
fps,
|
|
41
|
+
trimLeftOffset,
|
|
42
|
+
seamless: true,
|
|
43
|
+
});
|
|
44
|
+
const trimRight = trimLeft + asset.duration / fps - trimLeftOffset + trimRightOffset;
|
|
27
45
|
const trimRightOrAssetDuration = assetDuration
|
|
28
46
|
? Math.min(trimRight, assetDuration / asset.playbackRate)
|
|
29
47
|
: trimRight;
|
|
@@ -48,12 +66,16 @@ const trimAndSetTempo = ({ forSeamlessAacConcatenation, assetDuration, asset, tr
|
|
|
48
66
|
// Otherwise, we first trim and then apply playback rate, as then the atempo
|
|
49
67
|
// filter needs to do less work.
|
|
50
68
|
if (!forSeamlessAacConcatenation) {
|
|
51
|
-
const
|
|
52
|
-
|
|
69
|
+
const actualTrimLeft = (0, exports.getActualTrimLeft)({
|
|
70
|
+
asset,
|
|
71
|
+
fps,
|
|
72
|
+
trimLeftOffset,
|
|
73
|
+
seamless: false,
|
|
74
|
+
});
|
|
75
|
+
const trimRight = actualTrimLeft + (asset.duration / fps) * asset.playbackRate;
|
|
53
76
|
const trimRightOrAssetDuration = assetDuration
|
|
54
77
|
? Math.min(trimRight, assetDuration)
|
|
55
78
|
: trimRight;
|
|
56
|
-
const actualTrimLeft = trimLeft * asset.playbackRate;
|
|
57
79
|
return {
|
|
58
80
|
filter: [
|
|
59
81
|
`atrim=${stringifyTrim(actualTrimLeft)}:${stringifyTrim(trimRightOrAssetDuration)}`,
|
|
@@ -72,7 +94,12 @@ const stringifyFfmpegFilter = ({ channels, volume, fps, assetDuration, chunkLeng
|
|
|
72
94
|
const { toneFrequency, startInVideo, playbackRate } = asset;
|
|
73
95
|
const startInVideoSeconds = startInVideo / fps;
|
|
74
96
|
if (assetDuration &&
|
|
75
|
-
(0, exports.getActualTrimLeft)({
|
|
97
|
+
(0, exports.getActualTrimLeft)({
|
|
98
|
+
asset,
|
|
99
|
+
fps,
|
|
100
|
+
trimLeftOffset,
|
|
101
|
+
seamless: forSeamlessAacConcatenation,
|
|
102
|
+
}) >=
|
|
76
103
|
assetDuration / playbackRate) {
|
|
77
104
|
return null;
|
|
78
105
|
}
|
|
@@ -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.141",
|
|
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.141"
|
|
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-darwin-
|
|
45
|
-
"@remotion/compositor-
|
|
46
|
-
"@remotion/compositor-
|
|
47
|
-
"@remotion/compositor-
|
|
48
|
-
"@remotion/compositor-linux-x64-
|
|
49
|
-
"@remotion/compositor-linux-x64-
|
|
50
|
-
"@remotion/compositor-
|
|
44
|
+
"@remotion/compositor-darwin-arm64": "4.0.141",
|
|
45
|
+
"@remotion/compositor-darwin-x64": "4.0.141",
|
|
46
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.141",
|
|
47
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.141",
|
|
48
|
+
"@remotion/compositor-linux-x64-musl": "4.0.141",
|
|
49
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.141",
|
|
50
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.141"
|
|
51
51
|
},
|
|
52
52
|
"keywords": [
|
|
53
53
|
"remotion",
|