@remotion/lambda 4.0.256 → 4.0.258
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/get-aws-region.js +2 -1
- package/dist/cli/index.js +5 -4
- package/dist/shared/check-credentials.js +7 -6
- package/dist/shared/get-credentials.js +25 -23
- package/dist/shared/get-env-variable.d.ts +1 -0
- package/dist/shared/get-env-variable.js +15 -0
- package/dist/shared/get-service-client.js +16 -15
- package/dist/shared/is-likely-to-have-aws-profile.js +7 -1
- package/package.json +21 -21
- package/remotionlambda-arm64.zip +0 -0
- package/dist/api/__mocks__/clean-items.d.ts +0 -2
- package/dist/api/__mocks__/clean-items.js +0 -24
- package/dist/api/__mocks__/create-function.d.ts +0 -2
- package/dist/api/__mocks__/create-function.js +0 -21
- package/dist/api/__mocks__/delete-function.d.ts +0 -2
- package/dist/api/__mocks__/delete-function.js +0 -9
- package/dist/api/__mocks__/get-functions.d.ts +0 -2
- package/dist/api/__mocks__/get-functions.js +0 -9
- package/dist/api/__mocks__/upload-dir.d.ts +0 -3
- package/dist/api/__mocks__/upload-dir.js +0 -47
- package/dist/api/mock-functions.d.ts +0 -18
- package/dist/api/mock-functions.js +0 -36
- package/dist/cli/helpers/__mocks__/quit.d.ts +0 -1
- package/dist/cli/helpers/__mocks__/quit.js +0 -7
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +0 -7
- package/dist/functions/chunk-optimization/plan-frame-ranges.js +0 -17
- package/dist/functions/chunk-optimization/types.d.ts +0 -8
- package/dist/functions/chunk-optimization/types.js +0 -2
- package/dist/functions/helpers/__mocks__/get-browser-instance.d.ts +0 -3
- package/dist/functions/helpers/__mocks__/get-browser-instance.js +0 -12
- package/dist/functions/helpers/__mocks__/leak-detection.d.ts +0 -4
- package/dist/functions/helpers/__mocks__/leak-detection.js +0 -9
- package/dist/functions/helpers/__mocks__/timer.d.ts +0 -2
- package/dist/functions/helpers/__mocks__/timer.js +0 -10
- package/dist/functions/helpers/best-frames-per-lambda-param.d.ts +0 -1
- package/dist/functions/helpers/best-frames-per-lambda-param.js +0 -17
- package/dist/functions/helpers/calculate-chunk-times.d.ts +0 -5
- package/dist/functions/helpers/calculate-chunk-times.js +0 -29
- package/dist/functions/helpers/calculate-price-from-bucket.d.ts +0 -15
- package/dist/functions/helpers/calculate-price-from-bucket.js +0 -30
- package/dist/functions/helpers/can-concat-seamlessly.d.ts +0 -3
- package/dist/functions/helpers/can-concat-seamlessly.js +0 -17
- package/dist/functions/helpers/cleanup-props.d.ts +0 -8
- package/dist/functions/helpers/cleanup-props.js +0 -23
- package/dist/functions/helpers/concat-videos.d.ts +0 -23
- package/dist/functions/helpers/concat-videos.js +0 -54
- package/dist/functions/helpers/create-post-render-data.d.ts +0 -17
- package/dist/functions/helpers/create-post-render-data.js +0 -67
- package/dist/functions/helpers/find-output-file-in-bucket.d.ts +0 -14
- package/dist/functions/helpers/find-output-file-in-bucket.js +0 -38
- package/dist/functions/helpers/format-costs-info.d.ts +0 -2
- package/dist/functions/helpers/format-costs-info.js +0 -23
- package/dist/functions/helpers/get-overall-progress-s3.d.ts +0 -10
- package/dist/functions/helpers/get-overall-progress-s3.js +0 -24
- package/dist/functions/helpers/get-overall-progress.d.ts +0 -9
- package/dist/functions/helpers/get-overall-progress.js +0 -23
- package/dist/functions/helpers/get-progress.d.ts +0 -15
- package/dist/functions/helpers/get-progress.js +0 -254
- package/dist/functions/helpers/get-retry-stats.d.ts +0 -5
- package/dist/functions/helpers/get-retry-stats.js +0 -2
- package/dist/functions/helpers/inspect-errors.d.ts +0 -4
- package/dist/functions/helpers/inspect-errors.js +0 -39
- package/dist/functions/helpers/is-warm.d.ts +0 -2
- package/dist/functions/helpers/is-warm.js +0 -10
- package/dist/functions/helpers/leak-detection.d.ts +0 -4
- package/dist/functions/helpers/leak-detection.js +0 -40
- package/dist/functions/helpers/make-timeout-error.d.ts +0 -10
- package/dist/functions/helpers/make-timeout-error.js +0 -31
- package/dist/functions/helpers/make-timeout-message.d.ts +0 -10
- package/dist/functions/helpers/make-timeout-message.js +0 -75
- package/dist/functions/helpers/merge-chunks.d.ts +0 -36
- package/dist/functions/helpers/merge-chunks.js +0 -84
- package/dist/functions/helpers/min-max.d.ts +0 -2
- package/dist/functions/helpers/min-max.js +0 -33
- package/dist/functions/helpers/on-downloads-logger.d.ts +0 -2
- package/dist/functions/helpers/on-downloads-logger.js +0 -29
- package/dist/functions/helpers/overall-render-progress.d.ts +0 -59
- package/dist/functions/helpers/overall-render-progress.js +0 -180
- package/dist/functions/helpers/print-concurrency-curve.d.ts +0 -1
- package/dist/functions/helpers/print-concurrency-curve.js +0 -8
- package/dist/functions/helpers/print-logging-helper.d.ts +0 -4
- package/dist/functions/helpers/print-logging-helper.js +0 -12
- package/dist/functions/helpers/render-has-audio-video.d.ts +0 -6
- package/dist/functions/helpers/render-has-audio-video.js +0 -21
- package/dist/functions/helpers/request-context.d.ts +0 -5
- package/dist/functions/helpers/request-context.js +0 -2
- package/dist/functions/helpers/stream-renderer.d.ts +0 -17
- package/dist/functions/helpers/stream-renderer.js +0 -148
- package/dist/functions/launch.d.ts +0 -10
- package/dist/functions/launch.js +0 -595
- package/dist/functions/progress.d.ts +0 -11
- package/dist/functions/progress.js +0 -51
- package/dist/functions/renderer.d.ts +0 -17
- package/dist/functions/renderer.js +0 -341
- package/dist/functions/start.d.ts +0 -13
- package/dist/functions/start.js +0 -112
- package/dist/functions/still.d.ts +0 -19
- package/dist/functions/still.js +0 -329
- package/dist/shared/__mocks__/aws-clients.d.ts +0 -2
- package/dist/shared/__mocks__/aws-clients.js +0 -62
- package/dist/shared/__mocks__/bundle-site.d.ts +0 -2
- package/dist/shared/__mocks__/bundle-site.js +0 -32
- package/dist/shared/__mocks__/check-credentials.d.ts +0 -1
- package/dist/shared/__mocks__/check-credentials.js +0 -5
- package/dist/shared/__mocks__/get-account-id.d.ts +0 -2
- package/dist/shared/__mocks__/get-account-id.js +0 -11
- package/dist/shared/__mocks__/read-dir.d.ts +0 -2
- package/dist/shared/__mocks__/read-dir.js +0 -13
- package/dist/shared/call-lambda.d.ts +0 -16
- package/dist/shared/call-lambda.js +0 -149
- package/dist/shared/cleanup-serialized-input-props.d.ts +0 -14
- package/dist/shared/cleanup-serialized-input-props.js +0 -34
- package/dist/shared/docs-url.d.ts +0 -1
- package/dist/shared/docs-url.js +0 -4
- package/dist/shared/get-most-expensive-chunks.d.ts +0 -8
- package/dist/shared/get-most-expensive-chunks.js +0 -28
- package/dist/shared/invoke-webhook.d.ts +0 -48
- package/dist/shared/invoke-webhook.js +0 -140
- package/dist/shared/parse-lambda-timings-key.d.ts +0 -5
- package/dist/shared/parse-lambda-timings-key.js +0 -2
- package/dist/shared/return-values.d.ts +0 -16
- package/dist/shared/return-values.js +0 -2
- package/dist/shared/stackback.d.ts +0 -6
- package/dist/shared/stackback.js +0 -59
- package/dist/shared/validate-download-behavior.d.ts +0 -1
- package/dist/shared/validate-download-behavior.js +0 -21
- package/dist/shared/validate-frames-per-lambda.d.ts +0 -4
- package/dist/shared/validate-frames-per-lambda.js +0 -29
- package/dist/shared/validate-privacy.d.ts +0 -2
- package/dist/shared/validate-privacy.js +0 -14
- package/dist/shared/validate.d.ts +0 -4
- package/dist/shared/validate.js +0 -8
- package/dist/shared/why-is-node-running.d.ts +0 -15
- package/dist/shared/why-is-node-running.js +0 -88
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const bestFramesPerLambdaParam: (frameCount: number) => number;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bestFramesPerLambdaParam = void 0;
|
|
4
|
-
const no_react_1 = require("remotion/no-react");
|
|
5
|
-
// Always update the code in docs/lambda/concurrency.md too
|
|
6
|
-
const bestFramesPerLambdaParam = (frameCount) => {
|
|
7
|
-
// Between 0 and 10 minutes (at 30fps), interpolate the concurrency from 75 to 150
|
|
8
|
-
const concurrency = (0, no_react_1.interpolate)(frameCount, [0, 18000], [75, 150], {
|
|
9
|
-
extrapolateRight: 'clamp',
|
|
10
|
-
});
|
|
11
|
-
// At least have 20 as a `framesPerLambda` value
|
|
12
|
-
const framesPerLambda = Math.max(frameCount / concurrency, 20);
|
|
13
|
-
// Evenly distribute: For 21 frames over 2 lambda functions, distribute as 11 + 10 ==> framesPerLambda = 11
|
|
14
|
-
const lambdasNeeded = Math.ceil(frameCount / framesPerLambda);
|
|
15
|
-
return Math.ceil(frameCount / lambdasNeeded);
|
|
16
|
-
};
|
|
17
|
-
exports.bestFramesPerLambdaParam = bestFramesPerLambdaParam;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calculateChunkTimes = void 0;
|
|
4
|
-
const min_max_1 = require("./min-max");
|
|
5
|
-
const getAbsoluteTime = (parsedTimings) => {
|
|
6
|
-
if (parsedTimings.length === 0) {
|
|
7
|
-
return 0;
|
|
8
|
-
}
|
|
9
|
-
const allEnds = parsedTimings.map((p) => p.rendered);
|
|
10
|
-
const allStarts = parsedTimings.map((p) => p.start);
|
|
11
|
-
const biggestEnd = (0, min_max_1.max)(allEnds);
|
|
12
|
-
const smallestStart = (0, min_max_1.min)(allStarts);
|
|
13
|
-
return Math.max(0, biggestEnd - smallestStart);
|
|
14
|
-
};
|
|
15
|
-
const calculateChunkTimes = ({ type, timings, }) => {
|
|
16
|
-
const parsedTimings = timings;
|
|
17
|
-
const absoluteTime = getAbsoluteTime(parsedTimings);
|
|
18
|
-
if (type === 'combined-time-for-cost-calculation') {
|
|
19
|
-
const totalEncodingTimings = parsedTimings
|
|
20
|
-
.map((p) => Math.max(0, p.rendered - p.start))
|
|
21
|
-
.reduce((a, b) => a + b, 0);
|
|
22
|
-
return totalEncodingTimings + absoluteTime;
|
|
23
|
-
}
|
|
24
|
-
if (type === 'absolute-time') {
|
|
25
|
-
return absoluteTime;
|
|
26
|
-
}
|
|
27
|
-
throw new Error('invalid time for calculate chunk times');
|
|
28
|
-
};
|
|
29
|
-
exports.calculateChunkTimes = calculateChunkTimes;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { CloudProvider } from '@remotion/serverless';
|
|
2
|
-
import type { RenderMetadata } from '@remotion/serverless/client';
|
|
3
|
-
import type { AwsRegion } from '../../regions';
|
|
4
|
-
import type { ParsedTiming } from '../../shared/parse-lambda-timings-key';
|
|
5
|
-
export declare const estimatePriceFromBucket: <Provider extends CloudProvider>({ renderMetadata, memorySizeInMb, diskSizeInMb, lambdasInvoked, timings, region, }: {
|
|
6
|
-
renderMetadata: RenderMetadata<Provider> | null;
|
|
7
|
-
memorySizeInMb: number;
|
|
8
|
-
diskSizeInMb: number;
|
|
9
|
-
lambdasInvoked: number;
|
|
10
|
-
timings: ParsedTiming[];
|
|
11
|
-
region: AwsRegion;
|
|
12
|
-
}) => {
|
|
13
|
-
accruedSoFar: number;
|
|
14
|
-
estimatedBillingDurationInMilliseconds: number;
|
|
15
|
-
} | null;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.estimatePriceFromBucket = void 0;
|
|
4
|
-
const estimate_price_1 = require("../../api/estimate-price");
|
|
5
|
-
const calculate_chunk_times_1 = require("./calculate-chunk-times");
|
|
6
|
-
const estimatePriceFromBucket = ({ renderMetadata, memorySizeInMb, diskSizeInMb, lambdasInvoked, timings, region, }) => {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
if (!renderMetadata) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
const elapsedTime = Math.max(0, Date.now() - ((_a = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.startedDate) !== null && _a !== void 0 ? _a : 0));
|
|
12
|
-
const unfinished = Math.max(0, ((_b = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.totalChunks) !== null && _b !== void 0 ? _b : 0) - timings.length);
|
|
13
|
-
const timeElapsedOfUnfinished = new Array(unfinished)
|
|
14
|
-
.fill(true)
|
|
15
|
-
.map(() => elapsedTime)
|
|
16
|
-
.reduce((a, b) => a + b, 0);
|
|
17
|
-
const estimatedBillingDurationInMilliseconds = (0, calculate_chunk_times_1.calculateChunkTimes)({
|
|
18
|
-
type: 'combined-time-for-cost-calculation',
|
|
19
|
-
timings,
|
|
20
|
-
}) + timeElapsedOfUnfinished;
|
|
21
|
-
const accruedSoFar = Number((0, estimate_price_1.estimatePrice)({
|
|
22
|
-
region,
|
|
23
|
-
durationInMilliseconds: estimatedBillingDurationInMilliseconds,
|
|
24
|
-
memorySizeInMb,
|
|
25
|
-
diskSizeInMb,
|
|
26
|
-
lambdasInvoked,
|
|
27
|
-
}).toPrecision(5));
|
|
28
|
-
return { accruedSoFar, estimatedBillingDurationInMilliseconds };
|
|
29
|
-
};
|
|
30
|
-
exports.estimatePriceFromBucket = estimatePriceFromBucket;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.canConcatVideoSeamlessly = exports.canConcatAudioSeamlessly = void 0;
|
|
4
|
-
// Cannot do WAV yet, because currently assumes AAC in+outpoint
|
|
5
|
-
const canConcatAudioSeamlessly = (audioCodec, chunkDurationInFrames) => {
|
|
6
|
-
// Rendering a chunk that is too small generates too much overhead
|
|
7
|
-
// and is currently buggy
|
|
8
|
-
if (chunkDurationInFrames <= 4) {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
return audioCodec === 'aac';
|
|
12
|
-
};
|
|
13
|
-
exports.canConcatAudioSeamlessly = canConcatAudioSeamlessly;
|
|
14
|
-
const canConcatVideoSeamlessly = (codec) => {
|
|
15
|
-
return codec === 'h264';
|
|
16
|
-
};
|
|
17
|
-
exports.canConcatVideoSeamlessly = canConcatVideoSeamlessly;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { CloudProvider, ProviderSpecifics } from '@remotion/serverless';
|
|
2
|
-
import type { SerializedInputProps } from '@remotion/serverless/client';
|
|
3
|
-
export declare const cleanupProps: <Provider extends CloudProvider>({ serializedResolvedProps, inputProps, providerSpecifics, forcePathStyle, }: {
|
|
4
|
-
serializedResolvedProps: SerializedInputProps;
|
|
5
|
-
inputProps: SerializedInputProps;
|
|
6
|
-
providerSpecifics: ProviderSpecifics<Provider>;
|
|
7
|
-
forcePathStyle: boolean;
|
|
8
|
-
}) => Promise<[number, number]>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cleanupProps = void 0;
|
|
4
|
-
const cleanup_serialized_input_props_1 = require("../../shared/cleanup-serialized-input-props");
|
|
5
|
-
const cleanupProps = ({ serializedResolvedProps, inputProps, providerSpecifics, forcePathStyle, }) => {
|
|
6
|
-
const cleanupSerializedInputPropsProm = (0, cleanup_serialized_input_props_1.cleanupSerializedInputProps)({
|
|
7
|
-
region: providerSpecifics.getCurrentRegionInFunction(),
|
|
8
|
-
serialized: inputProps,
|
|
9
|
-
providerSpecifics,
|
|
10
|
-
forcePathStyle,
|
|
11
|
-
});
|
|
12
|
-
const cleanupResolvedInputPropsProm = (0, cleanup_serialized_input_props_1.cleanupSerializedResolvedProps)({
|
|
13
|
-
region: providerSpecifics.getCurrentRegionInFunction(),
|
|
14
|
-
serialized: serializedResolvedProps,
|
|
15
|
-
providerSpecifics,
|
|
16
|
-
forcePathStyle,
|
|
17
|
-
});
|
|
18
|
-
return Promise.all([
|
|
19
|
-
cleanupSerializedInputPropsProm,
|
|
20
|
-
cleanupResolvedInputPropsProm,
|
|
21
|
-
]);
|
|
22
|
-
};
|
|
23
|
-
exports.cleanupProps = cleanupProps;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { AudioCodec, CancelSignal, LogLevel } from '@remotion/renderer';
|
|
2
|
-
import type { ServerlessCodec } from '@remotion/serverless/client';
|
|
3
|
-
export declare const concatVideos: ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, files, outdir, audioCodec, audioBitrate, logLevel, framesPerLambda, binariesDirectory, cancelSignal, preferLossless, muted, metadata, }: {
|
|
4
|
-
onProgress: (frames: number) => void;
|
|
5
|
-
numberOfFrames: number;
|
|
6
|
-
codec: ServerlessCodec;
|
|
7
|
-
fps: number;
|
|
8
|
-
numberOfGifLoops: number | null;
|
|
9
|
-
files: string[];
|
|
10
|
-
outdir: string;
|
|
11
|
-
audioCodec: AudioCodec | null;
|
|
12
|
-
audioBitrate: string | null;
|
|
13
|
-
logLevel: LogLevel;
|
|
14
|
-
framesPerLambda: number;
|
|
15
|
-
binariesDirectory: string | null;
|
|
16
|
-
cancelSignal: CancelSignal | undefined;
|
|
17
|
-
preferLossless: boolean;
|
|
18
|
-
muted: boolean;
|
|
19
|
-
metadata: Record<string, string> | null;
|
|
20
|
-
}) => Promise<{
|
|
21
|
-
outfile: string;
|
|
22
|
-
cleanupChunksProm: Promise<void>;
|
|
23
|
-
}>;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.concatVideos = void 0;
|
|
7
|
-
const renderer_1 = require("@remotion/renderer");
|
|
8
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
|
-
const node_path_1 = require("node:path");
|
|
10
|
-
const constants_1 = require("../../shared/constants");
|
|
11
|
-
const can_concat_seamlessly_1 = require("./can-concat-seamlessly");
|
|
12
|
-
const timer_1 = require("./timer");
|
|
13
|
-
const concatVideos = async ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, files, outdir, audioCodec, audioBitrate, logLevel, framesPerLambda, binariesDirectory, cancelSignal, preferLossless, muted, metadata, }) => {
|
|
14
|
-
const outfile = (0, node_path_1.join)(renderer_1.RenderInternals.tmpDir(constants_1.REMOTION_CONCATED_TOKEN), `concat.${renderer_1.RenderInternals.getFileExtensionFromCodec(codec, audioCodec)}`);
|
|
15
|
-
const combine = (0, timer_1.timer)('Combine chunks', logLevel);
|
|
16
|
-
const filelistDir = renderer_1.RenderInternals.tmpDir(constants_1.REMOTION_FILELIST_TOKEN);
|
|
17
|
-
const chunkDurationInSeconds = framesPerLambda / fps;
|
|
18
|
-
const resolvedAudioCodec = renderer_1.RenderInternals.resolveAudioCodec({
|
|
19
|
-
setting: audioCodec,
|
|
20
|
-
codec,
|
|
21
|
-
preferLossless,
|
|
22
|
-
separateAudioTo: null,
|
|
23
|
-
});
|
|
24
|
-
const seamlessAudio = (0, can_concat_seamlessly_1.canConcatAudioSeamlessly)(resolvedAudioCodec, framesPerLambda);
|
|
25
|
-
const seamlessVideo = (0, can_concat_seamlessly_1.canConcatVideoSeamlessly)(codec);
|
|
26
|
-
await renderer_1.RenderInternals.combineChunks({
|
|
27
|
-
files,
|
|
28
|
-
filelistDir,
|
|
29
|
-
output: outfile,
|
|
30
|
-
onProgress,
|
|
31
|
-
numberOfFrames,
|
|
32
|
-
codec,
|
|
33
|
-
fps,
|
|
34
|
-
numberOfGifLoops,
|
|
35
|
-
resolvedAudioCodec,
|
|
36
|
-
audioBitrate,
|
|
37
|
-
indent: false,
|
|
38
|
-
logLevel,
|
|
39
|
-
chunkDurationInSeconds,
|
|
40
|
-
binariesDirectory,
|
|
41
|
-
cancelSignal,
|
|
42
|
-
seamlessAudio,
|
|
43
|
-
seamlessVideo,
|
|
44
|
-
muted,
|
|
45
|
-
metadata,
|
|
46
|
-
});
|
|
47
|
-
combine.end();
|
|
48
|
-
const cleanupChunksProm = node_fs_1.default.promises.rm(outdir, {
|
|
49
|
-
recursive: true,
|
|
50
|
-
force: true,
|
|
51
|
-
});
|
|
52
|
-
return { outfile, cleanupChunksProm };
|
|
53
|
-
};
|
|
54
|
-
exports.concatVideos = concatVideos;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { CloudProvider, EnhancedErrorInfo } from '@remotion/serverless';
|
|
2
|
-
import type { RenderMetadata } from '@remotion/serverless/client';
|
|
3
|
-
import type { PostRenderData } from '../../shared/constants';
|
|
4
|
-
import type { OutputFileMetadata } from './find-output-file-in-bucket';
|
|
5
|
-
import type { OverallRenderProgress } from './overall-render-progress';
|
|
6
|
-
export declare const createPostRenderData: <Provider extends CloudProvider>({ region, memorySizeInMb, renderMetadata, errorExplanations, timeToDelete, outputFile, timeToCombine, overallProgress, timeToFinish, outputSize, }: {
|
|
7
|
-
region: Provider["region"];
|
|
8
|
-
memorySizeInMb: number;
|
|
9
|
-
renderMetadata: RenderMetadata<Provider>;
|
|
10
|
-
timeToDelete: number;
|
|
11
|
-
errorExplanations: EnhancedErrorInfo[];
|
|
12
|
-
outputFile: OutputFileMetadata;
|
|
13
|
-
timeToCombine: number | null;
|
|
14
|
-
overallProgress: OverallRenderProgress<Provider>;
|
|
15
|
-
timeToFinish: number;
|
|
16
|
-
outputSize: number;
|
|
17
|
-
}) => PostRenderData<Provider>;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createPostRenderData = void 0;
|
|
4
|
-
const estimate_price_1 = require("../../api/estimate-price");
|
|
5
|
-
const constants_1 = require("../../shared/constants");
|
|
6
|
-
const get_most_expensive_chunks_1 = require("../../shared/get-most-expensive-chunks");
|
|
7
|
-
const calculate_chunk_times_1 = require("./calculate-chunk-times");
|
|
8
|
-
const createPostRenderData = ({ region, memorySizeInMb, renderMetadata, errorExplanations, timeToDelete, outputFile, timeToCombine, overallProgress, timeToFinish, outputSize, }) => {
|
|
9
|
-
const parsedTimings = overallProgress.timings;
|
|
10
|
-
const estimatedBillingDurationInMilliseconds = parsedTimings
|
|
11
|
-
.map((p) => p.rendered - p.start + get_most_expensive_chunks_1.OVERHEAD_TIME_PER_LAMBDA)
|
|
12
|
-
.reduce((a, b) => a + b);
|
|
13
|
-
const cost = (0, estimate_price_1.estimatePrice)({
|
|
14
|
-
durationInMilliseconds: estimatedBillingDurationInMilliseconds,
|
|
15
|
-
memorySizeInMb,
|
|
16
|
-
region: region,
|
|
17
|
-
lambdasInvoked: renderMetadata.estimatedTotalLambdaInvokations,
|
|
18
|
-
// We cannot determine the ephemeral storage size, so we
|
|
19
|
-
// overestimate the price, but will only have a miniscule effect (~0.2%)
|
|
20
|
-
diskSizeInMb: constants_1.MAX_EPHEMERAL_STORAGE_IN_MB,
|
|
21
|
-
});
|
|
22
|
-
if (!outputFile) {
|
|
23
|
-
throw new Error('Cannot wrap up without an output file in the S3 bucket.');
|
|
24
|
-
}
|
|
25
|
-
const endTime = Date.now();
|
|
26
|
-
if (overallProgress.timeToEncode === null) {
|
|
27
|
-
throw new Error('Expected time to encode to be set');
|
|
28
|
-
}
|
|
29
|
-
if (overallProgress.timeToRenderFrames === null) {
|
|
30
|
-
throw new Error('Expected time to encode to be set');
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
cost: {
|
|
34
|
-
currency: 'USD',
|
|
35
|
-
disclaimer: 'Estimated cost for lambda invocations only. Does not include cost for S3 storage and data transfer.',
|
|
36
|
-
estimatedCost: cost,
|
|
37
|
-
estimatedDisplayCost: `$${new Intl.NumberFormat('en-US', {
|
|
38
|
-
currency: 'USD',
|
|
39
|
-
currencyDisplay: 'narrowSymbol',
|
|
40
|
-
}).format(cost)}`,
|
|
41
|
-
},
|
|
42
|
-
outputFile: outputFile.url,
|
|
43
|
-
timeToFinish,
|
|
44
|
-
errors: errorExplanations,
|
|
45
|
-
startTime: renderMetadata.startedDate,
|
|
46
|
-
endTime,
|
|
47
|
-
outputSize,
|
|
48
|
-
renderSize: outputSize,
|
|
49
|
-
filesCleanedUp: 0,
|
|
50
|
-
timeToEncode: overallProgress.timeToEncode,
|
|
51
|
-
timeToCleanUp: timeToDelete,
|
|
52
|
-
timeToRenderChunks: (0, calculate_chunk_times_1.calculateChunkTimes)({
|
|
53
|
-
type: 'absolute-time',
|
|
54
|
-
timings: overallProgress.timings,
|
|
55
|
-
}),
|
|
56
|
-
timeToRenderFrames: overallProgress.timeToRenderFrames,
|
|
57
|
-
retriesInfo: overallProgress.retries,
|
|
58
|
-
mostExpensiveFrameRanges: renderMetadata.type === 'still'
|
|
59
|
-
? []
|
|
60
|
-
: (0, get_most_expensive_chunks_1.getMostExpensiveChunks)(parsedTimings, renderMetadata.framesPerLambda, renderMetadata.frameRange[0], renderMetadata.frameRange[1]),
|
|
61
|
-
deleteAfter: renderMetadata.deleteAfter,
|
|
62
|
-
estimatedBillingDurationInMilliseconds,
|
|
63
|
-
timeToCombine: timeToCombine !== null && timeToCombine !== void 0 ? timeToCombine : null,
|
|
64
|
-
artifactProgress: overallProgress.receivedArtifact,
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
exports.createPostRenderData = createPostRenderData;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { CloudProvider, ProviderSpecifics } from '@remotion/serverless';
|
|
2
|
-
import { type CustomCredentials, type RenderMetadata } from '@remotion/serverless/client';
|
|
3
|
-
export type OutputFileMetadata = {
|
|
4
|
-
url: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const findOutputFileInBucket: <Provider extends CloudProvider>({ region, renderMetadata, bucketName, customCredentials, currentRegion, providerSpecifics, forcePathStyle, }: {
|
|
7
|
-
region: Provider["region"];
|
|
8
|
-
renderMetadata: RenderMetadata<Provider>;
|
|
9
|
-
bucketName: string;
|
|
10
|
-
customCredentials: CustomCredentials<Provider> | null;
|
|
11
|
-
currentRegion: Provider["region"];
|
|
12
|
-
providerSpecifics: ProviderSpecifics<Provider>;
|
|
13
|
-
forcePathStyle: boolean;
|
|
14
|
-
}) => Promise<OutputFileMetadata | null>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findOutputFileInBucket = void 0;
|
|
4
|
-
const client_1 = require("@remotion/serverless/client");
|
|
5
|
-
const suggested_policy_1 = require("../../api/iam-validation/suggested-policy");
|
|
6
|
-
const get_output_url_from_metadata_1 = require("./get-output-url-from-metadata");
|
|
7
|
-
const findOutputFileInBucket = async ({ region, renderMetadata, bucketName, customCredentials, currentRegion, providerSpecifics, forcePathStyle, }) => {
|
|
8
|
-
if (!renderMetadata) {
|
|
9
|
-
throw new Error('unexpectedly did not get renderMetadata');
|
|
10
|
-
}
|
|
11
|
-
const { renderBucketName, key } = (0, client_1.getExpectedOutName)(renderMetadata, bucketName, customCredentials);
|
|
12
|
-
try {
|
|
13
|
-
await providerSpecifics.headFile({
|
|
14
|
-
bucketName,
|
|
15
|
-
key,
|
|
16
|
-
region,
|
|
17
|
-
customCredentials,
|
|
18
|
-
forcePathStyle,
|
|
19
|
-
});
|
|
20
|
-
return {
|
|
21
|
-
url: (0, get_output_url_from_metadata_1.getOutputUrlFromMetadata)(renderMetadata, bucketName, customCredentials, currentRegion).url,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
catch (err) {
|
|
25
|
-
if (err.name === 'NotFound') {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
if (err.message === 'UnknownError' ||
|
|
29
|
-
err.$metadata
|
|
30
|
-
.httpStatusCode === 403) {
|
|
31
|
-
throw new Error(`Unable to access item "${key}" from bucket "${renderBucketName}" ${(customCredentials === null || customCredentials === void 0 ? void 0 : customCredentials.endpoint)
|
|
32
|
-
? `(S3 Endpoint = ${customCredentials === null || customCredentials === void 0 ? void 0 : customCredentials.endpoint})`
|
|
33
|
-
: ''}. The "${suggested_policy_1.ROLE_NAME}" role must have permission for both "s3:GetObject" and "s3:ListBucket" actions.`);
|
|
34
|
-
}
|
|
35
|
-
throw err;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.findOutputFileInBucket = findOutputFileInBucket;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatCostsInfo = void 0;
|
|
4
|
-
const display = (accrued) => {
|
|
5
|
-
if (accrued < 0.001) {
|
|
6
|
-
return '<$0.001';
|
|
7
|
-
}
|
|
8
|
-
return new Intl.NumberFormat('en-US', {
|
|
9
|
-
currency: 'USD',
|
|
10
|
-
style: 'currency',
|
|
11
|
-
currencyDisplay: 'narrowSymbol',
|
|
12
|
-
minimumFractionDigits: 3,
|
|
13
|
-
}).format(accrued);
|
|
14
|
-
};
|
|
15
|
-
const formatCostsInfo = (accrued) => {
|
|
16
|
-
return {
|
|
17
|
-
accruedSoFar: accrued,
|
|
18
|
-
displayCost: display(accrued),
|
|
19
|
-
currency: 'USD',
|
|
20
|
-
disclaimer: 'Estimated cost only. Does not include charges for other AWS services.',
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
exports.formatCostsInfo = formatCostsInfo;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { CloudProvider, ProviderSpecifics } from '@remotion/serverless';
|
|
2
|
-
import type { OverallRenderProgress } from './overall-render-progress';
|
|
3
|
-
export declare const getOverallProgressS3: <Provider extends CloudProvider>({ renderId, bucketName, expectedBucketOwner, region, providerSpecifics, forcePathStyle, }: {
|
|
4
|
-
renderId: string;
|
|
5
|
-
expectedBucketOwner: string | null;
|
|
6
|
-
bucketName: string;
|
|
7
|
-
region: Provider["region"];
|
|
8
|
-
providerSpecifics: ProviderSpecifics<Provider>;
|
|
9
|
-
forcePathStyle: boolean;
|
|
10
|
-
}) => Promise<OverallRenderProgress<Provider>>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOverallProgressS3 = void 0;
|
|
4
|
-
const client_1 = require("@remotion/serverless/client");
|
|
5
|
-
const getOverallProgressS3 = async ({ renderId, bucketName, expectedBucketOwner, region, providerSpecifics, forcePathStyle, }) => {
|
|
6
|
-
try {
|
|
7
|
-
const Body = await providerSpecifics.readFile({
|
|
8
|
-
bucketName,
|
|
9
|
-
key: (0, client_1.overallProgressKey)(renderId),
|
|
10
|
-
expectedBucketOwner,
|
|
11
|
-
region,
|
|
12
|
-
forcePathStyle,
|
|
13
|
-
});
|
|
14
|
-
const str = await (0, client_1.streamToString)(Body);
|
|
15
|
-
return JSON.parse(str);
|
|
16
|
-
}
|
|
17
|
-
catch (err) {
|
|
18
|
-
if (err.name === 'NotFound') {
|
|
19
|
-
throw new TypeError(`No render with ID "${renderId}" found in bucket ${bucketName} and region ${region}`);
|
|
20
|
-
}
|
|
21
|
-
throw err;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
exports.getOverallProgressS3 = getOverallProgressS3;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const getOverallProgress: ({ encoding, invoking, frames, invokedLambda, visitedServeUrl, gotComposition, combining, }: {
|
|
2
|
-
invokedLambda: number;
|
|
3
|
-
visitedServeUrl: number | null;
|
|
4
|
-
gotComposition: number | null;
|
|
5
|
-
encoding: number;
|
|
6
|
-
invoking: number;
|
|
7
|
-
frames: number;
|
|
8
|
-
combining: number;
|
|
9
|
-
}) => number;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOverallProgress = void 0;
|
|
4
|
-
const weights = {
|
|
5
|
-
evaluating: 0.1,
|
|
6
|
-
encoding: 0.1,
|
|
7
|
-
frames: 0.6,
|
|
8
|
-
invoking: 0.1,
|
|
9
|
-
combining: 0.1,
|
|
10
|
-
};
|
|
11
|
-
const getOverallProgress = ({ encoding, invoking, frames, invokedLambda, visitedServeUrl, gotComposition, combining, }) => {
|
|
12
|
-
const evaluationProgress = [
|
|
13
|
-
Boolean(invokedLambda),
|
|
14
|
-
Boolean(visitedServeUrl),
|
|
15
|
-
Boolean(gotComposition),
|
|
16
|
-
].reduce((a, b) => Number(a) + Number(b), 0) / 3;
|
|
17
|
-
return (evaluationProgress * weights.evaluating +
|
|
18
|
-
encoding * weights.encoding +
|
|
19
|
-
invoking * weights.invoking +
|
|
20
|
-
frames * weights.frames +
|
|
21
|
-
combining * weights.combining);
|
|
22
|
-
};
|
|
23
|
-
exports.getOverallProgress = getOverallProgress;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { CloudProvider, ProviderSpecifics } from '@remotion/serverless';
|
|
2
|
-
import { type CustomCredentials } from '@remotion/serverless/client';
|
|
3
|
-
import type { GenericRenderProgress } from '../../shared/constants';
|
|
4
|
-
export declare const getProgress: <Provider extends CloudProvider>({ bucketName, renderId, expectedBucketOwner, region, memorySizeInMb, timeoutInMilliseconds, customCredentials, providerSpecifics, forcePathStyle, functionName, }: {
|
|
5
|
-
bucketName: string;
|
|
6
|
-
renderId: string;
|
|
7
|
-
expectedBucketOwner: string | null;
|
|
8
|
-
region: Provider["region"];
|
|
9
|
-
memorySizeInMb: number;
|
|
10
|
-
timeoutInMilliseconds: number;
|
|
11
|
-
customCredentials: CustomCredentials<Provider> | null;
|
|
12
|
-
providerSpecifics: ProviderSpecifics<Provider>;
|
|
13
|
-
forcePathStyle: boolean;
|
|
14
|
-
functionName: string;
|
|
15
|
-
}) => Promise<GenericRenderProgress<Provider>>;
|