@remotion/lambda 4.0.10 → 4.0.12
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/cli/log.d.ts +4 -4
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -4
- package/dist/functions/helpers/concat-videos.js +7 -2
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/launch.js +8 -1
- package/dist/functions/renderer.js +18 -9
- package/dist/shared/invoke-webhook.d.ts +2 -0
- package/package.json +8 -8
- package/remotionlambda-arm64.zip +0 -0
package/dist/cli/log.d.ts
CHANGED
|
@@ -2,24 +2,24 @@ 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
20
|
errorAdvanced: (options: {
|
|
21
21
|
indent: boolean;
|
|
22
|
-
logLevel: "
|
|
22
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
23
23
|
} & {
|
|
24
24
|
tag?: string | undefined;
|
|
25
25
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
@@ -79,7 +79,12 @@ const getAllFilesS3 = ({ bucket, expectedFiles, outdir, renderId, region, expect
|
|
|
79
79
|
console.log('Checking for finish... ', Object.keys(downloaded), expectedFiles + ' files expected');
|
|
80
80
|
if (areAllFilesDownloaded) {
|
|
81
81
|
console.log('All files are downloaded!');
|
|
82
|
-
resolve(
|
|
82
|
+
resolve(
|
|
83
|
+
// Need to use downloaded variable, not filesInBucket
|
|
84
|
+
// as it may be out of date
|
|
85
|
+
Object.keys(downloaded)
|
|
86
|
+
.sort()
|
|
87
|
+
.map((file) => getChunkDownloadOutputLocation({ outdir, file })));
|
|
83
88
|
}
|
|
84
89
|
};
|
|
85
90
|
console.log('Found ', filesInBucket);
|
|
@@ -108,7 +113,7 @@ const getAllFilesS3 = ({ bucket, expectedFiles, outdir, renderId, region, expect
|
|
|
108
113
|
region,
|
|
109
114
|
expectedBucketOwner,
|
|
110
115
|
});
|
|
111
|
-
|
|
116
|
+
renderer_1.RenderInternals.Log.info('Successfully downloaded', key);
|
|
112
117
|
downloadTimer.end();
|
|
113
118
|
downloaded[key] = true;
|
|
114
119
|
checkFinish();
|
|
@@ -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";
|
package/dist/functions/launch.js
CHANGED
|
@@ -373,7 +373,14 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
373
373
|
else {
|
|
374
374
|
console.log('No webhook specified');
|
|
375
375
|
}
|
|
376
|
-
|
|
376
|
+
const firstError = errors[0];
|
|
377
|
+
if (firstError.chunk !== null) {
|
|
378
|
+
throw new Error(`Stopping Lambda function because error occurred while rendering chunk ${firstError.chunk}:\n${errors[0].stack
|
|
379
|
+
.split('\n')
|
|
380
|
+
.map((s) => ` ${s}`)
|
|
381
|
+
.join('\n')}`);
|
|
382
|
+
}
|
|
383
|
+
throw new Error(`Stopping Lambda function because error occurred: ${errors[0].stack}`);
|
|
377
384
|
};
|
|
378
385
|
const fps = comp.fps / params.everyNthFrame;
|
|
379
386
|
const outdir = (0, node_path_1.join)(renderer_1.RenderInternals.tmpDir(constants_1.CONCAT_FOLDER_TOKEN), 'bucket');
|
|
@@ -47,6 +47,7 @@ const renderHandler = async (params, options, logs) => {
|
|
|
47
47
|
if (!params.frameRange) {
|
|
48
48
|
throw new Error('must pass framerange');
|
|
49
49
|
}
|
|
50
|
+
renderer_1.RenderInternals.Log.verbose(`Rendering frames ${params.frameRange[0]}-${params.frameRange[1]} in this Lambda function`);
|
|
50
51
|
const start = Date.now();
|
|
51
52
|
const chunkTimingData = {
|
|
52
53
|
timings: {},
|
|
@@ -79,9 +80,8 @@ const renderHandler = async (params, options, logs) => {
|
|
|
79
80
|
serializedInputPropsWithCustomSchema,
|
|
80
81
|
frameRange: params.frameRange,
|
|
81
82
|
onProgress: ({ renderedFrames, encodedFrames, stitchStage }) => {
|
|
82
|
-
if (renderedFrames % 5 === 0
|
|
83
|
-
renderer_1.RenderInternals.
|
|
84
|
-
console.log(`Rendered ${renderedFrames} frames, encoded ${encodedFrames} frames, stage = ${stitchStage}`);
|
|
83
|
+
if (renderedFrames % 5 === 0) {
|
|
84
|
+
renderer_1.RenderInternals.Log.info(`Rendered ${renderedFrames} frames, encoded ${encodedFrames} frames, stage = ${stitchStage}`);
|
|
85
85
|
(0, chunk_progress_1.writeLambdaInitializedFile)({
|
|
86
86
|
attempt: params.attempt,
|
|
87
87
|
bucketName: params.bucketName,
|
|
@@ -90,10 +90,13 @@ const renderHandler = async (params, options, logs) => {
|
|
|
90
90
|
framesRendered: renderedFrames,
|
|
91
91
|
renderId: params.renderId,
|
|
92
92
|
}).catch((err) => {
|
|
93
|
-
console.log(err);
|
|
93
|
+
console.log('Could not write progress', err);
|
|
94
94
|
return reject(err);
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
+
else {
|
|
98
|
+
renderer_1.RenderInternals.Log.verbose(`Rendered ${renderedFrames} frames, encoded ${encodedFrames} frames, stage = ${stitchStage}`);
|
|
99
|
+
}
|
|
97
100
|
const allFrames = renderer_1.RenderInternals.getFramesToRender(params.frameRange, params.everyNthFrame);
|
|
98
101
|
if (renderedFrames === allFrames.length) {
|
|
99
102
|
console.log('Rendered all frames!');
|
|
@@ -240,13 +243,19 @@ const rendererHandler = async (params, options) => {
|
|
|
240
243
|
console.log({ err });
|
|
241
244
|
throw err;
|
|
242
245
|
}
|
|
246
|
+
const { message } = err;
|
|
243
247
|
// If this error is encountered, we can just retry as it
|
|
244
248
|
// is a very rare error to occur
|
|
245
|
-
const
|
|
246
|
-
|
|
249
|
+
const isRetryableError = message.includes('FATAL:zygote_communication_linux.cc') ||
|
|
250
|
+
message.includes('error while loading shared libraries: libnss3.so') ||
|
|
251
|
+
message.includes('but the server sent no data') ||
|
|
252
|
+
message.includes('Compositor panicked') ||
|
|
253
|
+
(message.includes('Compositor exited') && !message.includes('SIGSEGV')) ||
|
|
254
|
+
message.includes('Timed out while setting up the headless browser');
|
|
247
255
|
const shouldNotRetry = err.name === 'CancelledError';
|
|
248
|
-
const
|
|
249
|
-
|
|
256
|
+
const isFatal = !isRetryableError;
|
|
257
|
+
const willRetry = isRetryableError && params.retriesLeft > 0 && !shouldNotRetry;
|
|
258
|
+
console.log(`Error occurred (will retry = ${String(willRetry)})`);
|
|
250
259
|
console.log(err);
|
|
251
260
|
await (0, write_lambda_error_1.writeLambdaError)({
|
|
252
261
|
bucketName: params.bucketName,
|
|
@@ -257,7 +266,7 @@ const rendererHandler = async (params, options) => {
|
|
|
257
266
|
chunk: params.chunk,
|
|
258
267
|
frame: null,
|
|
259
268
|
type: 'renderer',
|
|
260
|
-
isFatal
|
|
269
|
+
isFatal,
|
|
261
270
|
tmpDir: (0, write_lambda_error_1.getTmpDirStateIfENoSp)(err.stack),
|
|
262
271
|
attempt: params.attempt,
|
|
263
272
|
totalAttempts: params.retriesLeft + params.attempt,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.12",
|
|
4
4
|
"description": "Distributed renderer for Remotion based on AWS Lambda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"aws-policies": "^1.0.1",
|
|
27
27
|
"mime-types": "2.1.34",
|
|
28
28
|
"zod": "3.21.4",
|
|
29
|
-
"@remotion/bundler": "4.0.
|
|
30
|
-
"@remotion/cli": "4.0.
|
|
31
|
-
"remotion": "4.0.
|
|
32
|
-
"
|
|
29
|
+
"@remotion/bundler": "4.0.12",
|
|
30
|
+
"@remotion/cli": "4.0.12",
|
|
31
|
+
"@remotion/renderer": "4.0.12",
|
|
32
|
+
"remotion": "4.0.12"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@jonny/eslint-config": "3.0.266",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"typescript": "4.9.5",
|
|
45
45
|
"vitest": "0.31.1",
|
|
46
46
|
"zip-lib": "^0.7.2",
|
|
47
|
-
"@remotion/bundler": "4.0.
|
|
48
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
47
|
+
"@remotion/bundler": "4.0.12",
|
|
48
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.12"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@remotion/bundler": "4.0.
|
|
51
|
+
"@remotion/bundler": "4.0.12"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|