@remotion/lambda 4.0.194 → 4.0.196
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-site.d.ts +3 -3
- package/dist/cli/commands/render/render.js +1 -0
- package/dist/cli/index.js +1 -0
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +4 -1
- package/dist/functions/helpers/expected-out-name.d.ts +1 -1
- package/dist/functions/helpers/get-browser-instance.d.ts +3 -2
- package/dist/functions/helpers/get-browser-instance.js +3 -4
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/helpers/get-custom-out-name.d.ts +1 -1
- package/dist/functions/helpers/io.d.ts +3 -33
- package/dist/functions/helpers/io.js +3 -104
- package/dist/functions/helpers/print-cloudwatch-helper.d.ts +1 -1
- package/dist/functions/helpers/print-cloudwatch-helper.js +3 -3
- package/dist/functions/helpers/write-lambda-error.d.ts +2 -3
- package/dist/functions/helpers/write-lambda-error.js +3 -2
- package/dist/functions/provider-implementation.d.ts +0 -0
- package/dist/functions/provider-implementation.js +1 -0
- package/dist/functions/renderer.js +1 -1
- package/dist/internals.d.ts +6 -6
- package/dist/shared/compress-props.d.ts +8 -6
- package/dist/shared/compress-props.js +11 -14
- package/dist/shared/constants.d.ts +2 -2
- package/dist/shared/constants.js +6 -3
- package/package.json +11 -11
- package/remotionlambda-arm64.zip +0 -0
- package/dist/functions/helpers/check-if-render-exists.d.ts +0 -3
- package/dist/functions/helpers/check-if-render-exists.js +0 -15
- package/dist/functions/helpers/delete-chunks.d.ts +0 -9
- package/dist/functions/helpers/delete-chunks.js +0 -25
- package/dist/functions/helpers/get-cleanup-progress.d.ts +0 -10
- package/dist/functions/helpers/get-cleanup-progress.js +0 -35
- package/dist/functions/helpers/get-encoding-metadata.d.ts +0 -7
- package/dist/functions/helpers/get-encoding-metadata.js +0 -15
- package/dist/functions/helpers/get-encoding-progress-step-size.d.ts +0 -1
- package/dist/functions/helpers/get-encoding-progress-step-size.js +0 -7
- package/dist/functions/helpers/get-files-to-delete.d.ts +0 -10
- package/dist/functions/helpers/get-files-to-delete.js +0 -52
- package/dist/functions/helpers/get-final-encoding-status.d.ts +0 -6
- package/dist/functions/helpers/get-final-encoding-status.js +0 -18
- package/dist/functions/helpers/get-folder-size.d.ts +0 -1
- package/dist/functions/helpers/get-folder-size.js +0 -8
- package/dist/functions/helpers/get-lambdas-invoked-stats.d.ts +0 -8
- package/dist/functions/helpers/get-lambdas-invoked-stats.js +0 -14
- package/dist/functions/helpers/get-post-render-data.d.ts +0 -8
- package/dist/functions/helpers/get-post-render-data.js +0 -22
- package/dist/functions/helpers/get-render-metadata.d.ts +0 -8
- package/dist/functions/helpers/get-render-metadata.js +0 -17
- package/dist/functions/helpers/get-rendered-frames-progress.d.ts +0 -8
- package/dist/functions/helpers/get-rendered-frames-progress.js +0 -37
- package/dist/functions/helpers/get-time-to-finish.d.ts +0 -5
- package/dist/functions/helpers/get-time-to-finish.js +0 -13
- package/dist/functions/helpers/streaming-payloads.d.ts +0 -19
- package/dist/functions/helpers/streaming-payloads.js +0 -25
- package/dist/functions/helpers/write-post-render-data.d.ts +0 -9
- package/dist/functions/helpers/write-post-render-data.js +0 -18
- package/dist/functions/merge.d.ts +0 -9
- package/dist/functions/merge.js +0 -61
- package/dist/shared/chunk-progress.d.ts +0 -9
- package/dist/shared/chunk-progress.js +0 -2034
- package/dist/shared/parse-chunk-key.d.ts +0 -5
- package/dist/shared/parse-chunk-key.js +0 -15
- package/dist/shared/parse-lambda-initialized-key.d.ts +0 -5
- package/dist/shared/parse-lambda-initialized-key.js +0 -15
- package/dist/shared/serialize-props.d.ts +0 -14
- package/dist/shared/serialize-props.js +0 -36
|
@@ -61,11 +61,11 @@ export declare const internalDeploySite: (args_0: MandatoryParameters & {
|
|
|
61
61
|
getValue: ({ commandLine }: {
|
|
62
62
|
commandLine: Record<string, unknown>;
|
|
63
63
|
}) => {
|
|
64
|
-
value: "
|
|
64
|
+
value: "verbose" | "info" | "warn" | "error";
|
|
65
65
|
source: string;
|
|
66
66
|
};
|
|
67
|
-
setConfig: (newLogLevel: "
|
|
68
|
-
type: "
|
|
67
|
+
setConfig: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
|
|
68
|
+
type: "verbose" | "info" | "warn" | "error";
|
|
69
69
|
};
|
|
70
70
|
readonly throwIfSiteExists: {
|
|
71
71
|
cliFlag: string;
|
package/dist/cli/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CustomCredentials, OutNameInput } from '@remotion/serverless/client';
|
|
2
2
|
import type { OutNameOutput, RenderMetadata } from '../../defaults';
|
|
3
3
|
export declare const getCredentialsFromOutName: <Region extends string>(name: OutNameInput<Region> | null) => CustomCredentials<Region> | null;
|
|
4
|
-
export declare const getExpectedOutName: <Region extends string>(renderMetadata: RenderMetadata
|
|
4
|
+
export declare const getExpectedOutName: <Region extends string>(renderMetadata: RenderMetadata, bucketName: string, customCredentials: CustomCredentials<Region> | null) => OutNameOutput<Region>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { ChromiumOptions, LogLevel, openBrowser } from '@remotion/renderer';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ProviderSpecifics } from '@remotion/serverless';
|
|
3
|
+
import type { Await } from '@remotion/serverless/client';
|
|
3
4
|
type LaunchedBrowser = {
|
|
4
5
|
instance: Await<ReturnType<typeof openBrowser>>;
|
|
5
6
|
configurationString: string;
|
|
6
7
|
};
|
|
7
8
|
export declare const forgetBrowserEventLoop: (logLevel: LogLevel) => void;
|
|
8
|
-
export declare const getBrowserInstance: (logLevel: LogLevel, indent: boolean, chromiumOptions: ChromiumOptions) => Promise<LaunchedBrowser>;
|
|
9
|
+
export declare const getBrowserInstance: (logLevel: LogLevel, indent: boolean, chromiumOptions: ChromiumOptions, providerSpecifics: ProviderSpecifics) => Promise<LaunchedBrowser>;
|
|
9
10
|
export {};
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getBrowserInstance = exports.forgetBrowserEventLoop = void 0;
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
5
|
const version_1 = require("remotion/version");
|
|
6
|
-
const get_chromium_executable_path_1 = require("./get-chromium-executable-path");
|
|
7
6
|
const makeConfigurationString = (options, logLevel) => {
|
|
8
7
|
var _a, _b, _c;
|
|
9
8
|
return [
|
|
@@ -37,7 +36,7 @@ const forgetBrowserEventLoop = (logLevel) => {
|
|
|
37
36
|
_browserInstance === null || _browserInstance === void 0 ? void 0 : _browserInstance.instance.forgetEventLoop();
|
|
38
37
|
};
|
|
39
38
|
exports.forgetBrowserEventLoop = forgetBrowserEventLoop;
|
|
40
|
-
const getBrowserInstance = async (logLevel, indent, chromiumOptions) => {
|
|
39
|
+
const getBrowserInstance = async (logLevel, indent, chromiumOptions, providerSpecifics) => {
|
|
41
40
|
var _a;
|
|
42
41
|
const actualChromiumOptions = {
|
|
43
42
|
...chromiumOptions,
|
|
@@ -57,7 +56,7 @@ const getBrowserInstance = async (logLevel, indent, chromiumOptions) => {
|
|
|
57
56
|
if (!_browserInstance) {
|
|
58
57
|
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Cold Lambda function, launching new browser instance');
|
|
59
58
|
launching = true;
|
|
60
|
-
const execPath =
|
|
59
|
+
const execPath = providerSpecifics.getChromiumPath();
|
|
61
60
|
const instance = await renderer_1.RenderInternals.internalOpenBrowser({
|
|
62
61
|
browser: 'chrome',
|
|
63
62
|
browserExecutable: execPath,
|
|
@@ -91,7 +90,7 @@ const getBrowserInstance = async (logLevel, indent, chromiumOptions) => {
|
|
|
91
90
|
_browserInstance.instance.rememberEventLoop();
|
|
92
91
|
await _browserInstance.instance.close(true, logLevel, indent);
|
|
93
92
|
_browserInstance = null;
|
|
94
|
-
return (0, exports.getBrowserInstance)(logLevel, indent, chromiumOptions);
|
|
93
|
+
return (0, exports.getBrowserInstance)(logLevel, indent, chromiumOptions, providerSpecifics);
|
|
95
94
|
}
|
|
96
95
|
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Warm Lambda function, reusing browser instance');
|
|
97
96
|
_browserInstance.instance.rememberEventLoop();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getCurrentRegionInFunctionImplementation: () => "
|
|
1
|
+
export declare const getCurrentRegionInFunctionImplementation: () => "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";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CustomCredentials, OutNameInput } from '@remotion/serverless/client';
|
|
2
2
|
import type { RenderMetadata } from '../../defaults';
|
|
3
3
|
export declare const getCustomOutName: <Region extends string>({ renderMetadata, customCredentials, }: {
|
|
4
|
-
renderMetadata: RenderMetadata
|
|
4
|
+
renderMetadata: RenderMetadata;
|
|
5
5
|
customCredentials: CustomCredentials<Region> | null;
|
|
6
6
|
}) => OutNameInput<Region> | null;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import type { _Object } from '@aws-sdk/client-s3';
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type { Readable } from 'stream';
|
|
2
|
+
import type { CustomCredentials } from '@remotion/serverless/client';
|
|
3
|
+
import type { AwsRegion } from '../../regions';
|
|
7
4
|
export type LambdaLSInput = {
|
|
8
5
|
bucketName: string;
|
|
9
6
|
prefix: string;
|
|
@@ -12,39 +9,12 @@ export type LambdaLSInput = {
|
|
|
12
9
|
continuationToken?: string;
|
|
13
10
|
};
|
|
14
11
|
export type LambdaLsReturnType = Promise<_Object[]>;
|
|
15
|
-
export declare const lambdaLs: ({ bucketName, prefix, region, expectedBucketOwner, continuationToken, }: LambdaLSInput) => LambdaLsReturnType;
|
|
16
|
-
export declare const lambdaDeleteFile: ({ bucketName, key, region, customCredentials, }: {
|
|
17
|
-
region: AwsRegion;
|
|
18
|
-
bucketName: string;
|
|
19
|
-
key: string;
|
|
20
|
-
customCredentials: CustomCredentials | null;
|
|
21
|
-
}) => Promise<void>;
|
|
22
|
-
type LambdaWriteFileInput = {
|
|
23
|
-
bucketName: string;
|
|
24
|
-
key: string;
|
|
25
|
-
body: ReadStream | string | Uint8Array;
|
|
26
|
-
region: AwsRegion;
|
|
27
|
-
privacy: Privacy;
|
|
28
|
-
expectedBucketOwner: string | null;
|
|
29
|
-
downloadBehavior: DownloadBehavior | null;
|
|
30
|
-
customCredentials: CustomCredentials | null;
|
|
31
|
-
};
|
|
32
|
-
export declare const lambdaWriteFile: (params: LambdaWriteFileInput & {
|
|
33
|
-
retries?: number;
|
|
34
|
-
}) => Promise<void>;
|
|
35
|
-
export declare const lambdaReadFile: ({ bucketName, key, region, expectedBucketOwner, }: {
|
|
36
|
-
bucketName: string;
|
|
37
|
-
key: string;
|
|
38
|
-
region: AwsRegion;
|
|
39
|
-
expectedBucketOwner: string;
|
|
40
|
-
}) => Promise<Readable>;
|
|
41
12
|
export declare const lambdaHeadCommand: ({ bucketName, key, region, customCredentials, }: {
|
|
42
13
|
bucketName: string;
|
|
43
14
|
key: string;
|
|
44
15
|
region: AwsRegion;
|
|
45
|
-
customCredentials: CustomCredentials | null;
|
|
16
|
+
customCredentials: CustomCredentials<AwsRegion> | null;
|
|
46
17
|
}) => Promise<{
|
|
47
18
|
LastModified?: Date | undefined;
|
|
48
19
|
ContentLength?: number | undefined;
|
|
49
20
|
}>;
|
|
50
|
-
export {};
|
|
@@ -1,111 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.lambdaHeadCommand =
|
|
3
|
+
exports.lambdaHeadCommand = void 0;
|
|
7
4
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
8
|
-
const
|
|
9
|
-
const aws_clients_1 = require("../../shared/aws-clients");
|
|
10
|
-
const content_disposition_header_1 = require("../../shared/content-disposition-header");
|
|
11
|
-
const lambdaLs = async ({ bucketName, prefix, region, expectedBucketOwner, continuationToken, }) => {
|
|
12
|
-
var _a, _b, _c;
|
|
13
|
-
try {
|
|
14
|
-
const list = await (0, aws_clients_1.getS3Client)(region, null).send(new client_s3_1.ListObjectsV2Command({
|
|
15
|
-
Bucket: bucketName,
|
|
16
|
-
Prefix: prefix,
|
|
17
|
-
ExpectedBucketOwner: expectedBucketOwner !== null && expectedBucketOwner !== void 0 ? expectedBucketOwner : undefined,
|
|
18
|
-
ContinuationToken: continuationToken,
|
|
19
|
-
}));
|
|
20
|
-
if (list.NextContinuationToken) {
|
|
21
|
-
return [
|
|
22
|
-
...((_a = list.Contents) !== null && _a !== void 0 ? _a : []),
|
|
23
|
-
...(await (0, exports.lambdaLs)({
|
|
24
|
-
bucketName,
|
|
25
|
-
prefix,
|
|
26
|
-
expectedBucketOwner,
|
|
27
|
-
region,
|
|
28
|
-
continuationToken: list.NextContinuationToken,
|
|
29
|
-
})),
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
return (_b = list.Contents) !== null && _b !== void 0 ? _b : [];
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
if (!expectedBucketOwner) {
|
|
36
|
-
throw err;
|
|
37
|
-
}
|
|
38
|
-
// Prevent from accessing a foreign bucket, retry without ExpectedBucketOwner and see if it works. If it works then it's an owner mismatch.
|
|
39
|
-
if ((_c = err.stack) === null || _c === void 0 ? void 0 : _c.includes('AccessDenied')) {
|
|
40
|
-
await (0, aws_clients_1.getS3Client)(region, null).send(new client_s3_1.ListObjectsV2Command({
|
|
41
|
-
Bucket: bucketName,
|
|
42
|
-
Prefix: prefix,
|
|
43
|
-
}));
|
|
44
|
-
throw new Error(`Bucket owner mismatch: Expected the bucket ${bucketName} to be owned by you (AWS Account ID: ${expectedBucketOwner}) but it's not the case. Did you accidentially specify the wrong bucket?`);
|
|
45
|
-
}
|
|
46
|
-
throw err;
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
exports.lambdaLs = lambdaLs;
|
|
50
|
-
const lambdaDeleteFile = async ({ bucketName, key, region, customCredentials, }) => {
|
|
51
|
-
await (0, aws_clients_1.getS3Client)(region, customCredentials).send(new client_s3_1.DeleteObjectCommand({
|
|
52
|
-
Bucket: bucketName,
|
|
53
|
-
Key: key,
|
|
54
|
-
}));
|
|
55
|
-
};
|
|
56
|
-
exports.lambdaDeleteFile = lambdaDeleteFile;
|
|
57
|
-
const tryLambdaWriteFile = async ({ bucketName, key, body, region, privacy, expectedBucketOwner, downloadBehavior, customCredentials, }) => {
|
|
58
|
-
await (0, aws_clients_1.getS3Client)(region, customCredentials).send(new client_s3_1.PutObjectCommand({
|
|
59
|
-
Bucket: bucketName,
|
|
60
|
-
Key: key,
|
|
61
|
-
Body: body,
|
|
62
|
-
ACL: privacy === 'no-acl'
|
|
63
|
-
? undefined
|
|
64
|
-
: privacy === 'private'
|
|
65
|
-
? 'private'
|
|
66
|
-
: 'public-read',
|
|
67
|
-
ExpectedBucketOwner: customCredentials
|
|
68
|
-
? undefined
|
|
69
|
-
: expectedBucketOwner !== null && expectedBucketOwner !== void 0 ? expectedBucketOwner : undefined,
|
|
70
|
-
ContentType: mime_types_1.default.lookup(key) || 'application/octet-stream',
|
|
71
|
-
ContentDisposition: (0, content_disposition_header_1.getContentDispositionHeader)(downloadBehavior),
|
|
72
|
-
}));
|
|
73
|
-
};
|
|
74
|
-
const lambdaWriteFile = async (params) => {
|
|
75
|
-
var _a;
|
|
76
|
-
const remainingRetries = (_a = params.retries) !== null && _a !== void 0 ? _a : 2;
|
|
77
|
-
try {
|
|
78
|
-
await tryLambdaWriteFile(params);
|
|
79
|
-
}
|
|
80
|
-
catch (err) {
|
|
81
|
-
if (remainingRetries === 0) {
|
|
82
|
-
throw err;
|
|
83
|
-
}
|
|
84
|
-
const backoff = 2 ** (2 - remainingRetries) * 2000;
|
|
85
|
-
await new Promise((resolve) => {
|
|
86
|
-
setTimeout(resolve, backoff);
|
|
87
|
-
});
|
|
88
|
-
console.warn('Failed to write file to Lambda:');
|
|
89
|
-
console.warn(err);
|
|
90
|
-
console.warn(`Retrying (${remainingRetries} retries remaining)...`);
|
|
91
|
-
return (0, exports.lambdaWriteFile)({
|
|
92
|
-
...params,
|
|
93
|
-
retries: remainingRetries - 1,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
exports.lambdaWriteFile = lambdaWriteFile;
|
|
98
|
-
const lambdaReadFile = async ({ bucketName, key, region, expectedBucketOwner, }) => {
|
|
99
|
-
const { Body } = await (0, aws_clients_1.getS3Client)(region, null).send(new client_s3_1.GetObjectCommand({
|
|
100
|
-
Bucket: bucketName,
|
|
101
|
-
Key: key,
|
|
102
|
-
ExpectedBucketOwner: expectedBucketOwner,
|
|
103
|
-
}));
|
|
104
|
-
return Body;
|
|
105
|
-
};
|
|
106
|
-
exports.lambdaReadFile = lambdaReadFile;
|
|
5
|
+
const get_s3_client_1 = require("../../shared/get-s3-client");
|
|
107
6
|
const lambdaHeadCommand = async ({ bucketName, key, region, customCredentials, }) => {
|
|
108
|
-
const head = await (0,
|
|
7
|
+
const head = await (0, get_s3_client_1.getS3Client)(region, customCredentials).send(new client_s3_1.HeadObjectCommand({
|
|
109
8
|
Bucket: bucketName,
|
|
110
9
|
Key: key,
|
|
111
10
|
}));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
2
|
import type { ServerlessRoutines } from '@remotion/serverless/client';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const printCloudwatchHelper: (type: ServerlessRoutines, data: Record<string, string | boolean>, logLevel: LogLevel) => void;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.printCloudwatchHelper = void 0;
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
|
-
const
|
|
5
|
+
const printCloudwatchHelper = (type, data, logLevel) => {
|
|
6
6
|
const d = Object.keys(data).reduce((a, b) => {
|
|
7
7
|
return [...a, `${b}=${data[b]}`];
|
|
8
8
|
}, []);
|
|
9
9
|
const msg = [`method=${type}`, ...d].join(',');
|
|
10
10
|
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, msg);
|
|
11
11
|
};
|
|
12
|
-
exports.
|
|
12
|
+
exports.printCloudwatchHelper = printCloudwatchHelper;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { FileNameAndSize } from '@remotion/serverless/client';
|
|
1
|
+
import type { FileNameAndSize } from './get-files-in-folder';
|
|
3
2
|
export type LambdaErrorInfo = {
|
|
4
3
|
type: 'renderer' | 'browser' | 'stitcher' | 'webhook' | 'artifact';
|
|
5
4
|
message: string;
|
|
@@ -16,7 +15,7 @@ export type LambdaErrorInfo = {
|
|
|
16
15
|
total: number;
|
|
17
16
|
} | null;
|
|
18
17
|
};
|
|
19
|
-
export declare const getTmpDirStateIfENoSp:
|
|
18
|
+
export declare const getTmpDirStateIfENoSp: (err: string) => LambdaErrorInfo['tmpDir'];
|
|
20
19
|
export type EnhancedErrorInfo = LambdaErrorInfo & {
|
|
21
20
|
/**
|
|
22
21
|
* @deprecated Will always be an empty string.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTmpDirStateIfENoSp = void 0;
|
|
4
|
+
const get_files_in_folder_1 = require("./get-files-in-folder");
|
|
4
5
|
const is_enosp_err_1 = require("./is-enosp-err");
|
|
5
|
-
const getTmpDirStateIfENoSp = (err
|
|
6
|
+
const getTmpDirStateIfENoSp = (err) => {
|
|
6
7
|
if (!(0, is_enosp_err_1.errorIsOutOfSpaceError)(err)) {
|
|
7
8
|
return null;
|
|
8
9
|
}
|
|
9
|
-
const files =
|
|
10
|
+
const files = (0, get_files_in_folder_1.getFolderFiles)('/tmp');
|
|
10
11
|
return {
|
|
11
12
|
files: files
|
|
12
13
|
.slice(0)
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -296,7 +296,7 @@ const rendererHandler = async ({ onStream, options, params, providerSpecifics, r
|
|
|
296
296
|
const shouldNotRetry = err.name === 'CancelledError';
|
|
297
297
|
const shouldRetry = isRetryableError && params.retriesLeft > 0 && !shouldNotRetry;
|
|
298
298
|
renderer_1.RenderInternals.Log.error({ indent: false, logLevel: params.logLevel }, `Error occurred (will retry = ${String(shouldRetry)})`);
|
|
299
|
-
renderer_1.RenderInternals.Log.error({ indent: false, logLevel: params.logLevel }, err);
|
|
299
|
+
renderer_1.RenderInternals.Log.error({ indent: false, logLevel: params.logLevel }, err.stack);
|
|
300
300
|
onStream({
|
|
301
301
|
type: 'error-occurred',
|
|
302
302
|
payload: {
|
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", implementation: import("@remotion/serverless").ProviderSpecifics<import("./functions/aws-implementation").AwsProvider> | null) => 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, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, preferLossless, }: import("./api/make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("@remotion/serverless/client").ServerlessStartPayload<import("./functions/aws-implementation").AwsProvider>>;
|
|
4
4
|
getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, logLevel, }: import("./client").GetRenderProgressInput) => import("@remotion/serverless/client").ServerlessStatusPayload<import("./functions/aws-implementation").AwsProvider>;
|
|
5
5
|
makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, }: import("./api/render-still-on-lambda").RenderStillOnLambdaNonNullInput) => Promise<{
|
|
@@ -14,7 +14,7 @@ export declare const LambdaInternals: {
|
|
|
14
14
|
maxRetries: number;
|
|
15
15
|
frame: number;
|
|
16
16
|
privacy: import("@remotion/serverless/client").Privacy;
|
|
17
|
-
logLevel: "
|
|
17
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
18
18
|
outName: import("@remotion/serverless/client").OutNameInput<import("./functions/aws-implementation").AwsProvider> | null;
|
|
19
19
|
timeoutInMilliseconds: number;
|
|
20
20
|
chromiumOptions: import("@remotion/renderer").ChromiumOptions;
|
|
@@ -31,7 +31,7 @@ export declare const LambdaInternals: {
|
|
|
31
31
|
internalDeploySite: (args_0: {
|
|
32
32
|
entryPoint: string;
|
|
33
33
|
bucketName: string;
|
|
34
|
-
region: "
|
|
34
|
+
region: "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";
|
|
35
35
|
} & {
|
|
36
36
|
siteName: string;
|
|
37
37
|
options: {
|
|
@@ -57,11 +57,11 @@ export declare const LambdaInternals: {
|
|
|
57
57
|
getValue: ({ commandLine }: {
|
|
58
58
|
commandLine: Record<string, unknown>;
|
|
59
59
|
}) => {
|
|
60
|
-
value: "
|
|
60
|
+
value: "verbose" | "info" | "warn" | "error";
|
|
61
61
|
source: string;
|
|
62
62
|
};
|
|
63
|
-
setConfig: (newLogLevel: "
|
|
64
|
-
type: "
|
|
63
|
+
setConfig: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
|
|
64
|
+
type: "verbose" | "info" | "warn" | "error";
|
|
65
65
|
};
|
|
66
66
|
readonly throwIfSiteExists: {
|
|
67
67
|
cliFlag: string;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type
|
|
1
|
+
import type { ProviderSpecifics } from '@remotion/serverless';
|
|
2
|
+
import { type SerializedInputProps } from '@remotion/serverless/client';
|
|
3
3
|
type PropsType = 'input-props' | 'resolved-props';
|
|
4
4
|
export declare const serializeOrThrow: (inputProps: Record<string, unknown>, propsType: PropsType) => string;
|
|
5
5
|
export declare const getNeedsToUpload: (type: 'still' | 'video-or-audio', sizes: number[]) => boolean;
|
|
6
|
-
export declare const compressInputProps: ({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, }: {
|
|
6
|
+
export declare const compressInputProps: <Region extends string>({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, providerSpecifics, }: {
|
|
7
7
|
stringifiedInputProps: string;
|
|
8
|
-
region:
|
|
8
|
+
region: Region;
|
|
9
9
|
userSpecifiedBucketName: string | null;
|
|
10
10
|
propsType: PropsType;
|
|
11
11
|
needsToUpload: boolean;
|
|
12
|
+
providerSpecifics: ProviderSpecifics<Region>;
|
|
12
13
|
}) => Promise<SerializedInputProps>;
|
|
13
|
-
export declare const decompressInputProps: ({ serialized, region, bucketName, expectedBucketOwner, propsType, }: {
|
|
14
|
+
export declare const decompressInputProps: <Region extends string>({ serialized, region, bucketName, expectedBucketOwner, propsType, providerSpecifics, }: {
|
|
14
15
|
serialized: SerializedInputProps;
|
|
15
|
-
region:
|
|
16
|
+
region: Region;
|
|
16
17
|
bucketName: string;
|
|
17
18
|
expectedBucketOwner: string;
|
|
18
19
|
propsType: PropsType;
|
|
20
|
+
providerSpecifics: ProviderSpecifics<Region>;
|
|
19
21
|
}) => Promise<string>;
|
|
20
22
|
export {};
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.decompressInputProps = exports.compressInputProps = exports.getNeedsToUpload = exports.serializeOrThrow = void 0;
|
|
4
|
+
const client_1 = require("@remotion/serverless/client");
|
|
4
5
|
const no_react_1 = require("remotion/no-react");
|
|
5
|
-
const get_or_create_bucket_1 = require("../api/get-or-create-bucket");
|
|
6
|
-
const io_1 = require("../functions/helpers/io");
|
|
7
|
-
const constants_1 = require("./constants");
|
|
8
|
-
const random_hash_1 = require("./random-hash");
|
|
9
|
-
const stream_to_string_1 = require("./stream-to-string");
|
|
10
6
|
const validate_webhook_1 = require("./validate-webhook");
|
|
11
7
|
const makeKey = (type, hash) => {
|
|
12
8
|
if (type === 'input-props') {
|
|
13
|
-
return (0,
|
|
9
|
+
return (0, client_1.inputPropsKey)(hash);
|
|
14
10
|
}
|
|
15
|
-
return (0,
|
|
11
|
+
return (0, client_1.resolvedPropsKey)(hash);
|
|
16
12
|
};
|
|
17
13
|
const serializeOrThrow = (inputProps, propsType) => {
|
|
18
14
|
try {
|
|
@@ -39,15 +35,16 @@ const getNeedsToUpload = (type, sizes) => {
|
|
|
39
35
|
return false;
|
|
40
36
|
};
|
|
41
37
|
exports.getNeedsToUpload = getNeedsToUpload;
|
|
42
|
-
const compressInputProps = async ({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, }) => {
|
|
43
|
-
const hash =
|
|
38
|
+
const compressInputProps = async ({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, providerSpecifics, }) => {
|
|
39
|
+
const hash = providerSpecifics.randomHash();
|
|
44
40
|
if (needsToUpload) {
|
|
45
|
-
const bucketName = userSpecifiedBucketName !== null && userSpecifiedBucketName !== void 0 ? userSpecifiedBucketName : (await (0,
|
|
41
|
+
const bucketName = userSpecifiedBucketName !== null && userSpecifiedBucketName !== void 0 ? userSpecifiedBucketName : (await (0, client_1.internalGetOrCreateBucket)({
|
|
46
42
|
region,
|
|
47
43
|
enableFolderExpiry: null,
|
|
48
44
|
customCredentials: null,
|
|
45
|
+
providerSpecifics,
|
|
49
46
|
})).bucketName;
|
|
50
|
-
await
|
|
47
|
+
await providerSpecifics.writeFile({
|
|
51
48
|
body: stringifiedInputProps,
|
|
52
49
|
bucketName,
|
|
53
50
|
region,
|
|
@@ -69,18 +66,18 @@ const compressInputProps = async ({ stringifiedInputProps, region, userSpecified
|
|
|
69
66
|
};
|
|
70
67
|
};
|
|
71
68
|
exports.compressInputProps = compressInputProps;
|
|
72
|
-
const decompressInputProps = async ({ serialized, region, bucketName, expectedBucketOwner, propsType, }) => {
|
|
69
|
+
const decompressInputProps = async ({ serialized, region, bucketName, expectedBucketOwner, propsType, providerSpecifics, }) => {
|
|
73
70
|
if (serialized.type === 'payload') {
|
|
74
71
|
return serialized.payload;
|
|
75
72
|
}
|
|
76
73
|
try {
|
|
77
|
-
const response = await
|
|
74
|
+
const response = await providerSpecifics.readFile({
|
|
78
75
|
bucketName,
|
|
79
76
|
expectedBucketOwner,
|
|
80
77
|
key: makeKey(propsType, serialized.hash),
|
|
81
78
|
region,
|
|
82
79
|
});
|
|
83
|
-
const body = await (0,
|
|
80
|
+
const body = await (0, client_1.streamToString)(response);
|
|
84
81
|
const payload = body;
|
|
85
82
|
return payload;
|
|
86
83
|
}
|
|
@@ -17,9 +17,9 @@ export declare const COMMAND_NOT_FOUND = "Command not found";
|
|
|
17
17
|
export declare const DEFAULT_REGION: AwsRegion;
|
|
18
18
|
export declare const DEFAULT_MAX_RETRIES = 1;
|
|
19
19
|
export declare const MAX_FUNCTIONS_PER_RENDER = 200;
|
|
20
|
-
export declare const DEFAULT_EPHEMERAL_STORAGE_IN_MB = 2048;
|
|
21
|
-
export declare const MIN_EPHEMERAL_STORAGE_IN_MB = 512;
|
|
22
20
|
export declare const MAX_EPHEMERAL_STORAGE_IN_MB = 10240;
|
|
21
|
+
export declare const DEFAULT_EPHEMERAL_STORAGE_IN_MB: number;
|
|
22
|
+
export declare const MIN_EPHEMERAL_STORAGE_IN_MB = 512;
|
|
23
23
|
export declare const DEFAULT_OUTPUT_PRIVACY: Privacy;
|
|
24
24
|
export declare const DEFAULT_CLOUDWATCH_RETENTION_PERIOD = 14;
|
|
25
25
|
export declare const RENDER_FN_PREFIX = "remotion-render-";
|
package/dist/shared/constants.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = exports.REMOTION_FILELIST_TOKEN = exports.REMOTION_CONCATED_TOKEN = exports.CONCAT_FOLDER_TOKEN = exports.RENDERER_PATH_TOKEN = exports.getSitesKey = exports.LAMBDA_INSIGHTS_PREFIX = exports.LOG_GROUP_PREFIX = exports.RENDER_FN_PREFIX = exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = exports.DEFAULT_OUTPUT_PRIVACY = exports.
|
|
3
|
+
exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = exports.REMOTION_FILELIST_TOKEN = exports.REMOTION_CONCATED_TOKEN = exports.CONCAT_FOLDER_TOKEN = exports.RENDERER_PATH_TOKEN = exports.getSitesKey = exports.LAMBDA_INSIGHTS_PREFIX = exports.LOG_GROUP_PREFIX = exports.RENDER_FN_PREFIX = exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = exports.DEFAULT_OUTPUT_PRIVACY = exports.MIN_EPHEMERAL_STORAGE_IN_MB = exports.DEFAULT_EPHEMERAL_STORAGE_IN_MB = exports.MAX_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
|
+
const no_react_1 = require("remotion/no-react");
|
|
4
5
|
exports.MIN_MEMORY = 512;
|
|
5
6
|
exports.MAX_MEMORY = 10240;
|
|
6
7
|
exports.DEFAULT_MEMORY_SIZE = 2048;
|
|
@@ -14,9 +15,11 @@ exports.COMMAND_NOT_FOUND = 'Command not found';
|
|
|
14
15
|
exports.DEFAULT_REGION = 'us-east-1';
|
|
15
16
|
exports.DEFAULT_MAX_RETRIES = 1;
|
|
16
17
|
exports.MAX_FUNCTIONS_PER_RENDER = 200;
|
|
17
|
-
exports.DEFAULT_EPHEMERAL_STORAGE_IN_MB = 2048;
|
|
18
|
-
exports.MIN_EPHEMERAL_STORAGE_IN_MB = 512;
|
|
19
18
|
exports.MAX_EPHEMERAL_STORAGE_IN_MB = 10240;
|
|
19
|
+
exports.DEFAULT_EPHEMERAL_STORAGE_IN_MB = no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES
|
|
20
|
+
? exports.MAX_EPHEMERAL_STORAGE_IN_MB
|
|
21
|
+
: 2048;
|
|
22
|
+
exports.MIN_EPHEMERAL_STORAGE_IN_MB = 512;
|
|
20
23
|
exports.DEFAULT_OUTPUT_PRIVACY = 'public';
|
|
21
24
|
exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = 14;
|
|
22
25
|
exports.RENDER_FN_PREFIX = 'remotion-render-';
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/lambda"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/lambda",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.196",
|
|
7
7
|
"description": "Render Remotion videos on AWS Lambda",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"sideEffects": false,
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"@aws-sdk/s3-request-presigner": "3.583.0",
|
|
23
23
|
"mime-types": "2.1.34",
|
|
24
24
|
"zod": "3.22.3",
|
|
25
|
-
"@remotion/bundler": "4.0.
|
|
26
|
-
"@remotion/cli": "4.0.
|
|
27
|
-
"@remotion/
|
|
28
|
-
"@remotion/
|
|
29
|
-
"@remotion/
|
|
30
|
-
"
|
|
31
|
-
"remotion": "4.0.
|
|
25
|
+
"@remotion/bundler": "4.0.196",
|
|
26
|
+
"@remotion/cli": "4.0.196",
|
|
27
|
+
"@remotion/streaming": "4.0.196",
|
|
28
|
+
"@remotion/studio-server": "4.0.196",
|
|
29
|
+
"@remotion/renderer": "4.0.196",
|
|
30
|
+
"remotion": "4.0.196",
|
|
31
|
+
"@remotion/serverless": "4.0.196"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/mime-types": "2.1.1",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"pureimage": "0.4.13",
|
|
38
38
|
"vitest": "0.31.1",
|
|
39
39
|
"zip-lib": "^0.7.2",
|
|
40
|
-
"@remotion/bundler": "4.0.
|
|
41
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
40
|
+
"@remotion/bundler": "4.0.196",
|
|
41
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.196"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@remotion/bundler": "4.0.
|
|
44
|
+
"@remotion/bundler": "4.0.196"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkIfRenderExists = void 0;
|
|
4
|
-
const constants_1 = require("../../shared/constants");
|
|
5
|
-
const checkIfRenderExists = (contents, renderId, bucketName, region) => {
|
|
6
|
-
const initializedExists = Boolean(contents.find((c) => {
|
|
7
|
-
var _a;
|
|
8
|
-
return (_a = c.Key) === null || _a === void 0 ? void 0 : _a.startsWith((0, constants_1.initalizedMetadataKey)(renderId));
|
|
9
|
-
}));
|
|
10
|
-
if (!initializedExists) {
|
|
11
|
-
// ! Error message is checked in progress handler and will be retried. Make sure to update
|
|
12
|
-
throw new TypeError(`No render with ID "${renderId}" found in bucket ${bucketName} and region ${region}`);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
exports.checkIfRenderExists = checkIfRenderExists;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { _Object } from '@aws-sdk/client-s3';
|
|
2
|
-
import type { AwsRegion } from '../../pricing/aws-regions';
|
|
3
|
-
import type { CleanupJob } from './get-files-to-delete';
|
|
4
|
-
export declare const cleanupFiles: ({ bucket, region, contents, jobs, }: {
|
|
5
|
-
bucket: string;
|
|
6
|
-
region: AwsRegion;
|
|
7
|
-
contents: _Object[];
|
|
8
|
-
jobs: CleanupJob[];
|
|
9
|
-
}) => Promise<number>;
|