@remotion/lambda 4.0.139 → 4.0.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/deploy-function.d.ts +13 -5
- package/dist/api/deploy-function.js +27 -11
- package/dist/api/deploy-site.d.ts +77 -7
- package/dist/api/deploy-site.js +29 -8
- package/dist/api/make-lambda-payload.d.ts +4 -2
- package/dist/api/make-lambda-payload.js +14 -14
- package/dist/api/render-media-on-lambda.js +2 -1
- package/dist/api/render-still-on-lambda.d.ts +21 -14
- package/dist/api/render-still-on-lambda.js +36 -3
- package/dist/cli/commands/render/render.js +1 -0
- package/dist/cli/commands/sites/create.js +19 -6
- package/dist/functions/helpers/find-output-file-in-bucket.js +1 -1
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/helpers/get-output-url-from-metadata.d.ts +4 -1
- package/dist/functions/helpers/get-output-url-from-metadata.js +5 -2
- package/dist/functions/helpers/merge-chunks.js +1 -1
- package/dist/functions/helpers/streaming-payloads.d.ts +3 -3
- package/dist/functions/still.d.ts +1 -0
- package/dist/functions/still.js +3 -1
- package/dist/internals.d.ts +63 -4
- package/dist/internals.js +2 -0
- package/dist/shared/constants.d.ts +1 -1
- package/package.json +9 -8
- package/remotionlambda-arm64.zip +0 -0
|
@@ -1,18 +1,25 @@
|
|
|
1
|
+
import type { LogLevel } from '@remotion/renderer';
|
|
1
2
|
import type { AwsRegion } from '../pricing/aws-regions';
|
|
2
|
-
|
|
3
|
+
type MandatoryParameters = {
|
|
3
4
|
createCloudWatchLogGroup: boolean;
|
|
4
5
|
cloudWatchLogRetentionPeriodInDays?: number;
|
|
5
6
|
region: AwsRegion;
|
|
6
7
|
timeoutInSeconds: number;
|
|
7
8
|
memorySizeInMb: number;
|
|
8
|
-
diskSizeInMb?: number;
|
|
9
|
-
customRoleArn?: string;
|
|
10
|
-
enableLambdaInsights?: boolean;
|
|
11
9
|
};
|
|
10
|
+
type OptionalParameters = {
|
|
11
|
+
diskSizeInMb: number;
|
|
12
|
+
customRoleArn: string | undefined;
|
|
13
|
+
enableLambdaInsights: boolean;
|
|
14
|
+
indent: boolean;
|
|
15
|
+
logLevel: LogLevel;
|
|
16
|
+
};
|
|
17
|
+
export type DeployFunctionInput = MandatoryParameters & Partial<OptionalParameters>;
|
|
12
18
|
export type DeployFunctionOutput = {
|
|
13
19
|
functionName: string;
|
|
14
20
|
alreadyExisted: boolean;
|
|
15
21
|
};
|
|
22
|
+
export declare const errorHandled: (params: MandatoryParameters & OptionalParameters) => Promise<DeployFunctionOutput>;
|
|
16
23
|
/**
|
|
17
24
|
* @description Creates an AWS Lambda function in your account that will be able to render a video in the cloud.
|
|
18
25
|
* @see [Documentation](https://www.remotion.dev/docs/lambda/deployfunction)
|
|
@@ -25,4 +32,5 @@ export type DeployFunctionOutput = {
|
|
|
25
32
|
* @param params.diskSizeInMb The amount of storage the function should be allocated. The higher, the longer videos you can render. Default 512.
|
|
26
33
|
* @returns {Promise<DeployFunctionOutput>} An object that contains the `functionName` property
|
|
27
34
|
*/
|
|
28
|
-
export declare const deployFunction: (
|
|
35
|
+
export declare const deployFunction: ({ createCloudWatchLogGroup, memorySizeInMb, region, timeoutInSeconds, cloudWatchLogRetentionPeriodInDays, customRoleArn, enableLambdaInsights, indent, logLevel, ...options }: DeployFunctionInput) => Promise<DeployFunctionOutput>;
|
|
36
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deployFunction = void 0;
|
|
3
|
+
exports.deployFunction = exports.errorHandled = void 0;
|
|
4
4
|
const pure_1 = require("@remotion/renderer/pure");
|
|
5
5
|
const version_1 = require("remotion/version");
|
|
6
6
|
const get_functions_1 = require("../api/get-functions");
|
|
@@ -15,19 +15,18 @@ const validate_memory_size_1 = require("../shared/validate-memory-size");
|
|
|
15
15
|
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
|
-
const
|
|
19
|
-
var _a, _b
|
|
20
|
-
const diskSizeInMb = (_a = params.diskSizeInMb) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB;
|
|
18
|
+
const internalDeployFunction = async (params) => {
|
|
19
|
+
var _a, _b;
|
|
21
20
|
(0, validate_memory_size_1.validateMemorySize)(params.memorySizeInMb);
|
|
22
21
|
(0, validate_timeout_1.validateTimeout)(params.timeoutInSeconds);
|
|
23
22
|
(0, validate_aws_region_1.validateAwsRegion)(params.region);
|
|
24
23
|
(0, validate_retention_period_1.validateCloudWatchRetentionPeriod)(params.cloudWatchLogRetentionPeriodInDays);
|
|
25
|
-
(0, validate_disk_size_in_mb_1.validateDiskSizeInMb)(diskSizeInMb);
|
|
24
|
+
(0, validate_disk_size_in_mb_1.validateDiskSizeInMb)(params.diskSizeInMb);
|
|
26
25
|
(0, validate_custom_role_arn_1.validateCustomRoleArn)(params.customRoleArn);
|
|
27
26
|
const fnNameRender = [
|
|
28
27
|
`${constants_1.RENDER_FN_PREFIX}${lambda_version_string_1.LAMBDA_VERSION_STRING}`,
|
|
29
28
|
`mem${params.memorySizeInMb}mb`,
|
|
30
|
-
`disk${diskSizeInMb}mb`,
|
|
29
|
+
`disk${params.diskSizeInMb}mb`,
|
|
31
30
|
`${params.timeoutInSeconds}sec`,
|
|
32
31
|
].join('-');
|
|
33
32
|
const accountId = await (0, get_account_id_1.getAccountId)({ region: params.region });
|
|
@@ -38,7 +37,7 @@ const deployFunctionRaw = async (params) => {
|
|
|
38
37
|
const alreadyDeployed = fns.find((f) => f.version === version_1.VERSION &&
|
|
39
38
|
f.memorySizeInMb === params.memorySizeInMb &&
|
|
40
39
|
f.timeoutInSeconds === params.timeoutInSeconds &&
|
|
41
|
-
f.diskSizeInMb === diskSizeInMb);
|
|
40
|
+
f.diskSizeInMb === params.diskSizeInMb);
|
|
42
41
|
const created = await (0, create_function_1.createFunction)({
|
|
43
42
|
createCloudWatchLogGroup: params.createCloudWatchLogGroup,
|
|
44
43
|
region: params.region,
|
|
@@ -47,11 +46,11 @@ const deployFunctionRaw = async (params) => {
|
|
|
47
46
|
accountId,
|
|
48
47
|
memorySizeInMb: params.memorySizeInMb,
|
|
49
48
|
timeoutInSeconds: params.timeoutInSeconds,
|
|
50
|
-
retentionInDays: (
|
|
49
|
+
retentionInDays: (_a = params.cloudWatchLogRetentionPeriodInDays) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_CLOUDWATCH_RETENTION_PERIOD,
|
|
51
50
|
alreadyCreated: Boolean(alreadyDeployed),
|
|
52
|
-
ephemerealStorageInMb: diskSizeInMb,
|
|
51
|
+
ephemerealStorageInMb: params.diskSizeInMb,
|
|
53
52
|
customRoleArn: params.customRoleArn,
|
|
54
|
-
enableLambdaInsights: (
|
|
53
|
+
enableLambdaInsights: (_b = params.enableLambdaInsights) !== null && _b !== void 0 ? _b : false,
|
|
55
54
|
});
|
|
56
55
|
if (!created.FunctionName) {
|
|
57
56
|
throw new Error('Lambda was created but has no name');
|
|
@@ -61,6 +60,7 @@ const deployFunctionRaw = async (params) => {
|
|
|
61
60
|
alreadyExisted: Boolean(alreadyDeployed),
|
|
62
61
|
};
|
|
63
62
|
};
|
|
63
|
+
exports.errorHandled = pure_1.NoReactAPIs.wrapWithErrorHandling(internalDeployFunction);
|
|
64
64
|
/**
|
|
65
65
|
* @description Creates an AWS Lambda function in your account that will be able to render a video in the cloud.
|
|
66
66
|
* @see [Documentation](https://www.remotion.dev/docs/lambda/deployfunction)
|
|
@@ -73,4 +73,20 @@ const deployFunctionRaw = async (params) => {
|
|
|
73
73
|
* @param params.diskSizeInMb The amount of storage the function should be allocated. The higher, the longer videos you can render. Default 512.
|
|
74
74
|
* @returns {Promise<DeployFunctionOutput>} An object that contains the `functionName` property
|
|
75
75
|
*/
|
|
76
|
-
|
|
76
|
+
const deployFunction = ({ createCloudWatchLogGroup, memorySizeInMb, region, timeoutInSeconds, cloudWatchLogRetentionPeriodInDays, customRoleArn, enableLambdaInsights, indent, logLevel, ...options }) => {
|
|
77
|
+
var _a;
|
|
78
|
+
const diskSizeInMb = (_a = options.diskSizeInMb) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB;
|
|
79
|
+
return (0, exports.errorHandled)({
|
|
80
|
+
indent: indent !== null && indent !== void 0 ? indent : false,
|
|
81
|
+
logLevel: logLevel !== null && logLevel !== void 0 ? logLevel : 'info',
|
|
82
|
+
createCloudWatchLogGroup,
|
|
83
|
+
customRoleArn: customRoleArn !== null && customRoleArn !== void 0 ? customRoleArn : undefined,
|
|
84
|
+
diskSizeInMb,
|
|
85
|
+
enableLambdaInsights: enableLambdaInsights !== null && enableLambdaInsights !== void 0 ? enableLambdaInsights : false,
|
|
86
|
+
memorySizeInMb,
|
|
87
|
+
region,
|
|
88
|
+
timeoutInSeconds,
|
|
89
|
+
cloudWatchLogRetentionPeriodInDays,
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
exports.deployFunction = deployFunction;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { GitSource, WebpackOverrideFn } from '@remotion/bundler';
|
|
2
|
+
import type { ToOptions } from '@remotion/renderer';
|
|
3
|
+
import type { BrowserSafeApis } from '@remotion/renderer/client';
|
|
2
4
|
import type { AwsRegion } from '../pricing/aws-regions';
|
|
3
5
|
import type { UploadDirProgress } from './upload-dir';
|
|
4
|
-
|
|
6
|
+
type MandatoryParameters = {
|
|
5
7
|
entryPoint: string;
|
|
6
8
|
bucketName: string;
|
|
7
9
|
region: AwsRegion;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
};
|
|
11
|
+
type OptionalParameters = {
|
|
12
|
+
siteName: string;
|
|
13
|
+
options: {
|
|
10
14
|
onBundleProgress?: (progress: number) => void;
|
|
11
15
|
onUploadProgress?: (upload: UploadDirProgress) => void;
|
|
12
16
|
webpackOverride?: WebpackOverrideFn;
|
|
@@ -16,9 +20,11 @@ export type DeploySiteInput = {
|
|
|
16
20
|
rootDir?: string;
|
|
17
21
|
bypassBucketNameValidation?: boolean;
|
|
18
22
|
};
|
|
19
|
-
privacy
|
|
20
|
-
gitSource
|
|
21
|
-
|
|
23
|
+
privacy: 'public' | 'no-acl';
|
|
24
|
+
gitSource: GitSource | null;
|
|
25
|
+
indent: boolean;
|
|
26
|
+
} & ToOptions<typeof BrowserSafeApis.optionsMap.deploySiteLambda>;
|
|
27
|
+
export type DeploySiteInput = MandatoryParameters & Partial<OptionalParameters>;
|
|
22
28
|
export type DeploySiteOutput = Promise<{
|
|
23
29
|
serveUrl: string;
|
|
24
30
|
siteName: string;
|
|
@@ -28,6 +34,61 @@ export type DeploySiteOutput = Promise<{
|
|
|
28
34
|
untouchedFiles: number;
|
|
29
35
|
};
|
|
30
36
|
}>;
|
|
37
|
+
export declare const internalDeploySite: (args_0: MandatoryParameters & {
|
|
38
|
+
siteName: string;
|
|
39
|
+
options: {
|
|
40
|
+
onBundleProgress?: ((progress: number) => void) | undefined;
|
|
41
|
+
onUploadProgress?: ((upload: UploadDirProgress) => void) | undefined;
|
|
42
|
+
webpackOverride?: WebpackOverrideFn | undefined;
|
|
43
|
+
ignoreRegisterRootWarning?: boolean | undefined;
|
|
44
|
+
enableCaching?: boolean | undefined;
|
|
45
|
+
publicDir?: string | null | undefined;
|
|
46
|
+
rootDir?: string | undefined;
|
|
47
|
+
bypassBucketNameValidation?: boolean | undefined;
|
|
48
|
+
};
|
|
49
|
+
privacy: 'public' | 'no-acl';
|
|
50
|
+
gitSource: GitSource | null;
|
|
51
|
+
indent: boolean;
|
|
52
|
+
} & ToOptions<{
|
|
53
|
+
readonly logLevel: {
|
|
54
|
+
cliFlag: "log";
|
|
55
|
+
name: string;
|
|
56
|
+
ssrName: string;
|
|
57
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
docLink: string;
|
|
59
|
+
getValue: ({ commandLine }: {
|
|
60
|
+
commandLine: Record<string, unknown>;
|
|
61
|
+
}) => {
|
|
62
|
+
value: "verbose" | "info" | "warn" | "error";
|
|
63
|
+
source: string;
|
|
64
|
+
};
|
|
65
|
+
setConfig: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
|
|
66
|
+
type: "verbose" | "info" | "warn" | "error";
|
|
67
|
+
};
|
|
68
|
+
readonly throwIfSiteExists: {
|
|
69
|
+
cliFlag: string;
|
|
70
|
+
description: () => string;
|
|
71
|
+
docLink: string;
|
|
72
|
+
getValue: ({ commandLine }: {
|
|
73
|
+
commandLine: Record<string, unknown>;
|
|
74
|
+
}) => {
|
|
75
|
+
source: string;
|
|
76
|
+
value: boolean;
|
|
77
|
+
};
|
|
78
|
+
name: string;
|
|
79
|
+
setConfig: () => never;
|
|
80
|
+
ssrName: string;
|
|
81
|
+
type: boolean;
|
|
82
|
+
};
|
|
83
|
+
}>) => Promise<{
|
|
84
|
+
serveUrl: string;
|
|
85
|
+
siteName: string;
|
|
86
|
+
stats: {
|
|
87
|
+
uploadedFiles: number;
|
|
88
|
+
deletedFiles: number;
|
|
89
|
+
untouchedFiles: number;
|
|
90
|
+
};
|
|
91
|
+
}>;
|
|
31
92
|
/**
|
|
32
93
|
* @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.
|
|
33
94
|
* @see [Documentation](https://remotion.dev/docs/lambda/deploysite)
|
|
@@ -37,4 +98,13 @@ export type DeploySiteOutput = Promise<{
|
|
|
37
98
|
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
38
99
|
* @param {object} params.options Further options, see documentation page for this function.
|
|
39
100
|
*/
|
|
40
|
-
export declare const deploySite: (
|
|
101
|
+
export declare const deploySite: (args: DeploySiteInput) => Promise<{
|
|
102
|
+
serveUrl: string;
|
|
103
|
+
siteName: string;
|
|
104
|
+
stats: {
|
|
105
|
+
uploadedFiles: number;
|
|
106
|
+
deletedFiles: number;
|
|
107
|
+
untouchedFiles: number;
|
|
108
|
+
};
|
|
109
|
+
}>;
|
|
110
|
+
export {};
|
package/dist/api/deploy-site.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.deploySite = void 0;
|
|
6
|
+
exports.deploySite = exports.internalDeploySite = void 0;
|
|
7
7
|
const pure_1 = require("@remotion/renderer/pure");
|
|
8
8
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
9
|
const io_1 = require("../functions/helpers/io");
|
|
@@ -19,15 +19,13 @@ const validate_privacy_1 = require("../shared/validate-privacy");
|
|
|
19
19
|
const validate_site_name_1 = require("../shared/validate-site-name");
|
|
20
20
|
const bucket_exists_1 = require("./bucket-exists");
|
|
21
21
|
const upload_dir_1 = require("./upload-dir");
|
|
22
|
-
const
|
|
22
|
+
const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options, region, privacy, gitSource, throwIfSiteExists, }) => {
|
|
23
23
|
var _a, _b, _c, _d;
|
|
24
24
|
(0, validate_aws_region_1.validateAwsRegion)(region);
|
|
25
25
|
(0, validate_bucketname_1.validateBucketName)(bucketName, {
|
|
26
26
|
mustStartWithRemotion: !(options === null || options === void 0 ? void 0 : options.bypassBucketNameValidation),
|
|
27
27
|
});
|
|
28
|
-
|
|
29
|
-
(0, validate_site_name_1.validateSiteName)(siteId);
|
|
30
|
-
const privacy = passedPrivacy !== null && passedPrivacy !== void 0 ? passedPrivacy : 'public';
|
|
28
|
+
(0, validate_site_name_1.validateSiteName)(siteName);
|
|
31
29
|
(0, validate_privacy_1.validatePrivacy)(privacy, false);
|
|
32
30
|
const accountId = await (0, get_account_id_1.getAccountId)({ region });
|
|
33
31
|
const bucketExists = await (0, bucket_exists_1.bucketExistsInRegion)({
|
|
@@ -38,7 +36,7 @@ const deploySiteRaw = async ({ bucketName, entryPoint, siteName, options, region
|
|
|
38
36
|
if (!bucketExists) {
|
|
39
37
|
throw new Error(`No bucket with the name ${bucketName} exists`);
|
|
40
38
|
}
|
|
41
|
-
const subFolder = (0, constants_1.getSitesKey)(
|
|
39
|
+
const subFolder = (0, constants_1.getSitesKey)(siteName);
|
|
42
40
|
const [files, bundled] = await Promise.all([
|
|
43
41
|
(0, io_1.lambdaLs)({
|
|
44
42
|
bucketName,
|
|
@@ -59,6 +57,13 @@ const deploySiteRaw = async ({ bucketName, entryPoint, siteName, options, region
|
|
|
59
57
|
gitSource,
|
|
60
58
|
}),
|
|
61
59
|
]);
|
|
60
|
+
if (throwIfSiteExists && files.length > 0) {
|
|
61
|
+
throw new Error('`throwIfSiteExists` was passed as true, but there are already files in this folder: ' +
|
|
62
|
+
files
|
|
63
|
+
.slice(0, 5)
|
|
64
|
+
.map((f) => f.Key)
|
|
65
|
+
.join(', '));
|
|
66
|
+
}
|
|
62
67
|
const { toDelete, toUpload, existingCount } = await (0, get_s3_operations_1.getS3DiffOperations)({
|
|
63
68
|
objects: files,
|
|
64
69
|
bundle: bundled,
|
|
@@ -90,7 +95,7 @@ const deploySiteRaw = async ({ bucketName, entryPoint, siteName, options, region
|
|
|
90
95
|
}
|
|
91
96
|
return {
|
|
92
97
|
serveUrl: (0, make_s3_url_1.makeS3ServeUrl)({ bucketName, subFolder, region }),
|
|
93
|
-
siteName
|
|
98
|
+
siteName,
|
|
94
99
|
stats: {
|
|
95
100
|
uploadedFiles: toUpload.length,
|
|
96
101
|
deletedFiles: toDelete.length,
|
|
@@ -98,6 +103,7 @@ const deploySiteRaw = async ({ bucketName, entryPoint, siteName, options, region
|
|
|
98
103
|
},
|
|
99
104
|
};
|
|
100
105
|
};
|
|
106
|
+
exports.internalDeploySite = pure_1.NoReactAPIs.wrapWithErrorHandling(mandatoryDeploySite);
|
|
101
107
|
/**
|
|
102
108
|
* @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.
|
|
103
109
|
* @see [Documentation](https://remotion.dev/docs/lambda/deploysite)
|
|
@@ -107,4 +113,19 @@ const deploySiteRaw = async ({ bucketName, entryPoint, siteName, options, region
|
|
|
107
113
|
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
108
114
|
* @param {object} params.options Further options, see documentation page for this function.
|
|
109
115
|
*/
|
|
110
|
-
|
|
116
|
+
const deploySite = (args) => {
|
|
117
|
+
var _a, _b, _c, _d, _e;
|
|
118
|
+
return (0, exports.internalDeploySite)({
|
|
119
|
+
bucketName: args.bucketName,
|
|
120
|
+
entryPoint: args.entryPoint,
|
|
121
|
+
region: args.region,
|
|
122
|
+
gitSource: (_a = args.gitSource) !== null && _a !== void 0 ? _a : null,
|
|
123
|
+
options: (_b = args.options) !== null && _b !== void 0 ? _b : {},
|
|
124
|
+
privacy: (_c = args.privacy) !== null && _c !== void 0 ? _c : 'public',
|
|
125
|
+
siteName: (_d = args.siteName) !== null && _d !== void 0 ? _d : (0, random_hash_1.randomHash)(),
|
|
126
|
+
indent: false,
|
|
127
|
+
logLevel: 'info',
|
|
128
|
+
throwIfSiteExists: (_e = args.throwIfSiteExists) !== null && _e !== void 0 ? _e : false,
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
exports.deploySite = deploySite;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { AudioCodec, ChromiumOptions, ColorSpace, FrameRange, LogLevel, PixelFormat, ProResProfile, ToOptions, VideoImageFormat, X264Preset } from '@remotion/renderer';
|
|
2
2
|
import type { BrowserSafeApis } from '@remotion/renderer/client';
|
|
3
|
-
import type { AwsRegion, DeleteAfter
|
|
3
|
+
import type { AwsRegion, DeleteAfter } from '../client';
|
|
4
4
|
import type { LambdaPayloads, LambdaStartPayload, LambdaStatusPayload, OutNameInput, Privacy, WebhookOption } from '../defaults';
|
|
5
5
|
import { LambdaRoutines } from '../defaults';
|
|
6
6
|
import type { DownloadBehavior } from '../shared/content-disposition-header';
|
|
7
7
|
import type { LambdaCodec } from '../shared/validate-lambda-codec';
|
|
8
8
|
import type { GetRenderProgressInput } from './get-render-progress';
|
|
9
|
+
import type { RenderStillOnLambdaNonNullInput } from './render-still-on-lambda';
|
|
9
10
|
export type InnerRenderMediaOnLambdaInput = {
|
|
10
11
|
region: AwsRegion;
|
|
11
12
|
functionName: string;
|
|
@@ -47,7 +48,8 @@ export type InnerRenderMediaOnLambdaInput = {
|
|
|
47
48
|
audioCodec: AudioCodec | null;
|
|
48
49
|
colorSpace: ColorSpace;
|
|
49
50
|
deleteAfter: DeleteAfter | null;
|
|
51
|
+
indent: boolean;
|
|
50
52
|
} & ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda>;
|
|
51
53
|
export declare const 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, }: InnerRenderMediaOnLambdaInput) => Promise<LambdaStartPayload>;
|
|
52
54
|
export declare const getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, logLevel, }: GetRenderProgressInput) => LambdaStatusPayload;
|
|
53
|
-
export declare const makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName,
|
|
55
|
+
export declare const makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, }: RenderStillOnLambdaNonNullInput) => Promise<LambdaPayloads[LambdaRoutines.still]>;
|
|
@@ -85,7 +85,7 @@ const getRenderProgressPayload = ({ bucketName, renderId, s3OutputProvider, logL
|
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
87
|
exports.getRenderProgressPayload = getRenderProgressPayload;
|
|
88
|
-
const makeLambdaRenderStillPayload = async ({ serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName,
|
|
88
|
+
const makeLambdaRenderStillPayload = async ({ serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, }) => {
|
|
89
89
|
if (quality) {
|
|
90
90
|
throw new Error('The `quality` option is deprecated. Use `jpegQuality` instead.');
|
|
91
91
|
}
|
|
@@ -104,22 +104,22 @@ const makeLambdaRenderStillPayload = async ({ serveUrl, inputProps, imageFormat,
|
|
|
104
104
|
imageFormat,
|
|
105
105
|
envVariables,
|
|
106
106
|
jpegQuality,
|
|
107
|
-
maxRetries
|
|
108
|
-
frame
|
|
107
|
+
maxRetries,
|
|
108
|
+
frame,
|
|
109
109
|
privacy,
|
|
110
110
|
attempt: 1,
|
|
111
|
-
logLevel
|
|
112
|
-
outName
|
|
113
|
-
timeoutInMilliseconds
|
|
114
|
-
chromiumOptions
|
|
115
|
-
scale
|
|
116
|
-
downloadBehavior
|
|
111
|
+
logLevel,
|
|
112
|
+
outName,
|
|
113
|
+
timeoutInMilliseconds,
|
|
114
|
+
chromiumOptions,
|
|
115
|
+
scale,
|
|
116
|
+
downloadBehavior,
|
|
117
117
|
version: version_1.VERSION,
|
|
118
|
-
forceHeight
|
|
119
|
-
forceWidth
|
|
120
|
-
bucketName: forceBucketName
|
|
121
|
-
offthreadVideoCacheSizeInBytes
|
|
122
|
-
deleteAfter
|
|
118
|
+
forceHeight,
|
|
119
|
+
forceWidth,
|
|
120
|
+
bucketName: forceBucketName,
|
|
121
|
+
offthreadVideoCacheSizeInBytes,
|
|
122
|
+
deleteAfter,
|
|
123
123
|
type: defaults_1.LambdaRoutines.still,
|
|
124
124
|
};
|
|
125
125
|
};
|
|
@@ -93,9 +93,11 @@ const renderMediaOnLambdaOptionalToRequired = (options) => {
|
|
|
93
93
|
x264Preset: (_9 = options.x264Preset) !== null && _9 !== void 0 ? _9 : null,
|
|
94
94
|
deleteAfter: (_10 = options.deleteAfter) !== null && _10 !== void 0 ? _10 : null,
|
|
95
95
|
preferLossless: (_11 = options.preferLossless) !== null && _11 !== void 0 ? _11 : false,
|
|
96
|
+
indent: false,
|
|
96
97
|
};
|
|
97
98
|
};
|
|
98
99
|
exports.renderMediaOnLambdaOptionalToRequired = renderMediaOnLambdaOptionalToRequired;
|
|
100
|
+
const wrapped = pure_1.NoReactAPIs.wrapWithErrorHandling(exports.internalRenderMediaOnLambdaRaw);
|
|
99
101
|
/**
|
|
100
102
|
* @description Triggers a render on a lambda given a composition and a lambda function.
|
|
101
103
|
* @see [Documentation](https://remotion.dev/docs/lambda/rendermediaonlambda)
|
|
@@ -116,7 +118,6 @@ exports.renderMediaOnLambdaOptionalToRequired = renderMediaOnLambdaOptionalToReq
|
|
|
116
118
|
* @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
|
|
117
119
|
*/
|
|
118
120
|
const renderMediaOnLambda = (options) => {
|
|
119
|
-
const wrapped = pure_1.NoReactAPIs.wrapWithErrorHandling(exports.internalRenderMediaOnLambdaRaw);
|
|
120
121
|
if (options.quality) {
|
|
121
122
|
throw new Error('quality has been renamed to jpegQuality. Please rename the option.');
|
|
122
123
|
}
|
|
@@ -3,7 +3,7 @@ import type { BrowserSafeApis } from '@remotion/renderer/client';
|
|
|
3
3
|
import type { AwsRegion } from '../pricing/aws-regions';
|
|
4
4
|
import type { CostsInfo, OutNameInput, Privacy } from '../shared/constants';
|
|
5
5
|
import type { DownloadBehavior } from '../shared/content-disposition-header';
|
|
6
|
-
|
|
6
|
+
type MandatoryParameters = {
|
|
7
7
|
region: AwsRegion;
|
|
8
8
|
functionName: string;
|
|
9
9
|
serveUrl: string;
|
|
@@ -11,32 +11,38 @@ export type RenderStillOnLambdaInput = {
|
|
|
11
11
|
inputProps: Record<string, unknown>;
|
|
12
12
|
imageFormat: StillImageFormat;
|
|
13
13
|
privacy: Privacy;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
};
|
|
15
|
+
type OptionalParameters = {
|
|
16
|
+
maxRetries: number;
|
|
17
|
+
envVariables: Record<string, string>;
|
|
16
18
|
/**
|
|
17
19
|
* @deprecated Renamed to `jpegQuality`
|
|
18
20
|
*/
|
|
19
21
|
quality?: never;
|
|
20
|
-
frame
|
|
21
|
-
outName
|
|
22
|
-
chromiumOptions
|
|
23
|
-
downloadBehavior
|
|
24
|
-
forceWidth
|
|
25
|
-
forceHeight
|
|
26
|
-
forceBucketName
|
|
22
|
+
frame: number;
|
|
23
|
+
outName: OutNameInput | null;
|
|
24
|
+
chromiumOptions: ChromiumOptions;
|
|
25
|
+
downloadBehavior: DownloadBehavior;
|
|
26
|
+
forceWidth: number | null;
|
|
27
|
+
forceHeight: number | null;
|
|
28
|
+
forceBucketName: string | null;
|
|
27
29
|
/**
|
|
28
|
-
* @deprecated Renamed to `
|
|
30
|
+
* @deprecated Renamed to `logLevel`
|
|
29
31
|
*/
|
|
30
|
-
dumpBrowserLogs
|
|
31
|
-
onInit
|
|
32
|
+
dumpBrowserLogs: boolean;
|
|
33
|
+
onInit: (data: {
|
|
32
34
|
renderId: string;
|
|
33
35
|
cloudWatchLogs: string;
|
|
34
36
|
lambdaInsightsUrl: string;
|
|
35
37
|
}) => void;
|
|
36
|
-
|
|
38
|
+
indent: boolean;
|
|
39
|
+
} & ToOptions<typeof BrowserSafeApis.optionsMap.renderStillOnLambda>;
|
|
40
|
+
export type RenderStillOnLambdaNonNullInput = MandatoryParameters & OptionalParameters;
|
|
41
|
+
export type RenderStillOnLambdaInput = MandatoryParameters & Partial<OptionalParameters>;
|
|
37
42
|
export type RenderStillOnLambdaOutput = {
|
|
38
43
|
estimatedPrice: CostsInfo;
|
|
39
44
|
url: string;
|
|
45
|
+
outKey: string;
|
|
40
46
|
sizeInBytes: number;
|
|
41
47
|
bucketName: string;
|
|
42
48
|
renderId: string;
|
|
@@ -59,3 +65,4 @@ export type RenderStillOnLambdaOutput = {
|
|
|
59
65
|
* @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
|
|
60
66
|
*/
|
|
61
67
|
export declare const renderStillOnLambda: (input: RenderStillOnLambdaInput) => Promise<RenderStillOnLambdaOutput>;
|
|
68
|
+
export {};
|
|
@@ -6,7 +6,7 @@ const call_lambda_1 = require("../shared/call-lambda");
|
|
|
6
6
|
const constants_1 = require("../shared/constants");
|
|
7
7
|
const get_aws_urls_1 = require("../shared/get-aws-urls");
|
|
8
8
|
const make_lambda_payload_1 = require("./make-lambda-payload");
|
|
9
|
-
const
|
|
9
|
+
const internalRenderStillOnLambda = async (input) => {
|
|
10
10
|
var _a;
|
|
11
11
|
const { functionName, region, onInit } = input;
|
|
12
12
|
try {
|
|
@@ -17,7 +17,7 @@ const renderStillOnLambdaRaw = async (input) => {
|
|
|
17
17
|
region,
|
|
18
18
|
receivedStreamingPayload: (payload) => {
|
|
19
19
|
if (payload.type === 'render-id-determined') {
|
|
20
|
-
onInit
|
|
20
|
+
onInit({
|
|
21
21
|
renderId: payload.renderId,
|
|
22
22
|
cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchMethodUrl)({
|
|
23
23
|
functionName,
|
|
@@ -39,6 +39,7 @@ const renderStillOnLambdaRaw = async (input) => {
|
|
|
39
39
|
return {
|
|
40
40
|
estimatedPrice: res.estimatedPrice,
|
|
41
41
|
url: res.output,
|
|
42
|
+
outKey: res.outKey,
|
|
42
43
|
sizeInBytes: res.size,
|
|
43
44
|
bucketName: res.bucketName,
|
|
44
45
|
renderId: res.renderId,
|
|
@@ -58,6 +59,7 @@ const renderStillOnLambdaRaw = async (input) => {
|
|
|
58
59
|
throw err;
|
|
59
60
|
}
|
|
60
61
|
};
|
|
62
|
+
const errorHandled = pure_1.NoReactAPIs.wrapWithErrorHandling(internalRenderStillOnLambda);
|
|
61
63
|
/**
|
|
62
64
|
* @description Renders a still frame on Lambda
|
|
63
65
|
* @link https://remotion.dev/docs/lambda/renderstillonlambda
|
|
@@ -74,4 +76,35 @@ const renderStillOnLambdaRaw = async (input) => {
|
|
|
74
76
|
* @param params.privacy Whether the item in the S3 bucket should be public. Possible values: `"private"` and `"public"`
|
|
75
77
|
* @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
|
|
76
78
|
*/
|
|
77
|
-
|
|
79
|
+
const renderStillOnLambda = (input) => {
|
|
80
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
81
|
+
return errorHandled({
|
|
82
|
+
chromiumOptions: (_a = input.chromiumOptions) !== null && _a !== void 0 ? _a : {},
|
|
83
|
+
composition: input.composition,
|
|
84
|
+
deleteAfter: (_b = input.deleteAfter) !== null && _b !== void 0 ? _b : null,
|
|
85
|
+
downloadBehavior: (_c = input.downloadBehavior) !== null && _c !== void 0 ? _c : { type: 'play-in-browser' },
|
|
86
|
+
envVariables: (_d = input.envVariables) !== null && _d !== void 0 ? _d : {},
|
|
87
|
+
forceBucketName: (_e = input.forceBucketName) !== null && _e !== void 0 ? _e : null,
|
|
88
|
+
forceHeight: (_f = input.forceHeight) !== null && _f !== void 0 ? _f : null,
|
|
89
|
+
forceWidth: (_g = input.forceWidth) !== null && _g !== void 0 ? _g : null,
|
|
90
|
+
frame: (_h = input.frame) !== null && _h !== void 0 ? _h : 0,
|
|
91
|
+
functionName: input.functionName,
|
|
92
|
+
imageFormat: input.imageFormat,
|
|
93
|
+
indent: false,
|
|
94
|
+
inputProps: input.inputProps,
|
|
95
|
+
maxRetries: (_j = input.maxRetries) !== null && _j !== void 0 ? _j : constants_1.DEFAULT_MAX_RETRIES,
|
|
96
|
+
onInit: (_k = input.onInit) !== null && _k !== void 0 ? _k : (() => undefined),
|
|
97
|
+
outName: (_l = input.outName) !== null && _l !== void 0 ? _l : null,
|
|
98
|
+
privacy: input.privacy,
|
|
99
|
+
quality: undefined,
|
|
100
|
+
region: input.region,
|
|
101
|
+
serveUrl: input.serveUrl,
|
|
102
|
+
jpegQuality: (_m = input.jpegQuality) !== null && _m !== void 0 ? _m : 80,
|
|
103
|
+
logLevel: input.dumpBrowserLogs ? 'verbose' : (_o = input.logLevel) !== null && _o !== void 0 ? _o : 'info',
|
|
104
|
+
offthreadVideoCacheSizeInBytes: (_p = input.offthreadVideoCacheSizeInBytes) !== null && _p !== void 0 ? _p : null,
|
|
105
|
+
scale: (_q = input.scale) !== null && _q !== void 0 ? _q : 1,
|
|
106
|
+
timeoutInMilliseconds: (_r = input.timeoutInMilliseconds) !== null && _r !== void 0 ? _r : constants_1.DEFAULT_TIMEOUT,
|
|
107
|
+
dumpBrowserLogs: false,
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
exports.renderStillOnLambda = renderStillOnLambda;
|
|
@@ -233,6 +233,7 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
|
|
|
233
233
|
offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes !== null && offthreadVideoCacheSizeInBytes !== void 0 ? offthreadVideoCacheSizeInBytes : null,
|
|
234
234
|
x264Preset: x264Preset !== null && x264Preset !== void 0 ? x264Preset : null,
|
|
235
235
|
preferLossless,
|
|
236
|
+
indent: false,
|
|
236
237
|
});
|
|
237
238
|
const totalSteps = downloadName ? 6 : 5;
|
|
238
239
|
const progressBar = cli_1.CliInternals.createOverwriteableCliOutput({
|
|
@@ -5,9 +5,10 @@ const cli_1 = require("@remotion/cli");
|
|
|
5
5
|
const config_1 = require("@remotion/cli/config");
|
|
6
6
|
const client_1 = require("@remotion/renderer/client");
|
|
7
7
|
const no_react_1 = require("remotion/no-react");
|
|
8
|
-
const deploy_site_1 = require("../../../api/deploy-site");
|
|
9
8
|
const get_or_create_bucket_1 = require("../../../api/get-or-create-bucket");
|
|
9
|
+
const internals_1 = require("../../../internals");
|
|
10
10
|
const constants_1 = require("../../../shared/constants");
|
|
11
|
+
const random_hash_1 = require("../../../shared/random-hash");
|
|
11
12
|
const validate_site_name_1 = require("../../../shared/validate-site-name");
|
|
12
13
|
const args_1 = require("../../args");
|
|
13
14
|
const get_aws_region_1 = require("../../get-aws-region");
|
|
@@ -15,8 +16,9 @@ const progress_bar_1 = require("../../helpers/progress-bar");
|
|
|
15
16
|
const quit_1 = require("../../helpers/quit");
|
|
16
17
|
const log_1 = require("../../log");
|
|
17
18
|
exports.SITES_CREATE_SUBCOMMAND = 'create';
|
|
19
|
+
const { folderExpiryOption, publicDirOption, throwIfSiteExistsOption } = client_1.BrowserSafeApis.options;
|
|
18
20
|
const sitesCreateSubcommand = async (args, remotionRoot, logLevel) => {
|
|
19
|
-
var _a, _b, _c;
|
|
21
|
+
var _a, _b, _c, _d;
|
|
20
22
|
const { file, reason } = cli_1.CliInternals.findEntryPoint({
|
|
21
23
|
args,
|
|
22
24
|
remotionRoot,
|
|
@@ -66,7 +68,7 @@ const sitesCreateSubcommand = async (args, remotionRoot, logLevel) => {
|
|
|
66
68
|
].join('\n'), false);
|
|
67
69
|
};
|
|
68
70
|
const bucketStart = Date.now();
|
|
69
|
-
const enableFolderExpiry =
|
|
71
|
+
const enableFolderExpiry = folderExpiryOption.getValue({
|
|
70
72
|
commandLine: cli_1.CliInternals.parsedCli,
|
|
71
73
|
}).value;
|
|
72
74
|
const cliBucketName = (_b = args_1.parsedLambdaCli['force-bucket-name']) !== null && _b !== void 0 ? _b : null;
|
|
@@ -79,11 +81,19 @@ const sitesCreateSubcommand = async (args, remotionRoot, logLevel) => {
|
|
|
79
81
|
updateProgress();
|
|
80
82
|
const bundleStart = Date.now();
|
|
81
83
|
let uploadStart = Date.now();
|
|
82
|
-
const
|
|
84
|
+
const publicDir = publicDirOption.getValue({
|
|
85
|
+
commandLine: cli_1.CliInternals.parsedCli,
|
|
86
|
+
}).value;
|
|
87
|
+
const throwIfSiteExists = throwIfSiteExistsOption.getValue({
|
|
88
|
+
commandLine: cli_1.CliInternals.parsedCli,
|
|
89
|
+
}).value;
|
|
90
|
+
const { serveUrl, siteName, stats } = await internals_1.LambdaInternals.internalDeploySite({
|
|
83
91
|
entryPoint: file,
|
|
84
|
-
siteName: desiredSiteName,
|
|
92
|
+
siteName: desiredSiteName !== null && desiredSiteName !== void 0 ? desiredSiteName : (0, random_hash_1.randomHash)(),
|
|
85
93
|
bucketName,
|
|
86
94
|
options: {
|
|
95
|
+
publicDir,
|
|
96
|
+
rootDir: remotionRoot,
|
|
87
97
|
onBundleProgress: (progress) => {
|
|
88
98
|
multiProgress.bundleProgress = {
|
|
89
99
|
progress,
|
|
@@ -108,8 +118,11 @@ const sitesCreateSubcommand = async (args, remotionRoot, logLevel) => {
|
|
|
108
118
|
bypassBucketNameValidation: Boolean(args_1.parsedLambdaCli['force-bucket-name']),
|
|
109
119
|
},
|
|
110
120
|
region: (0, get_aws_region_1.getAwsRegion)(),
|
|
111
|
-
privacy: args_1.parsedLambdaCli.privacy,
|
|
121
|
+
privacy: (_d = args_1.parsedLambdaCli.privacy) !== null && _d !== void 0 ? _d : 'public',
|
|
112
122
|
gitSource: null,
|
|
123
|
+
indent: false,
|
|
124
|
+
logLevel,
|
|
125
|
+
throwIfSiteExists,
|
|
113
126
|
});
|
|
114
127
|
const uploadDuration = Date.now() - uploadStart;
|
|
115
128
|
multiProgress.deployProgress = {
|
|
@@ -20,7 +20,7 @@ const findOutputFileInBucket = async ({ region, renderMetadata, bucketName, cust
|
|
|
20
20
|
return {
|
|
21
21
|
lastModified: (_a = head.LastModified) === null || _a === void 0 ? void 0 : _a.getTime(),
|
|
22
22
|
size: head.ContentLength,
|
|
23
|
-
url: (0, get_output_url_from_metadata_1.getOutputUrlFromMetadata)(renderMetadata, bucketName, customCredentials),
|
|
23
|
+
url: (0, get_output_url_from_metadata_1.getOutputUrlFromMetadata)(renderMetadata, bucketName, customCredentials).url,
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-
|
|
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" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "sa-east-1" | "eu-south-1" | "af-south-1" | "ap-east-1" | "me-south-1";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { RenderMetadata } from '../../defaults';
|
|
2
2
|
import type { CustomCredentials } from '../../shared/aws-clients';
|
|
3
|
-
export declare const getOutputUrlFromMetadata: (renderMetadata: RenderMetadata, bucketName: string, customCredentials: CustomCredentials | null) =>
|
|
3
|
+
export declare const getOutputUrlFromMetadata: (renderMetadata: RenderMetadata, bucketName: string, customCredentials: CustomCredentials | null) => {
|
|
4
|
+
url: string;
|
|
5
|
+
key: string;
|
|
6
|
+
};
|
|
@@ -4,7 +4,10 @@ exports.getOutputUrlFromMetadata = void 0;
|
|
|
4
4
|
const expected_out_name_1 = require("./expected-out-name");
|
|
5
5
|
const get_current_region_1 = require("./get-current-region");
|
|
6
6
|
const getOutputUrlFromMetadata = (renderMetadata, bucketName, customCredentials) => {
|
|
7
|
-
const
|
|
8
|
-
return
|
|
7
|
+
const { key, renderBucketName } = (0, expected_out_name_1.getExpectedOutName)(renderMetadata, bucketName, customCredentials);
|
|
8
|
+
return {
|
|
9
|
+
url: `https://s3.${(0, get_current_region_1.getCurrentRegionInFunction)()}.amazonaws.com/${renderBucketName}/${key}`,
|
|
10
|
+
key,
|
|
11
|
+
};
|
|
9
12
|
};
|
|
10
13
|
exports.getOutputUrlFromMetadata = getOutputUrlFromMetadata;
|
|
@@ -180,7 +180,7 @@ const mergeChunksAndFinishRender = async (options) => {
|
|
|
180
180
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
181
181
|
serialized: options.serializedResolvedProps,
|
|
182
182
|
});
|
|
183
|
-
const outputUrl = (0, get_output_url_from_metadata_1.getOutputUrlFromMetadata)(options.renderMetadata, options.bucketName, options.customCredentials);
|
|
183
|
+
const { url: outputUrl } = (0, get_output_url_from_metadata_1.getOutputUrlFromMetadata)(options.renderMetadata, options.bucketName, options.customCredentials);
|
|
184
184
|
const postRenderData = (0, create_post_render_data_1.createPostRenderData)({
|
|
185
185
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
186
186
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
@@ -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
|
-
type: "render-id-determined";
|
|
8
7
|
renderId: string;
|
|
9
|
-
}, {
|
|
10
8
|
type: "render-id-determined";
|
|
9
|
+
}, {
|
|
11
10
|
renderId: string;
|
|
11
|
+
type: "render-id-determined";
|
|
12
12
|
}>]>;
|
|
13
13
|
export type StreamingPayloads = z.infer<typeof streamingPayloadSchema>;
|
|
14
14
|
export declare const isStreamingPayload: (str: string) => false | {
|
|
15
|
-
type: "render-id-determined";
|
|
16
15
|
renderId: string;
|
|
16
|
+
type: "render-id-determined";
|
|
17
17
|
};
|
|
18
18
|
export declare const sendProgressEvent: (responseStream: ResponseStream, payload: StreamingPayloads) => void;
|
|
19
19
|
export {};
|
package/dist/functions/still.js
CHANGED
|
@@ -204,13 +204,15 @@ const innerStillHandler = async ({ params: lambdaParams, expectedBucketOwner, re
|
|
|
204
204
|
// overestimate the price, but will only have a miniscule effect (~0.2%)
|
|
205
205
|
diskSizeInMb: constants_1.MAX_EPHEMERAL_STORAGE_IN_MB,
|
|
206
206
|
});
|
|
207
|
+
const { key: outKey, url } = (0, get_output_url_from_metadata_1.getOutputUrlFromMetadata)(renderMetadata, bucketName, customCredentials);
|
|
207
208
|
return {
|
|
208
209
|
type: 'success',
|
|
209
|
-
output:
|
|
210
|
+
output: url,
|
|
210
211
|
size,
|
|
211
212
|
bucketName,
|
|
212
213
|
estimatedPrice: (0, format_costs_info_1.formatCostsInfo)(estimatedPrice),
|
|
213
214
|
renderId,
|
|
215
|
+
outKey,
|
|
214
216
|
};
|
|
215
217
|
};
|
|
216
218
|
const stillHandler = async (options) => {
|
package/dist/internals.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
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, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, preferLossless, }: import("./api/make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("./defaults").LambdaStartPayload>;
|
|
4
4
|
getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, logLevel, }: import(".").GetRenderProgressInput) => import("./defaults").LambdaStatusPayload;
|
|
5
|
-
makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName,
|
|
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<{
|
|
6
6
|
type: import("./defaults").LambdaRoutines.still;
|
|
7
7
|
serveUrl: string;
|
|
8
8
|
composition: string;
|
|
9
9
|
inputProps: import("./defaults").SerializedInputProps;
|
|
10
10
|
imageFormat: "png" | "jpeg" | "pdf" | "webp";
|
|
11
|
-
envVariables: Record<string, string
|
|
11
|
+
envVariables: Record<string, string>;
|
|
12
12
|
attempt: number;
|
|
13
13
|
jpegQuality: number | undefined;
|
|
14
14
|
maxRetries: number;
|
|
15
15
|
frame: number;
|
|
16
16
|
privacy: import("./defaults").Privacy;
|
|
17
|
-
logLevel: "
|
|
17
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
18
18
|
outName: import("./defaults").OutNameInput | null;
|
|
19
19
|
timeoutInMilliseconds: number;
|
|
20
20
|
chromiumOptions: import("@remotion/renderer").ChromiumOptions;
|
|
@@ -27,4 +27,63 @@ export declare const LambdaInternals: {
|
|
|
27
27
|
offthreadVideoCacheSizeInBytes: number | null;
|
|
28
28
|
deleteAfter: "1-day" | "3-days" | "7-days" | "30-days" | null;
|
|
29
29
|
}>;
|
|
30
|
+
internalDeploySite: (args_0: {
|
|
31
|
+
entryPoint: string;
|
|
32
|
+
bucketName: string;
|
|
33
|
+
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";
|
|
34
|
+
} & {
|
|
35
|
+
siteName: string;
|
|
36
|
+
options: {
|
|
37
|
+
onBundleProgress?: ((progress: number) => void) | undefined;
|
|
38
|
+
onUploadProgress?: ((upload: import("./api/upload-dir").UploadDirProgress) => void) | undefined;
|
|
39
|
+
webpackOverride?: import("@remotion/bundler").WebpackOverrideFn | undefined;
|
|
40
|
+
ignoreRegisterRootWarning?: boolean | undefined;
|
|
41
|
+
enableCaching?: boolean | undefined;
|
|
42
|
+
publicDir?: string | null | undefined;
|
|
43
|
+
rootDir?: string | undefined;
|
|
44
|
+
bypassBucketNameValidation?: boolean | undefined;
|
|
45
|
+
};
|
|
46
|
+
privacy: "public" | "no-acl";
|
|
47
|
+
gitSource: import("@remotion/bundler").GitSource | null;
|
|
48
|
+
indent: boolean;
|
|
49
|
+
} & import("@remotion/renderer").ToOptions<{
|
|
50
|
+
readonly logLevel: {
|
|
51
|
+
cliFlag: "log";
|
|
52
|
+
name: string;
|
|
53
|
+
ssrName: string;
|
|
54
|
+
description: () => import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
docLink: string;
|
|
56
|
+
getValue: ({ commandLine }: {
|
|
57
|
+
commandLine: Record<string, unknown>;
|
|
58
|
+
}) => {
|
|
59
|
+
value: "verbose" | "info" | "warn" | "error";
|
|
60
|
+
source: string;
|
|
61
|
+
};
|
|
62
|
+
setConfig: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
|
|
63
|
+
type: "verbose" | "info" | "warn" | "error";
|
|
64
|
+
};
|
|
65
|
+
readonly throwIfSiteExists: {
|
|
66
|
+
cliFlag: string;
|
|
67
|
+
description: () => string;
|
|
68
|
+
docLink: string;
|
|
69
|
+
getValue: ({ commandLine }: {
|
|
70
|
+
commandLine: Record<string, unknown>;
|
|
71
|
+
}) => {
|
|
72
|
+
source: string;
|
|
73
|
+
value: boolean;
|
|
74
|
+
};
|
|
75
|
+
name: string;
|
|
76
|
+
setConfig: () => never;
|
|
77
|
+
ssrName: string;
|
|
78
|
+
type: boolean;
|
|
79
|
+
};
|
|
80
|
+
}>) => Promise<{
|
|
81
|
+
serveUrl: string;
|
|
82
|
+
siteName: string;
|
|
83
|
+
stats: {
|
|
84
|
+
uploadedFiles: number;
|
|
85
|
+
deletedFiles: number;
|
|
86
|
+
untouchedFiles: number;
|
|
87
|
+
};
|
|
88
|
+
}>;
|
|
30
89
|
};
|
package/dist/internals.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LambdaInternals = void 0;
|
|
4
|
+
const deploy_site_1 = require("./api/deploy-site");
|
|
4
5
|
const make_lambda_payload_1 = require("./api/make-lambda-payload");
|
|
5
6
|
const index_1 = require("./cli/index");
|
|
6
7
|
exports.LambdaInternals = {
|
|
@@ -8,4 +9,5 @@ exports.LambdaInternals = {
|
|
|
8
9
|
makeLambdaRenderMediaPayload: make_lambda_payload_1.makeLambdaRenderMediaPayload,
|
|
9
10
|
getRenderProgressPayload: make_lambda_payload_1.getRenderProgressPayload,
|
|
10
11
|
makeLambdaRenderStillPayload: make_lambda_payload_1.makeLambdaRenderStillPayload,
|
|
12
|
+
internalDeploySite: deploy_site_1.internalDeploySite,
|
|
11
13
|
};
|
|
@@ -271,7 +271,7 @@ export type LambdaPayloads = {
|
|
|
271
271
|
composition: string;
|
|
272
272
|
inputProps: SerializedInputProps;
|
|
273
273
|
imageFormat: StillImageFormat;
|
|
274
|
-
envVariables: Record<string, string
|
|
274
|
+
envVariables: Record<string, string>;
|
|
275
275
|
attempt: number;
|
|
276
276
|
jpegQuality: number | undefined;
|
|
277
277
|
maxRetries: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.141",
|
|
4
4
|
"description": "Distributed renderer for Remotion based on AWS Lambda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,16 +26,17 @@
|
|
|
26
26
|
"aws-policies": "^1.0.1",
|
|
27
27
|
"mime-types": "2.1.34",
|
|
28
28
|
"zod": "3.22.3",
|
|
29
|
-
"@remotion/bundler": "4.0.
|
|
30
|
-
"
|
|
31
|
-
"remotion": "4.0.
|
|
32
|
-
"@remotion/
|
|
29
|
+
"@remotion/bundler": "4.0.141",
|
|
30
|
+
"remotion": "4.0.141",
|
|
31
|
+
"@remotion/renderer": "4.0.141",
|
|
32
|
+
"@remotion/cli": "4.0.141"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@jonny/eslint-config": "3.0.281",
|
|
36
36
|
"@types/mime-types": "2.1.1",
|
|
37
37
|
"@types/minimist": "1.2.2",
|
|
38
38
|
"@types/node": "18.14.6",
|
|
39
|
+
"@types/react": "18.2.48",
|
|
39
40
|
"@types/prompt": "^1.1.0",
|
|
40
41
|
"eslint": "8.56.0",
|
|
41
42
|
"prettier": "3.2.5",
|
|
@@ -44,11 +45,11 @@
|
|
|
44
45
|
"ts-node": "10.9.2",
|
|
45
46
|
"vitest": "0.31.1",
|
|
46
47
|
"zip-lib": "^0.7.2",
|
|
47
|
-
"@remotion/
|
|
48
|
-
"@remotion/
|
|
48
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.141",
|
|
49
|
+
"@remotion/bundler": "4.0.141"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
|
-
"@remotion/bundler": "4.0.
|
|
52
|
+
"@remotion/bundler": "4.0.141"
|
|
52
53
|
},
|
|
53
54
|
"publishConfig": {
|
|
54
55
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|