@remotion/lambda 4.0.163 → 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/deploy-site.d.ts +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/args.d.ts +1 -0
- package/dist/cli/commands/functions/ls.js +3 -1
- 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 +8 -0
- package/dist/functions/helpers/get-overall-progress-s3.js +25 -0
- 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 -7
- package/dist/functions/helpers/merge-chunks.js +16 -149
- 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 +49 -0
- package/dist/functions/helpers/overall-render-progress.js +164 -0
- package/dist/functions/helpers/stream-renderer.d.ts +11 -0
- package/dist/functions/helpers/stream-renderer.js +127 -0
- package/dist/functions/helpers/streamify-response.d.ts +0 -3
- package/dist/functions/helpers/streamify-response.js +2 -14
- package/dist/functions/helpers/streaming-payloads.d.ts +3 -3
- 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 -51
- package/dist/functions/launch.js +103 -200
- 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/stream-writer.d.ts +6 -0
- package/dist/functions/streaming/stream-writer.js +35 -0
- package/dist/functions/streaming/streaming.d.ts +92 -0
- package/dist/functions/streaming/streaming.js +58 -0
- package/dist/internals.d.ts +7 -6
- 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 +15 -49
- package/dist/shared/constants.js +3 -32
- 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 -7
- package/package.json +18 -18
- package/remotionlambda-arm64.zip +0 -0
|
@@ -4,192 +4,116 @@ exports.getProgress = void 0;
|
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
5
|
const no_react_1 = require("remotion/no-react");
|
|
6
6
|
const constants_1 = require("../../shared/constants");
|
|
7
|
-
const parse_chunk_key_1 = require("../../shared/parse-chunk-key");
|
|
8
7
|
const truthy_1 = require("../../shared/truthy");
|
|
9
8
|
const calculate_chunk_times_1 = require("./calculate-chunk-times");
|
|
10
9
|
const calculate_price_from_bucket_1 = require("./calculate-price-from-bucket");
|
|
11
|
-
const check_if_render_exists_1 = require("./check-if-render-exists");
|
|
12
10
|
const expected_out_name_1 = require("./expected-out-name");
|
|
13
|
-
const find_output_file_in_bucket_1 = require("./find-output-file-in-bucket");
|
|
14
11
|
const format_costs_info_1 = require("./format-costs-info");
|
|
15
|
-
const get_cleanup_progress_1 = require("./get-cleanup-progress");
|
|
16
|
-
const get_current_region_1 = require("./get-current-region");
|
|
17
|
-
const get_encoding_metadata_1 = require("./get-encoding-metadata");
|
|
18
|
-
const get_encoding_progress_step_size_1 = require("./get-encoding-progress-step-size");
|
|
19
|
-
const get_final_encoding_status_1 = require("./get-final-encoding-status");
|
|
20
|
-
const get_lambdas_invoked_stats_1 = require("./get-lambdas-invoked-stats");
|
|
21
12
|
const get_overall_progress_1 = require("./get-overall-progress");
|
|
22
|
-
const
|
|
23
|
-
const get_render_metadata_1 = require("./get-render-metadata");
|
|
24
|
-
const get_rendered_frames_progress_1 = require("./get-rendered-frames-progress");
|
|
25
|
-
const get_retry_stats_1 = require("./get-retry-stats");
|
|
26
|
-
const get_time_to_finish_1 = require("./get-time-to-finish");
|
|
13
|
+
const get_overall_progress_s3_1 = require("./get-overall-progress-s3");
|
|
27
14
|
const inspect_errors_1 = require("./inspect-errors");
|
|
28
|
-
const io_1 = require("./io");
|
|
29
15
|
const make_timeout_error_1 = require("./make-timeout-error");
|
|
30
16
|
const render_has_audio_video_1 = require("./render-has-audio-video");
|
|
31
17
|
const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region, memorySizeInMb, timeoutInMilliseconds, customCredentials, }) => {
|
|
32
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
33
|
-
const
|
|
34
|
-
bucketName,
|
|
35
|
-
region,
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
19
|
+
const overallProgress = await (0, get_overall_progress_s3_1.getOverallProgressS3)({
|
|
36
20
|
renderId,
|
|
21
|
+
bucketName,
|
|
37
22
|
expectedBucketOwner,
|
|
23
|
+
region,
|
|
38
24
|
});
|
|
39
|
-
if (postRenderData) {
|
|
40
|
-
|
|
41
|
-
|
|
25
|
+
if (overallProgress.postRenderData) {
|
|
26
|
+
if (!overallProgress.renderMetadata) {
|
|
27
|
+
throw new Error('No render metadata found even though render is finished');
|
|
28
|
+
}
|
|
29
|
+
const outData = (0, expected_out_name_1.getExpectedOutName)(overallProgress.renderMetadata, bucketName, customCredentials);
|
|
30
|
+
const totalFrameCount = overallProgress.renderMetadata.type === 'still'
|
|
42
31
|
? 1
|
|
43
|
-
: renderer_1.RenderInternals.getFramesToRender(
|
|
32
|
+
: renderer_1.RenderInternals.getFramesToRender(overallProgress.renderMetadata.frameRange, overallProgress.renderMetadata.everyNthFrame).length;
|
|
44
33
|
return {
|
|
45
34
|
framesRendered: totalFrameCount,
|
|
46
35
|
bucket: bucketName,
|
|
47
|
-
renderSize: postRenderData.renderSize,
|
|
48
|
-
chunks:
|
|
36
|
+
renderSize: overallProgress.postRenderData.renderSize,
|
|
37
|
+
chunks: overallProgress.renderMetadata.totalChunks,
|
|
49
38
|
cleanup: {
|
|
50
|
-
doneIn: postRenderData.timeToCleanUp,
|
|
51
|
-
filesDeleted: postRenderData.filesCleanedUp,
|
|
52
|
-
minFilesToDelete: postRenderData.filesCleanedUp,
|
|
39
|
+
doneIn: overallProgress.postRenderData.timeToCleanUp,
|
|
40
|
+
filesDeleted: overallProgress.postRenderData.filesCleanedUp,
|
|
41
|
+
minFilesToDelete: overallProgress.postRenderData.filesCleanedUp,
|
|
53
42
|
},
|
|
54
43
|
costs: {
|
|
55
|
-
accruedSoFar: postRenderData.cost.estimatedCost,
|
|
56
|
-
displayCost: postRenderData.cost.estimatedDisplayCost,
|
|
57
|
-
currency: postRenderData.cost.currency,
|
|
58
|
-
disclaimer: postRenderData.cost.disclaimer,
|
|
44
|
+
accruedSoFar: overallProgress.postRenderData.cost.estimatedCost,
|
|
45
|
+
displayCost: overallProgress.postRenderData.cost.estimatedDisplayCost,
|
|
46
|
+
currency: overallProgress.postRenderData.cost.currency,
|
|
47
|
+
disclaimer: overallProgress.postRenderData.cost.disclaimer,
|
|
59
48
|
},
|
|
60
49
|
currentTime: Date.now(),
|
|
61
50
|
done: true,
|
|
62
51
|
encodingStatus: {
|
|
63
52
|
framesEncoded: totalFrameCount,
|
|
53
|
+
combinedFrames: totalFrameCount,
|
|
54
|
+
timeToCombine: overallProgress.postRenderData.timeToCombine,
|
|
64
55
|
},
|
|
65
|
-
errors: postRenderData.errors,
|
|
56
|
+
errors: overallProgress.postRenderData.errors,
|
|
66
57
|
fatalErrorEncountered: false,
|
|
67
|
-
lambdasInvoked:
|
|
68
|
-
outputFile: postRenderData.outputFile,
|
|
58
|
+
lambdasInvoked: overallProgress.renderMetadata.totalChunks,
|
|
59
|
+
outputFile: overallProgress.postRenderData.outputFile,
|
|
69
60
|
renderId,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
timeToFinish: overallProgress.postRenderData.timeToFinish,
|
|
62
|
+
timeToFinishChunks: overallProgress.postRenderData.timeToRenderChunks,
|
|
63
|
+
timeToRenderFrames: overallProgress.postRenderData.timeToRenderFrames,
|
|
73
64
|
overallProgress: 1,
|
|
74
|
-
retriesInfo: postRenderData.retriesInfo,
|
|
65
|
+
retriesInfo: overallProgress.postRenderData.retriesInfo,
|
|
75
66
|
outKey: outData.key,
|
|
76
67
|
outBucket: outData.renderBucketName,
|
|
77
|
-
mostExpensiveFrameRanges: (_a = postRenderData.mostExpensiveFrameRanges) !== null && _a !== void 0 ? _a : null,
|
|
78
|
-
timeToEncode: postRenderData.timeToEncode,
|
|
79
|
-
outputSizeInBytes: postRenderData.outputSize,
|
|
68
|
+
mostExpensiveFrameRanges: (_a = overallProgress.postRenderData.mostExpensiveFrameRanges) !== null && _a !== void 0 ? _a : null,
|
|
69
|
+
timeToEncode: overallProgress.postRenderData.timeToEncode,
|
|
70
|
+
outputSizeInBytes: overallProgress.postRenderData.outputSize,
|
|
80
71
|
type: 'success',
|
|
81
|
-
estimatedBillingDurationInMilliseconds: postRenderData.estimatedBillingDurationInMilliseconds,
|
|
72
|
+
estimatedBillingDurationInMilliseconds: overallProgress.postRenderData.estimatedBillingDurationInMilliseconds,
|
|
73
|
+
timeToCombine: overallProgress.postRenderData.timeToCombine,
|
|
74
|
+
combinedFrames: totalFrameCount,
|
|
75
|
+
renderMetadata: overallProgress.renderMetadata,
|
|
76
|
+
timeoutTimestamp: overallProgress.timeoutTimestamp,
|
|
82
77
|
};
|
|
83
78
|
}
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
88
|
-
expectedBucketOwner,
|
|
79
|
+
const { renderMetadata } = overallProgress;
|
|
80
|
+
const errorExplanations = (0, inspect_errors_1.inspectErrors)({
|
|
81
|
+
errors: overallProgress.errors,
|
|
89
82
|
});
|
|
90
|
-
|
|
91
|
-
const [renderMetadata, errorExplanations] = await Promise.all([
|
|
92
|
-
renderMetadataExists
|
|
93
|
-
? (0, get_render_metadata_1.getRenderMetadata)({
|
|
94
|
-
bucketName,
|
|
95
|
-
renderId,
|
|
96
|
-
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
97
|
-
expectedBucketOwner,
|
|
98
|
-
})
|
|
99
|
-
: null,
|
|
100
|
-
(0, inspect_errors_1.inspectErrors)({
|
|
101
|
-
contents,
|
|
102
|
-
renderId,
|
|
103
|
-
bucket: bucketName,
|
|
104
|
-
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
105
|
-
expectedBucketOwner,
|
|
106
|
-
}),
|
|
107
|
-
]);
|
|
108
|
-
if ((renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.type) === 'still') {
|
|
83
|
+
if (renderMetadata && renderMetadata.type === 'still') {
|
|
109
84
|
throw new Error("You don't need to call getRenderProgress() on a still render. Once you have obtained the `renderId`, the render is already done! 😉");
|
|
110
85
|
}
|
|
111
|
-
(0, check_if_render_exists_1.checkIfRenderExists)(contents, renderId, bucketName, (0, get_current_region_1.getCurrentRegionInFunction)());
|
|
112
|
-
const outputFile = renderMetadata
|
|
113
|
-
? await (0, find_output_file_in_bucket_1.findOutputFileInBucket)({
|
|
114
|
-
bucketName,
|
|
115
|
-
renderMetadata,
|
|
116
|
-
region,
|
|
117
|
-
customCredentials,
|
|
118
|
-
})
|
|
119
|
-
: null;
|
|
120
86
|
const priceFromBucket = (0, calculate_price_from_bucket_1.estimatePriceFromBucket)({
|
|
121
|
-
contents,
|
|
122
87
|
renderMetadata,
|
|
123
88
|
memorySizeInMb,
|
|
124
|
-
outputFileMetadata: outputFile,
|
|
125
89
|
lambdasInvoked: (_b = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.estimatedRenderLambdaInvokations) !== null && _b !== void 0 ? _b : 0,
|
|
126
90
|
// We cannot determine the ephemeral storage size, so we
|
|
127
91
|
// overestimate the price, but will only have a miniscule effect (~0.2%)
|
|
128
92
|
diskSizeInMb: constants_1.MAX_EPHEMERAL_STORAGE_IN_MB,
|
|
93
|
+
timings: (_c = overallProgress.timings) !== null && _c !== void 0 ? _c : [],
|
|
129
94
|
});
|
|
130
95
|
const { hasAudio, hasVideo } = renderMetadata
|
|
131
96
|
? (0, render_has_audio_video_1.lambdaRenderHasAudioVideo)(renderMetadata)
|
|
132
97
|
: { hasAudio: false, hasVideo: false };
|
|
133
|
-
const cleanup =
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
hasAudio,
|
|
139
|
-
hasVideo,
|
|
140
|
-
});
|
|
141
|
-
const timeToFinish = (0, get_time_to_finish_1.getTimeToFinish)({
|
|
142
|
-
lastModified: (_e = outputFile === null || outputFile === void 0 ? void 0 : outputFile.lastModified) !== null && _e !== void 0 ? _e : null,
|
|
143
|
-
renderMetadata,
|
|
144
|
-
});
|
|
98
|
+
const cleanup = {
|
|
99
|
+
doneIn: null,
|
|
100
|
+
minFilesToDelete: 0,
|
|
101
|
+
filesDeleted: 0,
|
|
102
|
+
};
|
|
145
103
|
const chunkMultiplier = [hasAudio, hasVideo].filter(truthy_1.truthy).length;
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
? (0, get_rendered_frames_progress_1.getRenderedFramesProgress)({
|
|
149
|
-
contents,
|
|
150
|
-
everyNthFrame: renderMetadata.everyNthFrame,
|
|
151
|
-
frameRange: renderMetadata.frameRange,
|
|
152
|
-
framesPerLambda: renderMetadata.framesPerLambda,
|
|
153
|
-
renderId,
|
|
154
|
-
})
|
|
155
|
-
: 0;
|
|
156
|
-
const allChunks = chunks.length / chunkMultiplier ===
|
|
157
|
-
((_f = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.totalChunks) !== null && _f !== void 0 ? _f : Infinity);
|
|
158
|
-
const renderSize = contents
|
|
159
|
-
.map((c) => { var _a; return (_a = c.Size) !== null && _a !== void 0 ? _a : 0; })
|
|
160
|
-
.reduce((a, b) => a + b, 0);
|
|
161
|
-
const lambdasInvokedStats = (0, get_lambdas_invoked_stats_1.getLambdasInvokedStats)({
|
|
162
|
-
contents,
|
|
163
|
-
renderId,
|
|
164
|
-
});
|
|
165
|
-
const retriesInfo = (0, get_retry_stats_1.getRetryStats)({
|
|
166
|
-
contents,
|
|
167
|
-
renderId,
|
|
168
|
-
});
|
|
104
|
+
const allChunks = ((_d = overallProgress.chunks) !== null && _d !== void 0 ? _d : []).length / chunkMultiplier ===
|
|
105
|
+
((_e = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.totalChunks) !== null && _e !== void 0 ? _e : Infinity);
|
|
169
106
|
const frameCount = renderMetadata
|
|
170
107
|
? renderer_1.RenderInternals.getFramesToRender(renderMetadata.frameRange, renderMetadata.everyNthFrame).length
|
|
171
108
|
: null;
|
|
172
|
-
const
|
|
173
|
-
const encodingStatus = (0, get_encoding_metadata_1.getEncodingMetadata)({
|
|
174
|
-
exists: contents.find((c) => c.Key === (0, constants_1.encodingProgressKey)(renderId)),
|
|
175
|
-
frameCount: frameCountOrNull,
|
|
176
|
-
stepSize: (0, get_encoding_progress_step_size_1.getEncodingProgressStepSize)(frameCountOrNull),
|
|
177
|
-
});
|
|
178
|
-
const finalEncodingStatus = (0, get_final_encoding_status_1.getFinalEncodingStatus)({
|
|
179
|
-
encodingProgress: encodingStatus,
|
|
180
|
-
outputFileExists: Boolean(outputFile),
|
|
181
|
-
renderMetadata,
|
|
182
|
-
});
|
|
183
|
-
const chunkCount = outputFile
|
|
184
|
-
? (_g = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.totalChunks) !== null && _g !== void 0 ? _g : 0
|
|
185
|
-
: chunks.length / chunkMultiplier;
|
|
186
|
-
const availableChunks = chunks.map((c) => (0, parse_chunk_key_1.parseLambdaChunkKey)(c.Key));
|
|
109
|
+
const chunkCount = (_f = overallProgress.chunks.length) !== null && _f !== void 0 ? _f : 0;
|
|
187
110
|
const missingChunks = renderMetadata
|
|
188
111
|
? new Array(renderMetadata.totalChunks)
|
|
189
112
|
.fill(true)
|
|
190
113
|
.map((_, i) => i)
|
|
191
114
|
.filter((index) => {
|
|
192
|
-
|
|
115
|
+
var _a;
|
|
116
|
+
return !((_a = overallProgress.chunks) !== null && _a !== void 0 ? _a : []).find((c) => c === index);
|
|
193
117
|
})
|
|
194
118
|
: null;
|
|
195
119
|
// We add a 20 second buffer for it, since AWS timeshifts can be quite a lot. Once it's 20sec over the limit, we consider it timed out
|
|
@@ -206,7 +130,6 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
|
|
|
206
130
|
? (0, make_timeout_error_1.makeTimeoutError)({
|
|
207
131
|
timeoutInMilliseconds,
|
|
208
132
|
renderMetadata,
|
|
209
|
-
chunks,
|
|
210
133
|
renderId,
|
|
211
134
|
missingChunks: missingChunks !== null && missingChunks !== void 0 ? missingChunks : [],
|
|
212
135
|
})
|
|
@@ -214,57 +137,58 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
|
|
|
214
137
|
...errorExplanations,
|
|
215
138
|
].filter(no_react_1.NoReactInternals.truthy);
|
|
216
139
|
return {
|
|
217
|
-
framesRendered,
|
|
140
|
+
framesRendered: (_g = overallProgress.framesRendered) !== null && _g !== void 0 ? _g : 0,
|
|
218
141
|
chunks: chunkCount,
|
|
219
142
|
done: false,
|
|
220
|
-
encodingStatus
|
|
143
|
+
encodingStatus: {
|
|
144
|
+
framesEncoded: overallProgress.framesEncoded,
|
|
145
|
+
combinedFrames: overallProgress.combinedFrames,
|
|
146
|
+
timeToCombine: overallProgress.timeToCombine,
|
|
147
|
+
},
|
|
148
|
+
timeToRenderFrames: overallProgress.timeToRenderFrames,
|
|
221
149
|
costs: priceFromBucket
|
|
222
150
|
? (0, format_costs_info_1.formatCostsInfo)(priceFromBucket.accruedSoFar)
|
|
223
151
|
: (0, format_costs_info_1.formatCostsInfo)(0),
|
|
224
152
|
renderId,
|
|
225
153
|
renderMetadata,
|
|
226
154
|
bucket: bucketName,
|
|
227
|
-
outputFile:
|
|
228
|
-
timeToFinish,
|
|
155
|
+
outputFile: null,
|
|
156
|
+
timeToFinish: null,
|
|
229
157
|
errors: allErrors,
|
|
230
158
|
fatalErrorEncountered: allErrors.some((f) => f.isFatal && !f.willRetry),
|
|
231
159
|
currentTime: Date.now(),
|
|
232
|
-
renderSize,
|
|
233
|
-
lambdasInvoked:
|
|
160
|
+
renderSize: 0,
|
|
161
|
+
lambdasInvoked: (_h = overallProgress.lambdasInvoked) !== null && _h !== void 0 ? _h : 0,
|
|
234
162
|
cleanup,
|
|
235
|
-
timeToFinishChunks: allChunks
|
|
163
|
+
timeToFinishChunks: allChunks && overallProgress
|
|
236
164
|
? (0, calculate_chunk_times_1.calculateChunkTimes)({
|
|
237
|
-
contents,
|
|
238
|
-
renderId,
|
|
239
165
|
type: 'absolute-time',
|
|
166
|
+
timings: overallProgress.timings,
|
|
240
167
|
})
|
|
241
168
|
: null,
|
|
242
169
|
overallProgress: (0, get_overall_progress_1.getOverallProgress)({
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
? finalEncodingStatus.framesEncoded / frameCount
|
|
170
|
+
encoding: renderMetadata && frameCount
|
|
171
|
+
? ((_j = overallProgress.framesEncoded) !== null && _j !== void 0 ? _j : 0) / frameCount
|
|
246
172
|
: 0,
|
|
247
173
|
invoking: renderMetadata
|
|
248
|
-
?
|
|
174
|
+
? ((_k = overallProgress.lambdasInvoked) !== null && _k !== void 0 ? _k : 0) /
|
|
249
175
|
renderMetadata.estimatedRenderLambdaInvokations
|
|
250
176
|
: 0,
|
|
251
177
|
rendering: renderMetadata ? chunkCount / renderMetadata.totalChunks : 0,
|
|
252
|
-
frames:
|
|
178
|
+
frames: ((_l = overallProgress.framesRendered) !== null && _l !== void 0 ? _l : 0) / (frameCount !== null && frameCount !== void 0 ? frameCount : 1),
|
|
253
179
|
}),
|
|
254
|
-
retriesInfo,
|
|
255
|
-
outKey:
|
|
256
|
-
|
|
257
|
-
: null,
|
|
258
|
-
outBucket: outputFile && renderMetadata
|
|
259
|
-
? (0, expected_out_name_1.getExpectedOutName)(renderMetadata, bucketName, customCredentials)
|
|
260
|
-
.renderBucketName
|
|
261
|
-
: null,
|
|
180
|
+
retriesInfo: (_m = overallProgress.retries) !== null && _m !== void 0 ? _m : [],
|
|
181
|
+
outKey: null,
|
|
182
|
+
outBucket: null,
|
|
262
183
|
mostExpensiveFrameRanges: null,
|
|
263
|
-
timeToEncode:
|
|
264
|
-
outputSizeInBytes:
|
|
184
|
+
timeToEncode: overallProgress.timeToEncode,
|
|
185
|
+
outputSizeInBytes: null,
|
|
265
186
|
estimatedBillingDurationInMilliseconds: priceFromBucket
|
|
266
187
|
? priceFromBucket.estimatedBillingDurationInMilliseconds
|
|
267
188
|
: null,
|
|
189
|
+
combinedFrames: (_o = overallProgress.combinedFrames) !== null && _o !== void 0 ? _o : 0,
|
|
190
|
+
timeToCombine: (_p = overallProgress.timeToCombine) !== null && _p !== void 0 ? _p : null,
|
|
191
|
+
timeoutTimestamp: overallProgress.timeoutTimestamp,
|
|
268
192
|
type: 'success',
|
|
269
193
|
};
|
|
270
194
|
};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import type { _Object } from '@aws-sdk/client-s3';
|
|
2
1
|
export type ChunkRetry = {
|
|
3
2
|
chunk: number;
|
|
4
3
|
attempt: number;
|
|
5
4
|
time: number;
|
|
6
5
|
};
|
|
7
|
-
export declare const getRetryStats: ({ contents, renderId, }: {
|
|
8
|
-
contents: _Object[];
|
|
9
|
-
renderId: string;
|
|
10
|
-
}) => ChunkRetry[];
|
|
@@ -1,20 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRetryStats = void 0;
|
|
4
|
-
const constants_1 = require("../../shared/constants");
|
|
5
|
-
const parse_lambda_initialized_key_1 = require("../../shared/parse-lambda-initialized-key");
|
|
6
|
-
const getRetryStats = ({ contents, renderId, }) => {
|
|
7
|
-
const retries = contents
|
|
8
|
-
.filter((c) => { var _a; return (_a = c.Key) === null || _a === void 0 ? void 0 : _a.startsWith((0, constants_1.lambdaChunkInitializedPrefix)(renderId)); })
|
|
9
|
-
.filter((c) => (0, parse_lambda_initialized_key_1.parseLambdaInitializedKey)(c.Key).attempt !== 1);
|
|
10
|
-
return retries.map((retry) => {
|
|
11
|
-
var _a;
|
|
12
|
-
const parsed = (0, parse_lambda_initialized_key_1.parseLambdaInitializedKey)(retry.Key);
|
|
13
|
-
return {
|
|
14
|
-
chunk: parsed.chunk,
|
|
15
|
-
attempt: parsed.attempt,
|
|
16
|
-
time: (_a = retry.LastModified) === null || _a === void 0 ? void 0 : _a.getTime(),
|
|
17
|
-
};
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
exports.getRetryStats = getRetryStats;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
contents: _Object[];
|
|
6
|
-
bucket: string;
|
|
7
|
-
region: AwsRegion;
|
|
8
|
-
renderId: string;
|
|
9
|
-
expectedBucketOwner: string;
|
|
10
|
-
}) => Promise<EnhancedErrorInfo[]>;
|
|
1
|
+
import type { EnhancedErrorInfo, LambdaErrorInfo } from './write-lambda-error';
|
|
2
|
+
export declare const inspectErrors: ({ errors, }: {
|
|
3
|
+
errors: LambdaErrorInfo[];
|
|
4
|
+
}) => EnhancedErrorInfo[];
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.inspectErrors = void 0;
|
|
4
|
-
const no_react_1 = require("remotion/no-react");
|
|
5
|
-
const constants_1 = require("../../shared/constants");
|
|
6
4
|
const docs_url_1 = require("../../shared/docs-url");
|
|
7
|
-
const stream_to_string_1 = require("../../shared/stream-to-string");
|
|
8
|
-
const io_1 = require("./io");
|
|
9
5
|
const is_enosp_err_1 = require("./is-enosp-err");
|
|
10
6
|
const FAILED_TO_LAUNCH_TOKEN = 'Failed to launch browser.';
|
|
11
7
|
const getExplanation = (stack) => {
|
|
@@ -31,30 +27,12 @@ const getExplanation = (stack) => {
|
|
|
31
27
|
}
|
|
32
28
|
return null;
|
|
33
29
|
};
|
|
34
|
-
const inspectErrors =
|
|
35
|
-
|
|
36
|
-
.filter((c) => { var _a; return (_a = c.Key) === null || _a === void 0 ? void 0 : _a.startsWith((0, constants_1.getErrorKeyPrefix)(renderId)); })
|
|
37
|
-
.map((c) => c.Key)
|
|
38
|
-
.filter(no_react_1.NoReactInternals.truthy);
|
|
39
|
-
if (errs.length === 0) {
|
|
40
|
-
return [];
|
|
41
|
-
}
|
|
42
|
-
const errors = await Promise.all(errs.map(async (key) => {
|
|
43
|
-
const Body = await (0, io_1.lambdaReadFile)({
|
|
44
|
-
bucketName: bucket,
|
|
45
|
-
key,
|
|
46
|
-
region,
|
|
47
|
-
expectedBucketOwner,
|
|
48
|
-
});
|
|
49
|
-
const errorLog = await (0, stream_to_string_1.streamToString)(Body);
|
|
50
|
-
return errorLog;
|
|
51
|
-
}));
|
|
52
|
-
return errors.map((e, index) => {
|
|
53
|
-
const parsed = JSON.parse(e);
|
|
30
|
+
const inspectErrors = ({ errors, }) => {
|
|
31
|
+
return errors.map((e) => {
|
|
54
32
|
return {
|
|
55
|
-
...
|
|
56
|
-
explanation: getExplanation(
|
|
57
|
-
s3Location:
|
|
33
|
+
...e,
|
|
34
|
+
explanation: getExplanation(e.stack),
|
|
35
|
+
s3Location: '',
|
|
58
36
|
};
|
|
59
37
|
});
|
|
60
38
|
};
|
|
@@ -32,7 +32,6 @@ type LambdaWriteFileInput = {
|
|
|
32
32
|
downloadBehavior: DownloadBehavior | null;
|
|
33
33
|
customCredentials: CustomCredentials | null;
|
|
34
34
|
};
|
|
35
|
-
export declare const tryLambdaWriteFile: ({ bucketName, key, body, region, privacy, expectedBucketOwner, downloadBehavior, customCredentials, }: LambdaWriteFileInput) => Promise<void>;
|
|
36
35
|
export declare const lambdaWriteFile: (params: LambdaWriteFileInput & {
|
|
37
36
|
retries?: number;
|
|
38
37
|
}) => Promise<void>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.lambdaHeadCommand = exports.lambdaReadFile = exports.lambdaWriteFile = exports.
|
|
6
|
+
exports.lambdaHeadCommand = exports.lambdaReadFile = exports.lambdaWriteFile = exports.lambdaDeleteFile = exports.lambdaLs = void 0;
|
|
7
7
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
8
8
|
const mime_types_1 = __importDefault(require("mime-types"));
|
|
9
9
|
const aws_clients_1 = require("../../shared/aws-clients");
|
|
@@ -71,12 +71,11 @@ const tryLambdaWriteFile = async ({ bucketName, key, body, region, privacy, expe
|
|
|
71
71
|
ContentDisposition: (0, content_disposition_header_1.getContentDispositionHeader)(downloadBehavior),
|
|
72
72
|
}));
|
|
73
73
|
};
|
|
74
|
-
exports.tryLambdaWriteFile = tryLambdaWriteFile;
|
|
75
74
|
const lambdaWriteFile = async (params) => {
|
|
76
75
|
var _a;
|
|
77
76
|
const remainingRetries = (_a = params.retries) !== null && _a !== void 0 ? _a : 2;
|
|
78
77
|
try {
|
|
79
|
-
await
|
|
78
|
+
await tryLambdaWriteFile(params);
|
|
80
79
|
}
|
|
81
80
|
catch (err) {
|
|
82
81
|
if (remainingRetries === 0) {
|
|
@@ -6,10 +6,6 @@ declare const expiryDays: {
|
|
|
6
6
|
readonly '30-days': 30;
|
|
7
7
|
};
|
|
8
8
|
export type DeleteAfter = keyof typeof expiryDays;
|
|
9
|
-
export declare const getEnabledLifeCycleRule: ({ key, value, }: {
|
|
10
|
-
key: string;
|
|
11
|
-
value: number;
|
|
12
|
-
}) => LifecycleRule;
|
|
13
9
|
export declare const getLifeCycleRules: () => LifecycleRule[];
|
|
14
10
|
export declare const generateRandomHashWithLifeCycleRule: (deleteAfter: DeleteAfter | null) => string;
|
|
15
11
|
export declare const validateDeleteAfter: (lifeCycleValue: unknown) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateDeleteAfter = exports.generateRandomHashWithLifeCycleRule = exports.getLifeCycleRules =
|
|
3
|
+
exports.validateDeleteAfter = exports.generateRandomHashWithLifeCycleRule = exports.getLifeCycleRules = void 0;
|
|
4
4
|
const random_hash_1 = require("../../shared/random-hash");
|
|
5
5
|
const truthy_1 = require("../../shared/truthy");
|
|
6
6
|
// Needs to be in sync with renderer/src/options/delete-after.ts#L7
|
|
@@ -22,9 +22,8 @@ const getEnabledLifeCycleRule = ({ key, value, }) => {
|
|
|
22
22
|
Status: 'Enabled',
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
-
exports.getEnabledLifeCycleRule = getEnabledLifeCycleRule;
|
|
26
25
|
const getLifeCycleRules = () => {
|
|
27
|
-
return Object.entries(expiryDays).map(([key, value]) =>
|
|
26
|
+
return Object.entries(expiryDays).map(([key, value]) => getEnabledLifeCycleRule({ key, value }));
|
|
28
27
|
};
|
|
29
28
|
exports.getLifeCycleRules = getLifeCycleRules;
|
|
30
29
|
const generateRandomHashWithLifeCycleRule = (deleteAfter) => {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import type { _Object } from '@aws-sdk/client-s3';
|
|
2
1
|
import type { RenderMetadata } from '../../defaults';
|
|
3
2
|
import type { EnhancedErrorInfo } from './write-lambda-error';
|
|
4
3
|
export declare const makeTimeoutError: ({ timeoutInMilliseconds, missingChunks, renderMetadata, renderId, }: {
|
|
5
4
|
timeoutInMilliseconds: number;
|
|
6
|
-
chunks: _Object[];
|
|
7
5
|
renderMetadata: RenderMetadata;
|
|
8
6
|
renderId: string;
|
|
9
7
|
missingChunks: number[];
|
|
@@ -3,12 +3,7 @@ import type { CustomCredentials } from '../../shared/aws-clients';
|
|
|
3
3
|
import type { PostRenderData, Privacy, RenderMetadata, SerializedInputProps } from '../../shared/constants';
|
|
4
4
|
import type { DownloadBehavior } from '../../shared/content-disposition-header';
|
|
5
5
|
import type { LambdaCodec } from '../../shared/validate-lambda-codec';
|
|
6
|
-
|
|
7
|
-
inputProps: SerializedInputProps;
|
|
8
|
-
serializedResolvedProps: SerializedInputProps;
|
|
9
|
-
framesPerLambda: number;
|
|
10
|
-
compositionStart: number;
|
|
11
|
-
}) => void;
|
|
6
|
+
import type { OverallProgressHelper } from './overall-render-progress';
|
|
12
7
|
export declare const mergeChunksAndFinishRender: (options: {
|
|
13
8
|
bucketName: string;
|
|
14
9
|
renderId: string;
|
|
@@ -27,11 +22,14 @@ export declare const mergeChunksAndFinishRender: (options: {
|
|
|
27
22
|
inputProps: SerializedInputProps;
|
|
28
23
|
serializedResolvedProps: SerializedInputProps;
|
|
29
24
|
renderMetadata: RenderMetadata;
|
|
30
|
-
onAllChunks: OnAllChunksAvailable;
|
|
31
25
|
audioBitrate: string | null;
|
|
32
26
|
logLevel: LogLevel;
|
|
33
27
|
framesPerLambda: number;
|
|
34
28
|
binariesDirectory: string | null;
|
|
35
29
|
preferLossless: boolean;
|
|
36
30
|
compositionStart: number;
|
|
31
|
+
outdir: string;
|
|
32
|
+
files: string[];
|
|
33
|
+
overallProgress: OverallProgressHelper;
|
|
34
|
+
startTime: number;
|
|
37
35
|
}) => Promise<PostRenderData>;
|