@remotion/lambda 4.0.164 → 4.0.165
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/api/delete-render.js +7 -3
- package/dist/api/deploy-function.d.ts +0 -1
- package/dist/api/deploy-function.js +3 -3
- package/dist/api/download-media.js +6 -3
- package/dist/api/get-compositions-on-lambda.js +0 -2
- package/dist/api/get-render-progress.js +0 -2
- package/dist/api/make-lambda-payload.js +2 -1
- package/dist/api/render-media-on-lambda.js +0 -2
- package/dist/api/render-still-on-lambda.js +37 -25
- package/dist/cli/commands/render/progress.d.ts +3 -28
- package/dist/cli/commands/render/progress.js +89 -90
- package/dist/cli/commands/render/render.js +7 -40
- package/dist/cli/commands/sites/create.js +2 -2
- package/dist/functions/chunk-optimization/types.d.ts +0 -3
- package/dist/functions/helpers/calculate-chunk-times.d.ts +3 -4
- package/dist/functions/helpers/calculate-chunk-times.js +4 -8
- package/dist/functions/helpers/calculate-price-from-bucket.d.ts +3 -5
- package/dist/functions/helpers/calculate-price-from-bucket.js +5 -18
- package/dist/functions/helpers/clean-tmpdir.d.ts +0 -2
- package/dist/functions/helpers/clean-tmpdir.js +1 -7
- package/dist/functions/helpers/concat-videos.d.ts +1 -13
- package/dist/functions/helpers/concat-videos.js +7 -131
- package/dist/functions/helpers/create-post-render-data.d.ts +6 -6
- package/dist/functions/helpers/create-post-render-data.js +17 -37
- package/dist/functions/helpers/find-output-file-in-bucket.d.ts +1 -3
- package/dist/functions/helpers/find-output-file-in-bucket.js +1 -4
- package/dist/functions/helpers/get-encoding-progress-step-size.d.ts +1 -1
- package/dist/functions/helpers/get-encoding-progress-step-size.js +0 -3
- package/dist/functions/helpers/get-lambdas-invoked-stats.d.ts +1 -6
- package/dist/functions/helpers/get-lambdas-invoked-stats.js +0 -13
- package/dist/functions/helpers/get-overall-progress-s3.d.ts +4 -2
- package/dist/functions/helpers/get-overall-progress-s3.js +8 -6
- package/dist/functions/helpers/get-overall-progress.d.ts +1 -2
- package/dist/functions/helpers/get-overall-progress.js +2 -4
- package/dist/functions/helpers/get-progress.js +78 -154
- package/dist/functions/helpers/get-retry-stats.d.ts +0 -5
- package/dist/functions/helpers/get-retry-stats.js +0 -18
- package/dist/functions/helpers/inspect-errors.d.ts +4 -10
- package/dist/functions/helpers/inspect-errors.js +5 -27
- package/dist/functions/helpers/io.d.ts +0 -1
- package/dist/functions/helpers/io.js +2 -3
- package/dist/functions/helpers/lifecycle.d.ts +0 -4
- package/dist/functions/helpers/lifecycle.js +2 -3
- package/dist/functions/helpers/make-timeout-error.d.ts +0 -2
- package/dist/functions/helpers/merge-chunks.d.ts +5 -0
- package/dist/functions/helpers/merge-chunks.js +16 -143
- package/dist/functions/helpers/min-max.d.ts +1 -1
- package/dist/functions/helpers/min-max.js +1 -1
- package/dist/functions/helpers/overall-render-progress.d.ts +26 -4
- package/dist/functions/helpers/overall-render-progress.js +116 -27
- package/dist/functions/helpers/stream-renderer.js +15 -9
- package/dist/functions/helpers/streamify-response.d.ts +0 -3
- package/dist/functions/helpers/streamify-response.js +2 -14
- package/dist/functions/helpers/write-lambda-error.d.ts +3 -6
- package/dist/functions/helpers/write-lambda-error.js +1 -21
- package/dist/functions/index.d.ts +5 -0
- package/dist/functions/index.js +70 -38
- package/dist/functions/launch.js +103 -133
- package/dist/functions/renderer.d.ts +2 -2
- package/dist/functions/renderer.js +70 -123
- package/dist/functions/start.d.ts +1 -0
- package/dist/functions/start.js +3 -2
- package/dist/functions/still.d.ts +7 -2
- package/dist/functions/still.js +17 -34
- package/dist/functions/streaming/streaming.d.ts +15 -2
- package/dist/functions/streaming/streaming.js +8 -6
- package/dist/internals.d.ts +2 -1
- package/dist/shared/aws-clients.js +8 -0
- package/dist/shared/call-lambda.d.ts +5 -4
- package/dist/shared/call-lambda.js +53 -44
- package/dist/shared/constants.d.ts +14 -35
- package/dist/shared/constants.js +3 -31
- package/dist/shared/content-disposition-header.d.ts +0 -3
- package/dist/shared/get-function-version.js +0 -2
- package/dist/shared/is-flaky-error.js +4 -0
- package/dist/shared/parse-lambda-timings-key.d.ts +0 -2
- package/dist/shared/parse-lambda-timings-key.js +0 -14
- package/dist/shared/return-values.d.ts +0 -5
- package/package.json +18 -18
- package/remotionlambda-arm64.zip +0 -0
|
@@ -1,48 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.callLambda = void 0;
|
|
3
|
+
exports.callLambdaWithStreaming = exports.callLambda = void 0;
|
|
4
4
|
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
5
|
-
const
|
|
5
|
+
const pure_1 = require("@remotion/renderer/pure");
|
|
6
|
+
const streaming_1 = require("../functions/streaming/streaming");
|
|
6
7
|
const aws_clients_1 = require("./aws-clients");
|
|
7
8
|
const INVALID_JSON_MESSAGE = 'Cannot parse Lambda response as JSON';
|
|
8
|
-
const
|
|
9
|
+
const parseJsonOrThrowSource = (data, type) => {
|
|
10
|
+
const asString = new TextDecoder('utf-8').decode(data);
|
|
9
11
|
try {
|
|
10
|
-
return JSON.parse(
|
|
12
|
+
return JSON.parse(asString);
|
|
11
13
|
}
|
|
12
|
-
catch (
|
|
13
|
-
throw new Error(
|
|
14
|
+
catch (err) {
|
|
15
|
+
throw new Error(`Invalid JSON (${type}): ${asString}`);
|
|
14
16
|
}
|
|
15
17
|
};
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if ('
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if ('errorMessage' in json) {
|
|
23
|
-
const err = new Error(json.errorMessage);
|
|
24
|
-
err.name = json.errorType;
|
|
25
|
-
err.stack = ((_a = json.trace) !== null && _a !== void 0 ? _a : []).join('\n');
|
|
26
|
-
throw err;
|
|
27
|
-
}
|
|
28
|
-
// This will not happen, it is for narrowing purposes
|
|
29
|
-
if ('statusCode' in json) {
|
|
30
|
-
throw new Error(`Lambda function failed with status code ${json.statusCode}`);
|
|
31
|
-
}
|
|
32
|
-
if (json.type === 'error') {
|
|
33
|
-
const err = new Error(json.message);
|
|
34
|
-
err.stack = json.stack;
|
|
18
|
+
const callLambda = async (options) => {
|
|
19
|
+
// Do not remove this await
|
|
20
|
+
const res = await callLambdaWithoutRetry(options);
|
|
21
|
+
if (res.type === 'error') {
|
|
22
|
+
const err = new Error(res.message);
|
|
23
|
+
err.stack = res.stack;
|
|
35
24
|
throw err;
|
|
36
25
|
}
|
|
37
|
-
return
|
|
26
|
+
return res;
|
|
38
27
|
};
|
|
39
|
-
|
|
28
|
+
exports.callLambda = callLambda;
|
|
29
|
+
const callLambdaWithStreaming = async (options) => {
|
|
40
30
|
// As of August 2023, Lambda streaming sometimes misses parts of the JSON response.
|
|
41
31
|
// Handling this for now by applying a retry mechanism.
|
|
42
32
|
try {
|
|
43
33
|
// Do not remove this await
|
|
44
|
-
|
|
45
|
-
return res;
|
|
34
|
+
await callLambdaWithStreamingWithoutRetry(options);
|
|
46
35
|
}
|
|
47
36
|
catch (err) {
|
|
48
37
|
if (options.retriesRemaining === 0) {
|
|
@@ -51,33 +40,54 @@ const callLambda = async (options) => {
|
|
|
51
40
|
if (!err.message.includes(INVALID_JSON_MESSAGE)) {
|
|
52
41
|
throw err;
|
|
53
42
|
}
|
|
54
|
-
return (0, exports.
|
|
43
|
+
return (0, exports.callLambdaWithStreaming)({
|
|
55
44
|
...options,
|
|
56
45
|
retriesRemaining: options.retriesRemaining - 1,
|
|
57
46
|
});
|
|
58
47
|
}
|
|
59
48
|
};
|
|
60
|
-
exports.
|
|
61
|
-
const callLambdaWithoutRetry = async ({ functionName, type, payload, region,
|
|
49
|
+
exports.callLambdaWithStreaming = callLambdaWithStreaming;
|
|
50
|
+
const callLambdaWithoutRetry = async ({ functionName, type, payload, region, timeoutInTest, }) => {
|
|
51
|
+
const Payload = JSON.stringify({ type, ...payload });
|
|
52
|
+
const res = await (0, aws_clients_1.getLambdaClient)(region, timeoutInTest).send(new client_lambda_1.InvokeCommand({
|
|
53
|
+
FunctionName: functionName,
|
|
54
|
+
Payload,
|
|
55
|
+
InvocationType: 'RequestResponse',
|
|
56
|
+
}));
|
|
57
|
+
const decoded = new TextDecoder('utf-8').decode(res.Payload);
|
|
58
|
+
try {
|
|
59
|
+
return JSON.parse(decoded);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
throw new Error(`Invalid JSON (${type}): ${JSON.stringify(decoded)}`);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const callLambdaWithStreamingWithoutRetry = async ({ functionName, type, payload, region, timeoutInTest, receivedStreamingPayload, }) => {
|
|
62
66
|
const res = await (0, aws_clients_1.getLambdaClient)(region, timeoutInTest).send(new client_lambda_1.InvokeWithResponseStreamCommand({
|
|
63
67
|
FunctionName: functionName,
|
|
64
68
|
Payload: JSON.stringify({ type, ...payload }),
|
|
65
69
|
}));
|
|
70
|
+
const { onData, clear } = pure_1.NoReactAPIs.makeStreamer((status, messageTypeId, data) => {
|
|
71
|
+
const messageType = (0, streaming_1.messageTypeIdToMessageType)(messageTypeId);
|
|
72
|
+
const innerPayload = streaming_1.formatMap[messageType] === 'json'
|
|
73
|
+
? parseJsonOrThrowSource(data, messageType)
|
|
74
|
+
: data;
|
|
75
|
+
const message = {
|
|
76
|
+
successType: status,
|
|
77
|
+
message: {
|
|
78
|
+
type: messageType,
|
|
79
|
+
payload: innerPayload,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
receivedStreamingPayload(message);
|
|
83
|
+
});
|
|
66
84
|
const events = res.EventStream;
|
|
67
|
-
let responsePayload = '';
|
|
68
85
|
for await (const event of events) {
|
|
69
86
|
// There are two types of events you can get on a stream.
|
|
70
87
|
// `PayloadChunk`: These contain the actual raw bytes of the chunk
|
|
71
88
|
// It has a single property: `Payload`
|
|
72
|
-
if (event.PayloadChunk) {
|
|
73
|
-
|
|
74
|
-
const decoded = new TextDecoder('utf-8').decode(event.PayloadChunk.Payload);
|
|
75
|
-
const streamPayload = (0, streaming_payloads_1.isStreamingPayload)(decoded);
|
|
76
|
-
if (streamPayload) {
|
|
77
|
-
receivedStreamingPayload(streamPayload);
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
responsePayload += decoded;
|
|
89
|
+
if (event.PayloadChunk && event.PayloadChunk.Payload) {
|
|
90
|
+
onData(event.PayloadChunk.Payload);
|
|
81
91
|
}
|
|
82
92
|
if (event.InvokeComplete) {
|
|
83
93
|
if (event.InvokeComplete.ErrorCode) {
|
|
@@ -89,6 +99,5 @@ const callLambdaWithoutRetry = async ({ functionName, type, payload, region, rec
|
|
|
89
99
|
}
|
|
90
100
|
}
|
|
91
101
|
}
|
|
92
|
-
|
|
93
|
-
return json;
|
|
102
|
+
clear();
|
|
94
103
|
};
|
|
@@ -32,36 +32,7 @@ export declare const RENDER_FN_PREFIX = "remotion-render-";
|
|
|
32
32
|
export declare const LOG_GROUP_PREFIX = "/aws/lambda/";
|
|
33
33
|
export declare const LAMBDA_INSIGHTS_PREFIX = "/aws/lambda-insights";
|
|
34
34
|
export declare const rendersPrefix: (renderId: string) => string;
|
|
35
|
-
export declare const
|
|
36
|
-
export declare const renderMetadataKey: (renderId: string) => string;
|
|
37
|
-
export declare const initalizedMetadataKey: (renderId: string) => string;
|
|
38
|
-
export declare const lambdaChunkInitializedPrefix: (renderId: string) => string;
|
|
39
|
-
export declare const lambdaChunkInitializedKey: ({ renderId, chunk, attempt, }: {
|
|
40
|
-
attempt: number;
|
|
41
|
-
renderId: string;
|
|
42
|
-
chunk: number;
|
|
43
|
-
}) => string;
|
|
44
|
-
export declare const lambdaTimingsPrefix: (renderId: string) => string;
|
|
45
|
-
export declare const lambdaTimingsPrefixForChunk: (renderId: string, chunk: number) => string;
|
|
46
|
-
export declare const lambdaLogsPrefix: (renderId: string, chunk: number, startFrame: number, endFrame: number) => string;
|
|
47
|
-
export declare const lambdaTimingsKey: ({ renderId, chunk, start, rendered, }: {
|
|
48
|
-
renderId: string;
|
|
49
|
-
chunk: number;
|
|
50
|
-
start: number;
|
|
51
|
-
rendered: number;
|
|
52
|
-
}) => string;
|
|
53
|
-
export declare const chunkKey: (renderId: string) => string;
|
|
54
|
-
export declare const chunkKeyForIndex: ({ renderId, index, type, }: {
|
|
55
|
-
renderId: string;
|
|
56
|
-
index: number;
|
|
57
|
-
type: 'video' | 'audio';
|
|
58
|
-
}) => string;
|
|
59
|
-
export declare const getErrorKeyPrefix: (renderId: string) => string;
|
|
60
|
-
export declare const getErrorFileName: ({ renderId, chunk, attempt, }: {
|
|
61
|
-
renderId: string;
|
|
62
|
-
chunk: number | null;
|
|
63
|
-
attempt: number;
|
|
64
|
-
}) => string;
|
|
35
|
+
export declare const overallProgressKey: (renderId: string) => string;
|
|
65
36
|
export type OutNameInput = string | {
|
|
66
37
|
bucketName: string;
|
|
67
38
|
key: string;
|
|
@@ -81,7 +52,6 @@ export declare const getSitesKey: (siteId: string) => string;
|
|
|
81
52
|
export declare const outName: (renderId: string, extension: string) => string;
|
|
82
53
|
export declare const outStillName: (renderId: string, imageFormat: StillImageFormat) => string;
|
|
83
54
|
export declare const customOutName: (renderId: string, bucketName: string, name: OutNameInput) => OutNameOutput;
|
|
84
|
-
export declare const postRenderDataKey: (renderId: string) => string;
|
|
85
55
|
export declare const defaultPropsKey: (hash: string) => string;
|
|
86
56
|
export declare const inputPropsKey: (hash: string) => string;
|
|
87
57
|
export declare const resolvedPropsKey: (hash: string) => string;
|
|
@@ -262,6 +232,7 @@ export type LambdaPayloads = {
|
|
|
262
232
|
colorSpace: ColorSpace | null;
|
|
263
233
|
compositionStart: number;
|
|
264
234
|
framesPerLambda: number;
|
|
235
|
+
progressEveryNthFrame: number;
|
|
265
236
|
};
|
|
266
237
|
still: {
|
|
267
238
|
type: LambdaRoutines.still;
|
|
@@ -287,6 +258,7 @@ export type LambdaPayloads = {
|
|
|
287
258
|
bucketName: string | null;
|
|
288
259
|
offthreadVideoCacheSizeInBytes: number | null;
|
|
289
260
|
deleteAfter: DeleteAfter | null;
|
|
261
|
+
streamed: boolean;
|
|
290
262
|
};
|
|
291
263
|
compositions: {
|
|
292
264
|
type: LambdaRoutines.compositions;
|
|
@@ -302,9 +274,6 @@ export type LambdaPayloads = {
|
|
|
302
274
|
};
|
|
303
275
|
};
|
|
304
276
|
export type LambdaPayload = LambdaPayloads[LambdaRoutines];
|
|
305
|
-
export type EncodingProgress = {
|
|
306
|
-
framesEncoded: number;
|
|
307
|
-
};
|
|
308
277
|
type Discriminated = {
|
|
309
278
|
type: 'still';
|
|
310
279
|
imageFormat: StillImageFormat;
|
|
@@ -351,11 +320,11 @@ export type PostRenderData = {
|
|
|
351
320
|
outputSize: number;
|
|
352
321
|
renderSize: number;
|
|
353
322
|
timeToFinish: number;
|
|
323
|
+
timeToRenderFrames: number;
|
|
354
324
|
errors: EnhancedErrorInfo[];
|
|
355
325
|
startTime: number;
|
|
356
326
|
endTime: number;
|
|
357
327
|
filesCleanedUp: number;
|
|
358
|
-
renderMetadata: RenderMetadata;
|
|
359
328
|
timeToEncode: number;
|
|
360
329
|
timeToCleanUp: number;
|
|
361
330
|
timeToRenderChunks: number;
|
|
@@ -363,6 +332,7 @@ export type PostRenderData = {
|
|
|
363
332
|
mostExpensiveFrameRanges: ExpensiveChunk[] | undefined;
|
|
364
333
|
estimatedBillingDurationInMilliseconds: number;
|
|
365
334
|
deleteAfter: DeleteAfter | null;
|
|
335
|
+
timeToCombine: number | null;
|
|
366
336
|
};
|
|
367
337
|
export type CostsInfo = {
|
|
368
338
|
accruedSoFar: number;
|
|
@@ -375,6 +345,11 @@ export type CleanupInfo = {
|
|
|
375
345
|
minFilesToDelete: number;
|
|
376
346
|
filesDeleted: number;
|
|
377
347
|
};
|
|
348
|
+
type EncodingProgress = {
|
|
349
|
+
framesEncoded: number;
|
|
350
|
+
combinedFrames: number;
|
|
351
|
+
timeToCombine: number | null;
|
|
352
|
+
};
|
|
378
353
|
export type RenderProgress = {
|
|
379
354
|
chunks: number;
|
|
380
355
|
done: boolean;
|
|
@@ -394,6 +369,7 @@ export type RenderProgress = {
|
|
|
394
369
|
lambdasInvoked: number;
|
|
395
370
|
cleanup: CleanupInfo | null;
|
|
396
371
|
timeToFinishChunks: number | null;
|
|
372
|
+
timeToRenderFrames: number | null;
|
|
397
373
|
timeToEncode: number | null;
|
|
398
374
|
overallProgress: number;
|
|
399
375
|
retriesInfo: ChunkRetry[];
|
|
@@ -402,6 +378,9 @@ export type RenderProgress = {
|
|
|
402
378
|
outputSizeInBytes: number | null;
|
|
403
379
|
type: 'success';
|
|
404
380
|
estimatedBillingDurationInMilliseconds: number | null;
|
|
381
|
+
combinedFrames: number;
|
|
382
|
+
timeToCombine: number | null;
|
|
383
|
+
timeoutTimestamp: number;
|
|
405
384
|
};
|
|
406
385
|
export type Privacy = 'public' | 'private' | 'no-acl';
|
|
407
386
|
export declare const LAMBDA_CONCURRENCY_LIMIT_QUOTA = "L-B99A9384";
|
package/dist/shared/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = exports.LambdaRoutines = exports.REMOTION_FILELIST_TOKEN = exports.REMOTION_CONCATED_TOKEN = exports.CONCAT_FOLDER_TOKEN = exports.RENDERER_PATH_TOKEN = exports.resolvedPropsKey = exports.inputPropsKey = exports.defaultPropsKey = exports.
|
|
3
|
+
exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = exports.LambdaRoutines = exports.REMOTION_FILELIST_TOKEN = exports.REMOTION_CONCATED_TOKEN = exports.CONCAT_FOLDER_TOKEN = exports.RENDERER_PATH_TOKEN = exports.resolvedPropsKey = exports.inputPropsKey = exports.defaultPropsKey = exports.customOutName = exports.outStillName = exports.outName = exports.getSitesKey = exports.overallProgressKey = exports.rendersPrefix = exports.LAMBDA_INSIGHTS_PREFIX = exports.LOG_GROUP_PREFIX = exports.RENDER_FN_PREFIX = exports.REMOTION_BUCKET_PREFIX = exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = exports.DEFAULT_OUTPUT_PRIVACY = exports.MAX_EPHEMERAL_STORAGE_IN_MB = exports.MIN_EPHEMERAL_STORAGE_IN_MB = exports.DEFAULT_EPHEMERAL_STORAGE_IN_MB = exports.MAX_FUNCTIONS_PER_RENDER = exports.DEFAULT_MAX_RETRIES = exports.DEFAULT_REGION = exports.COMMAND_NOT_FOUND = exports.BINARY_NAME = exports.DEFAULT_FRAMES_PER_LAMBDA = exports.MINIMUM_FRAMES_PER_LAMBDA = exports.MAX_TIMEOUT = exports.MIN_TIMEOUT = exports.DEFAULT_TIMEOUT = exports.DEFAULT_MEMORY_SIZE = exports.MAX_MEMORY = exports.MIN_MEMORY = void 0;
|
|
4
4
|
exports.MIN_MEMORY = 512;
|
|
5
5
|
exports.MAX_MEMORY = 10240;
|
|
6
6
|
exports.DEFAULT_MEMORY_SIZE = 2048;
|
|
@@ -25,32 +25,8 @@ exports.LOG_GROUP_PREFIX = '/aws/lambda/';
|
|
|
25
25
|
exports.LAMBDA_INSIGHTS_PREFIX = '/aws/lambda-insights';
|
|
26
26
|
const rendersPrefix = (renderId) => `renders/${renderId}`;
|
|
27
27
|
exports.rendersPrefix = rendersPrefix;
|
|
28
|
-
const
|
|
29
|
-
exports.
|
|
30
|
-
const renderMetadataKey = (renderId) => `${(0, exports.rendersPrefix)(renderId)}/pre-render-metadata.json`;
|
|
31
|
-
exports.renderMetadataKey = renderMetadataKey;
|
|
32
|
-
const initalizedMetadataKey = (renderId) => `${(0, exports.rendersPrefix)(renderId)}/initialized.txt`;
|
|
33
|
-
exports.initalizedMetadataKey = initalizedMetadataKey;
|
|
34
|
-
const lambdaChunkInitializedPrefix = (renderId) => `${(0, exports.rendersPrefix)(renderId)}/lambda-initialized`;
|
|
35
|
-
exports.lambdaChunkInitializedPrefix = lambdaChunkInitializedPrefix;
|
|
36
|
-
const lambdaChunkInitializedKey = ({ renderId, chunk, attempt, }) => `${(0, exports.lambdaChunkInitializedPrefix)(renderId)}-chunk:${chunk}-attempt:${attempt}.txt`;
|
|
37
|
-
exports.lambdaChunkInitializedKey = lambdaChunkInitializedKey;
|
|
38
|
-
const lambdaTimingsPrefix = (renderId) => `${(0, exports.rendersPrefix)(renderId)}/lambda-timings/chunk:`;
|
|
39
|
-
exports.lambdaTimingsPrefix = lambdaTimingsPrefix;
|
|
40
|
-
const lambdaTimingsPrefixForChunk = (renderId, chunk) => (0, exports.lambdaTimingsPrefix)(renderId) + String(chunk).padStart(8, '0');
|
|
41
|
-
exports.lambdaTimingsPrefixForChunk = lambdaTimingsPrefixForChunk;
|
|
42
|
-
const lambdaLogsPrefix = (renderId, chunk, startFrame, endFrame) => `${(0, exports.rendersPrefix)(renderId)}/logs/chunk:${String(chunk).padStart(8, '0')}:frames:${startFrame}-${endFrame}.json`;
|
|
43
|
-
exports.lambdaLogsPrefix = lambdaLogsPrefix;
|
|
44
|
-
const lambdaTimingsKey = ({ renderId, chunk, start, rendered, }) => `${(0, exports.lambdaTimingsPrefixForChunk)(renderId, chunk)}-start:${start}-rendered:${rendered}.txt`;
|
|
45
|
-
exports.lambdaTimingsKey = lambdaTimingsKey;
|
|
46
|
-
const chunkKey = (renderId) => `${(0, exports.rendersPrefix)(renderId)}/chunks/chunk`;
|
|
47
|
-
exports.chunkKey = chunkKey;
|
|
48
|
-
const chunkKeyForIndex = ({ renderId, index, type, }) => `${(0, exports.chunkKey)(renderId)}:${String(index).padStart(8, '0')}:${type}`;
|
|
49
|
-
exports.chunkKeyForIndex = chunkKeyForIndex;
|
|
50
|
-
const getErrorKeyPrefix = (renderId) => `${(0, exports.rendersPrefix)(renderId)}/errors/`;
|
|
51
|
-
exports.getErrorKeyPrefix = getErrorKeyPrefix;
|
|
52
|
-
const getErrorFileName = ({ renderId, chunk, attempt, }) => (0, exports.getErrorKeyPrefix)(renderId) + ':chunk-' + chunk + ':attempt-' + attempt;
|
|
53
|
-
exports.getErrorFileName = getErrorFileName;
|
|
28
|
+
const overallProgressKey = (renderId) => `${(0, exports.rendersPrefix)(renderId)}/progress.json`;
|
|
29
|
+
exports.overallProgressKey = overallProgressKey;
|
|
54
30
|
const getSitesKey = (siteId) => `sites/${siteId}`;
|
|
55
31
|
exports.getSitesKey = getSitesKey;
|
|
56
32
|
const outName = (renderId, extension) => `${(0, exports.rendersPrefix)(renderId)}/out.${extension}`;
|
|
@@ -73,10 +49,6 @@ const customOutName = (renderId, bucketName, name) => {
|
|
|
73
49
|
};
|
|
74
50
|
};
|
|
75
51
|
exports.customOutName = customOutName;
|
|
76
|
-
const postRenderDataKey = (renderId) => {
|
|
77
|
-
return `${(0, exports.rendersPrefix)(renderId)}/post-render-metadata.json`;
|
|
78
|
-
};
|
|
79
|
-
exports.postRenderDataKey = postRenderDataKey;
|
|
80
52
|
const defaultPropsKey = (hash) => {
|
|
81
53
|
return `default-props/${hash}.json`;
|
|
82
54
|
};
|
|
@@ -12,9 +12,7 @@ const getFunctionVersion = async ({ functionName, region, logLevel, }) => {
|
|
|
12
12
|
},
|
|
13
13
|
region,
|
|
14
14
|
type: constants_1.LambdaRoutines.info,
|
|
15
|
-
receivedStreamingPayload: () => undefined,
|
|
16
15
|
timeoutInTest: 120000,
|
|
17
|
-
retriesRemaining: 0,
|
|
18
16
|
});
|
|
19
17
|
return result.version;
|
|
20
18
|
}
|
|
@@ -49,6 +49,10 @@ const isFlakyError = (err) => {
|
|
|
49
49
|
if (message.includes('Timeout exceeded rendering the component')) {
|
|
50
50
|
return true;
|
|
51
51
|
}
|
|
52
|
+
// CDN slowness
|
|
53
|
+
if (message.includes('Loading root component')) {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
52
56
|
// Internet flakiness
|
|
53
57
|
if (message.includes('getaddrinfo') ||
|
|
54
58
|
message.includes('ECONNRESET') ||
|
|
@@ -1,16 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseLambdaTimingsKey = void 0;
|
|
4
|
-
const parseLambdaTimingsKey = (key) => {
|
|
5
|
-
const match = key.match(/^renders\/(.*)\/lambda-timings\/chunk:([0-9]+)-start:([0-9]+)-rendered:([0-9]+).txt$/);
|
|
6
|
-
if (!match) {
|
|
7
|
-
throw new Error(`Cannot parse filename ${key} into timing information. Malformed data.`);
|
|
8
|
-
}
|
|
9
|
-
return {
|
|
10
|
-
renderId: match[1],
|
|
11
|
-
chunk: Number(match[2]),
|
|
12
|
-
start: Number(match[3]),
|
|
13
|
-
rendered: Number(match[4]),
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
exports.parseLambdaTimingsKey = parseLambdaTimingsKey;
|
|
@@ -6,11 +6,6 @@ import type { rendererHandler } from '../functions/renderer';
|
|
|
6
6
|
import type { startHandler } from '../functions/start';
|
|
7
7
|
import type { stillHandler } from '../functions/still';
|
|
8
8
|
import type { LambdaRoutines } from './constants';
|
|
9
|
-
export type OrError<T> = T | {
|
|
10
|
-
type: 'error';
|
|
11
|
-
message: string;
|
|
12
|
-
stack: string;
|
|
13
|
-
};
|
|
14
9
|
export interface LambdaReturnValues {
|
|
15
10
|
[LambdaRoutines.start]: ReturnType<typeof startHandler>;
|
|
16
11
|
[LambdaRoutines.launch]: ReturnType<typeof launchHandler>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.165",
|
|
4
4
|
"description": "Distributed renderer for Remotion based on AWS Lambda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -13,22 +13,22 @@
|
|
|
13
13
|
"url": "https://github.com/JonnyBurger/remotion"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@smithy/abort-controller": "
|
|
17
|
-
"@aws-sdk/client-cloudwatch-logs": "3.
|
|
18
|
-
"@aws-sdk/client-iam": "3.
|
|
19
|
-
"@aws-sdk/client-lambda": "3.
|
|
20
|
-
"@aws-sdk/client-s3": "3.
|
|
21
|
-
"@aws-sdk/client-service-quotas": "3.
|
|
22
|
-
"@aws-sdk/client-sts": "3.
|
|
23
|
-
"@aws-sdk/credential-providers": "3.
|
|
24
|
-
"@aws-sdk/lib-storage": "3.
|
|
25
|
-
"@aws-sdk/s3-request-presigner": "3.
|
|
16
|
+
"@smithy/abort-controller": "3.0.0",
|
|
17
|
+
"@aws-sdk/client-cloudwatch-logs": "3.583.0",
|
|
18
|
+
"@aws-sdk/client-iam": "3.583.0",
|
|
19
|
+
"@aws-sdk/client-lambda": "3.583.0",
|
|
20
|
+
"@aws-sdk/client-s3": "3.583.0",
|
|
21
|
+
"@aws-sdk/client-service-quotas": "3.583.0",
|
|
22
|
+
"@aws-sdk/client-sts": "3.583.0",
|
|
23
|
+
"@aws-sdk/credential-providers": "3.583.0",
|
|
24
|
+
"@aws-sdk/lib-storage": "3.583.0",
|
|
25
|
+
"@aws-sdk/s3-request-presigner": "3.583.0",
|
|
26
26
|
"mime-types": "2.1.34",
|
|
27
27
|
"zod": "3.22.3",
|
|
28
|
-
"@remotion/bundler": "4.0.
|
|
29
|
-
"@remotion/
|
|
30
|
-
"@remotion/
|
|
31
|
-
"remotion": "4.0.
|
|
28
|
+
"@remotion/bundler": "4.0.165",
|
|
29
|
+
"@remotion/cli": "4.0.165",
|
|
30
|
+
"@remotion/renderer": "4.0.165",
|
|
31
|
+
"remotion": "4.0.165"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@jonny/eslint-config": "3.0.281",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"ts-node": "10.9.2",
|
|
45
45
|
"vitest": "0.31.1",
|
|
46
46
|
"zip-lib": "^0.7.2",
|
|
47
|
-
"@remotion/
|
|
48
|
-
"@remotion/
|
|
47
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.165",
|
|
48
|
+
"@remotion/bundler": "4.0.165"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@remotion/bundler": "4.0.
|
|
51
|
+
"@remotion/bundler": "4.0.165"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|