@remotion/lambda 4.0.60 → 4.0.62
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/create-function.d.ts +2 -1
- package/dist/api/create-function.js +5 -2
- package/dist/api/deploy-function.d.ts +1 -0
- package/dist/api/deploy-function.js +2 -1
- package/dist/api/iam-validation/role-permissions.js +5 -0
- package/dist/api/iam-validation/user-permissions.js +4 -1
- package/dist/api/render-media-on-lambda.d.ts +1 -0
- package/dist/api/render-media-on-lambda.js +4 -0
- package/dist/api/render-still-on-lambda.d.ts +1 -0
- package/dist/api/render-still-on-lambda.js +4 -0
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/commands/functions/deploy.js +5 -2
- package/dist/cli/commands/render/render.js +4 -3
- package/dist/cli/commands/still.js +5 -4
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/helpers/streaming-payloads.d.ts +3 -3
- package/dist/internals.d.ts +1 -1
- package/dist/shared/constants.d.ts +1 -0
- package/dist/shared/constants.js +3 -2
- package/dist/shared/get-aws-urls.d.ts +4 -0
- package/dist/shared/get-aws-urls.js +5 -1
- package/dist/shared/lambda-insights-extensions.d.ts +4 -0
- package/dist/shared/lambda-insights-extensions.js +26 -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
- package/dist/functions/streaming/streaming.d.ts +0 -12
- package/dist/functions/streaming/streaming.js +0 -100
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AwsRegion } from '../pricing/aws-regions';
|
|
2
|
-
export declare const createFunction: ({ createCloudWatchLogGroup, region, zipFile, functionName, accountId, memorySizeInMb, timeoutInSeconds, alreadyCreated, retentionInDays, ephemerealStorageInMb, customRoleArn, }: {
|
|
2
|
+
export declare const createFunction: ({ createCloudWatchLogGroup, region, zipFile, functionName, accountId, memorySizeInMb, timeoutInSeconds, alreadyCreated, retentionInDays, ephemerealStorageInMb, customRoleArn, enableLambdaInsights, }: {
|
|
3
3
|
createCloudWatchLogGroup: boolean;
|
|
4
4
|
region: AwsRegion;
|
|
5
5
|
zipFile: string;
|
|
@@ -11,6 +11,7 @@ export declare const createFunction: ({ createCloudWatchLogGroup, region, zipFil
|
|
|
11
11
|
retentionInDays: number;
|
|
12
12
|
ephemerealStorageInMb: number;
|
|
13
13
|
customRoleArn: string;
|
|
14
|
+
enableLambdaInsights: boolean;
|
|
14
15
|
}) => Promise<{
|
|
15
16
|
FunctionName: string;
|
|
16
17
|
}>;
|
|
@@ -8,8 +8,9 @@ const version_1 = require("remotion/version");
|
|
|
8
8
|
const defaults_1 = require("../defaults");
|
|
9
9
|
const aws_clients_1 = require("../shared/aws-clients");
|
|
10
10
|
const hosted_layers_1 = require("../shared/hosted-layers");
|
|
11
|
+
const lambda_insights_extensions_1 = require("../shared/lambda-insights-extensions");
|
|
11
12
|
const suggested_policy_1 = require("./iam-validation/suggested-policy");
|
|
12
|
-
const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, functionName, accountId, memorySizeInMb, timeoutInSeconds, alreadyCreated, retentionInDays, ephemerealStorageInMb, customRoleArn, }) => {
|
|
13
|
+
const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, functionName, accountId, memorySizeInMb, timeoutInSeconds, alreadyCreated, retentionInDays, ephemerealStorageInMb, customRoleArn, enableLambdaInsights, }) => {
|
|
13
14
|
var _a;
|
|
14
15
|
if (createCloudWatchLogGroup) {
|
|
15
16
|
try {
|
|
@@ -43,7 +44,9 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
|
|
|
43
44
|
Description: 'Renders a Remotion video.',
|
|
44
45
|
MemorySize: memorySizeInMb,
|
|
45
46
|
Timeout: timeoutInSeconds,
|
|
46
|
-
Layers: hosted_layers_1.hostedLayers[region]
|
|
47
|
+
Layers: hosted_layers_1.hostedLayers[region]
|
|
48
|
+
.map(({ layerArn, version }) => `${layerArn}:${version}`)
|
|
49
|
+
.concat(enableLambdaInsights ? lambda_insights_extensions_1.lambdaInsightsExtensions[region] : []),
|
|
47
50
|
Architectures: ['arm64'],
|
|
48
51
|
EphemeralStorage: {
|
|
49
52
|
Size: ephemerealStorageInMb,
|
|
@@ -16,7 +16,7 @@ const validate_retention_period_1 = require("../shared/validate-retention-period
|
|
|
16
16
|
const validate_timeout_1 = require("../shared/validate-timeout");
|
|
17
17
|
const create_function_1 = require("./create-function");
|
|
18
18
|
const deployFunctionRaw = async (params) => {
|
|
19
|
-
var _a, _b;
|
|
19
|
+
var _a, _b, _c;
|
|
20
20
|
const diskSizeInMb = (_a = params.diskSizeInMb) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB;
|
|
21
21
|
(0, validate_memory_size_1.validateMemorySize)(params.memorySizeInMb);
|
|
22
22
|
(0, validate_timeout_1.validateTimeout)(params.timeoutInSeconds);
|
|
@@ -51,6 +51,7 @@ const deployFunctionRaw = async (params) => {
|
|
|
51
51
|
alreadyCreated: Boolean(alreadyDeployed),
|
|
52
52
|
ephemerealStorageInMb: diskSizeInMb,
|
|
53
53
|
customRoleArn: params.customRoleArn,
|
|
54
|
+
enableLambdaInsights: (_c = params.enableLambdaInsights) !== null && _c !== void 0 ? _c : false,
|
|
54
55
|
});
|
|
55
56
|
if (!created.FunctionName) {
|
|
56
57
|
throw new Error('Lambda was created but has no name');
|
|
@@ -25,10 +25,15 @@ exports.rolePermissions = [
|
|
|
25
25
|
actions: [aws_policies_1.lambda.InvokeFunction],
|
|
26
26
|
resource: [`arn:aws:lambda:*:*:function:${constants_1.RENDER_FN_PREFIX}*`],
|
|
27
27
|
},
|
|
28
|
+
{
|
|
29
|
+
actions: [aws_policies_1.logs.CreateLogGroup],
|
|
30
|
+
resource: [`arn:aws:logs:*:*:log-group:${constants_1.LAMBDA_INSIGHTS_PREFIX}`],
|
|
31
|
+
},
|
|
28
32
|
{
|
|
29
33
|
actions: [aws_policies_1.logs.CreateLogStream, aws_policies_1.logs.PutLogEvents],
|
|
30
34
|
resource: [
|
|
31
35
|
`arn:aws:logs:*:*:log-group:${constants_1.LOG_GROUP_PREFIX}${constants_1.RENDER_FN_PREFIX}*`,
|
|
36
|
+
`arn:aws:logs:*:*:log-group:${constants_1.LAMBDA_INSIGHTS_PREFIX}:*`,
|
|
32
37
|
],
|
|
33
38
|
},
|
|
34
39
|
];
|
|
@@ -76,6 +76,9 @@ exports.requiredPermissions = [
|
|
|
76
76
|
{
|
|
77
77
|
id: 'FetchBinaries',
|
|
78
78
|
actions: [aws_policies_1.lambda.GetLayerVersion],
|
|
79
|
-
resource: [
|
|
79
|
+
resource: [
|
|
80
|
+
hosted_layers_1.REMOTION_HOSTED_LAYER_ARN,
|
|
81
|
+
'arn:aws:lambda:*:580247275435:layer:LambdaInsightsExtension*',
|
|
82
|
+
],
|
|
80
83
|
},
|
|
81
84
|
];
|
|
@@ -58,6 +58,7 @@ export type RenderMediaOnLambdaOutput = {
|
|
|
58
58
|
renderId: string;
|
|
59
59
|
bucketName: string;
|
|
60
60
|
cloudWatchLogs: string;
|
|
61
|
+
lambdaInsightsLogs: string;
|
|
61
62
|
folderInS3Console: string;
|
|
62
63
|
};
|
|
63
64
|
export declare const internalRenderMediaOnLambdaRaw: (input: InnerRenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
|
|
@@ -36,6 +36,7 @@ export type RenderStillOnLambdaInput = {
|
|
|
36
36
|
onInit?: (data: {
|
|
37
37
|
renderId: string;
|
|
38
38
|
cloudWatchLogs: string;
|
|
39
|
+
lambdaInsightsUrl: string;
|
|
39
40
|
}) => void;
|
|
40
41
|
deleteAfter?: DeleteAfter | null;
|
|
41
42
|
} & Partial<ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda>>;
|
|
@@ -60,6 +60,10 @@ const renderStillOnLambdaRaw = async ({ functionName, serveUrl, inputProps, imag
|
|
|
60
60
|
rendererFunctionName: null,
|
|
61
61
|
renderId: payload.renderId,
|
|
62
62
|
}),
|
|
63
|
+
lambdaInsightsUrl: (0, get_aws_urls_1.getLambdaInsightsUrl)({
|
|
64
|
+
functionName,
|
|
65
|
+
region,
|
|
66
|
+
}),
|
|
63
67
|
});
|
|
64
68
|
}
|
|
65
69
|
},
|
package/dist/cli/args.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ type LambdaCommandLineOptions = {
|
|
|
19
19
|
['disable-chunk-optimization']: boolean;
|
|
20
20
|
['save-browser-logs']: boolean;
|
|
21
21
|
['disable-cloudwatch']: boolean;
|
|
22
|
+
['enable-lambda-insights']: boolean;
|
|
22
23
|
['max-retries']?: number;
|
|
23
24
|
['frames-per-lambda']?: number;
|
|
24
25
|
['concurrency-per-lambda']?: number;
|
|
@@ -13,14 +13,15 @@ const args_1 = require("../../args");
|
|
|
13
13
|
const get_aws_region_1 = require("../../get-aws-region");
|
|
14
14
|
exports.FUNCTIONS_DEPLOY_SUBCOMMAND = 'deploy';
|
|
15
15
|
const functionsDeploySubcommand = async () => {
|
|
16
|
-
var _a, _b, _c, _d, _e;
|
|
16
|
+
var _a, _b, _c, _d, _e, _f;
|
|
17
17
|
const region = (0, get_aws_region_1.getAwsRegion)();
|
|
18
18
|
const timeoutInSeconds = (_a = args_1.parsedLambdaCli.timeout) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_TIMEOUT;
|
|
19
19
|
const memorySizeInMb = (_b = args_1.parsedLambdaCli.memory) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_MEMORY_SIZE;
|
|
20
20
|
const diskSizeInMb = (_c = args_1.parsedLambdaCli.disk) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB;
|
|
21
21
|
const customRoleArn = (_d = args_1.parsedLambdaCli['custom-role-arn']) !== null && _d !== void 0 ? _d : undefined;
|
|
22
22
|
const createCloudWatchLogGroup = !args_1.parsedLambdaCli['disable-cloudwatch'];
|
|
23
|
-
const
|
|
23
|
+
const enableLambdaInsights = (_e = args_1.parsedLambdaCli['enable-lambda-insights']) !== null && _e !== void 0 ? _e : false;
|
|
24
|
+
const cloudWatchLogRetentionPeriodInDays = (_f = args_1.parsedLambdaCli['retention-period']) !== null && _f !== void 0 ? _f : constants_1.DEFAULT_CLOUDWATCH_RETENTION_PERIOD;
|
|
24
25
|
(0, validate_memory_size_1.validateMemorySize)(memorySizeInMb);
|
|
25
26
|
(0, validate_timeout_1.validateTimeout)(timeoutInSeconds);
|
|
26
27
|
(0, validate_disk_size_in_mb_1.validateDiskSizeInMb)(diskSizeInMb);
|
|
@@ -34,6 +35,7 @@ Timeout = ${timeoutInSeconds}sec
|
|
|
34
35
|
Version = ${version_1.VERSION}
|
|
35
36
|
CloudWatch Logging Enabled = ${createCloudWatchLogGroup}
|
|
36
37
|
CloudWatch Retention Period = ${cloudWatchLogRetentionPeriodInDays} days
|
|
38
|
+
Lambda Insights Enabled = ${enableLambdaInsights}
|
|
37
39
|
`.trim()));
|
|
38
40
|
}
|
|
39
41
|
const output = cli_1.CliInternals.createOverwriteableCliOutput({
|
|
@@ -52,6 +54,7 @@ CloudWatch Retention Period = ${cloudWatchLogRetentionPeriodInDays} days
|
|
|
52
54
|
cloudWatchLogRetentionPeriodInDays,
|
|
53
55
|
diskSizeInMb,
|
|
54
56
|
customRoleArn,
|
|
57
|
+
enableLambdaInsights,
|
|
55
58
|
});
|
|
56
59
|
if (cli_1.CliInternals.quietFlagProvided()) {
|
|
57
60
|
cli_1.CliInternals.Log.info(functionName);
|
|
@@ -38,7 +38,7 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
|
|
|
38
38
|
(0, quit_1.quit)(1);
|
|
39
39
|
}
|
|
40
40
|
const region = (0, get_aws_region_1.getAwsRegion)();
|
|
41
|
-
const { chromiumOptions, crf, envVariables, frameRange, inputProps, pixelFormat, proResProfile, puppeteerTimeout, jpegQuality, scale, everyNthFrame, numberOfGifLoops, muted, overwrite, audioBitrate, videoBitrate, height, width, browserExecutable,
|
|
41
|
+
const { chromiumOptions, crf, envVariables, frameRange, inputProps, pixelFormat, proResProfile, puppeteerTimeout, jpegQuality, scale, everyNthFrame, numberOfGifLoops, muted, overwrite, audioBitrate, videoBitrate, height, width, browserExecutable, offthreadVideoCacheSizeInBytes, colorSpace, deleteAfter, x264Preset, } = await cli_1.CliInternals.getCliOptions({
|
|
42
42
|
type: 'series',
|
|
43
43
|
isLambda: true,
|
|
44
44
|
remotionRoot,
|
|
@@ -54,7 +54,7 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
|
|
|
54
54
|
const server = await renderer_1.RenderInternals.prepareServer({
|
|
55
55
|
concurrency: 1,
|
|
56
56
|
indent: false,
|
|
57
|
-
port,
|
|
57
|
+
port: config_1.ConfigInternals.getRendererPortFromConfigFileAndCliFlag(),
|
|
58
58
|
remotionRoot,
|
|
59
59
|
logLevel,
|
|
60
60
|
webpackConfigOrServeUrl: serveUrl,
|
|
@@ -73,7 +73,7 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
|
|
|
73
73
|
staticBase: null,
|
|
74
74
|
data: inputProps,
|
|
75
75
|
}).serializedString,
|
|
76
|
-
port,
|
|
76
|
+
port: config_1.ConfigInternals.getRendererPortFromConfigFileAndCliFlag(),
|
|
77
77
|
puppeteerInstance: undefined,
|
|
78
78
|
serveUrlOrWebpackUrl: serveUrl,
|
|
79
79
|
timeoutInMilliseconds: puppeteerTimeout,
|
|
@@ -164,6 +164,7 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
|
|
|
164
164
|
log_1.Log.info(cli_1.CliInternals.chalk.gray(`bucket = ${res.bucketName}, function = ${functionName}`));
|
|
165
165
|
log_1.Log.info(cli_1.CliInternals.chalk.gray(`renderId = ${res.renderId}, codec = ${codec} (${reason})`));
|
|
166
166
|
log_1.Log.verbose({ indent: false, logLevel }, `CloudWatch logs (if enabled): ${res.cloudWatchLogs}`);
|
|
167
|
+
log_1.Log.verbose({ indent: false, logLevel }, `Lambda insights (if enabled): ${res.lambdaInsightsLogs}`);
|
|
167
168
|
log_1.Log.verbose({ indent: false, logLevel }, `Render folder: ${res.folderInS3Console}`);
|
|
168
169
|
const status = await (0, get_render_progress_1.getRenderProgress)({
|
|
169
170
|
functionName,
|
|
@@ -28,7 +28,7 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
28
28
|
log_1.Log.info(`${constants_1.BINARY_NAME} ${exports.STILL_COMMAND} <serve-url> <composition-id> [output-location]`);
|
|
29
29
|
(0, quit_1.quit)(1);
|
|
30
30
|
}
|
|
31
|
-
const { chromiumOptions, envVariables, inputProps, puppeteerTimeout, jpegQuality, stillFrame, scale, height, width, browserExecutable,
|
|
31
|
+
const { chromiumOptions, envVariables, inputProps, puppeteerTimeout, jpegQuality, stillFrame, scale, height, width, browserExecutable, offthreadVideoCacheSizeInBytes, } = await cli_1.CliInternals.getCliOptions({
|
|
32
32
|
type: 'still',
|
|
33
33
|
isLambda: true,
|
|
34
34
|
remotionRoot,
|
|
@@ -45,7 +45,7 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
45
45
|
const server = await renderer_1.RenderInternals.prepareServer({
|
|
46
46
|
concurrency: 1,
|
|
47
47
|
indent: false,
|
|
48
|
-
port,
|
|
48
|
+
port: config_1.ConfigInternals.getRendererPortFromConfigFileAndCliFlag(),
|
|
49
49
|
remotionRoot,
|
|
50
50
|
logLevel,
|
|
51
51
|
webpackConfigOrServeUrl: serveUrl,
|
|
@@ -65,7 +65,7 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
65
65
|
staticBase: null,
|
|
66
66
|
data: inputProps,
|
|
67
67
|
}).serializedString,
|
|
68
|
-
port,
|
|
68
|
+
port: config_1.ConfigInternals.getRendererPortFromConfigFileAndCliFlag(),
|
|
69
69
|
puppeteerInstance: undefined,
|
|
70
70
|
timeoutInMilliseconds: puppeteerTimeout,
|
|
71
71
|
height,
|
|
@@ -111,9 +111,10 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
111
111
|
scale,
|
|
112
112
|
forceHeight: height,
|
|
113
113
|
forceWidth: width,
|
|
114
|
-
onInit: ({ cloudWatchLogs, renderId }) => {
|
|
114
|
+
onInit: ({ cloudWatchLogs, renderId, lambdaInsightsUrl }) => {
|
|
115
115
|
log_1.Log.info(cli_1.CliInternals.chalk.gray(`Render invoked with ID = ${renderId}`));
|
|
116
116
|
log_1.Log.verbose({ indent: false, logLevel }, `CloudWatch logs (if enabled): ${cloudWatchLogs}`);
|
|
117
|
+
log_1.Log.verbose({ indent: false, logLevel }, `Lambda Insights (if enabled): ${lambdaInsightsUrl}`);
|
|
117
118
|
},
|
|
118
119
|
deleteAfter,
|
|
119
120
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "
|
|
1
|
+
export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-south-1" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "af-south-1" | "ap-south-1" | "ap-east-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "me-south-1" | "sa-east-1";
|
|
@@ -4,16 +4,16 @@ declare const streamingPayloadSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
4
4
|
type: z.ZodLiteral<"render-id-determined">;
|
|
5
5
|
renderId: z.ZodString;
|
|
6
6
|
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
renderId: string;
|
|
8
7
|
type: "render-id-determined";
|
|
9
|
-
}, {
|
|
10
8
|
renderId: string;
|
|
9
|
+
}, {
|
|
11
10
|
type: "render-id-determined";
|
|
11
|
+
renderId: string;
|
|
12
12
|
}>]>;
|
|
13
13
|
export type StreamingPayloads = z.infer<typeof streamingPayloadSchema>;
|
|
14
14
|
export declare const isStreamingPayload: (str: string) => false | {
|
|
15
|
-
renderId: string;
|
|
16
15
|
type: "render-id-determined";
|
|
16
|
+
renderId: string;
|
|
17
17
|
};
|
|
18
18
|
export declare const sendProgressEvent: (responseStream: ResponseStream, payload: StreamingPayloads) => void;
|
|
19
19
|
export {};
|
package/dist/internals.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const LambdaInternals: {
|
|
2
|
-
executeCommand: (args: string[], remotionRoot: string, logLevel: "
|
|
2
|
+
executeCommand: (args: string[], remotionRoot: string, logLevel: "verbose" | "info" | "warn" | "error") => Promise<void>;
|
|
3
3
|
makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, }: import("./api/make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("./defaults").LambdaStartPayload>;
|
|
4
4
|
getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, }: import(".").GetRenderProgressInput) => import("./defaults").LambdaStatusPayload;
|
|
5
5
|
};
|
|
@@ -31,6 +31,7 @@ export declare const ENCODING_PROGRESS_STEP_SIZE = 100;
|
|
|
31
31
|
export declare const REMOTION_BUCKET_PREFIX = "remotionlambda-";
|
|
32
32
|
export declare const RENDER_FN_PREFIX = "remotion-render-";
|
|
33
33
|
export declare const LOG_GROUP_PREFIX = "/aws/lambda/";
|
|
34
|
+
export declare const LAMBDA_INSIGHTS_PREFIX = "/aws/lambda-insights";
|
|
34
35
|
export declare const rendersPrefix: (renderId: string) => string;
|
|
35
36
|
export declare const encodingProgressKey: (renderId: string) => string;
|
|
36
37
|
export declare const renderMetadataKey: (renderId: string) => string;
|
package/dist/shared/constants.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.LAMBDA_BURST_LIMIT_QUOTA = void 0;
|
|
3
|
+
exports.LambdaRoutines = exports.REMOTION_FILELIST_TOKEN = exports.REMOTION_CONCATED_TOKEN = exports.CONCAT_FOLDER_TOKEN = exports.RENDERER_PATH_TOKEN = exports.resolvedPropsKey = exports.inputPropsKey = exports.defaultPropsKey = exports.postRenderDataKey = exports.customOutName = exports.outStillName = exports.outName = exports.getSitesKey = exports.getErrorFileName = exports.getErrorKeyPrefix = exports.chunkKeyForIndex = exports.chunkKey = exports.lambdaTimingsKey = exports.lambdaLogsPrefix = exports.lambdaTimingsPrefixForChunk = exports.lambdaTimingsPrefix = exports.lambdaChunkInitializedKey = exports.lambdaChunkInitializedPrefix = exports.initalizedMetadataKey = exports.renderMetadataKey = exports.encodingProgressKey = exports.rendersPrefix = exports.LAMBDA_INSIGHTS_PREFIX = exports.LOG_GROUP_PREFIX = exports.RENDER_FN_PREFIX = exports.REMOTION_BUCKET_PREFIX = exports.ENCODING_PROGRESS_STEP_SIZE = exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = exports.DEFAULT_OUTPUT_PRIVACY = exports.MAX_EPHEMERAL_STORAGE_IN_MB = exports.MIN_EPHEMERAL_STORAGE_IN_MB = exports.DEFAULT_EPHEMERAL_STORAGE_IN_MB = exports.MAX_FUNCTIONS_PER_RENDER = exports.DEFAULT_MAX_RETRIES = exports.DEFAULT_REGION = exports.COMMAND_NOT_FOUND = exports.BINARY_NAME = exports.DEFAULT_FRAMES_PER_LAMBDA = exports.MINIMUM_FRAMES_PER_LAMBDA = exports.MAX_TIMEOUT = exports.MIN_TIMEOUT = exports.DEFAULT_TIMEOUT = exports.DEFAULT_MEMORY_SIZE = exports.MAX_MEMORY = exports.MIN_MEMORY = void 0;
|
|
4
|
+
exports.LAMBDA_BURST_LIMIT_QUOTA = exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = void 0;
|
|
5
5
|
exports.MIN_MEMORY = 512;
|
|
6
6
|
exports.MAX_MEMORY = 10240;
|
|
7
7
|
exports.DEFAULT_MEMORY_SIZE = 2048;
|
|
@@ -24,6 +24,7 @@ exports.ENCODING_PROGRESS_STEP_SIZE = 100;
|
|
|
24
24
|
exports.REMOTION_BUCKET_PREFIX = 'remotionlambda-';
|
|
25
25
|
exports.RENDER_FN_PREFIX = 'remotion-render-';
|
|
26
26
|
exports.LOG_GROUP_PREFIX = '/aws/lambda/';
|
|
27
|
+
exports.LAMBDA_INSIGHTS_PREFIX = '/aws/lambda-insights';
|
|
27
28
|
const rendersPrefix = (renderId) => `renders/${renderId}`;
|
|
28
29
|
exports.rendersPrefix = rendersPrefix;
|
|
29
30
|
const encodingProgressKey = (renderId) => `${(0, exports.rendersPrefix)(renderId)}/encoding-progress.json`;
|
|
@@ -7,6 +7,10 @@ export declare const getCloudwatchMethodUrl: ({ region, functionName, renderId,
|
|
|
7
7
|
rendererFunctionName: string | null;
|
|
8
8
|
renderId: string;
|
|
9
9
|
}) => string;
|
|
10
|
+
export declare const getLambdaInsightsUrl: ({ region, functionName, }: {
|
|
11
|
+
region: AwsRegion;
|
|
12
|
+
functionName: string;
|
|
13
|
+
}) => string;
|
|
10
14
|
export declare const getCloudwatchRendererUrl: ({ region, functionName, renderId, rendererFunctionName, chunk, }: {
|
|
11
15
|
region: AwsRegion;
|
|
12
16
|
functionName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getS3RenderUrl = exports.getCloudwatchRendererUrl = exports.getCloudwatchMethodUrl = void 0;
|
|
3
|
+
exports.getS3RenderUrl = exports.getCloudwatchRendererUrl = exports.getLambdaInsightsUrl = exports.getCloudwatchMethodUrl = void 0;
|
|
4
4
|
const encode_aws_url_params_1 = require("./encode-aws-url-params");
|
|
5
5
|
const cloudWatchUrlWithQuery = ({ region, functionNameToUse, query, }) => {
|
|
6
6
|
return `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#logsV2:log-groups/log-group/$252Faws$252Flambda$252F${functionNameToUse}/log-events$3FfilterPattern$3D${(0, encode_aws_url_params_1.encodeAwsUrlParams)(query)}`;
|
|
@@ -11,6 +11,10 @@ const getCloudwatchMethodUrl = ({ region, functionName, renderId, rendererFuncti
|
|
|
11
11
|
return cloudWatchUrlWithQuery({ region, functionNameToUse, query });
|
|
12
12
|
};
|
|
13
13
|
exports.getCloudwatchMethodUrl = getCloudwatchMethodUrl;
|
|
14
|
+
const getLambdaInsightsUrl = ({ region, functionName, }) => {
|
|
15
|
+
return `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#lambda-insights:functions/${functionName}`;
|
|
16
|
+
};
|
|
17
|
+
exports.getLambdaInsightsUrl = getLambdaInsightsUrl;
|
|
14
18
|
const getCloudwatchRendererUrl = ({ region, functionName, renderId, rendererFunctionName, chunk, }) => {
|
|
15
19
|
const functionNameToUse = rendererFunctionName !== null && rendererFunctionName !== void 0 ? rendererFunctionName : functionName;
|
|
16
20
|
const query = `"method=renderer,renderId=${renderId}${chunk === null ? '' : `,chunk=${chunk},`}"`;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lambdaInsightsExtensions = void 0;
|
|
4
|
+
exports.lambdaInsightsExtensions = {
|
|
5
|
+
'us-east-1': 'arn:aws:lambda:us-east-1:580247275435:layer:LambdaInsightsExtension-Arm64:5',
|
|
6
|
+
'us-east-2': 'arn:aws:lambda:us-east-2:580247275435:layer:LambdaInsightsExtension-Arm64:7',
|
|
7
|
+
'us-west-1': 'arn:aws:lambda:us-west-1:580247275435:layer:LambdaInsightsExtension-Arm64:3',
|
|
8
|
+
'us-west-2': 'arn:aws:lambda:us-west-2:580247275435:layer:LambdaInsightsExtension-Arm64:5',
|
|
9
|
+
'af-south-1': 'arn:aws:lambda:af-south-1:012438385374:layer:LambdaInsightsExtension-Arm64:2',
|
|
10
|
+
'ap-east-1': 'arn:aws:lambda:ap-east-1:519774774795:layer:LambdaInsightsExtension-Arm64:2',
|
|
11
|
+
'ap-south-1': 'arn:aws:lambda:ap-south-1:580247275435:layer:LambdaInsightsExtension-Arm64:7',
|
|
12
|
+
'ap-northeast-3': 'arn:aws:lambda:ap-northeast-3:194566237122:layer:LambdaInsightsExtension-Arm64:2',
|
|
13
|
+
'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:580247275435:layer:LambdaInsightsExtension-Arm64:4',
|
|
14
|
+
'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:580247275435:layer:LambdaInsightsExtension-Arm64:5',
|
|
15
|
+
'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:580247275435:layer:LambdaInsightsExtension-Arm64:5',
|
|
16
|
+
'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:580247275435:layer:LambdaInsightsExtension-Arm64:11',
|
|
17
|
+
'ca-central-1': 'arn:aws:lambda:ca-central-1:580247275435:layer:LambdaInsightsExtension-Arm64:3',
|
|
18
|
+
'eu-central-1': 'arn:aws:lambda:eu-central-1:580247275435:layer:LambdaInsightsExtension-Arm64:5',
|
|
19
|
+
'eu-west-1': 'arn:aws:lambda:eu-west-1:580247275435:layer:LambdaInsightsExtension-Arm64:5',
|
|
20
|
+
'eu-west-2': 'arn:aws:lambda:eu-west-2:580247275435:layer:LambdaInsightsExtension-Arm64:5',
|
|
21
|
+
'eu-south-1': 'arn:aws:lambda:eu-south-1:339249233099:layer:LambdaInsightsExtension-Arm64:2',
|
|
22
|
+
'eu-west-3': 'arn:aws:lambda:eu-west-3:580247275435:layer:LambdaInsightsExtension-Arm64:3',
|
|
23
|
+
'eu-north-1': 'arn:aws:lambda:eu-north-1:580247275435:layer:LambdaInsightsExtension-Arm64:3',
|
|
24
|
+
'me-south-1': 'arn:aws:lambda:me-south-1:285320876703:layer:LambdaInsightsExtension-Arm64:2',
|
|
25
|
+
'sa-east-1': 'arn:aws:lambda:sa-east-1:580247275435:layer:LambdaInsightsExtension-Arm64:3',
|
|
26
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.62",
|
|
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.22.3",
|
|
29
|
-
"@remotion/
|
|
30
|
-
"@remotion/
|
|
31
|
-
"@remotion/
|
|
32
|
-
"remotion": "4.0.
|
|
29
|
+
"@remotion/bundler": "4.0.62",
|
|
30
|
+
"@remotion/cli": "4.0.62",
|
|
31
|
+
"@remotion/renderer": "4.0.62",
|
|
32
|
+
"remotion": "4.0.62"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@jonny/eslint-config": "3.0.276",
|
|
@@ -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/
|
|
47
|
-
"@remotion/
|
|
46
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.62",
|
|
47
|
+
"@remotion/bundler": "4.0.62"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@remotion/bundler": "4.0.
|
|
50
|
+
"@remotion/bundler": "4.0.62"
|
|
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;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
type OnMessage = (type: 'error' | 'success', nonce: string, data: Buffer) => void;
|
|
3
|
-
export declare const makeStreaming: (onMessage: OnMessage) => {
|
|
4
|
-
addData: (data: Buffer) => void;
|
|
5
|
-
};
|
|
6
|
-
export declare const makePayloadMessage: (nonce: number, data: Buffer, status: 0 | 1) => Buffer;
|
|
7
|
-
export type StreamingPayload = {
|
|
8
|
-
type: 'frames-rendered';
|
|
9
|
-
frames: number;
|
|
10
|
-
};
|
|
11
|
-
export type OnStream = (payload: StreamingPayload) => void;
|
|
12
|
-
export {};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makePayloadMessage = exports.makeStreaming = void 0;
|
|
4
|
-
const makeStreaming = (onMessage) => {
|
|
5
|
-
let outputBuffer = Buffer.from('');
|
|
6
|
-
const separator = Buffer.from('remotion_buffer:');
|
|
7
|
-
let unprocessedBuffers = [];
|
|
8
|
-
let missingData = null;
|
|
9
|
-
const processInput = () => {
|
|
10
|
-
let separatorIndex = outputBuffer.indexOf(separator);
|
|
11
|
-
if (separatorIndex === -1) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
separatorIndex += separator.length;
|
|
15
|
-
let nonceString = '';
|
|
16
|
-
let lengthString = '';
|
|
17
|
-
let statusString = '';
|
|
18
|
-
// Each message from Rust is prefixed with `remotion_buffer;{[nonce]}:{[length]}`
|
|
19
|
-
// Let's read the buffer to extract the nonce, and if the full length is available,
|
|
20
|
-
// we'll extract the data and pass it to the callback.
|
|
21
|
-
// eslint-disable-next-line no-constant-condition
|
|
22
|
-
while (true) {
|
|
23
|
-
const nextDigit = outputBuffer[separatorIndex];
|
|
24
|
-
// 0x3a is the character ":"
|
|
25
|
-
if (nextDigit === 0x3a) {
|
|
26
|
-
separatorIndex++;
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
separatorIndex++;
|
|
30
|
-
nonceString += String.fromCharCode(nextDigit);
|
|
31
|
-
}
|
|
32
|
-
// eslint-disable-next-line no-constant-condition
|
|
33
|
-
while (true) {
|
|
34
|
-
const nextDigit = outputBuffer[separatorIndex];
|
|
35
|
-
if (nextDigit === 0x3a) {
|
|
36
|
-
separatorIndex++;
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
separatorIndex++;
|
|
40
|
-
lengthString += String.fromCharCode(nextDigit);
|
|
41
|
-
}
|
|
42
|
-
// eslint-disable-next-line no-constant-condition
|
|
43
|
-
while (true) {
|
|
44
|
-
const nextDigit = outputBuffer[separatorIndex];
|
|
45
|
-
if (nextDigit === 0x3a) {
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
separatorIndex++;
|
|
49
|
-
statusString += String.fromCharCode(nextDigit);
|
|
50
|
-
}
|
|
51
|
-
const length = Number(lengthString);
|
|
52
|
-
const status = Number(statusString);
|
|
53
|
-
const dataLength = outputBuffer.length - separatorIndex - 1;
|
|
54
|
-
if (dataLength < length) {
|
|
55
|
-
missingData = {
|
|
56
|
-
dataMissing: length - dataLength,
|
|
57
|
-
};
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const data = outputBuffer.subarray(separatorIndex + 1, separatorIndex + 1 + Number(lengthString));
|
|
61
|
-
onMessage(status === 1 ? 'error' : 'success', nonceString, data);
|
|
62
|
-
missingData = null;
|
|
63
|
-
outputBuffer = outputBuffer.subarray(separatorIndex + Number(lengthString) + 1);
|
|
64
|
-
processInput();
|
|
65
|
-
};
|
|
66
|
-
return {
|
|
67
|
-
addData: (data) => {
|
|
68
|
-
unprocessedBuffers.push(data);
|
|
69
|
-
const separatorIndex = data.indexOf(separator);
|
|
70
|
-
if (separatorIndex === -1) {
|
|
71
|
-
if (missingData) {
|
|
72
|
-
missingData.dataMissing -= data.length;
|
|
73
|
-
}
|
|
74
|
-
if (!missingData || missingData.dataMissing > 0) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
unprocessedBuffers.unshift(outputBuffer);
|
|
79
|
-
outputBuffer = Buffer.concat(unprocessedBuffers);
|
|
80
|
-
unprocessedBuffers = [];
|
|
81
|
-
console.log('the unprocessed input is now', new TextDecoder('utf-8').decode(outputBuffer));
|
|
82
|
-
processInput();
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
exports.makeStreaming = makeStreaming;
|
|
87
|
-
const makePayloadMessage = (nonce, data, status) => {
|
|
88
|
-
const concat = Buffer.concat([
|
|
89
|
-
Buffer.from('remotion_buffer:'),
|
|
90
|
-
Buffer.from(nonce.toString()),
|
|
91
|
-
Buffer.from(':'),
|
|
92
|
-
Buffer.from(data.length.toString()),
|
|
93
|
-
Buffer.from(':'),
|
|
94
|
-
Buffer.from(String(status)),
|
|
95
|
-
Buffer.from(':'),
|
|
96
|
-
data,
|
|
97
|
-
]);
|
|
98
|
-
return concat;
|
|
99
|
-
};
|
|
100
|
-
exports.makePayloadMessage = makePayloadMessage;
|