@remotion/lambda 3.0.0-lambda.252 → 3.0.0-lambda.279
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/render-media-on-lambda.d.ts +3 -2
- package/dist/api/render-media-on-lambda.d.ts.map +1 -1
- package/dist/api/render-media-on-lambda.js +4 -3
- package/dist/api/render-media-on-lambda.js.map +1 -1
- package/dist/api/render-still-on-lambda.d.ts +2 -1
- package/dist/api/render-still-on-lambda.d.ts.map +1 -1
- package/dist/api/render-still-on-lambda.js +2 -1
- package/dist/api/render-still-on-lambda.js.map +1 -1
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/commands/render/render.d.ts.map +1 -1
- package/dist/cli/commands/render/render.js +1 -0
- package/dist/cli/commands/render/render.js.map +1 -1
- package/dist/cli/commands/sites/create.d.ts.map +1 -1
- package/dist/cli/commands/sites/create.js +4 -1
- package/dist/cli/commands/sites/create.js.map +1 -1
- package/dist/cli/commands/still.d.ts.map +1 -1
- package/dist/cli/commands/still.js +1 -0
- package/dist/cli/commands/still.js.map +1 -1
- package/dist/cli/helpers/confirm.d.ts.map +1 -1
- package/dist/cli/helpers/confirm.js +4 -18
- package/dist/cli/helpers/confirm.js.map +1 -1
- package/dist/cli/helpers/yes-or-no.d.ts +5 -0
- package/dist/cli/helpers/yes-or-no.d.ts.map +1 -0
- package/dist/cli/helpers/yes-or-no.js +45 -0
- package/dist/cli/helpers/yes-or-no.js.map +1 -0
- package/dist/functions/helpers/best-frames-per-lambda-param.d.ts +2 -0
- package/dist/functions/helpers/best-frames-per-lambda-param.d.ts.map +1 -0
- package/dist/functions/helpers/best-frames-per-lambda-param.js +18 -0
- package/dist/functions/helpers/best-frames-per-lambda-param.js.map +1 -0
- package/dist/functions/helpers/expected-out-name.d.ts.map +1 -1
- package/dist/functions/helpers/expected-out-name.js +3 -0
- package/dist/functions/helpers/expected-out-name.js.map +1 -1
- package/dist/functions/helpers/print-concurrency-curve.d.ts +2 -0
- package/dist/functions/helpers/print-concurrency-curve.d.ts.map +1 -0
- package/dist/functions/helpers/print-concurrency-curve.js +9 -0
- package/dist/functions/helpers/print-concurrency-curve.js.map +1 -0
- package/dist/functions/launch.d.ts.map +1 -1
- package/dist/functions/launch.js +15 -13
- package/dist/functions/launch.js.map +1 -1
- package/dist/functions/renderer.d.ts.map +1 -1
- package/dist/functions/renderer.js +0 -1
- package/dist/functions/renderer.js.map +1 -1
- package/dist/functions/start.d.ts.map +1 -1
- package/dist/functions/start.js +1 -0
- package/dist/functions/start.js.map +1 -1
- package/dist/functions/still.d.ts.map +1 -1
- package/dist/functions/still.js +6 -2
- package/dist/functions/still.js.map +1 -1
- package/dist/shared/constants.d.ts +9 -4
- package/dist/shared/constants.d.ts.map +1 -1
- package/dist/shared/constants.js +6 -2
- package/dist/shared/constants.js.map +1 -1
- package/dist/shared/hosted-layers.js +30 -30
- package/dist/shared/validate-frames-per-lambda.d.ts.map +1 -1
- package/dist/shared/validate-frames-per-lambda.js +5 -1
- package/dist/shared/validate-frames-per-lambda.js.map +1 -1
- package/dist/shared/validate-outname.d.ts +2 -0
- package/dist/shared/validate-outname.d.ts.map +1 -0
- package/dist/shared/validate-outname.js +19 -0
- package/dist/shared/validate-outname.js.map +1 -0
- package/package.json +7 -7
- package/remotionlambda.zip +0 -0
- package/dist/api/download-video.d.ts +0 -20
- package/dist/api/download-video.d.ts.map +0 -1
- package/dist/api/download-video.js +0 -55
- package/dist/api/download-video.js.map +0 -1
- package/dist/api/render-video-on-lambda.d.ts +0 -72
- package/dist/api/render-video-on-lambda.d.ts.map +0 -1
- package/dist/api/render-video-on-lambda.js +0 -64
- package/dist/api/render-video-on-lambda.js.map +0 -1
- package/dist/pricing/calculate-price.d.ts +0 -15
- package/dist/pricing/calculate-price.d.ts.map +0 -1
- package/dist/pricing/calculate-price.js +0 -34
- package/dist/pricing/calculate-price.js.map +0 -1
- package/dist/pricing/estimate-price.d.ts +0 -15
- package/dist/pricing/estimate-price.d.ts.map +0 -1
- package/dist/pricing/estimate-price.js +0 -34
- package/dist/pricing/estimate-price.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "3.0.0-lambda.
|
|
3
|
+
"version": "3.0.0-lambda.279+ee1497f24",
|
|
4
4
|
"description": "Utility functions for audio and video",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -21,21 +21,21 @@
|
|
|
21
21
|
"url": "https://github.com/JonnyBurger/remotion"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"@aws-sdk/abort-controller": "3.40.0",
|
|
24
25
|
"@aws-sdk/client-cloudwatch-logs": "3.42.0",
|
|
25
26
|
"@aws-sdk/client-iam": "3.42.0",
|
|
26
27
|
"@aws-sdk/client-lambda": "3.42.0",
|
|
27
28
|
"@aws-sdk/client-s3": "3.42.0",
|
|
28
29
|
"@aws-sdk/lib-storage": "3.42.0",
|
|
29
30
|
"@aws-sdk/s3-request-presigner": "3.42.0",
|
|
30
|
-
"@remotion/bundler": "3.0.0-lambda.
|
|
31
|
-
"@remotion/cli": "3.0.0-lambda.
|
|
32
|
-
"@remotion/renderer": "3.0.0-lambda.
|
|
31
|
+
"@remotion/bundler": "3.0.0-lambda.279+ee1497f24",
|
|
32
|
+
"@remotion/cli": "3.0.0-lambda.279+ee1497f24",
|
|
33
|
+
"@remotion/renderer": "3.0.0-lambda.279+ee1497f24",
|
|
33
34
|
"aws-policies": "^1.0.1",
|
|
34
35
|
"dotenv": "^10.0.0",
|
|
35
36
|
"minimist": "^1.2.5",
|
|
36
37
|
"p-limit": "^3.1.0",
|
|
37
|
-
"
|
|
38
|
-
"remotion": "3.0.0-lambda.252+4aa1ba4a2"
|
|
38
|
+
"remotion": "3.0.0-lambda.279+ee1497f24"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": "^17.0.1",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "ee1497f245ee1ba32b693542abd1bb085dcd55e7"
|
|
63
63
|
}
|
package/remotionlambda.zip
CHANGED
|
Binary file
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { LambdaReadFileProgress } from '../functions/helpers/read-with-progress';
|
|
2
|
-
import { AwsRegion } from '../pricing/aws-regions';
|
|
3
|
-
declare type DownloadMediaInput = {
|
|
4
|
-
region: AwsRegion;
|
|
5
|
-
bucketName: string;
|
|
6
|
-
renderId: string;
|
|
7
|
-
outPath: string;
|
|
8
|
-
onProgress?: LambdaReadFileProgress;
|
|
9
|
-
};
|
|
10
|
-
declare type DownloadMediaOutput = {
|
|
11
|
-
outputPath: string;
|
|
12
|
-
sizeInBytes: number;
|
|
13
|
-
};
|
|
14
|
-
export declare const downloadMedia: (input: DownloadMediaInput) => Promise<DownloadMediaOutput>;
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated Renamed to downloadMedia()
|
|
17
|
-
*/
|
|
18
|
-
export declare const downloadVideo: (input: DownloadMediaInput) => Promise<DownloadMediaOutput>;
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=download-video.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"download-video.d.ts","sourceRoot":"","sources":["../../src/api/download-video.ts"],"names":[],"mappings":"AAKA,OAAO,EACN,sBAAsB,EAEtB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAGjD,aAAK,kBAAkB,GAAG;IACzB,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACpC,CAAC;AAEF,aAAK,mBAAmB,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,aAAa,UAClB,kBAAkB,KACvB,QAAQ,mBAAmB,CAuC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,UA7ClB,kBAAkB,KACvB,QAAQ,mBAAmB,CA4CY,CAAC"}
|
|
@@ -1,55 +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.downloadVideo = exports.downloadMedia = void 0;
|
|
7
|
-
const renderer_1 = require("@remotion/renderer");
|
|
8
|
-
const fs_1 = require("fs");
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const expected_out_name_1 = require("../functions/helpers/expected-out-name");
|
|
11
|
-
const get_render_metadata_1 = require("../functions/helpers/get-render-metadata");
|
|
12
|
-
const read_with_progress_1 = require("../functions/helpers/read-with-progress");
|
|
13
|
-
const get_account_id_1 = require("../shared/get-account-id");
|
|
14
|
-
const downloadMedia = async (input) => {
|
|
15
|
-
var _a;
|
|
16
|
-
const expectedBucketOwner = await (0, get_account_id_1.getAccountId)({
|
|
17
|
-
region: input.region,
|
|
18
|
-
});
|
|
19
|
-
const renderMetadata = await (0, get_render_metadata_1.getRenderMetadata)({
|
|
20
|
-
bucketName: input.bucketName,
|
|
21
|
-
expectedBucketOwner,
|
|
22
|
-
region: input.region,
|
|
23
|
-
renderId: input.renderId,
|
|
24
|
-
});
|
|
25
|
-
const readable = await (0, read_with_progress_1.lambdaReadFileWithProgress)({
|
|
26
|
-
bucketName: input.bucketName,
|
|
27
|
-
expectedBucketOwner,
|
|
28
|
-
key: (0, expected_out_name_1.getExpectedOutName)(renderMetadata),
|
|
29
|
-
region: input.region,
|
|
30
|
-
onProgress: (_a = input.onProgress) !== null && _a !== void 0 ? _a : (() => undefined),
|
|
31
|
-
});
|
|
32
|
-
const outputPath = path_1.default.resolve(process.cwd(), input.outPath);
|
|
33
|
-
renderer_1.RenderInternals.ensureOutputDirectory(outputPath);
|
|
34
|
-
const writeStream = (0, fs_1.createWriteStream)(outputPath);
|
|
35
|
-
let sizeInBytes = 0;
|
|
36
|
-
await new Promise((resolve, reject) => {
|
|
37
|
-
readable
|
|
38
|
-
.on('data', (d) => {
|
|
39
|
-
sizeInBytes += d.length;
|
|
40
|
-
})
|
|
41
|
-
.pipe(writeStream)
|
|
42
|
-
.on('error', (err) => reject(err))
|
|
43
|
-
.on('close', () => resolve());
|
|
44
|
-
});
|
|
45
|
-
return {
|
|
46
|
-
outputPath,
|
|
47
|
-
sizeInBytes,
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
exports.downloadMedia = downloadMedia;
|
|
51
|
-
/**
|
|
52
|
-
* @deprecated Renamed to downloadMedia()
|
|
53
|
-
*/
|
|
54
|
-
exports.downloadVideo = exports.downloadMedia;
|
|
55
|
-
//# sourceMappingURL=download-video.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"download-video.js","sourceRoot":"","sources":["../../src/api/download-video.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAmD;AACnD,2BAAqC;AACrC,gDAAwB;AACxB,8EAA0E;AAC1E,kFAA2E;AAC3E,gFAGiD;AAEjD,6DAAsD;AAe/C,MAAM,aAAa,GAAG,KAAK,EACjC,KAAyB,EACM,EAAE;;IACjC,MAAM,mBAAmB,GAAG,MAAM,IAAA,6BAAY,EAAC;QAC9C,MAAM,EAAE,KAAK,CAAC,MAAM;KACpB,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,MAAM,IAAA,uCAAiB,EAAC;QAC9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AAa,CAAC"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { FrameRange, ImageFormat, LogLevel, PixelFormat, ProResProfile } from 'remotion';
|
|
2
|
-
import { AwsRegion } from '../pricing/aws-regions';
|
|
3
|
-
import { Privacy } from '../shared/constants';
|
|
4
|
-
/**
|
|
5
|
-
* @description Triggers a render on a lambda given a composition and a lambda function.
|
|
6
|
-
* @link https://remotion-3.vercel.app/docs/lambda/rendermediaonlambda
|
|
7
|
-
* @param params.functionName The name of the Lambda function that should be used
|
|
8
|
-
* @param params.serveUrl The URL of the deployed project
|
|
9
|
-
* @param params.composition The ID of the composition which should be rendered.
|
|
10
|
-
* @param params.inputProps The input props that should be passed to the composition.
|
|
11
|
-
* @param params.codec The video codec which should be used for encoding.
|
|
12
|
-
* @param params.imageFormat In which image format the frames should be rendered.
|
|
13
|
-
* @param params.crf The constant rate factor to be used during encoding.
|
|
14
|
-
* @param params.envVariables Object containing environment variables to be inserted into the video environment
|
|
15
|
-
* @param params.proResProfile The ProRes profile if rendering a ProRes video
|
|
16
|
-
* @param params.quality JPEG quality if JPEG was selected as the image format.
|
|
17
|
-
* @param params.region The AWS region in which the video should be rendered.
|
|
18
|
-
* @param params.maxRetries How often rendering a chunk may fail before the video render gets aborted.
|
|
19
|
-
* @param params.enableChunkOptimization Whether Remotion should restructure and optimize chunks for subsequent renders. Default true.
|
|
20
|
-
* @param params.logLevel Level of logging that Lambda function should perform. Default "info".
|
|
21
|
-
* @returns `Promise<{renderId: string; bucketName: string}>`
|
|
22
|
-
*/
|
|
23
|
-
export declare const renderMediaOnLambda: ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, enableChunkOptimization, logLevel, frameRange, }: {
|
|
24
|
-
region: AwsRegion;
|
|
25
|
-
functionName: string;
|
|
26
|
-
serveUrl: string;
|
|
27
|
-
composition: string;
|
|
28
|
-
inputProps: unknown;
|
|
29
|
-
codec: 'h264-mkv' | 'mp3' | 'aac' | 'wav';
|
|
30
|
-
imageFormat: ImageFormat;
|
|
31
|
-
crf?: number | undefined;
|
|
32
|
-
envVariables?: Record<string, string> | undefined;
|
|
33
|
-
pixelFormat?: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le" | undefined;
|
|
34
|
-
proResProfile?: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
35
|
-
privacy: Privacy;
|
|
36
|
-
quality?: number | undefined;
|
|
37
|
-
maxRetries: number;
|
|
38
|
-
framesPerLambda?: number | undefined;
|
|
39
|
-
enableChunkOptimization?: boolean | undefined;
|
|
40
|
-
logLevel?: "verbose" | "info" | "warn" | "error" | undefined;
|
|
41
|
-
frameRange?: FrameRange | undefined;
|
|
42
|
-
}) => Promise<{
|
|
43
|
-
renderId: string;
|
|
44
|
-
bucketName: string;
|
|
45
|
-
}>;
|
|
46
|
-
/**
|
|
47
|
-
* @deprecated Renamed to renderMediaOnLambda()
|
|
48
|
-
*/
|
|
49
|
-
export declare const renderVideoOnLambda: ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, enableChunkOptimization, logLevel, frameRange, }: {
|
|
50
|
-
region: AwsRegion;
|
|
51
|
-
functionName: string;
|
|
52
|
-
serveUrl: string;
|
|
53
|
-
composition: string;
|
|
54
|
-
inputProps: unknown;
|
|
55
|
-
codec: 'h264-mkv' | 'mp3' | 'aac' | 'wav';
|
|
56
|
-
imageFormat: ImageFormat;
|
|
57
|
-
crf?: number | undefined;
|
|
58
|
-
envVariables?: Record<string, string> | undefined;
|
|
59
|
-
pixelFormat?: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le" | undefined;
|
|
60
|
-
proResProfile?: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
61
|
-
privacy: Privacy;
|
|
62
|
-
quality?: number | undefined;
|
|
63
|
-
maxRetries: number;
|
|
64
|
-
framesPerLambda?: number | undefined;
|
|
65
|
-
enableChunkOptimization?: boolean | undefined;
|
|
66
|
-
logLevel?: "verbose" | "info" | "warn" | "error" | undefined;
|
|
67
|
-
frameRange?: FrameRange | undefined;
|
|
68
|
-
}) => Promise<{
|
|
69
|
-
renderId: string;
|
|
70
|
-
bucketName: string;
|
|
71
|
-
}>;
|
|
72
|
-
//# sourceMappingURL=render-video-on-lambda.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render-video-on-lambda.d.ts","sourceRoot":"","sources":["../../src/api/render-video-on-lambda.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,WAAW,EAEX,QAAQ,EACR,WAAW,EACX,aAAa,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAGN,OAAO,EACP,MAAM,qBAAqB,CAAC;AAI7B;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,mBAAmB;YAoBvB,SAAS;kBACH,MAAM;cACV,MAAM;iBACH,MAAM;gBACP,OAAO;WACZ,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK;iBAC5B,WAAW;UAClB,MAAM,GAAG,SAAS;;;;aAIf,OAAO;;gBAEJ,MAAM;;;;;;;;EAmClB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB;YArDvB,SAAS;kBACH,MAAM;cACV,MAAM;iBACH,MAAM;gBACP,OAAO;WACZ,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK;iBAC5B,WAAW;UAClB,MAAM,GAAG,SAAS;;;;aAIf,OAAO;;gBAEJ,MAAM;;;;;;;;EAwCmC,CAAC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renderVideoOnLambda = exports.renderMediaOnLambda = void 0;
|
|
4
|
-
const remotion_1 = require("remotion");
|
|
5
|
-
const call_lambda_1 = require("../shared/call-lambda");
|
|
6
|
-
const constants_1 = require("../shared/constants");
|
|
7
|
-
const convert_to_serve_url_1 = require("../shared/convert-to-serve-url");
|
|
8
|
-
const validate_frames_per_lambda_1 = require("../shared/validate-frames-per-lambda");
|
|
9
|
-
/**
|
|
10
|
-
* @description Triggers a render on a lambda given a composition and a lambda function.
|
|
11
|
-
* @link https://remotion-3.vercel.app/docs/lambda/rendermediaonlambda
|
|
12
|
-
* @param params.functionName The name of the Lambda function that should be used
|
|
13
|
-
* @param params.serveUrl The URL of the deployed project
|
|
14
|
-
* @param params.composition The ID of the composition which should be rendered.
|
|
15
|
-
* @param params.inputProps The input props that should be passed to the composition.
|
|
16
|
-
* @param params.codec The video codec which should be used for encoding.
|
|
17
|
-
* @param params.imageFormat In which image format the frames should be rendered.
|
|
18
|
-
* @param params.crf The constant rate factor to be used during encoding.
|
|
19
|
-
* @param params.envVariables Object containing environment variables to be inserted into the video environment
|
|
20
|
-
* @param params.proResProfile The ProRes profile if rendering a ProRes video
|
|
21
|
-
* @param params.quality JPEG quality if JPEG was selected as the image format.
|
|
22
|
-
* @param params.region The AWS region in which the video should be rendered.
|
|
23
|
-
* @param params.maxRetries How often rendering a chunk may fail before the video render gets aborted.
|
|
24
|
-
* @param params.enableChunkOptimization Whether Remotion should restructure and optimize chunks for subsequent renders. Default true.
|
|
25
|
-
* @param params.logLevel Level of logging that Lambda function should perform. Default "info".
|
|
26
|
-
* @returns `Promise<{renderId: string; bucketName: string}>`
|
|
27
|
-
*/
|
|
28
|
-
const renderMediaOnLambda = async ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, enableChunkOptimization, logLevel, frameRange, }) => {
|
|
29
|
-
(0, validate_frames_per_lambda_1.validateFramesPerLambda)(framesPerLambda);
|
|
30
|
-
const realServeUrl = await (0, convert_to_serve_url_1.convertToServeUrl)(serveUrl, region);
|
|
31
|
-
const res = await (0, call_lambda_1.callLambda)({
|
|
32
|
-
functionName,
|
|
33
|
-
type: constants_1.LambdaRoutines.start,
|
|
34
|
-
payload: {
|
|
35
|
-
framesPerLambda: framesPerLambda !== null && framesPerLambda !== void 0 ? framesPerLambda : constants_1.DEFAULT_FRAMES_PER_LAMBDA,
|
|
36
|
-
composition,
|
|
37
|
-
serveUrl: realServeUrl,
|
|
38
|
-
inputProps,
|
|
39
|
-
codec,
|
|
40
|
-
imageFormat,
|
|
41
|
-
crf,
|
|
42
|
-
envVariables,
|
|
43
|
-
pixelFormat,
|
|
44
|
-
proResProfile,
|
|
45
|
-
quality,
|
|
46
|
-
maxRetries,
|
|
47
|
-
privacy,
|
|
48
|
-
enableChunkOptimization,
|
|
49
|
-
logLevel: logLevel !== null && logLevel !== void 0 ? logLevel : remotion_1.Internals.Logging.DEFAULT_LOG_LEVEL,
|
|
50
|
-
frameRange: frameRange !== null && frameRange !== void 0 ? frameRange : null,
|
|
51
|
-
},
|
|
52
|
-
region,
|
|
53
|
-
});
|
|
54
|
-
return {
|
|
55
|
-
renderId: res.renderId,
|
|
56
|
-
bucketName: res.bucketName,
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
exports.renderMediaOnLambda = renderMediaOnLambda;
|
|
60
|
-
/**
|
|
61
|
-
* @deprecated Renamed to renderMediaOnLambda()
|
|
62
|
-
*/
|
|
63
|
-
exports.renderVideoOnLambda = exports.renderMediaOnLambda;
|
|
64
|
-
//# sourceMappingURL=render-video-on-lambda.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render-video-on-lambda.js","sourceRoot":"","sources":["../../src/api/render-video-on-lambda.ts"],"names":[],"mappings":";;;AAAA,uCAOkB;AAElB,uDAAiD;AACjD,mDAI6B;A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from './aws-regions';
|
|
2
|
-
declare type EstimatePriceInput = {
|
|
3
|
-
region: AwsRegion;
|
|
4
|
-
durationInMiliseconds: number;
|
|
5
|
-
memorySizeInMb: number;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @description Calculates the AWS costs incurred for AWS Lambda given the region, execution duration and memory size.
|
|
10
|
-
* @link https://remotion-3.vercel.app/docs/lambda/estimateprice
|
|
11
|
-
* @returns `number` Price in USD
|
|
12
|
-
*/
|
|
13
|
-
export declare const estimatePrice: ({ region, durationInMiliseconds, memorySizeInMb, }: EstimatePriceInput) => number;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=calculate-price.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calculate-price.d.ts","sourceRoot":"","sources":["../../src/pricing/calculate-price.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAGxC,aAAK,kBAAkB,GAAG;IACzB,MAAM,EAAE,SAAS,CAAC;IAClB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;CACvB,CAAC;AACF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,uDAIvB,kBAAkB,WAkCpB,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.estimatePrice = void 0;
|
|
4
|
-
const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
5
|
-
const validate_memory_size_1 = require("../shared/validate-memory-size");
|
|
6
|
-
const price_per_1_s_1 = require("./price-per-1-s");
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @description Calculates the AWS costs incurred for AWS Lambda given the region, execution duration and memory size.
|
|
10
|
-
* @link https://remotion-3.vercel.app/docs/lambda/estimateprice
|
|
11
|
-
* @returns `number` Price in USD
|
|
12
|
-
*/
|
|
13
|
-
const estimatePrice = ({ region, durationInMiliseconds, memorySizeInMb, }) => {
|
|
14
|
-
(0, validate_memory_size_1.validateMemorySize)(memorySizeInMb);
|
|
15
|
-
(0, validate_aws_region_1.validateAwsRegion)(region);
|
|
16
|
-
if (typeof durationInMiliseconds !== 'number') {
|
|
17
|
-
throw new TypeError(`Parameter 'durationInMiliseconds' must be a number but got ${typeof durationInMiliseconds}`);
|
|
18
|
-
}
|
|
19
|
-
if (Number.isNaN(durationInMiliseconds)) {
|
|
20
|
-
throw new TypeError(`Parameter 'durationInMiliseconds' must not be NaN but it is.`);
|
|
21
|
-
}
|
|
22
|
-
if (!Number.isFinite(durationInMiliseconds)) {
|
|
23
|
-
throw new TypeError(`Parameter 'durationInMiliseconds' must be finite but it is ${durationInMiliseconds}`);
|
|
24
|
-
}
|
|
25
|
-
if (durationInMiliseconds < 0) {
|
|
26
|
-
throw new TypeError(`Parameter 'durationInMiliseconds' must be over 0 but it is ${durationInMiliseconds}.`);
|
|
27
|
-
}
|
|
28
|
-
const timeCostDollars = Number(price_per_1_s_1.pricing[region]['Lambda Duration'].price) *
|
|
29
|
-
((memorySizeInMb * durationInMiliseconds) / 1000 / 1024);
|
|
30
|
-
const invocationCost = Number(price_per_1_s_1.pricing[region]['Lambda Requests'].price);
|
|
31
|
-
return Number((timeCostDollars + invocationCost).toFixed(5));
|
|
32
|
-
};
|
|
33
|
-
exports.estimatePrice = estimatePrice;
|
|
34
|
-
//# sourceMappingURL=calculate-price.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calculate-price.js","sourceRoot":"","sources":["../../src/pricing/calculate-price.ts"],"names":[],"mappings":";;;AAAA,uEAAgE;AAChE,yEAAkE;AAElE,mDAAwC;AAOxC;;;;;GAKG;AACI,MAAM,aAAa,GAAG,CAAC,EAC7B,MAAM,EACN,qBAAqB,EACrB,cAAc,GACM,EAAE,EAAE;IACxB,IAAA,yCAAkB,EAAC,cAAc,CAAC,CAAC;IACnC,IAAA,uCAAiB,EAAC,MAAM,CAAC,CAAC;IAC1B,IAAI,OAAO,qBAAqB,KAAK,QAAQ,EAAE;QAC9C,MAAM,IAAI,SAAS,CAClB,8DAA8D,OAAO,qBAAqB,EAAE,CAC5F,CAAC;KACF;IAED,IAAI,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,EAAE;QACxC,MAAM,IAAI,SAAS,CAClB,8DAA8D,CAC9D,CAAC;KACF;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE;QAC5C,MAAM,IAAI,SAAS,CAClB,8DAA8D,qBAAqB,EAAE,CACrF,CAAC;KACF;IAED,IAAI,qBAAqB,GAAG,CAAC,EAAE;QAC9B,MAAM,IAAI,SAAS,CAClB,8DAA8D,qBAAqB,GAAG,CACtF,CAAC;KACF;IAED,MAAM,eAAe,GACpB,MAAM,CAAC,uBAAO,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC;QAChD,CAAC,CAAC,cAAc,GAAG,qBAAqB,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;IAE1D,MAAM,cAAc,GAAG,MAAM,CAAC,uBAAO,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,CAAC;IAExE,OAAO,MAAM,CAAC,CAAC,eAAe,GAAG,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC,CAAC;AAtCW,QAAA,aAAa,iBAsCxB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AwsRegion } from './aws-regions';
|
|
2
|
-
declare type EstimatePriceInput = {
|
|
3
|
-
region: AwsRegion;
|
|
4
|
-
durationInMiliseconds: number;
|
|
5
|
-
memorySizeInMb: number;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @description Calculates the AWS costs incurred for AWS Lambda given the region, execution duration and memory size.
|
|
10
|
-
* @link https://remotion-3.vercel.app/docs/lambda/estimateprice
|
|
11
|
-
* @returns `number` Price in USD
|
|
12
|
-
*/
|
|
13
|
-
export declare const estimatePrice: ({ region, durationInMiliseconds, memorySizeInMb, }: EstimatePriceInput) => number;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=estimate-price.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"estimate-price.d.ts","sourceRoot":"","sources":["../../src/pricing/estimate-price.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAGxC,aAAK,kBAAkB,GAAG;IACzB,MAAM,EAAE,SAAS,CAAC;IAClB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;CACvB,CAAC;AACF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,uDAIvB,kBAAkB,WAkCpB,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.estimatePrice = void 0;
|
|
4
|
-
const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
5
|
-
const validate_memory_size_1 = require("../shared/validate-memory-size");
|
|
6
|
-
const price_per_1_s_1 = require("./price-per-1-s");
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @description Calculates the AWS costs incurred for AWS Lambda given the region, execution duration and memory size.
|
|
10
|
-
* @link https://remotion-3.vercel.app/docs/lambda/estimateprice
|
|
11
|
-
* @returns `number` Price in USD
|
|
12
|
-
*/
|
|
13
|
-
const estimatePrice = ({ region, durationInMiliseconds, memorySizeInMb, }) => {
|
|
14
|
-
(0, validate_memory_size_1.validateMemorySize)(memorySizeInMb);
|
|
15
|
-
(0, validate_aws_region_1.validateAwsRegion)(region);
|
|
16
|
-
if (typeof durationInMiliseconds !== 'number') {
|
|
17
|
-
throw new TypeError(`Parameter 'durationInMiliseconds' must be a number but got ${typeof durationInMiliseconds}`);
|
|
18
|
-
}
|
|
19
|
-
if (Number.isNaN(durationInMiliseconds)) {
|
|
20
|
-
throw new TypeError(`Parameter 'durationInMiliseconds' must not be NaN but it is.`);
|
|
21
|
-
}
|
|
22
|
-
if (!Number.isFinite(durationInMiliseconds)) {
|
|
23
|
-
throw new TypeError(`Parameter 'durationInMiliseconds' must be finite but it is ${durationInMiliseconds}`);
|
|
24
|
-
}
|
|
25
|
-
if (durationInMiliseconds < 0) {
|
|
26
|
-
throw new TypeError(`Parameter 'durationInMiliseconds' must be over 0 but it is ${durationInMiliseconds}.`);
|
|
27
|
-
}
|
|
28
|
-
const timeCostDollars = Number(price_per_1_s_1.pricing[region]['Lambda Duration'].price) *
|
|
29
|
-
((memorySizeInMb * durationInMiliseconds) / 1000 / 1024);
|
|
30
|
-
const invocationCost = Number(price_per_1_s_1.pricing[region]['Lambda Requests'].price);
|
|
31
|
-
return Number((timeCostDollars + invocationCost).toFixed(5));
|
|
32
|
-
};
|
|
33
|
-
exports.estimatePrice = estimatePrice;
|
|
34
|
-
//# sourceMappingURL=estimate-price.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"estimate-price.js","sourceRoot":"","sources":["../../src/pricing/estimate-price.ts"],"names":[],"mappings":";;;AAAA,uEAAgE;AAChE,yEAAkE;AAElE,mDAAwC;AAOxC;;;;;GAKG;AACI,MAAM,aAAa,GAAG,CAAC,EAC7B,MAAM,EACN,qBAAqB,EACrB,cAAc,GACM,EAAE,EAAE;IACxB,IAAA,yCAAkB,EAAC,cAAc,CAAC,CAAC;IACnC,IAAA,uCAAiB,EAAC,MAAM,CAAC,CAAC;IAC1B,IAAI,OAAO,qBAAqB,KAAK,QAAQ,EAAE;QAC9C,MAAM,IAAI,SAAS,CAClB,8DAA8D,OAAO,qBAAqB,EAAE,CAC5F,CAAC;KACF;IAED,IAAI,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,EAAE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