@remotion/lambda 4.0.10 → 4.1.0-alpha10
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/streaming-payloads.d.ts +3 -3
- package/dist/functions/launch.js +8 -1
- package/dist/functions/renderer.js +14 -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: "info" | "error" | "verbose" | "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: "info" | "error" | "verbose" | "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: "info" | "error" | "verbose" | "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: "info" | "error" | "verbose" | "warn";
|
|
23
23
|
} & {
|
|
24
24
|
tag?: string | undefined;
|
|
25
25
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
@@ -4,16 +4,16 @@ declare const streamingPayloadSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
4
4
|
type: z.ZodLiteral<"render-id-determined">;
|
|
5
5
|
renderId: z.ZodString;
|
|
6
6
|
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
renderId: string;
|
|
8
7
|
type: "render-id-determined";
|
|
9
|
-
}, {
|
|
10
8
|
renderId: string;
|
|
9
|
+
}, {
|
|
11
10
|
type: "render-id-determined";
|
|
11
|
+
renderId: string;
|
|
12
12
|
}>]>;
|
|
13
13
|
export type StreamingPayloads = z.infer<typeof streamingPayloadSchema>;
|
|
14
14
|
export declare const isStreamingPayload: (str: string) => false | {
|
|
15
|
-
renderId: string;
|
|
16
15
|
type: "render-id-determined";
|
|
16
|
+
renderId: string;
|
|
17
17
|
};
|
|
18
18
|
export declare const sendProgressEvent: (responseStream: ResponseStream, payload: StreamingPayloads) => void;
|
|
19
19
|
export {};
|
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');
|
|
@@ -79,9 +79,8 @@ const renderHandler = async (params, options, logs) => {
|
|
|
79
79
|
serializedInputPropsWithCustomSchema,
|
|
80
80
|
frameRange: params.frameRange,
|
|
81
81
|
onProgress: ({ renderedFrames, encodedFrames, stitchStage }) => {
|
|
82
|
-
if (renderedFrames % 5 === 0
|
|
83
|
-
renderer_1.RenderInternals.
|
|
84
|
-
console.log(`Rendered ${renderedFrames} frames, encoded ${encodedFrames} frames, stage = ${stitchStage}`);
|
|
82
|
+
if (renderedFrames % 5 === 0) {
|
|
83
|
+
renderer_1.RenderInternals.Log.info(`Rendered ${renderedFrames} frames, encoded ${encodedFrames} frames, stage = ${stitchStage}`);
|
|
85
84
|
(0, chunk_progress_1.writeLambdaInitializedFile)({
|
|
86
85
|
attempt: params.attempt,
|
|
87
86
|
bucketName: params.bucketName,
|
|
@@ -90,10 +89,13 @@ const renderHandler = async (params, options, logs) => {
|
|
|
90
89
|
framesRendered: renderedFrames,
|
|
91
90
|
renderId: params.renderId,
|
|
92
91
|
}).catch((err) => {
|
|
93
|
-
console.log(err);
|
|
92
|
+
console.log('Could not write progress', err);
|
|
94
93
|
return reject(err);
|
|
95
94
|
});
|
|
96
95
|
}
|
|
96
|
+
else {
|
|
97
|
+
renderer_1.RenderInternals.Log.verbose(`Rendered ${renderedFrames} frames, encoded ${encodedFrames} frames, stage = ${stitchStage}`);
|
|
98
|
+
}
|
|
97
99
|
const allFrames = renderer_1.RenderInternals.getFramesToRender(params.frameRange, params.everyNthFrame);
|
|
98
100
|
if (renderedFrames === allFrames.length) {
|
|
99
101
|
console.log('Rendered all frames!');
|
|
@@ -242,11 +244,14 @@ const rendererHandler = async (params, options) => {
|
|
|
242
244
|
}
|
|
243
245
|
// If this error is encountered, we can just retry as it
|
|
244
246
|
// is a very rare error to occur
|
|
245
|
-
const
|
|
246
|
-
err.message.includes('error while loading shared libraries: libnss3.so')
|
|
247
|
+
const isRetryableError = err.message.includes('FATAL:zygote_communication_linux.cc') ||
|
|
248
|
+
err.message.includes('error while loading shared libraries: libnss3.so') ||
|
|
249
|
+
err.message.includes('but the server sent no data') ||
|
|
250
|
+
err.message.includes('Timed out while setting up the headless browser');
|
|
247
251
|
const shouldNotRetry = err.name === 'CancelledError';
|
|
248
|
-
const
|
|
249
|
-
|
|
252
|
+
const isFatal = !isRetryableError;
|
|
253
|
+
const willRetry = isRetryableError && params.retriesLeft > 0 && !shouldNotRetry;
|
|
254
|
+
console.log(`Error occurred (will retry = ${String(willRetry)})`);
|
|
250
255
|
console.log(err);
|
|
251
256
|
await (0, write_lambda_error_1.writeLambdaError)({
|
|
252
257
|
bucketName: params.bucketName,
|
|
@@ -257,7 +262,7 @@ const rendererHandler = async (params, options) => {
|
|
|
257
262
|
chunk: params.chunk,
|
|
258
263
|
frame: null,
|
|
259
264
|
type: 'renderer',
|
|
260
|
-
isFatal
|
|
265
|
+
isFatal,
|
|
261
266
|
tmpDir: (0, write_lambda_error_1.getTmpDirStateIfENoSp)(err.stack),
|
|
262
267
|
attempt: params.attempt,
|
|
263
268
|
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.1.0-alpha10",
|
|
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/
|
|
30
|
-
"@remotion/cli": "4.0
|
|
31
|
-
"remotion": "4.0
|
|
32
|
-
"@remotion/
|
|
29
|
+
"@remotion/renderer": "4.1.0-alpha10",
|
|
30
|
+
"@remotion/cli": "4.1.0-alpha10",
|
|
31
|
+
"remotion": "4.1.0-alpha10",
|
|
32
|
+
"@remotion/bundler": "4.1.0-alpha10"
|
|
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.1.0-alpha10",
|
|
48
|
+
"@remotion/compositor-linux-arm64-gnu": "4.1.0-alpha10"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@remotion/bundler": "4.0
|
|
51
|
+
"@remotion/bundler": "4.1.0-alpha10"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|