@remotion/lambda 4.0.166 → 4.0.167
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/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -4
- package/dist/functions/helpers/check-if-render-exists.js +1 -1
- package/dist/functions/helpers/get-cleanup-progress.d.ts +3 -1
- package/dist/functions/helpers/get-cleanup-progress.js +3 -1
- package/dist/functions/helpers/get-encoding-progress-step-size.d.ts +1 -1
- package/dist/functions/helpers/get-encoding-progress-step-size.js +0 -3
- package/dist/functions/helpers/get-files-to-delete.d.ts +3 -1
- package/dist/functions/helpers/get-files-to-delete.js +35 -1
- package/dist/functions/helpers/get-lambdas-invoked-stats.d.ts +1 -1
- package/dist/functions/helpers/get-lambdas-invoked-stats.js +0 -1
- package/dist/functions/streaming/streaming.js +2 -2
- package/dist/internals.d.ts +5 -5
- package/dist/shared/call-lambda.js +5 -5
- package/dist/shared/chunk-progress.d.ts +2 -1
- package/dist/shared/chunk-progress.js +2 -2
- package/package.json +9 -11
- package/remotionlambda-arm64.zip +0 -0
- package/remotion-lambda-cli.js +0 -12
|
@@ -59,11 +59,11 @@ export declare const internalDeploySite: (args_0: MandatoryParameters & {
|
|
|
59
59
|
getValue: ({ commandLine }: {
|
|
60
60
|
commandLine: Record<string, unknown>;
|
|
61
61
|
}) => {
|
|
62
|
-
value: "
|
|
62
|
+
value: "info" | "error" | "verbose" | "warn";
|
|
63
63
|
source: string;
|
|
64
64
|
};
|
|
65
|
-
setConfig: (newLogLevel: "
|
|
66
|
-
type: "
|
|
65
|
+
setConfig: (newLogLevel: "info" | "error" | "verbose" | "warn") => void;
|
|
66
|
+
type: "info" | "error" | "verbose" | "warn";
|
|
67
67
|
};
|
|
68
68
|
readonly throwIfSiteExists: {
|
|
69
69
|
cliFlag: string;
|
|
@@ -5,7 +5,7 @@ const constants_1 = require("../../shared/constants");
|
|
|
5
5
|
const checkIfRenderExists = (contents, renderId, bucketName, region) => {
|
|
6
6
|
const initializedExists = Boolean(contents.find((c) => {
|
|
7
7
|
var _a;
|
|
8
|
-
return (_a = c.Key) === null || _a === void 0 ? void 0 : _a.startsWith((0, constants_1.
|
|
8
|
+
return (_a = c.Key) === null || _a === void 0 ? void 0 : _a.startsWith((0, constants_1.initalizedMetadataKey)(renderId));
|
|
9
9
|
}));
|
|
10
10
|
if (!initializedExists) {
|
|
11
11
|
// ! Error message is checked in progress handler and will be retried. Make sure to update
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { _Object } from '@aws-sdk/client-s3';
|
|
2
2
|
import type { CleanupInfo } from '../../shared/constants';
|
|
3
|
-
export declare const getCleanupProgress: ({ contents, output, chunkCount, renderId, }: {
|
|
3
|
+
export declare const getCleanupProgress: ({ contents, output, chunkCount, renderId, hasAudio, hasVideo, }: {
|
|
4
4
|
contents: _Object[];
|
|
5
5
|
output: string | null;
|
|
6
6
|
chunkCount: number;
|
|
7
7
|
renderId: string;
|
|
8
|
+
hasAudio: boolean;
|
|
9
|
+
hasVideo: boolean;
|
|
8
10
|
}) => null | CleanupInfo;
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCleanupProgress = void 0;
|
|
4
4
|
const get_files_to_delete_1 = require("./get-files-to-delete");
|
|
5
|
-
const getCleanupProgress = ({ contents, output, chunkCount, renderId, }) => {
|
|
5
|
+
const getCleanupProgress = ({ contents, output, chunkCount, renderId, hasAudio, hasVideo, }) => {
|
|
6
6
|
if (output === null) {
|
|
7
7
|
return null;
|
|
8
8
|
}
|
|
9
9
|
const filesToDelete = (0, get_files_to_delete_1.getFilesToDelete)({
|
|
10
10
|
chunkCount,
|
|
11
11
|
renderId,
|
|
12
|
+
hasAudio,
|
|
13
|
+
hasVideo,
|
|
12
14
|
});
|
|
13
15
|
const filesStillThere = contents.filter((c) => {
|
|
14
16
|
return filesToDelete.find((f) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
declare const getEncodingProgressStepSize: (totalFrames: number) => number;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEncodingProgressStepSize = void 0;
|
|
4
2
|
const getEncodingProgressStepSize = (totalFrames) => {
|
|
5
3
|
return Math.min(100, Math.max(5, totalFrames / 10));
|
|
6
4
|
};
|
|
7
|
-
exports.getEncodingProgressStepSize = getEncodingProgressStepSize;
|
|
@@ -2,7 +2,9 @@ export type CleanupJob = {
|
|
|
2
2
|
name: string;
|
|
3
3
|
type: 'exact' | 'prefix';
|
|
4
4
|
};
|
|
5
|
-
export declare const getFilesToDelete: ({ chunkCount, renderId, }: {
|
|
5
|
+
export declare const getFilesToDelete: ({ chunkCount, renderId, hasVideo, hasAudio, }: {
|
|
6
6
|
chunkCount: number;
|
|
7
7
|
renderId: string;
|
|
8
|
+
hasVideo: boolean;
|
|
9
|
+
hasAudio: boolean;
|
|
8
10
|
}) => CleanupJob[];
|
|
@@ -2,17 +2,51 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFilesToDelete = void 0;
|
|
4
4
|
const constants_1 = require("../../shared/constants");
|
|
5
|
-
const getFilesToDelete = ({ chunkCount, renderId, }) => {
|
|
5
|
+
const getFilesToDelete = ({ chunkCount, renderId, hasVideo, hasAudio, }) => {
|
|
6
|
+
const videoChunks = hasVideo
|
|
7
|
+
? new Array(chunkCount).fill(true).map((_x, i) => (0, constants_1.chunkKeyForIndex)({
|
|
8
|
+
index: i,
|
|
9
|
+
renderId,
|
|
10
|
+
type: 'video',
|
|
11
|
+
}))
|
|
12
|
+
: [];
|
|
13
|
+
const audioChunks = hasAudio
|
|
14
|
+
? new Array(chunkCount).fill(true).map((_x, i) => (0, constants_1.chunkKeyForIndex)({
|
|
15
|
+
index: i,
|
|
16
|
+
renderId,
|
|
17
|
+
type: 'audio',
|
|
18
|
+
}))
|
|
19
|
+
: [];
|
|
6
20
|
const lambdaTimings = new Array(chunkCount)
|
|
7
21
|
.fill(true)
|
|
8
22
|
.map((_x, i) => (0, constants_1.lambdaTimingsPrefixForChunk)(renderId, i));
|
|
9
23
|
return [
|
|
24
|
+
{
|
|
25
|
+
name: (0, constants_1.lambdaChunkInitializedPrefix)(renderId),
|
|
26
|
+
type: 'prefix',
|
|
27
|
+
},
|
|
28
|
+
...videoChunks.map((i) => {
|
|
29
|
+
return {
|
|
30
|
+
name: i,
|
|
31
|
+
type: 'exact',
|
|
32
|
+
};
|
|
33
|
+
}),
|
|
34
|
+
...audioChunks.map((i) => {
|
|
35
|
+
return {
|
|
36
|
+
name: i,
|
|
37
|
+
type: 'exact',
|
|
38
|
+
};
|
|
39
|
+
}),
|
|
10
40
|
...lambdaTimings.map((i) => {
|
|
11
41
|
return {
|
|
12
42
|
name: i,
|
|
13
43
|
type: 'prefix',
|
|
14
44
|
};
|
|
15
45
|
}),
|
|
46
|
+
{
|
|
47
|
+
name: (0, constants_1.encodingProgressKey)(renderId),
|
|
48
|
+
type: 'exact',
|
|
49
|
+
},
|
|
16
50
|
];
|
|
17
51
|
};
|
|
18
52
|
exports.getFilesToDelete = getFilesToDelete;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeStreamPayload = exports.messageTypeIdToMessageType = exports.formatMap = void 0;
|
|
4
|
-
const
|
|
4
|
+
const streaming_1 = require("@remotion/streaming");
|
|
5
5
|
const framesRendered = 'frames-rendered';
|
|
6
6
|
const errorOccurred = 'error-occurred';
|
|
7
7
|
const renderIdDetermined = 'render-id-determined';
|
|
@@ -49,7 +49,7 @@ const makeStreamPayload = ({ message }) => {
|
|
|
49
49
|
const body = exports.formatMap[message.type] === 'json'
|
|
50
50
|
? new TextEncoder().encode(JSON.stringify(message.payload))
|
|
51
51
|
: message.payload;
|
|
52
|
-
return
|
|
52
|
+
return (0, streaming_1.makeStreamPayloadMessage)({
|
|
53
53
|
body,
|
|
54
54
|
nonce: messageTypeToMessageId(message.type),
|
|
55
55
|
status: 0,
|
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: "info" | "error" | "verbose" | "warn") => 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("./client").GetRenderProgressInput) => import("./defaults").LambdaStatusPayload;
|
|
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("./defaults").Privacy;
|
|
17
|
-
logLevel: "
|
|
17
|
+
logLevel: "info" | "error" | "verbose" | "warn";
|
|
18
18
|
outName: import("./defaults").OutNameInput | null;
|
|
19
19
|
timeoutInMilliseconds: number;
|
|
20
20
|
chromiumOptions: import("@remotion/renderer").ChromiumOptions;
|
|
@@ -57,11 +57,11 @@ export declare const LambdaInternals: {
|
|
|
57
57
|
getValue: ({ commandLine }: {
|
|
58
58
|
commandLine: Record<string, unknown>;
|
|
59
59
|
}) => {
|
|
60
|
-
value: "
|
|
60
|
+
value: "info" | "error" | "verbose" | "warn";
|
|
61
61
|
source: string;
|
|
62
62
|
};
|
|
63
|
-
setConfig: (newLogLevel: "
|
|
64
|
-
type: "
|
|
63
|
+
setConfig: (newLogLevel: "info" | "error" | "verbose" | "warn") => void;
|
|
64
|
+
type: "info" | "error" | "verbose" | "warn";
|
|
65
65
|
};
|
|
66
66
|
readonly throwIfSiteExists: {
|
|
67
67
|
cliFlag: string;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.callLambdaWithStreaming = exports.callLambda = void 0;
|
|
4
4
|
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const streaming_1 = require("@remotion/streaming");
|
|
6
|
+
const streaming_2 = require("../functions/streaming/streaming");
|
|
7
7
|
const aws_clients_1 = require("./aws-clients");
|
|
8
8
|
const INVALID_JSON_MESSAGE = 'Cannot parse Lambda response as JSON';
|
|
9
9
|
const parseJsonOrThrowSource = (data, type) => {
|
|
@@ -67,9 +67,9 @@ const callLambdaWithStreamingWithoutRetry = async ({ functionName, type, payload
|
|
|
67
67
|
FunctionName: functionName,
|
|
68
68
|
Payload: JSON.stringify({ type, ...payload }),
|
|
69
69
|
}));
|
|
70
|
-
const { onData, clear } =
|
|
71
|
-
const messageType = (0,
|
|
72
|
-
const innerPayload =
|
|
70
|
+
const { onData, clear } = (0, streaming_1.makeStreamer)((status, messageTypeId, data) => {
|
|
71
|
+
const messageType = (0, streaming_2.messageTypeIdToMessageType)(messageTypeId);
|
|
72
|
+
const innerPayload = streaming_2.formatMap[messageType] === 'json'
|
|
73
73
|
? parseJsonOrThrowSource(data, messageType)
|
|
74
74
|
: data;
|
|
75
75
|
const message = {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export declare const writeLambdaInitializedFile: ({ bucketName, expectedBucketOwner, attempt, chunk, renderId, }: {
|
|
1
|
+
export declare const writeLambdaInitializedFile: ({ bucketName, expectedBucketOwner, attempt, chunk, renderId, framesRendered, }: {
|
|
2
2
|
bucketName: string;
|
|
3
3
|
expectedBucketOwner: string;
|
|
4
4
|
renderId: string;
|
|
5
5
|
chunk: number;
|
|
6
6
|
attempt: number;
|
|
7
|
+
framesRendered: number;
|
|
7
8
|
}) => Promise<void>;
|
|
8
9
|
export declare const getProgressOfChunk: (etag: string) => number;
|
|
@@ -2010,11 +2010,11 @@ const etags = [
|
|
|
2010
2010
|
'"c5b2cebf15b205503560c4e8e6d1ea78"',
|
|
2011
2011
|
'"5ec829debe54b19a5f78d9a65b900a39"',
|
|
2012
2012
|
];
|
|
2013
|
-
const writeLambdaInitializedFile = ({ bucketName, expectedBucketOwner, attempt, chunk, renderId, }) => {
|
|
2013
|
+
const writeLambdaInitializedFile = ({ bucketName, expectedBucketOwner, attempt, chunk, renderId, framesRendered, }) => {
|
|
2014
2014
|
return (0, io_1.lambdaWriteFile)({
|
|
2015
2015
|
privacy: 'private',
|
|
2016
2016
|
bucketName,
|
|
2017
|
-
body:
|
|
2017
|
+
body: String(framesRendered),
|
|
2018
2018
|
key: (0, constants_1.lambdaChunkInitializedKey)({
|
|
2019
2019
|
renderId,
|
|
2020
2020
|
chunk,
|
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.167",
|
|
4
4
|
"description": "Distributed renderer for Remotion based on AWS Lambda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"bin": {
|
|
8
|
-
"remotion-lambda": "remotion-lambda-cli.js"
|
|
9
|
-
},
|
|
10
7
|
"author": "Jonny Burger <jonny@remotion.dev>",
|
|
11
8
|
"license": "MIT",
|
|
12
9
|
"repository": {
|
|
@@ -25,10 +22,11 @@
|
|
|
25
22
|
"@aws-sdk/s3-request-presigner": "3.583.0",
|
|
26
23
|
"mime-types": "2.1.34",
|
|
27
24
|
"zod": "3.22.3",
|
|
28
|
-
"@remotion/bundler": "4.0.
|
|
29
|
-
"@remotion/
|
|
30
|
-
"remotion": "4.0.
|
|
31
|
-
"
|
|
25
|
+
"@remotion/bundler": "4.0.167",
|
|
26
|
+
"@remotion/renderer": "4.0.167",
|
|
27
|
+
"@remotion/cli": "4.0.167",
|
|
28
|
+
"remotion": "4.0.167",
|
|
29
|
+
"@remotion/streaming": "4.0.167"
|
|
32
30
|
},
|
|
33
31
|
"devDependencies": {
|
|
34
32
|
"@jonny/eslint-config": "3.0.281",
|
|
@@ -44,11 +42,11 @@
|
|
|
44
42
|
"ts-node": "10.9.2",
|
|
45
43
|
"vitest": "0.31.1",
|
|
46
44
|
"zip-lib": "^0.7.2",
|
|
47
|
-
"@remotion/bundler": "4.0.
|
|
48
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
45
|
+
"@remotion/bundler": "4.0.167",
|
|
46
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.167"
|
|
49
47
|
},
|
|
50
48
|
"peerDependencies": {
|
|
51
|
-
"@remotion/bundler": "4.0.
|
|
49
|
+
"@remotion/bundler": "4.0.167"
|
|
52
50
|
},
|
|
53
51
|
"publishConfig": {
|
|
54
52
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|
package/remotion-lambda-cli.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const dotenv = require('dotenv');
|
|
3
|
-
dotenv.config();
|
|
4
|
-
const {cli} = require('./dist/cli/index');
|
|
5
|
-
|
|
6
|
-
cli()
|
|
7
|
-
.then(() => process.exit(0))
|
|
8
|
-
.catch((err) => {
|
|
9
|
-
// eslint-disable-next-line no-console
|
|
10
|
-
console.error(err);
|
|
11
|
-
process.exit(1);
|
|
12
|
-
});
|