@remotion/lambda 3.3.37 → 3.3.39
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/get-compositions-on-lambda.d.ts +1 -2
- package/dist/api/render-media-on-lambda.d.ts +4 -4
- package/dist/api/render-media-on-lambda.js +3 -1
- package/dist/api/render-still-on-lambda.d.ts +1 -2
- package/dist/api/render-still-on-lambda.js +1 -0
- package/dist/api/upload-dir.js +18 -29
- package/dist/api/validate-webhook-signature.d.ts +1 -1
- package/dist/cli/args.d.ts +2 -0
- package/dist/cli/commands/render/progress.js +0 -7
- package/dist/cli/commands/render/render.js +2 -1
- package/dist/cli/helpers/find-function-name.js +35 -6
- package/dist/cli/helpers/progress-bar.js +0 -3
- package/dist/functions/launch.js +16 -8
- package/dist/functions/renderer.js +4 -0
- package/dist/functions/start.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/shared/constants.d.ts +5 -0
- package/dist/shared/get-aws-urls.d.ts +2 -1
- package/dist/shared/get-aws-urls.js +3 -2
- package/package.json +8 -8
- package/remotionlambda-arm64.zip +0 -0
- package/remotionlambda-x64.zip +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
-
import type { ChromiumOptions } from '@remotion/renderer/src/open-browser';
|
|
1
|
+
import type { ChromiumOptions, LogLevel } from '@remotion/renderer';
|
|
3
2
|
import type { TCompMetadata } from 'remotion';
|
|
4
3
|
import type { AwsRegion } from '../client';
|
|
5
4
|
export declare type GetCompositionsOnLambdaInput = {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { FrameRange, ImageFormat, LogLevel, PixelFormat, ProResProfile } from '@remotion/renderer';
|
|
2
|
-
import type { ChromiumOptions } from '@remotion/renderer/src/open-browser';
|
|
1
|
+
import type { ChromiumOptions, FrameRange, ImageFormat, LogLevel, PixelFormat, ProResProfile } from '@remotion/renderer';
|
|
3
2
|
import type { AwsRegion } from '../pricing/aws-regions';
|
|
4
3
|
import type { OutNameInput, Privacy } from '../shared/constants';
|
|
5
4
|
import type { DownloadBehavior } from '../shared/content-disposition-header';
|
|
@@ -40,6 +39,7 @@ export declare type RenderMediaOnLambdaInput = {
|
|
|
40
39
|
};
|
|
41
40
|
forceWidth?: number | null;
|
|
42
41
|
forceHeight?: number | null;
|
|
42
|
+
rendererFunctionName?: string | null;
|
|
43
43
|
};
|
|
44
44
|
export declare type RenderMediaOnLambdaOutput = {
|
|
45
45
|
renderId: string;
|
|
@@ -66,8 +66,8 @@ export declare type RenderMediaOnLambdaOutput = {
|
|
|
66
66
|
* @param params.webhook Configuration for webhook called upon completion or timeout of the render.
|
|
67
67
|
* @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
|
|
68
68
|
*/
|
|
69
|
-
export declare const renderMediaOnLambda: ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, logLevel, frameRange, outName, timeoutInMilliseconds, chromiumOptions, scale, numberOfGifLoops, everyNthFrame, concurrencyPerLambda, downloadBehavior, muted, overwrite, audioBitrate, videoBitrate, webhook, forceHeight, forceWidth, }: RenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
|
|
69
|
+
export declare const renderMediaOnLambda: ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, logLevel, frameRange, outName, timeoutInMilliseconds, chromiumOptions, scale, numberOfGifLoops, everyNthFrame, concurrencyPerLambda, downloadBehavior, muted, overwrite, audioBitrate, videoBitrate, webhook, forceHeight, forceWidth, rendererFunctionName, }: RenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
|
|
70
70
|
/**
|
|
71
71
|
* @deprecated Renamed to renderMediaOnLambda()
|
|
72
72
|
*/
|
|
73
|
-
export declare const renderVideoOnLambda: ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, logLevel, frameRange, outName, timeoutInMilliseconds, chromiumOptions, scale, numberOfGifLoops, everyNthFrame, concurrencyPerLambda, downloadBehavior, muted, overwrite, audioBitrate, videoBitrate, webhook, forceHeight, forceWidth, }: RenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
|
|
73
|
+
export declare const renderVideoOnLambda: ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, logLevel, frameRange, outName, timeoutInMilliseconds, chromiumOptions, scale, numberOfGifLoops, everyNthFrame, concurrencyPerLambda, downloadBehavior, muted, overwrite, audioBitrate, videoBitrate, webhook, forceHeight, forceWidth, rendererFunctionName, }: RenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
|
|
@@ -29,7 +29,7 @@ const validate_serveurl_1 = require("../shared/validate-serveurl");
|
|
|
29
29
|
* @param params.webhook Configuration for webhook called upon completion or timeout of the render.
|
|
30
30
|
* @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
|
|
31
31
|
*/
|
|
32
|
-
const renderMediaOnLambda = async ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, logLevel, frameRange, outName, timeoutInMilliseconds, chromiumOptions, scale, numberOfGifLoops, everyNthFrame, concurrencyPerLambda, downloadBehavior, muted, overwrite, audioBitrate, videoBitrate, webhook, forceHeight, forceWidth, }) => {
|
|
32
|
+
const renderMediaOnLambda = async ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, logLevel, frameRange, outName, timeoutInMilliseconds, chromiumOptions, scale, numberOfGifLoops, everyNthFrame, concurrencyPerLambda, downloadBehavior, muted, overwrite, audioBitrate, videoBitrate, webhook, forceHeight, forceWidth, rendererFunctionName, }) => {
|
|
33
33
|
var _a;
|
|
34
34
|
const actualCodec = (0, validate_lambda_codec_1.validateLambdaCodec)(codec);
|
|
35
35
|
(0, validate_serveurl_1.validateServeUrl)(serveUrl);
|
|
@@ -48,6 +48,7 @@ const renderMediaOnLambda = async ({ functionName, serveUrl, inputProps, codec,
|
|
|
48
48
|
functionName,
|
|
49
49
|
type: constants_1.LambdaRoutines.start,
|
|
50
50
|
payload: {
|
|
51
|
+
rendererFunctionName: rendererFunctionName !== null && rendererFunctionName !== void 0 ? rendererFunctionName : null,
|
|
51
52
|
framesPerLambda: framesPerLambda !== null && framesPerLambda !== void 0 ? framesPerLambda : null,
|
|
52
53
|
composition,
|
|
53
54
|
serveUrl,
|
|
@@ -90,6 +91,7 @@ const renderMediaOnLambda = async ({ functionName, serveUrl, inputProps, codec,
|
|
|
90
91
|
method: constants_1.LambdaRoutines.renderer,
|
|
91
92
|
region,
|
|
92
93
|
renderId: res.renderId,
|
|
94
|
+
rendererFunctionName: rendererFunctionName !== null && rendererFunctionName !== void 0 ? rendererFunctionName : null,
|
|
93
95
|
}),
|
|
94
96
|
folderInS3Console: (0, get_aws_urls_1.getS3RenderUrl)({
|
|
95
97
|
bucketName: res.bucketName,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { LogLevel, StillImageFormat } from '@remotion/renderer';
|
|
2
|
-
import type { ChromiumOptions } from '@remotion/renderer/src/open-browser';
|
|
1
|
+
import type { ChromiumOptions, LogLevel, StillImageFormat } from '@remotion/renderer';
|
|
3
2
|
import type { AwsRegion } from '../pricing/aws-regions';
|
|
4
3
|
import type { CostsInfo, OutNameInput, Privacy } from '../shared/constants';
|
|
5
4
|
import type { DownloadBehavior } from '../shared/content-disposition-header';
|
package/dist/api/upload-dir.js
CHANGED
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.uploadDir = exports.getDirFiles = void 0;
|
|
7
|
-
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
8
7
|
const lib_storage_1 = require("@aws-sdk/lib-storage");
|
|
9
8
|
const fs_1 = require("fs");
|
|
10
9
|
const mime_types_1 = __importDefault(require("mime-types"));
|
|
@@ -52,7 +51,7 @@ const uploadDir = async ({ bucket, region, localDir, onProgress, keyPrefix, priv
|
|
|
52
51
|
progresses[file.name] = 0;
|
|
53
52
|
}
|
|
54
53
|
const client = (0, aws_clients_1.getS3Client)(region, null);
|
|
55
|
-
const uploads = files.map(
|
|
54
|
+
const uploads = files.map((filePath) => {
|
|
56
55
|
const Key = (0, make_s3_key_1.makeS3Key)(keyPrefix, localDir, filePath.name);
|
|
57
56
|
const Body = (0, fs_1.createReadStream)(filePath.name);
|
|
58
57
|
const ContentType = mime_types_1.default.lookup(Key) || 'application/octet-stream';
|
|
@@ -61,33 +60,23 @@ const uploadDir = async ({ bucket, region, localDir, onProgress, keyPrefix, priv
|
|
|
61
60
|
: privacy === 'private'
|
|
62
61
|
? 'private'
|
|
63
62
|
: 'public-read';
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return paralellUploads3.done();
|
|
82
|
-
}
|
|
83
|
-
await client.send(new client_s3_1.PutObjectCommand({
|
|
84
|
-
Key,
|
|
85
|
-
Bucket: bucket,
|
|
86
|
-
Body,
|
|
87
|
-
ACL,
|
|
88
|
-
ContentType,
|
|
89
|
-
}));
|
|
90
|
-
progresses[filePath.name] = filePath.size;
|
|
63
|
+
const paralellUploads3 = new lib_storage_1.Upload({
|
|
64
|
+
client,
|
|
65
|
+
queueSize: 4,
|
|
66
|
+
partSize: 5 * 1024 * 1024,
|
|
67
|
+
params: {
|
|
68
|
+
Key,
|
|
69
|
+
Bucket: bucket,
|
|
70
|
+
Body,
|
|
71
|
+
ACL,
|
|
72
|
+
ContentType,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
paralellUploads3.on('httpUploadProgress', (progress) => {
|
|
76
|
+
var _a;
|
|
77
|
+
progresses[filePath.name] = (_a = progress.loaded) !== null && _a !== void 0 ? _a : 0;
|
|
78
|
+
});
|
|
79
|
+
return paralellUploads3.done();
|
|
91
80
|
});
|
|
92
81
|
const promise = Promise.all(uploads);
|
|
93
82
|
const interval = setInterval(() => {
|
package/dist/cli/args.d.ts
CHANGED
|
@@ -27,6 +27,8 @@ declare type LambdaCommandLineOptions = {
|
|
|
27
27
|
privacy: Privacy;
|
|
28
28
|
webhook: string | undefined;
|
|
29
29
|
['webhook-secret']: string | undefined;
|
|
30
|
+
['renderer-function-name']: string | undefined;
|
|
31
|
+
['function-name']: string | undefined;
|
|
30
32
|
};
|
|
31
33
|
export declare const parsedLambdaCli: LambdaCommandLineOptions & import("minimist").ParsedArgs;
|
|
32
34
|
export declare const forceFlagProvided: boolean;
|
|
@@ -9,7 +9,6 @@ const makeInvokeProgress = (invokeProgress, totalSteps, retriesInfo) => {
|
|
|
9
9
|
const { lambdasInvoked, totalLambdas } = invokeProgress;
|
|
10
10
|
const progress = totalLambdas === null ? 0 : lambdasInvoked / totalLambdas;
|
|
11
11
|
return [
|
|
12
|
-
'⚡️',
|
|
13
12
|
`(1/${totalSteps})`,
|
|
14
13
|
cli_1.CliInternals.makeProgressBar(progress),
|
|
15
14
|
`${progress === 0 ? 'Invoked' : 'Invoking'} lambdas`,
|
|
@@ -29,7 +28,6 @@ const makeRenderProgress = ({ chunkProgress, totalSteps, }) => {
|
|
|
29
28
|
? null
|
|
30
29
|
: `(${chunkProgress.framesRendered}/${chunkProgress.totalFrames})`;
|
|
31
30
|
const first = [
|
|
32
|
-
'🧩',
|
|
33
31
|
`(2/${totalSteps})`,
|
|
34
32
|
cli_1.CliInternals.makeProgressBar(renderProgress),
|
|
35
33
|
doneIn === null ? 'Rendering frames' : 'Rendered frames',
|
|
@@ -38,7 +36,6 @@ const makeRenderProgress = ({ chunkProgress, totalSteps, }) => {
|
|
|
38
36
|
.filter(truthy_1.truthy)
|
|
39
37
|
.join(' ');
|
|
40
38
|
const second = [
|
|
41
|
-
'🏗️ ',
|
|
42
39
|
`(3/${totalSteps})`,
|
|
43
40
|
cli_1.CliInternals.makeProgressBar(encodingProgress),
|
|
44
41
|
`${doneIn === null ? 'Encoding' : 'Encoded'} chunks`,
|
|
@@ -57,7 +54,6 @@ const makeEncodingProgress = ({ encodingProgress, chunkProgress, totalSteps, tot
|
|
|
57
54
|
return '';
|
|
58
55
|
}
|
|
59
56
|
return [
|
|
60
|
-
'📽 ',
|
|
61
57
|
`(4/${totalSteps})`,
|
|
62
58
|
cli_1.CliInternals.makeProgressBar(progress),
|
|
63
59
|
`${timeToEncode === null ? 'Combining' : 'Combined'} videos`,
|
|
@@ -72,7 +68,6 @@ const makeCleanupProgress = (cleanupInfo, totalSteps, skipped) => {
|
|
|
72
68
|
}
|
|
73
69
|
if (skipped) {
|
|
74
70
|
return [
|
|
75
|
-
'🪣 ',
|
|
76
71
|
`(5/${totalSteps})`,
|
|
77
72
|
cli_1.CliInternals.chalk.blueBright(`Not cleaning up because --log=verbose was set`),
|
|
78
73
|
].join(' ');
|
|
@@ -80,7 +75,6 @@ const makeCleanupProgress = (cleanupInfo, totalSteps, skipped) => {
|
|
|
80
75
|
const { doneIn, filesDeleted, minFilesToDelete } = cleanupInfo;
|
|
81
76
|
const progress = filesDeleted / minFilesToDelete;
|
|
82
77
|
return [
|
|
83
|
-
'🪣 ',
|
|
84
78
|
`(5/${totalSteps})`,
|
|
85
79
|
cli_1.CliInternals.makeProgressBar(progress),
|
|
86
80
|
`${doneIn === null ? 'Cleaning up' : 'Cleaned up'} artifacts`,
|
|
@@ -91,7 +85,6 @@ const makeCleanupProgress = (cleanupInfo, totalSteps, skipped) => {
|
|
|
91
85
|
};
|
|
92
86
|
const makeDownloadProgress = (downloadInfo, totalSteps) => {
|
|
93
87
|
return [
|
|
94
|
-
'💾',
|
|
95
88
|
`(6/${totalSteps})`,
|
|
96
89
|
downloadInfo.totalSize === null
|
|
97
90
|
? cli_1.CliInternals.getFileSizeDownloadBar(downloadInfo.downloaded)
|
|
@@ -20,7 +20,7 @@ const log_1 = require("../../log");
|
|
|
20
20
|
const progress_1 = require("./progress");
|
|
21
21
|
exports.RENDER_COMMAND = 'render';
|
|
22
22
|
const renderCommand = async (args, remotionRoot) => {
|
|
23
|
-
var _a, _b, _c, _d, _e;
|
|
23
|
+
var _a, _b, _c, _d, _e, _f;
|
|
24
24
|
const serveUrl = args[0];
|
|
25
25
|
if (!serveUrl) {
|
|
26
26
|
log_1.Log.error('No serve URL passed.');
|
|
@@ -94,6 +94,7 @@ const renderCommand = async (args, remotionRoot) => {
|
|
|
94
94
|
secret: (_e = args_1.parsedLambdaCli['webhook-secret']) !== null && _e !== void 0 ? _e : null,
|
|
95
95
|
}
|
|
96
96
|
: undefined,
|
|
97
|
+
rendererFunctionName: (_f = args_1.parsedLambdaCli['renderer-function-name']) !== null && _f !== void 0 ? _f : null,
|
|
97
98
|
});
|
|
98
99
|
const totalSteps = downloadName ? 6 : 5;
|
|
99
100
|
const progressBar = cli_1.CliInternals.createOverwriteableCliOutput(cli_1.CliInternals.quietFlagProvided());
|
|
@@ -4,6 +4,7 @@ exports.findFunctionName = void 0;
|
|
|
4
4
|
const version_1 = require("remotion/version");
|
|
5
5
|
const get_functions_1 = require("../../api/get-functions");
|
|
6
6
|
const constants_1 = require("../../shared/constants");
|
|
7
|
+
const args_1 = require("../args");
|
|
7
8
|
const functions_1 = require("../commands/functions");
|
|
8
9
|
const deploy_1 = require("../commands/functions/deploy");
|
|
9
10
|
const ls_1 = require("../commands/functions/ls");
|
|
@@ -16,7 +17,7 @@ const findFunctionName = async () => {
|
|
|
16
17
|
region: (0, get_aws_region_1.getAwsRegion)(),
|
|
17
18
|
compatibleOnly: false,
|
|
18
19
|
});
|
|
19
|
-
|
|
20
|
+
let lambdasWithMatchingVersion = remotionLambdas.filter((l) => l.version === version_1.VERSION);
|
|
20
21
|
if (lambdasWithMatchingVersion.length === 0) {
|
|
21
22
|
log_1.Log.error(`No lambda functions with version ${version_1.VERSION} found in your account.`);
|
|
22
23
|
if (remotionLambdas.length > 0) {
|
|
@@ -28,11 +29,39 @@ const findFunctionName = async () => {
|
|
|
28
29
|
(0, quit_1.quit)(1);
|
|
29
30
|
}
|
|
30
31
|
if (lambdasWithMatchingVersion.length > 1) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
if (args_1.parsedLambdaCli['function-name']) {
|
|
33
|
+
const prevFunctions = [...lambdasWithMatchingVersion];
|
|
34
|
+
lambdasWithMatchingVersion = lambdasWithMatchingVersion.filter((l) => l.functionName === args_1.parsedLambdaCli['function-name']);
|
|
35
|
+
if (lambdasWithMatchingVersion.length === 0) {
|
|
36
|
+
log_1.Log.error(`No lambda function with name "${args_1.parsedLambdaCli['function-name']}" and version ${version_1.VERSION} found in your account.`);
|
|
37
|
+
log_1.Log.info();
|
|
38
|
+
if (prevFunctions.length === 0) {
|
|
39
|
+
log_1.Log.info(`No functions for version ${version_1.VERSION} were found, deploy one using:`);
|
|
40
|
+
log_1.Log.info(` npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${deploy_1.FUNCTIONS_DEPLOY_SUBCOMMAND}`);
|
|
41
|
+
(0, quit_1.quit)(1);
|
|
42
|
+
}
|
|
43
|
+
log_1.Log.info('The following functions were found:');
|
|
44
|
+
for (const l of prevFunctions) {
|
|
45
|
+
log_1.Log.info(`- ${l.functionName} (v${l.version})`);
|
|
46
|
+
}
|
|
47
|
+
log_1.Log.info('Remove the `--function-name` parameter use one of them.');
|
|
48
|
+
(0, quit_1.quit)(1);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
log_1.Log.error('More than 1 lambda function found in your account. Unsure which one to use.');
|
|
53
|
+
log_1.Log.info();
|
|
54
|
+
log_1.Log.info('Possible solutions:');
|
|
55
|
+
log_1.Log.info('- Define using `--function-name` which function you want to use.');
|
|
56
|
+
log_1.Log.info(`- Delete extraneous lambda functions in your AWS console or using:`);
|
|
57
|
+
log_1.Log.info(` npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${rm_1.FUNCTIONS_RM_SUBCOMMAND} $(npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${ls_1.FUNCTIONS_LS_SUBCOMMAND} -q) -y`);
|
|
58
|
+
log_1.Log.info();
|
|
59
|
+
log_1.Log.info(`The following functions were found (only showing v${version_1.VERSION}):`);
|
|
60
|
+
for (const l of lambdasWithMatchingVersion) {
|
|
61
|
+
log_1.Log.info(`- ${l.functionName}`);
|
|
62
|
+
}
|
|
63
|
+
(0, quit_1.quit)(1);
|
|
64
|
+
}
|
|
36
65
|
}
|
|
37
66
|
const { functionName } = lambdasWithMatchingVersion[0];
|
|
38
67
|
return functionName;
|
|
@@ -5,7 +5,6 @@ const cli_1 = require("@remotion/cli");
|
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const makeBundleProgress = ({ progress, doneIn }) => {
|
|
7
7
|
return [
|
|
8
|
-
'📦',
|
|
9
8
|
`(1/3)`,
|
|
10
9
|
cli_1.CliInternals.makeProgressBar(progress / 100),
|
|
11
10
|
`${doneIn === null ? 'Bundling' : 'Bundled'} video`,
|
|
@@ -20,7 +19,6 @@ const makeBucketProgress = ({ bucketCreated, doneIn, }) => {
|
|
|
20
19
|
const statesFinished = states.filter(Boolean).map((p) => p).length;
|
|
21
20
|
const progress = statesFinished / states.length;
|
|
22
21
|
return [
|
|
23
|
-
'🪣 ',
|
|
24
22
|
`(2/3)`,
|
|
25
23
|
cli_1.CliInternals.makeProgressBar(progress),
|
|
26
24
|
`${doneIn === null ? 'Creating' : 'Created'} bucket`,
|
|
@@ -48,7 +46,6 @@ const makeUploadDiff = ({ stats }) => {
|
|
|
48
46
|
const makeDeployProgressBar = ({ sizeUploaded, totalSize, doneIn, stats, }) => {
|
|
49
47
|
const progress = totalSize === null ? 0 : sizeUploaded / totalSize;
|
|
50
48
|
return [
|
|
51
|
-
'☁️ ',
|
|
52
49
|
`(3/3)`,
|
|
53
50
|
cli_1.CliInternals.makeProgressBar(progress),
|
|
54
51
|
`${doneIn === null ? 'Uploading' : 'Uploaded'} to S3`,
|
package/dist/functions/launch.js
CHANGED
|
@@ -57,10 +57,10 @@ const timer_1 = require("./helpers/timer");
|
|
|
57
57
|
const validate_composition_1 = require("./helpers/validate-composition");
|
|
58
58
|
const write_lambda_error_1 = require("./helpers/write-lambda-error");
|
|
59
59
|
const write_post_render_data_1 = require("./helpers/write-post-render-data");
|
|
60
|
-
const callFunctionWithRetry = async (payload, retries
|
|
60
|
+
const callFunctionWithRetry = async ({ payload, retries, functionName, }) => {
|
|
61
61
|
try {
|
|
62
62
|
await (0, aws_clients_1.getLambdaClient)((0, get_current_region_1.getCurrentRegionInFunction)()).send(new client_lambda_1.InvokeCommand({
|
|
63
|
-
FunctionName:
|
|
63
|
+
FunctionName: functionName,
|
|
64
64
|
// @ts-expect-error
|
|
65
65
|
Payload: JSON.stringify(payload),
|
|
66
66
|
InvocationType: 'Event',
|
|
@@ -74,15 +74,20 @@ const callFunctionWithRetry = async (payload, retries = 0) => {
|
|
|
74
74
|
await new Promise((resolve) => {
|
|
75
75
|
setTimeout(resolve, 1000);
|
|
76
76
|
});
|
|
77
|
-
return callFunctionWithRetry(
|
|
77
|
+
return callFunctionWithRetry({
|
|
78
|
+
payload,
|
|
79
|
+
retries: retries + 1,
|
|
80
|
+
functionName,
|
|
81
|
+
});
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
};
|
|
81
85
|
const innerLaunchHandler = async (params, options) => {
|
|
82
|
-
var _a, _b, _c, _d;
|
|
86
|
+
var _a, _b, _c, _d, _e;
|
|
83
87
|
if (params.type !== constants_1.LambdaRoutines.launch) {
|
|
84
88
|
throw new Error('Expected launch type');
|
|
85
89
|
}
|
|
90
|
+
const functionName = (_a = params.rendererFunctionName) !== null && _a !== void 0 ? _a : process.env.AWS_LAMBDA_FUNCTION_NAME;
|
|
86
91
|
const startedDate = Date.now();
|
|
87
92
|
let webhookInvoked = false;
|
|
88
93
|
console.log(`Function has ${Math.max(options.getRemainingTimeInMillis() - 1000, 1000)} before it times out`);
|
|
@@ -161,7 +166,7 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
161
166
|
renderer_1.RenderInternals.validateConcurrency(params.concurrencyPerLambda, 'concurrencyPerLambda');
|
|
162
167
|
const realFrameRange = renderer_1.RenderInternals.getRealFrameRange(comp.durationInFrames, params.frameRange);
|
|
163
168
|
const frameCount = renderer_1.RenderInternals.getFramesToRender(realFrameRange, params.everyNthFrame);
|
|
164
|
-
const framesPerLambda = (
|
|
169
|
+
const framesPerLambda = (_b = params.framesPerLambda) !== null && _b !== void 0 ? _b : (0, best_frames_per_lambda_param_1.bestFramesPerLambdaParam)(frameCount.length);
|
|
165
170
|
(0, validate_frames_per_lambda_1.validateFramesPerLambda)({
|
|
166
171
|
framesPerLambda,
|
|
167
172
|
durationInFrames: frameCount.length,
|
|
@@ -215,6 +220,9 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
215
220
|
muted: params.muted,
|
|
216
221
|
audioBitrate: params.audioBitrate,
|
|
217
222
|
videoBitrate: params.videoBitrate,
|
|
223
|
+
launchFunctionConfig: {
|
|
224
|
+
version: version_1.VERSION,
|
|
225
|
+
},
|
|
218
226
|
};
|
|
219
227
|
return payload;
|
|
220
228
|
});
|
|
@@ -241,14 +249,14 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
241
249
|
memorySizeInMb: Number(process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE),
|
|
242
250
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
243
251
|
renderId: params.renderId,
|
|
244
|
-
outName: (
|
|
252
|
+
outName: (_c = params.outName) !== null && _c !== void 0 ? _c : undefined,
|
|
245
253
|
privacy: params.privacy,
|
|
246
254
|
everyNthFrame: params.everyNthFrame,
|
|
247
255
|
frameRange: realFrameRange,
|
|
248
256
|
};
|
|
249
257
|
const { key, renderBucketName, customCredentials } = (0, expected_out_name_1.getExpectedOutName)(renderMetadata, params.bucketName, typeof params.outName === 'string' || typeof params.outName === 'undefined'
|
|
250
258
|
? null
|
|
251
|
-
: (
|
|
259
|
+
: (_e = (_d = params.outName) === null || _d === void 0 ? void 0 : _d.s3OutputProvider) !== null && _e !== void 0 ? _e : null);
|
|
252
260
|
const output = await (0, find_output_file_in_bucket_1.findOutputFileInBucket)({
|
|
253
261
|
bucketName: params.bucketName,
|
|
254
262
|
customCredentials,
|
|
@@ -281,7 +289,7 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
281
289
|
});
|
|
282
290
|
await Promise.all(lambdaPayloads.map(async (payload, index) => {
|
|
283
291
|
const callingLambdaTimer = (0, timer_1.timer)('Calling chunk ' + index);
|
|
284
|
-
await callFunctionWithRetry(payload);
|
|
292
|
+
await callFunctionWithRetry({ payload, retries: 0, functionName });
|
|
285
293
|
callingLambdaTimer.end();
|
|
286
294
|
}));
|
|
287
295
|
reqSend.end();
|
|
@@ -8,6 +8,7 @@ const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
|
8
8
|
const renderer_1 = require("@remotion/renderer");
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const version_1 = require("remotion/version");
|
|
11
12
|
const aws_clients_1 = require("../shared/aws-clients");
|
|
12
13
|
const chunk_progress_1 = require("../shared/chunk-progress");
|
|
13
14
|
const constants_1 = require("../shared/constants");
|
|
@@ -21,6 +22,9 @@ const renderHandler = async (params, options, logs) => {
|
|
|
21
22
|
if (params.type !== constants_1.LambdaRoutines.renderer) {
|
|
22
23
|
throw new Error('Params must be renderer');
|
|
23
24
|
}
|
|
25
|
+
if (params.launchFunctionConfig.version !== version_1.VERSION) {
|
|
26
|
+
throw new Error(`The version of the function that was specified as "rendererFunctionName" is ${version_1.VERSION} but the version of the function that invoked the render is ${params.launchFunctionConfig.version}. Please make sure that the version of the function that is specified as "rendererFunctionName" is the same as the version of the function that is invoked.`);
|
|
27
|
+
}
|
|
24
28
|
const inputPropsPromise = (0, deserialize_input_props_1.deserializeInputProps)({
|
|
25
29
|
bucketName: params.bucketName,
|
|
26
30
|
expectedBucketOwner: options.expectedBucketOwner,
|
package/dist/functions/start.js
CHANGED
|
@@ -75,6 +75,7 @@ const startHandler = async (params, options) => {
|
|
|
75
75
|
videoBitrate: params.videoBitrate,
|
|
76
76
|
forceHeight: params.forceHeight,
|
|
77
77
|
forceWidth: params.forceWidth,
|
|
78
|
+
rendererFunctionName: params.rendererFunctionName,
|
|
78
79
|
};
|
|
79
80
|
await (0, aws_clients_1.getLambdaClient)((0, get_current_region_1.getCurrentRegionInFunction)()).send(new client_lambda_1.InvokeCommand({
|
|
80
81
|
FunctionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
|
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ import type { LambdaArchitecture } from './shared/validate-architecture';
|
|
|
46
46
|
/**
|
|
47
47
|
* @deprecated Import this from `@remotion/lambda/client` instead
|
|
48
48
|
*/
|
|
49
|
-
declare const renderMediaOnLambda: ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, logLevel, frameRange, outName, timeoutInMilliseconds, chromiumOptions, scale, numberOfGifLoops, everyNthFrame, concurrencyPerLambda, downloadBehavior, muted, overwrite, audioBitrate, videoBitrate, webhook, forceHeight, forceWidth, }: RenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
|
|
49
|
+
declare const renderMediaOnLambda: ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, logLevel, frameRange, outName, timeoutInMilliseconds, chromiumOptions, scale, numberOfGifLoops, everyNthFrame, concurrencyPerLambda, downloadBehavior, muted, overwrite, audioBitrate, videoBitrate, webhook, forceHeight, forceWidth, rendererFunctionName, }: RenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
|
|
50
50
|
/**
|
|
51
51
|
* @deprecated Import this from `@remotion/lambda/client` instead
|
|
52
52
|
*/
|
|
@@ -110,6 +110,7 @@ export declare type LambdaPayloads = {
|
|
|
110
110
|
type: LambdaRoutines.info;
|
|
111
111
|
};
|
|
112
112
|
start: {
|
|
113
|
+
rendererFunctionName: string | null;
|
|
113
114
|
type: LambdaRoutines.start;
|
|
114
115
|
serveUrl: string;
|
|
115
116
|
composition: string;
|
|
@@ -144,6 +145,7 @@ export declare type LambdaPayloads = {
|
|
|
144
145
|
forceWidth: number | null;
|
|
145
146
|
};
|
|
146
147
|
launch: {
|
|
148
|
+
rendererFunctionName: string | null;
|
|
147
149
|
type: LambdaRoutines.launch;
|
|
148
150
|
serveUrl: string;
|
|
149
151
|
composition: string;
|
|
@@ -217,6 +219,9 @@ export declare type LambdaPayloads = {
|
|
|
217
219
|
muted: boolean;
|
|
218
220
|
audioBitrate: string | null;
|
|
219
221
|
videoBitrate: string | null;
|
|
222
|
+
launchFunctionConfig: {
|
|
223
|
+
version: string;
|
|
224
|
+
};
|
|
220
225
|
};
|
|
221
226
|
still: {
|
|
222
227
|
type: LambdaRoutines.still;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { AwsRegion } from '../client';
|
|
2
2
|
import type { LambdaRoutines } from './constants';
|
|
3
|
-
export declare const getCloudwatchStreamUrl: ({ region, functionName, method, renderId, }: {
|
|
3
|
+
export declare const getCloudwatchStreamUrl: ({ region, functionName, method, renderId, rendererFunctionName, }: {
|
|
4
4
|
region: AwsRegion;
|
|
5
5
|
functionName: string;
|
|
6
|
+
rendererFunctionName: string | null;
|
|
6
7
|
method: LambdaRoutines;
|
|
7
8
|
renderId: string;
|
|
8
9
|
}) => string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getS3RenderUrl = exports.getCloudwatchStreamUrl = void 0;
|
|
4
|
-
const getCloudwatchStreamUrl = ({ region, functionName, method, renderId, }) => {
|
|
5
|
-
|
|
4
|
+
const getCloudwatchStreamUrl = ({ region, functionName, method, renderId, rendererFunctionName, }) => {
|
|
5
|
+
const functionNameToUse = rendererFunctionName !== null && rendererFunctionName !== void 0 ? rendererFunctionName : functionName;
|
|
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$2522method$253D${method}$252CrenderId$253D${renderId}$2522`;
|
|
6
7
|
};
|
|
7
8
|
exports.getCloudwatchStreamUrl = getCloudwatchStreamUrl;
|
|
8
9
|
const getS3RenderUrl = ({ renderId, region, bucketName, }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.39",
|
|
4
4
|
"description": "Distributed renderer for Remotion based on AWS Lambda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"@aws-sdk/credential-providers": "3.215.0",
|
|
34
34
|
"@aws-sdk/lib-storage": "3.215.0",
|
|
35
35
|
"@aws-sdk/s3-request-presigner": "3.215.0",
|
|
36
|
-
"@remotion/bundler": "3.3.
|
|
37
|
-
"@remotion/cli": "3.3.
|
|
38
|
-
"@remotion/renderer": "3.3.
|
|
36
|
+
"@remotion/bundler": "3.3.39",
|
|
37
|
+
"@remotion/cli": "3.3.39",
|
|
38
|
+
"@remotion/renderer": "3.3.39",
|
|
39
39
|
"aws-policies": "^1.0.1",
|
|
40
40
|
"mime-types": "2.1.34",
|
|
41
|
-
"remotion": "3.3.
|
|
41
|
+
"remotion": "3.3.39"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@jonny/eslint-config": "3.0.266",
|
|
45
|
-
"@remotion/compositor-linux-arm64-musl": "3.3.
|
|
46
|
-
"@remotion/compositor-linux-x64-musl": "3.3.
|
|
45
|
+
"@remotion/compositor-linux-arm64-musl": "3.3.39",
|
|
46
|
+
"@remotion/compositor-linux-x64-musl": "3.3.39",
|
|
47
47
|
"@types/mime-types": "2.1.1",
|
|
48
48
|
"@types/minimist": "1.2.2",
|
|
49
49
|
"@types/node": "^14.14.14",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "5a07260074fe3a6db2cdba0001503c665951414d"
|
|
63
63
|
}
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|
package/remotionlambda-x64.zip
CHANGED
|
Binary file
|