@remotion/lambda 4.0.138 → 4.0.140
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 +3 -1
- package/dist/api/deploy-site.js +15 -2
- 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 +20 -14
- package/dist/api/render-still-on-lambda.js +35 -3
- package/dist/cli/commands/render/render.js +1 -0
- package/dist/cli/commands/sites/create.js +7 -1
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +4 -1
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/helpers/streaming-payloads.d.ts +3 -3
- package/dist/internals.d.ts +4 -4
- package/dist/shared/constants.d.ts +1 -1
- package/package.json +8 -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,4 +1,5 @@
|
|
|
1
1
|
import type { GitSource, WebpackOverrideFn } from '@remotion/bundler';
|
|
2
|
+
import type { LogLevel } from '@remotion/renderer';
|
|
2
3
|
import type { AwsRegion } from '../pricing/aws-regions';
|
|
3
4
|
import type { UploadDirProgress } from './upload-dir';
|
|
4
5
|
export type DeploySiteInput = {
|
|
@@ -18,6 +19,7 @@ export type DeploySiteInput = {
|
|
|
18
19
|
};
|
|
19
20
|
privacy?: 'public' | 'no-acl';
|
|
20
21
|
gitSource?: GitSource | null;
|
|
22
|
+
logLevel?: LogLevel;
|
|
21
23
|
};
|
|
22
24
|
export type DeploySiteOutput = Promise<{
|
|
23
25
|
serveUrl: string;
|
|
@@ -37,4 +39,4 @@ export type DeploySiteOutput = Promise<{
|
|
|
37
39
|
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
38
40
|
* @param {object} params.options Further options, see documentation page for this function.
|
|
39
41
|
*/
|
|
40
|
-
export declare const deploySite: (
|
|
42
|
+
export declare const deploySite: (args: DeploySiteInput) => DeploySiteOutput;
|
package/dist/api/deploy-site.js
CHANGED
|
@@ -19,7 +19,7 @@ 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 internalDeploySite = async ({ bucketName, entryPoint, siteName, options, region, privacy: passedPrivacy, gitSource, }) => {
|
|
23
23
|
var _a, _b, _c, _d;
|
|
24
24
|
(0, validate_aws_region_1.validateAwsRegion)(region);
|
|
25
25
|
(0, validate_bucketname_1.validateBucketName)(bucketName, {
|
|
@@ -98,6 +98,19 @@ const deploySiteRaw = async ({ bucketName, entryPoint, siteName, options, region
|
|
|
98
98
|
},
|
|
99
99
|
};
|
|
100
100
|
};
|
|
101
|
+
const deploySiteRaw = (args) => {
|
|
102
|
+
return internalDeploySite({
|
|
103
|
+
bucketName: args.bucketName,
|
|
104
|
+
entryPoint: args.entryPoint,
|
|
105
|
+
region: args.region,
|
|
106
|
+
gitSource: args.gitSource,
|
|
107
|
+
options: args.options,
|
|
108
|
+
privacy: args.privacy,
|
|
109
|
+
siteName: args.siteName,
|
|
110
|
+
indent: false,
|
|
111
|
+
logLevel: 'info',
|
|
112
|
+
});
|
|
113
|
+
};
|
|
101
114
|
/**
|
|
102
115
|
* @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.
|
|
103
116
|
* @see [Documentation](https://remotion.dev/docs/lambda/deploysite)
|
|
@@ -107,4 +120,4 @@ const deploySiteRaw = async ({ bucketName, entryPoint, siteName, options, region
|
|
|
107
120
|
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
108
121
|
* @param {object} params.options Further options, see documentation page for this function.
|
|
109
122
|
*/
|
|
110
|
-
exports.deploySite = pure_1.NoReactAPIs.wrapWithErrorHandling(
|
|
123
|
+
exports.deploySite = pure_1.NoReactAPIs.wrapWithErrorHandling(internalDeploySite);
|
|
@@ -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,29 +11,34 @@ 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;
|
|
@@ -59,3 +64,4 @@ export type RenderStillOnLambdaOutput = {
|
|
|
59
64
|
* @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
|
|
60
65
|
*/
|
|
61
66
|
export declare const renderStillOnLambda: (input: RenderStillOnLambdaInput) => Promise<RenderStillOnLambdaOutput>;
|
|
67
|
+
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,
|
|
@@ -58,6 +58,7 @@ const renderStillOnLambdaRaw = async (input) => {
|
|
|
58
58
|
throw err;
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
|
+
const errorHandled = pure_1.NoReactAPIs.wrapWithErrorHandling(internalRenderStillOnLambda);
|
|
61
62
|
/**
|
|
62
63
|
* @description Renders a still frame on Lambda
|
|
63
64
|
* @link https://remotion.dev/docs/lambda/renderstillonlambda
|
|
@@ -74,4 +75,35 @@ const renderStillOnLambdaRaw = async (input) => {
|
|
|
74
75
|
* @param params.privacy Whether the item in the S3 bucket should be public. Possible values: `"private"` and `"public"`
|
|
75
76
|
* @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
|
|
76
77
|
*/
|
|
77
|
-
|
|
78
|
+
const renderStillOnLambda = (input) => {
|
|
79
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
80
|
+
return errorHandled({
|
|
81
|
+
chromiumOptions: (_a = input.chromiumOptions) !== null && _a !== void 0 ? _a : {},
|
|
82
|
+
composition: input.composition,
|
|
83
|
+
deleteAfter: (_b = input.deleteAfter) !== null && _b !== void 0 ? _b : null,
|
|
84
|
+
downloadBehavior: (_c = input.downloadBehavior) !== null && _c !== void 0 ? _c : { type: 'play-in-browser' },
|
|
85
|
+
envVariables: (_d = input.envVariables) !== null && _d !== void 0 ? _d : {},
|
|
86
|
+
forceBucketName: (_e = input.forceBucketName) !== null && _e !== void 0 ? _e : null,
|
|
87
|
+
forceHeight: (_f = input.forceHeight) !== null && _f !== void 0 ? _f : null,
|
|
88
|
+
forceWidth: (_g = input.forceWidth) !== null && _g !== void 0 ? _g : null,
|
|
89
|
+
frame: (_h = input.frame) !== null && _h !== void 0 ? _h : 0,
|
|
90
|
+
functionName: input.functionName,
|
|
91
|
+
imageFormat: input.imageFormat,
|
|
92
|
+
indent: false,
|
|
93
|
+
inputProps: input.inputProps,
|
|
94
|
+
maxRetries: (_j = input.maxRetries) !== null && _j !== void 0 ? _j : constants_1.DEFAULT_MAX_RETRIES,
|
|
95
|
+
onInit: (_k = input.onInit) !== null && _k !== void 0 ? _k : (() => undefined),
|
|
96
|
+
outName: (_l = input.outName) !== null && _l !== void 0 ? _l : null,
|
|
97
|
+
privacy: input.privacy,
|
|
98
|
+
quality: undefined,
|
|
99
|
+
region: input.region,
|
|
100
|
+
serveUrl: input.serveUrl,
|
|
101
|
+
jpegQuality: (_m = input.jpegQuality) !== null && _m !== void 0 ? _m : 80,
|
|
102
|
+
logLevel: input.dumpBrowserLogs ? 'verbose' : (_o = input.logLevel) !== null && _o !== void 0 ? _o : 'info',
|
|
103
|
+
offthreadVideoCacheSizeInBytes: (_p = input.offthreadVideoCacheSizeInBytes) !== null && _p !== void 0 ? _p : null,
|
|
104
|
+
scale: (_q = input.scale) !== null && _q !== void 0 ? _q : 1,
|
|
105
|
+
timeoutInMilliseconds: (_r = input.timeoutInMilliseconds) !== null && _r !== void 0 ? _r : constants_1.DEFAULT_TIMEOUT,
|
|
106
|
+
dumpBrowserLogs: false,
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
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({
|
|
@@ -15,6 +15,7 @@ const progress_bar_1 = require("../../helpers/progress-bar");
|
|
|
15
15
|
const quit_1 = require("../../helpers/quit");
|
|
16
16
|
const log_1 = require("../../log");
|
|
17
17
|
exports.SITES_CREATE_SUBCOMMAND = 'create';
|
|
18
|
+
const { folderExpiryOption, publicDirOption } = client_1.BrowserSafeApis.options;
|
|
18
19
|
const sitesCreateSubcommand = async (args, remotionRoot, logLevel) => {
|
|
19
20
|
var _a, _b, _c;
|
|
20
21
|
const { file, reason } = cli_1.CliInternals.findEntryPoint({
|
|
@@ -66,7 +67,7 @@ const sitesCreateSubcommand = async (args, remotionRoot, logLevel) => {
|
|
|
66
67
|
].join('\n'), false);
|
|
67
68
|
};
|
|
68
69
|
const bucketStart = Date.now();
|
|
69
|
-
const enableFolderExpiry =
|
|
70
|
+
const enableFolderExpiry = folderExpiryOption.getValue({
|
|
70
71
|
commandLine: cli_1.CliInternals.parsedCli,
|
|
71
72
|
}).value;
|
|
72
73
|
const cliBucketName = (_b = args_1.parsedLambdaCli['force-bucket-name']) !== null && _b !== void 0 ? _b : null;
|
|
@@ -79,11 +80,16 @@ const sitesCreateSubcommand = async (args, remotionRoot, logLevel) => {
|
|
|
79
80
|
updateProgress();
|
|
80
81
|
const bundleStart = Date.now();
|
|
81
82
|
let uploadStart = Date.now();
|
|
83
|
+
const publicDir = publicDirOption.getValue({
|
|
84
|
+
commandLine: cli_1.CliInternals.parsedCli,
|
|
85
|
+
}).value;
|
|
82
86
|
const { serveUrl, siteName, stats } = await (0, deploy_site_1.deploySite)({
|
|
83
87
|
entryPoint: file,
|
|
84
88
|
siteName: desiredSiteName,
|
|
85
89
|
bucketName,
|
|
86
90
|
options: {
|
|
91
|
+
publicDir,
|
|
92
|
+
rootDir: remotionRoot,
|
|
87
93
|
onBundleProgress: (progress) => {
|
|
88
94
|
multiProgress.bundleProgress = {
|
|
89
95
|
progress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "
|
|
1
|
+
export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-south-1" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "af-south-1" | "ap-south-1" | "ap-east-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "me-south-1" | "sa-east-1";
|
|
@@ -4,16 +4,16 @@ declare const streamingPayloadSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
4
4
|
type: z.ZodLiteral<"render-id-determined">;
|
|
5
5
|
renderId: z.ZodString;
|
|
6
6
|
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
renderId: string;
|
|
8
7
|
type: "render-id-determined";
|
|
9
|
-
}, {
|
|
10
8
|
renderId: string;
|
|
9
|
+
}, {
|
|
11
10
|
type: "render-id-determined";
|
|
11
|
+
renderId: string;
|
|
12
12
|
}>]>;
|
|
13
13
|
export type StreamingPayloads = z.infer<typeof streamingPayloadSchema>;
|
|
14
14
|
export declare const isStreamingPayload: (str: string) => false | {
|
|
15
|
-
renderId: string;
|
|
16
15
|
type: "render-id-determined";
|
|
16
|
+
renderId: string;
|
|
17
17
|
};
|
|
18
18
|
export declare const sendProgressEvent: (responseStream: ResponseStream, payload: StreamingPayloads) => void;
|
|
19
19
|
export {};
|
package/dist/internals.d.ts
CHANGED
|
@@ -1,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;
|
|
@@ -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.140",
|
|
4
4
|
"description": "Distributed renderer for Remotion based on AWS Lambda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"aws-policies": "^1.0.1",
|
|
27
27
|
"mime-types": "2.1.34",
|
|
28
28
|
"zod": "3.22.3",
|
|
29
|
-
"@remotion/bundler": "4.0.
|
|
30
|
-
"@remotion/
|
|
31
|
-
"@remotion/
|
|
32
|
-
"remotion": "4.0.
|
|
29
|
+
"@remotion/bundler": "4.0.140",
|
|
30
|
+
"@remotion/cli": "4.0.140",
|
|
31
|
+
"@remotion/renderer": "4.0.140",
|
|
32
|
+
"remotion": "4.0.140"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@jonny/eslint-config": "3.0.281",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"ts-node": "10.9.2",
|
|
45
45
|
"vitest": "0.31.1",
|
|
46
46
|
"zip-lib": "^0.7.2",
|
|
47
|
-
"@remotion/bundler": "4.0.
|
|
48
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
47
|
+
"@remotion/bundler": "4.0.140",
|
|
48
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.140"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@remotion/bundler": "4.0.
|
|
51
|
+
"@remotion/bundler": "4.0.140"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|