@remotion/lambda 4.0.5 → 4.0.7
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/admin/bundle-lambda.js +2 -0
- package/dist/api/get-compositions-on-lambda.js +2 -0
- package/dist/api/get-render-progress.d.ts +2 -2
- package/dist/api/get-render-progress.js +2 -0
- package/dist/api/make-lambda-payload.d.ts +2 -2
- package/dist/api/render-media-on-lambda.js +4 -2
- package/dist/api/render-still-on-lambda.d.ts +5 -1
- package/dist/api/render-still-on-lambda.js +18 -3
- package/dist/cli/commands/render/render.js +1 -1
- package/dist/cli/commands/still.js +38 -50
- package/dist/cli/index.js +16 -2
- package/dist/cli/log.d.ts +9 -3
- package/dist/client.d.ts +4 -1
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -4
- package/dist/functions/compositions.d.ts +1 -0
- package/dist/functions/compositions.js +2 -1
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/helpers/get-progress.js +8 -1
- package/dist/functions/helpers/make-timeout-error.d.ts +2 -1
- package/dist/functions/helpers/make-timeout-error.js +7 -6
- package/dist/functions/helpers/make-timeout-message.d.ts +2 -1
- package/dist/functions/helpers/make-timeout-message.js +53 -16
- package/dist/functions/helpers/streamify-response.js +15 -12
- package/dist/functions/helpers/streaming-payloads.d.ts +19 -0
- package/dist/functions/helpers/streaming-payloads.js +25 -0
- package/dist/functions/index.js +44 -5
- package/dist/functions/info.d.ts +1 -0
- package/dist/functions/info.js +1 -0
- package/dist/functions/launch.d.ts +3 -1
- package/dist/functions/launch.js +7 -4
- package/dist/functions/renderer.d.ts +3 -1
- package/dist/functions/renderer.js +26 -10
- package/dist/functions/start.d.ts +1 -0
- package/dist/functions/start.js +2 -1
- package/dist/functions/still.d.ts +8 -5
- package/dist/functions/still.js +51 -54
- package/dist/index.d.ts +3 -3
- package/dist/internals.d.ts +1 -1
- package/dist/shared/aws-clients.d.ts +1 -1
- package/dist/shared/aws-clients.js +3 -1
- package/dist/shared/call-lambda.d.ts +4 -1
- package/dist/shared/call-lambda.js +30 -13
- package/dist/shared/compress-props.js +1 -1
- package/dist/shared/constants.d.ts +1 -0
- package/dist/shared/encode-aws-url-params.d.ts +1 -0
- package/dist/shared/encode-aws-url-params.js +7 -0
- package/dist/shared/get-aws-urls.d.ts +9 -2
- package/dist/shared/get-aws-urls.js +15 -4
- package/dist/shared/get-function-version.js +2 -0
- package/dist/shared/invoke-webhook.d.ts +2 -0
- package/dist/shared/return-values.d.ts +5 -5
- package/package.json +20 -19
- package/remotionlambda-arm64.zip +0 -0
- package/remotionlambda-x64.zip +0 -0
|
@@ -33,11 +33,13 @@ const bundleLambda = async () => {
|
|
|
33
33
|
'./ffmpeg/remotion/bin/ffprobe.exe',
|
|
34
34
|
'./ffmpeg/remotion/bin/ffmpeg',
|
|
35
35
|
'./ffmpeg/remotion/bin/ffmpeg.exe',
|
|
36
|
+
'./mappings.wasm',
|
|
36
37
|
],
|
|
37
38
|
});
|
|
38
39
|
const compositorFile = `${outdir}/compositor`;
|
|
39
40
|
node_fs_1.default.copyFileSync(compositor_linux_arm64_gnu_1.binaryPath, compositorFile);
|
|
40
41
|
node_fs_1.default.cpSync(compositor_linux_arm64_gnu_1.ffmpegCwd, `${outdir}/ffmpeg`, { recursive: true });
|
|
42
|
+
node_fs_1.default.cpSync(node_path_1.default.join(__dirname, '..', '..', '..', 'renderer', 'node_modules', 'source-map', 'lib', 'mappings.wasm'), `${outdir}/mappings.wasm`);
|
|
41
43
|
await zl.archiveFolder(outdir, function_zip_path_1.FUNCTION_ZIP_ARM64);
|
|
42
44
|
node_fs_1.default.rmSync(outdir, { recursive: true });
|
|
43
45
|
};
|
|
@@ -43,6 +43,8 @@ const getCompositionsOnLambda = async ({ chromiumOptions, serveUrl, region, inpu
|
|
|
43
43
|
bucketName: bucketName !== null && bucketName !== void 0 ? bucketName : null,
|
|
44
44
|
},
|
|
45
45
|
region,
|
|
46
|
+
receivedStreamingPayload: () => undefined,
|
|
47
|
+
timeoutInTest: 120000,
|
|
46
48
|
});
|
|
47
49
|
return res.compositions;
|
|
48
50
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AwsRegion } from '../pricing/aws-regions';
|
|
2
2
|
import type { CustomCredentials } from '../shared/aws-clients';
|
|
3
3
|
import type { RenderProgress } from '../shared/constants';
|
|
4
|
-
export type
|
|
4
|
+
export type GetRenderProgressInput = {
|
|
5
5
|
functionName: string;
|
|
6
6
|
bucketName: string;
|
|
7
7
|
renderId: string;
|
|
@@ -18,4 +18,4 @@ export type GetRenderInput = {
|
|
|
18
18
|
* @param {CustomCredentials} params.s3OutputProvider? Endpoint and credentials if the output file is stored outside of AWS.
|
|
19
19
|
* @returns {Promise<RenderProgress>} See documentation for this function to see all properties on the return object.
|
|
20
20
|
*/
|
|
21
|
-
export declare const getRenderProgress: (input:
|
|
21
|
+
export declare const getRenderProgress: (input: GetRenderProgressInput) => Promise<RenderProgress>;
|
|
@@ -20,6 +20,8 @@ const getRenderProgress = async (input) => {
|
|
|
20
20
|
type: constants_1.LambdaRoutines.status,
|
|
21
21
|
payload: (0, make_lambda_payload_1.getRenderProgressPayload)(input),
|
|
22
22
|
region: input.region,
|
|
23
|
+
receivedStreamingPayload: () => undefined,
|
|
24
|
+
timeoutInTest: 120000,
|
|
23
25
|
});
|
|
24
26
|
return result;
|
|
25
27
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LambdaStartPayload, LambdaStatusPayload } from '../defaults';
|
|
2
|
-
import type {
|
|
2
|
+
import type { GetRenderProgressInput } from './get-render-progress';
|
|
3
3
|
import type { RenderMediaOnLambdaInput } from './render-media-on-lambda';
|
|
4
4
|
export declare const makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, downloadBehavior, muted, overwrite, dumpBrowserLogs, jpegQuality, quality, }: RenderMediaOnLambdaInput) => Promise<LambdaStartPayload>;
|
|
5
|
-
export declare const getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, }:
|
|
5
|
+
export declare const getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, }: GetRenderProgressInput) => LambdaStatusPayload;
|
|
@@ -33,16 +33,18 @@ const renderMediaOnLambda = async (input) => {
|
|
|
33
33
|
type: constants_1.LambdaRoutines.start,
|
|
34
34
|
payload: await (0, make_lambda_payload_1.makeLambdaRenderMediaPayload)(input),
|
|
35
35
|
region,
|
|
36
|
+
receivedStreamingPayload: () => undefined,
|
|
37
|
+
timeoutInTest: 120000,
|
|
36
38
|
});
|
|
37
39
|
return {
|
|
38
40
|
renderId: res.renderId,
|
|
39
41
|
bucketName: res.bucketName,
|
|
40
|
-
cloudWatchLogs: (0, get_aws_urls_1.
|
|
42
|
+
cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchRendererUrl)({
|
|
41
43
|
functionName,
|
|
42
|
-
method: constants_1.LambdaRoutines.renderer,
|
|
43
44
|
region,
|
|
44
45
|
renderId: res.renderId,
|
|
45
46
|
rendererFunctionName: rendererFunctionName !== null && rendererFunctionName !== void 0 ? rendererFunctionName : null,
|
|
47
|
+
chunk: null,
|
|
46
48
|
}),
|
|
47
49
|
folderInS3Console: (0, get_aws_urls_1.getS3RenderUrl)({
|
|
48
50
|
bucketName: res.bucketName,
|
|
@@ -31,6 +31,10 @@ export type RenderStillOnLambdaInput = {
|
|
|
31
31
|
* @deprecated Renamed to `dumpBrowserLogs`
|
|
32
32
|
*/
|
|
33
33
|
dumpBrowserLogs?: boolean;
|
|
34
|
+
onInit?: (data: {
|
|
35
|
+
renderId: string;
|
|
36
|
+
cloudWatchLogs: string;
|
|
37
|
+
}) => void;
|
|
34
38
|
};
|
|
35
39
|
export type RenderStillOnLambdaOutput = {
|
|
36
40
|
estimatedPrice: CostsInfo;
|
|
@@ -56,4 +60,4 @@ export type RenderStillOnLambdaOutput = {
|
|
|
56
60
|
* @param params.privacy Whether the item in the S3 bucket should be public. Possible values: `"private"` and `"public"`
|
|
57
61
|
* @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
|
|
58
62
|
*/
|
|
59
|
-
export declare const renderStillOnLambda: ({ functionName, serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, dumpBrowserLogs, }: RenderStillOnLambdaInput) => Promise<RenderStillOnLambdaOutput>;
|
|
63
|
+
export declare const renderStillOnLambda: ({ functionName, serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, dumpBrowserLogs, onInit, }: RenderStillOnLambdaInput) => Promise<RenderStillOnLambdaOutput>;
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.renderStillOnLambda = void 0;
|
|
4
4
|
const version_1 = require("remotion/version");
|
|
5
5
|
const call_lambda_1 = require("../shared/call-lambda");
|
|
6
|
+
const compress_props_1 = require("../shared/compress-props");
|
|
6
7
|
const constants_1 = require("../shared/constants");
|
|
7
8
|
const get_aws_urls_1 = require("../shared/get-aws-urls");
|
|
8
|
-
const compress_props_1 = require("../shared/compress-props");
|
|
9
9
|
/**
|
|
10
10
|
* @description Renders a still frame on Lambda
|
|
11
11
|
* @link https://remotion.dev/docs/lambda/renderstillonlambda
|
|
@@ -22,7 +22,7 @@ const compress_props_1 = require("../shared/compress-props");
|
|
|
22
22
|
* @param params.privacy Whether the item in the S3 bucket should be public. Possible values: `"private"` and `"public"`
|
|
23
23
|
* @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
|
|
24
24
|
*/
|
|
25
|
-
const renderStillOnLambda = async ({ functionName, serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, dumpBrowserLogs, }) => {
|
|
25
|
+
const renderStillOnLambda = async ({ functionName, serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, dumpBrowserLogs, onInit, }) => {
|
|
26
26
|
var _a;
|
|
27
27
|
if (quality) {
|
|
28
28
|
throw new Error('The `quality` option is deprecated. Use `jpegQuality` instead.');
|
|
@@ -62,6 +62,21 @@ const renderStillOnLambda = async ({ functionName, serveUrl, inputProps, imageFo
|
|
|
62
62
|
bucketName: forceBucketName !== null && forceBucketName !== void 0 ? forceBucketName : null,
|
|
63
63
|
},
|
|
64
64
|
region,
|
|
65
|
+
receivedStreamingPayload: (payload) => {
|
|
66
|
+
if (payload.type === 'render-id-determined') {
|
|
67
|
+
onInit === null || onInit === void 0 ? void 0 : onInit({
|
|
68
|
+
renderId: payload.renderId,
|
|
69
|
+
cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchMethodUrl)({
|
|
70
|
+
functionName,
|
|
71
|
+
method: constants_1.LambdaRoutines.still,
|
|
72
|
+
region,
|
|
73
|
+
rendererFunctionName: null,
|
|
74
|
+
renderId: payload.renderId,
|
|
75
|
+
}),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
timeoutInTest: 120000,
|
|
65
80
|
});
|
|
66
81
|
return {
|
|
67
82
|
estimatedPrice: res.estimatedPrice,
|
|
@@ -69,7 +84,7 @@ const renderStillOnLambda = async ({ functionName, serveUrl, inputProps, imageFo
|
|
|
69
84
|
sizeInBytes: res.size,
|
|
70
85
|
bucketName: res.bucketName,
|
|
71
86
|
renderId: res.renderId,
|
|
72
|
-
cloudWatchLogs: (0, get_aws_urls_1.
|
|
87
|
+
cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchMethodUrl)({
|
|
73
88
|
functionName,
|
|
74
89
|
method: constants_1.LambdaRoutines.still,
|
|
75
90
|
region,
|
|
@@ -4,6 +4,7 @@ exports.renderCommand = exports.RENDER_COMMAND = void 0;
|
|
|
4
4
|
const cli_1 = require("@remotion/cli");
|
|
5
5
|
const config_1 = require("@remotion/cli/config");
|
|
6
6
|
const renderer_1 = require("@remotion/renderer");
|
|
7
|
+
const remotion_1 = require("remotion");
|
|
7
8
|
const download_media_1 = require("../../../api/download-media");
|
|
8
9
|
const get_render_progress_1 = require("../../../api/get-render-progress");
|
|
9
10
|
const render_media_on_lambda_1 = require("../../../api/render-media-on-lambda");
|
|
@@ -19,7 +20,6 @@ const find_function_name_1 = require("../../helpers/find-function-name");
|
|
|
19
20
|
const quit_1 = require("../../helpers/quit");
|
|
20
21
|
const log_1 = require("../../log");
|
|
21
22
|
const progress_1 = require("./progress");
|
|
22
|
-
const remotion_1 = require("remotion");
|
|
23
23
|
exports.RENDER_COMMAND = 'render';
|
|
24
24
|
const renderCommand = async (args, remotionRoot) => {
|
|
25
25
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -4,6 +4,7 @@ exports.stillCommand = exports.STILL_COMMAND = void 0;
|
|
|
4
4
|
const cli_1 = require("@remotion/cli");
|
|
5
5
|
const config_1 = require("@remotion/cli/config");
|
|
6
6
|
const renderer_1 = require("@remotion/renderer");
|
|
7
|
+
const remotion_1 = require("remotion");
|
|
7
8
|
const download_media_1 = require("../../api/download-media");
|
|
8
9
|
const render_still_on_lambda_1 = require("../../api/render-still-on-lambda");
|
|
9
10
|
const constants_1 = require("../../shared/constants");
|
|
@@ -15,10 +16,9 @@ const get_aws_region_1 = require("../get-aws-region");
|
|
|
15
16
|
const find_function_name_1 = require("../helpers/find-function-name");
|
|
16
17
|
const quit_1 = require("../helpers/quit");
|
|
17
18
|
const log_1 = require("../log");
|
|
18
|
-
const remotion_1 = require("remotion");
|
|
19
19
|
exports.STILL_COMMAND = 'still';
|
|
20
20
|
const stillCommand = async (args, remotionRoot) => {
|
|
21
|
-
var _a, _b, _c, _d, _e
|
|
21
|
+
var _a, _b, _c, _d, _e;
|
|
22
22
|
const serveUrl = args[0];
|
|
23
23
|
if (!serveUrl) {
|
|
24
24
|
log_1.Log.error('No serve URL passed.');
|
|
@@ -83,57 +83,45 @@ const stillCommand = async (args, remotionRoot) => {
|
|
|
83
83
|
fromUi: null,
|
|
84
84
|
configImageFormat: (_e = config_1.ConfigInternals.getUserPreferredStillImageFormat()) !== null && _e !== void 0 ? _e : null,
|
|
85
85
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
86
|
+
log_1.Log.info(cli_1.CliInternals.chalk.gray(`functionName = ${functionName}, imageFormat = ${imageFormat} (${imageFormatReason})`));
|
|
87
|
+
const res = await (0, render_still_on_lambda_1.renderStillOnLambda)({
|
|
88
|
+
functionName,
|
|
89
|
+
serveUrl,
|
|
90
|
+
inputProps,
|
|
91
|
+
imageFormat,
|
|
92
|
+
composition,
|
|
93
|
+
privacy,
|
|
94
|
+
region,
|
|
95
|
+
maxRetries,
|
|
96
|
+
envVariables,
|
|
97
|
+
frame: stillFrame,
|
|
98
|
+
jpegQuality,
|
|
99
|
+
logLevel,
|
|
100
|
+
outName,
|
|
101
|
+
chromiumOptions,
|
|
102
|
+
timeoutInMilliseconds: puppeteerTimeout,
|
|
103
|
+
scale,
|
|
104
|
+
forceHeight: height,
|
|
105
|
+
forceWidth: width,
|
|
106
|
+
onInit: ({ cloudWatchLogs, renderId }) => {
|
|
107
|
+
log_1.Log.info(cli_1.CliInternals.chalk.gray(`Render invoked with ID = ${renderId}`));
|
|
108
|
+
log_1.Log.verbose(`CloudWatch logs (if enabled): ${cloudWatchLogs}`);
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
if (downloadName) {
|
|
112
|
+
log_1.Log.info('Finished rendering. Downloading...');
|
|
113
|
+
const { outputPath, sizeInBytes } = await (0, download_media_1.downloadMedia)({
|
|
114
|
+
bucketName: res.bucketName,
|
|
115
|
+
outPath: downloadName,
|
|
95
116
|
region,
|
|
96
|
-
|
|
97
|
-
envVariables,
|
|
98
|
-
frame: stillFrame,
|
|
99
|
-
jpegQuality,
|
|
100
|
-
logLevel,
|
|
101
|
-
outName,
|
|
102
|
-
chromiumOptions,
|
|
103
|
-
timeoutInMilliseconds: puppeteerTimeout,
|
|
104
|
-
scale,
|
|
105
|
-
forceHeight: height,
|
|
106
|
-
forceWidth: width,
|
|
117
|
+
renderId: res.renderId,
|
|
107
118
|
});
|
|
108
|
-
log_1.Log.info(cli_1.CliInternals.
|
|
109
|
-
log_1.Log.verbose(`CloudWatch logs (if enabled): ${res.cloudWatchLogs}`);
|
|
110
|
-
if (downloadName) {
|
|
111
|
-
log_1.Log.info('Finished rendering. Downloading...');
|
|
112
|
-
const { outputPath, sizeInBytes } = await (0, download_media_1.downloadMedia)({
|
|
113
|
-
bucketName: res.bucketName,
|
|
114
|
-
outPath: downloadName,
|
|
115
|
-
region,
|
|
116
|
-
renderId: res.renderId,
|
|
117
|
-
});
|
|
118
|
-
log_1.Log.info('Done!', outputPath, cli_1.CliInternals.formatBytes(sizeInBytes));
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
log_1.Log.info(`Finished still!`);
|
|
122
|
-
log_1.Log.info();
|
|
123
|
-
log_1.Log.info(res.url);
|
|
124
|
-
}
|
|
119
|
+
log_1.Log.info('Done!', outputPath, cli_1.CliInternals.formatBytes(sizeInBytes));
|
|
125
120
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
frame: null,
|
|
131
|
-
name: err.name,
|
|
132
|
-
stack: err.stack,
|
|
133
|
-
stackFrame: frames,
|
|
134
|
-
});
|
|
135
|
-
await cli_1.CliInternals.handleCommonError(errorWithStackFrame, renderer_1.RenderInternals.getLogLevel());
|
|
136
|
-
(0, quit_1.quit)(1);
|
|
121
|
+
else {
|
|
122
|
+
log_1.Log.info(`Finished still!`);
|
|
123
|
+
log_1.Log.info();
|
|
124
|
+
log_1.Log.info(res.url);
|
|
137
125
|
}
|
|
138
126
|
};
|
|
139
127
|
exports.stillCommand = stillCommand;
|
package/dist/cli/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cli = exports.executeCommand = void 0;
|
|
4
4
|
const cli_1 = require("@remotion/cli");
|
|
5
|
+
const config_1 = require("@remotion/cli/config");
|
|
5
6
|
const renderer_1 = require("@remotion/renderer");
|
|
6
7
|
const suggested_policy_1 = require("../api/iam-validation/suggested-policy");
|
|
7
8
|
const defaults_1 = require("../defaults");
|
|
@@ -97,7 +98,7 @@ const matchCommand = (args, remotionRoot) => {
|
|
|
97
98
|
(0, quit_1.quit)(1);
|
|
98
99
|
};
|
|
99
100
|
const executeCommand = async (args, remotionRoot) => {
|
|
100
|
-
var _a, _b, _c;
|
|
101
|
+
var _a, _b, _c, _d, _e;
|
|
101
102
|
try {
|
|
102
103
|
(0, is_cli_1.setIsCli)(true);
|
|
103
104
|
await matchCommand(args, remotionRoot);
|
|
@@ -137,7 +138,20 @@ AWS returned an "TooManyRequestsException" error message which could mean you re
|
|
|
137
138
|
AWS returned an error message "The security token included in the request is invalid". A possible reason for this is that you did not enable the region in your AWS account under "Account". The original message is:
|
|
138
139
|
`);
|
|
139
140
|
}
|
|
140
|
-
|
|
141
|
+
if (error instanceof renderer_1.RenderInternals.SymbolicateableError) {
|
|
142
|
+
await cli_1.CliInternals.handleCommonError(error, config_1.ConfigInternals.Logging.getLogLevel());
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
const frames = renderer_1.RenderInternals.parseStack((_e = (_d = error.stack) === null || _d === void 0 ? void 0 : _d.split('\n')) !== null && _e !== void 0 ? _e : []);
|
|
146
|
+
const errorWithStackFrame = new renderer_1.RenderInternals.SymbolicateableError({
|
|
147
|
+
message: error.message,
|
|
148
|
+
frame: null,
|
|
149
|
+
name: error.name,
|
|
150
|
+
stack: error.stack,
|
|
151
|
+
stackFrame: frames,
|
|
152
|
+
});
|
|
153
|
+
await cli_1.CliInternals.handleCommonError(errorWithStackFrame, config_1.ConfigInternals.Logging.getLogLevel());
|
|
154
|
+
}
|
|
141
155
|
(0, quit_1.quit)(1);
|
|
142
156
|
}
|
|
143
157
|
};
|
package/dist/cli/log.d.ts
CHANGED
|
@@ -2,19 +2,25 @@ export declare const Log: {
|
|
|
2
2
|
verbose: (message?: any, ...optionalParams: any[]) => void;
|
|
3
3
|
verboseAdvanced: (options: {
|
|
4
4
|
indent: boolean;
|
|
5
|
-
logLevel: "
|
|
5
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
6
6
|
} & {
|
|
7
7
|
tag?: string | undefined;
|
|
8
8
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
9
9
|
info: (message?: any, ...optionalParams: any[]) => void;
|
|
10
10
|
infoAdvanced: (options: {
|
|
11
11
|
indent: boolean;
|
|
12
|
-
logLevel: "
|
|
12
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
13
13
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
14
14
|
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
15
15
|
warnAdvanced: (options: {
|
|
16
16
|
indent: boolean;
|
|
17
|
-
logLevel: "
|
|
17
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
18
18
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
19
19
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
20
|
+
errorAdvanced: (options: {
|
|
21
|
+
indent: boolean;
|
|
22
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
23
|
+
} & {
|
|
24
|
+
tag?: string | undefined;
|
|
25
|
+
}, message?: any, ...optionalParams: any[]) => void;
|
|
20
26
|
};
|
package/dist/client.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { getCompositionsOnLambda } from './api/get-compositions-on-lambda';
|
|
2
2
|
import { getFunctions } from './api/get-functions';
|
|
3
|
+
import type { GetRenderProgressInput } from './api/get-render-progress';
|
|
3
4
|
import { getRenderProgress } from './api/get-render-progress';
|
|
4
5
|
import { getSites } from './api/get-sites';
|
|
5
6
|
import type { PresignUrlInput } from './api/presign-url';
|
|
6
7
|
import { presignUrl } from './api/presign-url';
|
|
8
|
+
import type { RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput } from './api/render-media-on-lambda';
|
|
7
9
|
import { renderMediaOnLambda, renderVideoOnLambda } from './api/render-media-on-lambda';
|
|
10
|
+
import type { RenderStillOnLambdaInput, RenderStillOnLambdaOutput } from './api/render-still-on-lambda';
|
|
8
11
|
import { renderStillOnLambda } from './api/render-still-on-lambda';
|
|
9
12
|
import type { SpeculateFunctionNameInput } from './api/speculate-function-name';
|
|
10
13
|
import { speculateFunctionName } from './api/speculate-function-name';
|
|
@@ -13,4 +16,4 @@ import type { AwsRegion } from './pricing/aws-regions';
|
|
|
13
16
|
import type { RenderProgress } from './shared/constants';
|
|
14
17
|
import type { WebhookPayload } from './shared/invoke-webhook';
|
|
15
18
|
export { renderVideoOnLambda, renderMediaOnLambda, renderStillOnLambda, getRenderProgress, getFunctions, validateWebhookSignature, getCompositionsOnLambda, presignUrl, getSites, speculateFunctionName, };
|
|
16
|
-
export type { AwsRegion, RenderProgress, SpeculateFunctionNameInput, WebhookPayload, PresignUrlInput, };
|
|
19
|
+
export type { AwsRegion, RenderProgress, SpeculateFunctionNameInput, WebhookPayload, PresignUrlInput, RenderStillOnLambdaInput, RenderStillOnLambdaOutput, RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput, GetRenderProgressInput, };
|
|
@@ -5,10 +5,10 @@ const renderer_1 = require("@remotion/renderer");
|
|
|
5
5
|
const version_1 = require("remotion/version");
|
|
6
6
|
const get_or_create_bucket_1 = require("../api/get-or-create-bucket");
|
|
7
7
|
const defaults_1 = require("../defaults");
|
|
8
|
+
const compress_props_1 = require("../shared/compress-props");
|
|
8
9
|
const convert_to_serve_url_1 = require("../shared/convert-to-serve-url");
|
|
9
10
|
const get_browser_instance_1 = require("./helpers/get-browser-instance");
|
|
10
11
|
const get_current_region_1 = require("./helpers/get-current-region");
|
|
11
|
-
const compress_props_1 = require("../shared/compress-props");
|
|
12
12
|
const compositionsHandler = async (lambdaParams, options) => {
|
|
13
13
|
var _a, _b, _c;
|
|
14
14
|
if (lambdaParams.type !== defaults_1.LambdaRoutines.compositions) {
|
|
@@ -55,6 +55,7 @@ const compositionsHandler = async (lambdaParams, options) => {
|
|
|
55
55
|
});
|
|
56
56
|
return Promise.resolve({
|
|
57
57
|
compositions,
|
|
58
|
+
type: 'success',
|
|
58
59
|
});
|
|
59
60
|
};
|
|
60
61
|
exports.compositionsHandler = compositionsHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-
|
|
1
|
+
export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "sa-east-1" | "eu-south-1" | "af-south-1" | "ap-east-1" | "me-south-1";
|
|
@@ -71,6 +71,7 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
|
|
|
71
71
|
mostExpensiveFrameRanges: (_a = postRenderData.mostExpensiveFrameRanges) !== null && _a !== void 0 ? _a : null,
|
|
72
72
|
timeToEncode: postRenderData.timeToEncode,
|
|
73
73
|
outputSizeInBytes: postRenderData.outputSize,
|
|
74
|
+
type: 'success',
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
77
|
const contents = await (0, io_1.lambdaLs)({
|
|
@@ -171,7 +172,12 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
|
|
|
171
172
|
Date.now() > renderMetadata.startedDate + timeoutInMilliseconds + 20000;
|
|
172
173
|
const allErrors = [
|
|
173
174
|
isBeyondTimeout
|
|
174
|
-
? (0, make_timeout_error_1.makeTimeoutError)({
|
|
175
|
+
? (0, make_timeout_error_1.makeTimeoutError)({
|
|
176
|
+
timeoutInMilliseconds,
|
|
177
|
+
renderMetadata,
|
|
178
|
+
chunks,
|
|
179
|
+
renderId,
|
|
180
|
+
})
|
|
175
181
|
: null,
|
|
176
182
|
...errorExplanations,
|
|
177
183
|
].filter(remotion_1.Internals.truthy);
|
|
@@ -222,6 +228,7 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
|
|
|
222
228
|
mostExpensiveFrameRanges: null,
|
|
223
229
|
timeToEncode: null,
|
|
224
230
|
outputSizeInBytes: (_j = outputFile === null || outputFile === void 0 ? void 0 : outputFile.size) !== null && _j !== void 0 ? _j : null,
|
|
231
|
+
type: 'success',
|
|
225
232
|
};
|
|
226
233
|
};
|
|
227
234
|
exports.getProgress = getProgress;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { _Object } from '@aws-sdk/client-s3';
|
|
2
2
|
import type { RenderMetadata } from '../../defaults';
|
|
3
3
|
import type { EnhancedErrorInfo } from './write-lambda-error';
|
|
4
|
-
export declare const makeTimeoutError: ({ timeoutInMilliseconds, chunks, renderMetadata, }: {
|
|
4
|
+
export declare const makeTimeoutError: ({ timeoutInMilliseconds, chunks, renderMetadata, renderId, }: {
|
|
5
5
|
timeoutInMilliseconds: number;
|
|
6
6
|
chunks: _Object[];
|
|
7
7
|
renderMetadata: RenderMetadata;
|
|
8
|
+
renderId: string;
|
|
8
9
|
}) => EnhancedErrorInfo;
|
|
@@ -3,23 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.makeTimeoutError = void 0;
|
|
4
4
|
const parse_chunk_key_1 = require("../../shared/parse-chunk-key");
|
|
5
5
|
const make_timeout_message_1 = require("./make-timeout-message");
|
|
6
|
-
const makeTimeoutError = ({ timeoutInMilliseconds, chunks, renderMetadata, }) => {
|
|
6
|
+
const makeTimeoutError = ({ timeoutInMilliseconds, chunks, renderMetadata, renderId, }) => {
|
|
7
7
|
const availableChunks = chunks.map((c) => (0, parse_chunk_key_1.parseLambdaChunkKey)(c.Key));
|
|
8
8
|
const missingChunks = new Array(renderMetadata.totalChunks)
|
|
9
9
|
.fill(true)
|
|
10
|
-
.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
.map((_, i) => i)
|
|
11
|
+
.filter((index) => {
|
|
12
|
+
return !availableChunks.find((c) => c.chunk === index);
|
|
13
|
+
});
|
|
14
14
|
const message = (0, make_timeout_message_1.makeTimeoutMessage)({
|
|
15
15
|
missingChunks,
|
|
16
16
|
renderMetadata,
|
|
17
17
|
timeoutInMilliseconds,
|
|
18
|
+
renderId,
|
|
18
19
|
});
|
|
19
20
|
return {
|
|
20
21
|
attempt: 1,
|
|
21
22
|
chunk: null,
|
|
22
|
-
explanation:
|
|
23
|
+
explanation: null,
|
|
23
24
|
frame: null,
|
|
24
25
|
isFatal: true,
|
|
25
26
|
s3Location: '',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RenderMetadata } from '../../defaults';
|
|
2
|
-
export declare const makeTimeoutMessage: ({ timeoutInMilliseconds, missingChunks, renderMetadata, }: {
|
|
2
|
+
export declare const makeTimeoutMessage: ({ timeoutInMilliseconds, missingChunks, renderMetadata, renderId, }: {
|
|
3
3
|
timeoutInMilliseconds: number;
|
|
4
4
|
missingChunks: number[];
|
|
5
5
|
renderMetadata: RenderMetadata;
|
|
6
|
+
renderId: string;
|
|
6
7
|
}) => string;
|
|
@@ -1,31 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeTimeoutMessage = void 0;
|
|
4
|
+
const defaults_1 = require("../../defaults");
|
|
4
5
|
const docs_url_1 = require("../../shared/docs-url");
|
|
6
|
+
const get_aws_urls_1 = require("../../shared/get-aws-urls");
|
|
7
|
+
const get_current_region_1 = require("./get-current-region");
|
|
8
|
+
const MAX_MISSING_CHUNKS = 5;
|
|
5
9
|
const makeChunkMissingMessage = ({ missingChunks, renderMetadata, }) => {
|
|
6
|
-
|
|
7
|
-
.map((ch) => {
|
|
8
|
-
const isLastChunk = ch === renderMetadata.totalChunks - 1;
|
|
9
|
-
const start = ch * renderMetadata.framesPerLambda;
|
|
10
|
-
const end = isLastChunk
|
|
11
|
-
? renderMetadata.frameRange[1]
|
|
12
|
-
: (ch + 1) * renderMetadata.framesPerLambda - 1;
|
|
13
|
-
return `Chunk ${ch} (Frames ${start} - ${end})`;
|
|
14
|
-
})
|
|
15
|
-
.slice(0, 5);
|
|
16
|
-
if (missingChunksMessageList.length === 0) {
|
|
10
|
+
if (missingChunks.length === 0) {
|
|
17
11
|
return 'All chunks have been successfully rendered, but the main function has timed out.';
|
|
18
12
|
}
|
|
19
|
-
return
|
|
13
|
+
return [
|
|
14
|
+
`The following chunks are missing (showing ${Math.min(MAX_MISSING_CHUNKS, missingChunks.length)} out of ${missingChunks.length}):`,
|
|
15
|
+
...missingChunks
|
|
16
|
+
.map((ch) => {
|
|
17
|
+
const isLastChunk = ch === renderMetadata.totalChunks - 1;
|
|
18
|
+
const start = ch * renderMetadata.framesPerLambda;
|
|
19
|
+
const end = isLastChunk
|
|
20
|
+
? renderMetadata.frameRange[1]
|
|
21
|
+
: (ch + 1) * renderMetadata.framesPerLambda - 1;
|
|
22
|
+
const msg = `Chunk ${ch} (Frames ${start} - ${end})`;
|
|
23
|
+
return [
|
|
24
|
+
msg,
|
|
25
|
+
`▸ Logs for chunk ${ch}: ${(0, get_aws_urls_1.getCloudwatchRendererUrl)({
|
|
26
|
+
functionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
|
|
27
|
+
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
28
|
+
rendererFunctionName: null,
|
|
29
|
+
renderId: renderMetadata.renderId,
|
|
30
|
+
chunk: ch,
|
|
31
|
+
})}`,
|
|
32
|
+
].join('\n');
|
|
33
|
+
})
|
|
34
|
+
.slice(0, 5),
|
|
35
|
+
].join('\n');
|
|
20
36
|
};
|
|
21
|
-
const makeTimeoutMessage = ({ timeoutInMilliseconds, missingChunks, renderMetadata, }) => {
|
|
37
|
+
const makeTimeoutMessage = ({ timeoutInMilliseconds, missingChunks, renderMetadata, renderId, }) => {
|
|
38
|
+
const cloudWatchRendererUrl = (0, get_aws_urls_1.getCloudwatchRendererUrl)({
|
|
39
|
+
renderId,
|
|
40
|
+
functionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
|
|
41
|
+
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
42
|
+
rendererFunctionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
|
|
43
|
+
chunk: null,
|
|
44
|
+
});
|
|
45
|
+
const cloudWatchLaunchUrl = (0, get_aws_urls_1.getCloudwatchMethodUrl)({
|
|
46
|
+
renderId,
|
|
47
|
+
functionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
|
|
48
|
+
method: defaults_1.LambdaRoutines.launch,
|
|
49
|
+
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
50
|
+
rendererFunctionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
|
|
51
|
+
});
|
|
22
52
|
const message = [
|
|
23
53
|
`The main function timed out after ${timeoutInMilliseconds}ms.`,
|
|
24
|
-
`Consider increasing the timeout of your function.`,
|
|
25
54
|
makeChunkMissingMessage({ missingChunks, renderMetadata }),
|
|
26
|
-
|
|
55
|
+
'',
|
|
56
|
+
`Consider increasing the timeout of your function.`,
|
|
57
|
+
`▸ You can use the "--timeout" parameter when deploying a function via CLI, or the "timeoutInSeconds" parameter when using the deployFunction() API.`,
|
|
27
58
|
`${docs_url_1.DOCS_URL}/docs/lambda/cli/functions#deploy`,
|
|
28
|
-
'
|
|
59
|
+
'',
|
|
60
|
+
'▸ Visit the logs for the main function:',
|
|
61
|
+
cloudWatchLaunchUrl,
|
|
62
|
+
'▸ Visit the logs for the renderer functions:',
|
|
63
|
+
cloudWatchRendererUrl,
|
|
64
|
+
'',
|
|
65
|
+
'▸ Get help on debugging this error:',
|
|
29
66
|
`${docs_url_1.DOCS_URL}/docs/lambda/troubleshooting/debug`,
|
|
30
67
|
].join('\n');
|
|
31
68
|
return message;
|
|
@@ -33,8 +33,11 @@ function isInAWS(handler) {
|
|
|
33
33
|
}
|
|
34
34
|
exports.isInAWS = isInAWS;
|
|
35
35
|
function streamifyResponse(handler) {
|
|
36
|
-
// Check
|
|
37
|
-
if (
|
|
36
|
+
// Check if we are inside Lambda
|
|
37
|
+
if (process.env.AWS_LAMBDA_FUNCTION_VERSION &&
|
|
38
|
+
process.env.AWS_LAMBDA_FUNCTION_NAME &&
|
|
39
|
+
// @ts-expect-error
|
|
40
|
+
typeof awslambda !== 'undefined') {
|
|
38
41
|
// @ts-expect-error
|
|
39
42
|
return awslambda.streamifyResponse(handler);
|
|
40
43
|
}
|
|
@@ -43,16 +46,16 @@ function streamifyResponse(handler) {
|
|
|
43
46
|
const responseStream = patchArgs(argList);
|
|
44
47
|
await target(...argList);
|
|
45
48
|
return {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
EventStream: [
|
|
50
|
+
{
|
|
51
|
+
PayloadChunk: {
|
|
52
|
+
Payload: responseStream._isBase64Encoded
|
|
53
|
+
? responseStream.getBufferedData()
|
|
54
|
+
: responseStream.getBufferedData(),
|
|
55
|
+
},
|
|
56
|
+
InvokeComplete: true,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
56
59
|
};
|
|
57
60
|
},
|
|
58
61
|
});
|