@remotion/lambda 4.0.25 → 4.0.27
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/deploy-function.js +15 -14
- package/dist/api/deploy-site.js +12 -11
- package/dist/api/render-media-on-lambda.js +22 -21
- package/dist/api/render-still-on-lambda.js +19 -18
- package/dist/cli/commands/render/render.js +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -4
- package/dist/functions/launch.js +5 -1
- package/dist/shared/invoke-webhook.d.ts +2 -0
- package/package.json +8 -8
- package/remotionlambda-arm64.zip +0 -0
- package/dist/cli/helpers/validate.d.ts +0 -4
- package/dist/cli/helpers/validate.js +0 -8
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deployFunction = void 0;
|
|
4
|
+
const pure_1 = require("@remotion/renderer/pure");
|
|
4
5
|
const version_1 = require("remotion/version");
|
|
5
6
|
const get_functions_1 = require("../api/get-functions");
|
|
6
7
|
const constants_1 = require("../shared/constants");
|
|
@@ -14,19 +15,7 @@ const validate_memory_size_1 = require("../shared/validate-memory-size");
|
|
|
14
15
|
const validate_retention_period_1 = require("../shared/validate-retention-period");
|
|
15
16
|
const validate_timeout_1 = require("../shared/validate-timeout");
|
|
16
17
|
const create_function_1 = require("./create-function");
|
|
17
|
-
|
|
18
|
-
* @description Creates an AWS Lambda function in your account that will be able to render a video in the cloud.
|
|
19
|
-
* @see [Documentation](https://www.remotion.dev/docs/lambda/deployfunction)
|
|
20
|
-
* @param params.createCloudWatchLogGroup Whether you'd like to create a CloudWatch Log Group to store the logs for this function.
|
|
21
|
-
* @param params.cloudWatchLogRetentionPeriodInDays (optional) The number of days to retain the CloudWatch logs for this function. Default is 14 days.
|
|
22
|
-
* @param params.region The region you want to deploy your function to.
|
|
23
|
-
* @param params.timeoutInSeconds After how many seconds the lambda function should be killed if it does not end itself.
|
|
24
|
-
* @param params.memorySizeInMb How much memory should be allocated to the Lambda function.
|
|
25
|
-
* @param params.architecture The architecture Lambda should run on. One of x86_64 and x64
|
|
26
|
-
* @param params.diskSizeInMb The amount of storage the function should be allocated. The higher, the longer videos you can render. Default 512.
|
|
27
|
-
* @returns {Promise<DeployFunctionOutput>} An object that contains the `functionName` property
|
|
28
|
-
*/
|
|
29
|
-
const deployFunction = async (params) => {
|
|
18
|
+
const deployFunctionRaw = async (params) => {
|
|
30
19
|
var _a, _b;
|
|
31
20
|
const diskSizeInMb = (_a = params.diskSizeInMb) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB;
|
|
32
21
|
(0, validate_memory_size_1.validateMemorySize)(params.memorySizeInMb);
|
|
@@ -71,4 +60,16 @@ const deployFunction = async (params) => {
|
|
|
71
60
|
alreadyExisted: Boolean(alreadyDeployed),
|
|
72
61
|
};
|
|
73
62
|
};
|
|
74
|
-
|
|
63
|
+
/**
|
|
64
|
+
* @description Creates an AWS Lambda function in your account that will be able to render a video in the cloud.
|
|
65
|
+
* @see [Documentation](https://www.remotion.dev/docs/lambda/deployfunction)
|
|
66
|
+
* @param params.createCloudWatchLogGroup Whether you'd like to create a CloudWatch Log Group to store the logs for this function.
|
|
67
|
+
* @param params.cloudWatchLogRetentionPeriodInDays (optional) The number of days to retain the CloudWatch logs for this function. Default is 14 days.
|
|
68
|
+
* @param params.region The region you want to deploy your function to.
|
|
69
|
+
* @param params.timeoutInSeconds After how many seconds the lambda function should be killed if it does not end itself.
|
|
70
|
+
* @param params.memorySizeInMb How much memory should be allocated to the Lambda function.
|
|
71
|
+
* @param params.architecture The architecture Lambda should run on. One of x86_64 and x64
|
|
72
|
+
* @param params.diskSizeInMb The amount of storage the function should be allocated. The higher, the longer videos you can render. Default 512.
|
|
73
|
+
* @returns {Promise<DeployFunctionOutput>} An object that contains the `functionName` property
|
|
74
|
+
*/
|
|
75
|
+
exports.deployFunction = pure_1.PureJSAPIs.wrapWithErrorHandling(deployFunctionRaw);
|
package/dist/api/deploy-site.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.deploySite = void 0;
|
|
7
|
+
const pure_1 = require("@remotion/renderer/pure");
|
|
7
8
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
9
|
const io_1 = require("../functions/helpers/io");
|
|
9
10
|
const bundle_site_1 = require("../shared/bundle-site");
|
|
@@ -18,16 +19,7 @@ const validate_privacy_1 = require("../shared/validate-privacy");
|
|
|
18
19
|
const validate_site_name_1 = require("../shared/validate-site-name");
|
|
19
20
|
const bucket_exists_1 = require("./bucket-exists");
|
|
20
21
|
const upload_dir_1 = require("./upload-dir");
|
|
21
|
-
|
|
22
|
-
* @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.
|
|
23
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/deploysite)
|
|
24
|
-
* @param {AwsRegion} params.region The region in which the S3 bucket resides in.
|
|
25
|
-
* @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.
|
|
26
|
-
* @param {string} params.bucketName The name of the bucket to deploy your project into.
|
|
27
|
-
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
28
|
-
* @param {object} params.options Further options, see documentation page for this function.
|
|
29
|
-
*/
|
|
30
|
-
const deploySite = async ({ bucketName, entryPoint, siteName, options, region, privacy: passedPrivacy, }) => {
|
|
22
|
+
const deploySiteRaw = async ({ bucketName, entryPoint, siteName, options, region, privacy: passedPrivacy, }) => {
|
|
31
23
|
var _a, _b, _c, _d;
|
|
32
24
|
(0, validate_aws_region_1.validateAwsRegion)(region);
|
|
33
25
|
(0, validate_bucketname_1.validateBucketName)(bucketName, {
|
|
@@ -105,4 +97,13 @@ const deploySite = async ({ bucketName, entryPoint, siteName, options, region, p
|
|
|
105
97
|
},
|
|
106
98
|
};
|
|
107
99
|
};
|
|
108
|
-
|
|
100
|
+
/**
|
|
101
|
+
* @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.
|
|
102
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/deploysite)
|
|
103
|
+
* @param {AwsRegion} params.region The region in which the S3 bucket resides in.
|
|
104
|
+
* @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.
|
|
105
|
+
* @param {string} params.bucketName The name of the bucket to deploy your project into.
|
|
106
|
+
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
107
|
+
* @param {object} params.options Further options, see documentation page for this function.
|
|
108
|
+
*/
|
|
109
|
+
exports.deploySite = pure_1.PureJSAPIs.wrapWithErrorHandling(deploySiteRaw);
|
|
@@ -1,30 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.renderVideoOnLambda = exports.renderMediaOnLambda = void 0;
|
|
4
|
+
const pure_1 = require("@remotion/renderer/pure");
|
|
4
5
|
const call_lambda_1 = require("../shared/call-lambda");
|
|
5
6
|
const constants_1 = require("../shared/constants");
|
|
6
7
|
const get_aws_urls_1 = require("../shared/get-aws-urls");
|
|
7
8
|
const make_lambda_payload_1 = require("./make-lambda-payload");
|
|
8
|
-
|
|
9
|
-
* @description Triggers a render on a lambda given a composition and a lambda function.
|
|
10
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/rendermediaonlambda)
|
|
11
|
-
* @param params.functionName The name of the Lambda function that should be used
|
|
12
|
-
* @param params.serveUrl The URL of the deployed project
|
|
13
|
-
* @param params.composition The ID of the composition which should be rendered.
|
|
14
|
-
* @param params.inputProps The input props that should be passed to the composition.
|
|
15
|
-
* @param params.codec The media codec which should be used for encoding.
|
|
16
|
-
* @param params.imageFormat In which image format the frames should be rendered. Default "jpeg"
|
|
17
|
-
* @param params.crf The constant rate factor to be used during encoding.
|
|
18
|
-
* @param params.envVariables Object containing environment variables to be inserted into the video environment
|
|
19
|
-
* @param params.proResProfile The ProRes profile if rendering a ProRes video
|
|
20
|
-
* @param params.jpegQuality JPEG quality if JPEG was selected as the image format.
|
|
21
|
-
* @param params.region The AWS region in which the media should be rendered.
|
|
22
|
-
* @param params.maxRetries How often rendering a chunk may fail before the media render gets aborted. Default "1"
|
|
23
|
-
* @param params.logLevel Level of logging that Lambda function should perform. Default "info".
|
|
24
|
-
* @param params.webhook Configuration for webhook called upon completion or timeout of the render.
|
|
25
|
-
* @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
|
|
26
|
-
*/
|
|
27
|
-
const renderMediaOnLambda = async (input) => {
|
|
9
|
+
const renderMediaOnLambdaRaw = async (input) => {
|
|
28
10
|
var _a;
|
|
29
11
|
const { functionName, region, rendererFunctionName } = input;
|
|
30
12
|
try {
|
|
@@ -61,7 +43,26 @@ const renderMediaOnLambda = async (input) => {
|
|
|
61
43
|
throw err;
|
|
62
44
|
}
|
|
63
45
|
};
|
|
64
|
-
|
|
46
|
+
/**
|
|
47
|
+
* @description Triggers a render on a lambda given a composition and a lambda function.
|
|
48
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/rendermediaonlambda)
|
|
49
|
+
* @param params.functionName The name of the Lambda function that should be used
|
|
50
|
+
* @param params.serveUrl The URL of the deployed project
|
|
51
|
+
* @param params.composition The ID of the composition which should be rendered.
|
|
52
|
+
* @param params.inputProps The input props that should be passed to the composition.
|
|
53
|
+
* @param params.codec The media codec which should be used for encoding.
|
|
54
|
+
* @param params.imageFormat In which image format the frames should be rendered. Default "jpeg"
|
|
55
|
+
* @param params.crf The constant rate factor to be used during encoding.
|
|
56
|
+
* @param params.envVariables Object containing environment variables to be inserted into the video environment
|
|
57
|
+
* @param params.proResProfile The ProRes profile if rendering a ProRes video
|
|
58
|
+
* @param params.jpegQuality JPEG quality if JPEG was selected as the image format.
|
|
59
|
+
* @param params.region The AWS region in which the media should be rendered.
|
|
60
|
+
* @param params.maxRetries How often rendering a chunk may fail before the media render gets aborted. Default "1"
|
|
61
|
+
* @param params.logLevel Level of logging that Lambda function should perform. Default "info".
|
|
62
|
+
* @param params.webhook Configuration for webhook called upon completion or timeout of the render.
|
|
63
|
+
* @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
|
|
64
|
+
*/
|
|
65
|
+
exports.renderMediaOnLambda = pure_1.PureJSAPIs.wrapWithErrorHandling(renderMediaOnLambdaRaw);
|
|
65
66
|
/**
|
|
66
67
|
* @deprecated Renamed to renderMediaOnLambda()
|
|
67
68
|
*/
|
|
@@ -1,28 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.renderStillOnLambda = void 0;
|
|
4
|
+
const pure_1 = require("@remotion/renderer/pure");
|
|
4
5
|
const version_1 = require("remotion/version");
|
|
5
6
|
const call_lambda_1 = require("../shared/call-lambda");
|
|
6
7
|
const compress_props_1 = require("../shared/compress-props");
|
|
7
8
|
const constants_1 = require("../shared/constants");
|
|
8
9
|
const get_aws_urls_1 = require("../shared/get-aws-urls");
|
|
9
|
-
|
|
10
|
-
* @description Renders a still frame on Lambda
|
|
11
|
-
* @link https://remotion.dev/docs/lambda/renderstillonlambda
|
|
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.imageFormat In which image format the frames should be rendered.
|
|
17
|
-
* @param params.envVariables Object containing environment variables to be inserted into the video environment
|
|
18
|
-
* @param params.jpegQuality JPEG quality if JPEG was selected as the image format.
|
|
19
|
-
* @param params.region The AWS region in which the video should be rendered.
|
|
20
|
-
* @param params.maxRetries How often rendering a chunk may fail before the video render gets aborted.
|
|
21
|
-
* @param params.frame Which frame should be used for the still image. Default 0.
|
|
22
|
-
* @param params.privacy Whether the item in the S3 bucket should be public. Possible values: `"private"` and `"public"`
|
|
23
|
-
* @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
|
|
24
|
-
*/
|
|
25
|
-
const renderStillOnLambda = async ({ functionName, serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, dumpBrowserLogs, onInit, offthreadVideoCacheSizeInBytes, }) => {
|
|
10
|
+
const renderStillOnLambdaRaw = async ({ functionName, serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, dumpBrowserLogs, onInit, offthreadVideoCacheSizeInBytes, }) => {
|
|
26
11
|
var _a;
|
|
27
12
|
if (quality) {
|
|
28
13
|
throw new Error('The `quality` option is deprecated. Use `jpegQuality` instead.');
|
|
@@ -102,4 +87,20 @@ const renderStillOnLambda = async ({ functionName, serveUrl, inputProps, imageFo
|
|
|
102
87
|
throw err;
|
|
103
88
|
}
|
|
104
89
|
};
|
|
105
|
-
|
|
90
|
+
/**
|
|
91
|
+
* @description Renders a still frame on Lambda
|
|
92
|
+
* @link https://remotion.dev/docs/lambda/renderstillonlambda
|
|
93
|
+
* @param params.functionName The name of the Lambda function that should be used
|
|
94
|
+
* @param params.serveUrl The URL of the deployed project
|
|
95
|
+
* @param params.composition The ID of the composition which should be rendered.
|
|
96
|
+
* @param params.inputProps The input props that should be passed to the composition.
|
|
97
|
+
* @param params.imageFormat In which image format the frames should be rendered.
|
|
98
|
+
* @param params.envVariables Object containing environment variables to be inserted into the video environment
|
|
99
|
+
* @param params.jpegQuality JPEG quality if JPEG was selected as the image format.
|
|
100
|
+
* @param params.region The AWS region in which the video should be rendered.
|
|
101
|
+
* @param params.maxRetries How often rendering a chunk may fail before the video render gets aborted.
|
|
102
|
+
* @param params.frame Which frame should be used for the still image. Default 0.
|
|
103
|
+
* @param params.privacy Whether the item in the S3 bucket should be public. Possible values: `"private"` and `"public"`
|
|
104
|
+
* @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
|
|
105
|
+
*/
|
|
106
|
+
exports.renderStillOnLambda = pure_1.PureJSAPIs.wrapWithErrorHandling(renderStillOnLambdaRaw);
|
|
@@ -284,7 +284,7 @@ const renderCommand = async (args, remotionRoot) => {
|
|
|
284
284
|
stack: err.stack,
|
|
285
285
|
stackFrame: frames,
|
|
286
286
|
});
|
|
287
|
-
await cli_1.CliInternals.
|
|
287
|
+
await cli_1.CliInternals.printError(errorWithStackFrame, logLevel);
|
|
288
288
|
}
|
|
289
289
|
log_1.Log.info();
|
|
290
290
|
log_1.Log.info(`Accrued costs until error was thrown: ${newStatus.costs.displayCost}.`);
|
package/dist/cli/index.js
CHANGED
|
@@ -139,7 +139,7 @@ AWS returned an error message "The security token included in the request is inv
|
|
|
139
139
|
`);
|
|
140
140
|
}
|
|
141
141
|
if (error instanceof renderer_1.RenderInternals.SymbolicateableError) {
|
|
142
|
-
await cli_1.CliInternals.
|
|
142
|
+
await cli_1.CliInternals.printError(error, config_1.ConfigInternals.Logging.getLogLevel());
|
|
143
143
|
}
|
|
144
144
|
else {
|
|
145
145
|
const frames = renderer_1.RenderInternals.parseStack((_e = (_d = error.stack) === null || _d === void 0 ? void 0 : _d.split('\n')) !== null && _e !== void 0 ? _e : []);
|
|
@@ -150,7 +150,7 @@ AWS returned an error message "The security token included in the request is inv
|
|
|
150
150
|
stack: error.stack,
|
|
151
151
|
stackFrame: frames,
|
|
152
152
|
});
|
|
153
|
-
await cli_1.CliInternals.
|
|
153
|
+
await cli_1.CliInternals.printError(errorWithStackFrame, config_1.ConfigInternals.Logging.getLogLevel());
|
|
154
154
|
}
|
|
155
155
|
(0, quit_1.quit)(1);
|
|
156
156
|
}
|
package/dist/functions/launch.js
CHANGED
|
@@ -124,7 +124,11 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
124
124
|
(0, validate_1.validateDimension)(comp.width, 'width', 'passed to a Lambda render');
|
|
125
125
|
renderer_1.RenderInternals.validateBitrate(params.audioBitrate, 'audioBitrate');
|
|
126
126
|
renderer_1.RenderInternals.validateBitrate(params.videoBitrate, 'videoBitrate');
|
|
127
|
-
renderer_1.RenderInternals.validateConcurrency(
|
|
127
|
+
renderer_1.RenderInternals.validateConcurrency({
|
|
128
|
+
value: params.concurrencyPerLambda,
|
|
129
|
+
setting: 'concurrencyPerLambda',
|
|
130
|
+
checkIfValidForCurrentMachine: true,
|
|
131
|
+
});
|
|
128
132
|
const realFrameRange = renderer_1.RenderInternals.getRealFrameRange(comp.durationInFrames, params.frameRange);
|
|
129
133
|
const frameCount = renderer_1.RenderInternals.getFramesToRender(realFrameRange, params.everyNthFrame);
|
|
130
134
|
const framesPerLambda = (_c = params.framesPerLambda) !== null && _c !== void 0 ? _c : (0, best_frames_per_lambda_param_1.bestFramesPerLambdaParam)(frameCount.length);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.27",
|
|
4
4
|
"description": "Distributed renderer for Remotion based on AWS Lambda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"aws-policies": "^1.0.1",
|
|
27
27
|
"mime-types": "2.1.34",
|
|
28
28
|
"zod": "3.21.4",
|
|
29
|
-
"@remotion/bundler": "4.0.
|
|
30
|
-
"@remotion/cli": "4.0.
|
|
31
|
-
"@remotion/renderer": "4.0.
|
|
32
|
-
"remotion": "4.0.
|
|
29
|
+
"@remotion/bundler": "4.0.27",
|
|
30
|
+
"@remotion/cli": "4.0.27",
|
|
31
|
+
"@remotion/renderer": "4.0.27",
|
|
32
|
+
"remotion": "4.0.27"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@jonny/eslint-config": "3.0.266",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"ts-node": "^10.8.0",
|
|
44
44
|
"vitest": "0.31.1",
|
|
45
45
|
"zip-lib": "^0.7.2",
|
|
46
|
-
"@remotion/bundler": "4.0.
|
|
47
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
46
|
+
"@remotion/bundler": "4.0.27",
|
|
47
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.27"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@remotion/bundler": "4.0.
|
|
50
|
+
"@remotion/bundler": "4.0.27"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateDurationInFrames = exports.validateDimension = exports.validateFps = void 0;
|
|
4
|
-
/* eslint-disable prefer-destructuring */
|
|
5
|
-
const remotion_1 = require("remotion");
|
|
6
|
-
exports.validateFps = remotion_1.Internals.validateFps;
|
|
7
|
-
exports.validateDimension = remotion_1.Internals.validateDimension;
|
|
8
|
-
exports.validateDurationInFrames = remotion_1.Internals.validateDurationInFrames;
|