@remotion/lambda 4.0.160 → 4.0.163
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/deploy-site.d.ts +3 -3
- package/dist/cli/commands/functions/deploy.js +1 -1
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -4
- package/dist/functions/helpers/streaming-payloads.d.ts +3 -3
- package/dist/internals.d.ts +5 -5
- package/package.json +8 -8
- package/remotionlambda-arm64.zip +0 -0
- package/dist/functions/streaming/streaming.d.ts +0 -75
- package/dist/functions/streaming/streaming.js +0 -160
|
@@ -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: "verbose" | "info" | "warn" | "error";
|
|
63
63
|
source: string;
|
|
64
64
|
};
|
|
65
|
-
setConfig: (newLogLevel: "
|
|
66
|
-
type: "
|
|
65
|
+
setConfig: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
|
|
66
|
+
type: "verbose" | "info" | "warn" | "error";
|
|
67
67
|
};
|
|
68
68
|
readonly throwIfSiteExists: {
|
|
69
69
|
cliFlag: string;
|
|
@@ -73,7 +73,7 @@ VPC Security Group IDs = ${vpcSecurityGroupIds}
|
|
|
73
73
|
if (cli_1.CliInternals.quietFlagProvided()) {
|
|
74
74
|
cli_1.CliInternals.Log.info({ indent: false, logLevel }, functionName);
|
|
75
75
|
}
|
|
76
|
-
if (alreadyExisted) {
|
|
76
|
+
else if (alreadyExisted) {
|
|
77
77
|
output.update(`Already exists as ${functionName}`, true);
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
@@ -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/internals.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const LambdaInternals: {
|
|
2
|
-
executeCommand: (args: string[], remotionRoot: string, logLevel: "
|
|
2
|
+
executeCommand: (args: string[], remotionRoot: string, logLevel: "verbose" | "info" | "warn" | "error") => 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
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: "verbose" | "info" | "warn" | "error";
|
|
18
18
|
outName: import("./defaults").OutNameInput | null;
|
|
19
19
|
timeoutInMilliseconds: number;
|
|
20
20
|
chromiumOptions: import("@remotion/renderer").ChromiumOptions;
|
|
@@ -56,11 +56,11 @@ export declare const LambdaInternals: {
|
|
|
56
56
|
getValue: ({ commandLine }: {
|
|
57
57
|
commandLine: Record<string, unknown>;
|
|
58
58
|
}) => {
|
|
59
|
-
value: "
|
|
59
|
+
value: "verbose" | "info" | "warn" | "error";
|
|
60
60
|
source: string;
|
|
61
61
|
};
|
|
62
|
-
setConfig: (newLogLevel: "
|
|
63
|
-
type: "
|
|
62
|
+
setConfig: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
|
|
63
|
+
type: "verbose" | "info" | "warn" | "error";
|
|
64
64
|
};
|
|
65
65
|
readonly throwIfSiteExists: {
|
|
66
66
|
cliFlag: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.163",
|
|
4
4
|
"description": "Distributed renderer for Remotion based on AWS Lambda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"@aws-sdk/s3-request-presigner": "3.382.0",
|
|
26
26
|
"mime-types": "2.1.34",
|
|
27
27
|
"zod": "3.22.3",
|
|
28
|
-
"@remotion/bundler": "4.0.
|
|
29
|
-
"@remotion/
|
|
30
|
-
"@remotion/
|
|
31
|
-
"remotion": "4.0.
|
|
28
|
+
"@remotion/bundler": "4.0.163",
|
|
29
|
+
"@remotion/renderer": "4.0.163",
|
|
30
|
+
"@remotion/cli": "4.0.163",
|
|
31
|
+
"remotion": "4.0.163"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@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/
|
|
48
|
-
"@remotion/
|
|
47
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.163",
|
|
48
|
+
"@remotion/bundler": "4.0.163"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@remotion/bundler": "4.0.
|
|
51
|
+
"@remotion/bundler": "4.0.163"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
declare const framesRendered: "frames-rendered";
|
|
3
|
-
declare const errorOccurred: "error-occurred";
|
|
4
|
-
declare const renderIdDetermined: "render-id-determined";
|
|
5
|
-
declare const videoChunkRendered: "video-chunk-rendered";
|
|
6
|
-
declare const audioChunkRendered: "audio-chunk-rendered";
|
|
7
|
-
declare const responseJson: "response-json";
|
|
8
|
-
declare const messageTypes: {
|
|
9
|
-
readonly '1': {
|
|
10
|
-
readonly type: "frames-rendered";
|
|
11
|
-
};
|
|
12
|
-
readonly '2': {
|
|
13
|
-
readonly type: "error-occurred";
|
|
14
|
-
};
|
|
15
|
-
readonly '3': {
|
|
16
|
-
readonly type: "render-id-determined";
|
|
17
|
-
};
|
|
18
|
-
readonly '4': {
|
|
19
|
-
readonly type: "video-chunk-rendered";
|
|
20
|
-
};
|
|
21
|
-
readonly '5': {
|
|
22
|
-
readonly type: "audio-chunk-rendered";
|
|
23
|
-
};
|
|
24
|
-
readonly '6': {
|
|
25
|
-
readonly type: "response-json";
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
type MessageTypeId = keyof typeof messageTypes;
|
|
29
|
-
type MessageType = (typeof messageTypes)[MessageTypeId]['type'];
|
|
30
|
-
export declare const formatMap: {
|
|
31
|
-
[key in MessageType]: 'json' | 'binary';
|
|
32
|
-
};
|
|
33
|
-
export type StreamingPayload = {
|
|
34
|
-
type: typeof framesRendered;
|
|
35
|
-
payload: {
|
|
36
|
-
frames: number;
|
|
37
|
-
};
|
|
38
|
-
} | {
|
|
39
|
-
type: typeof videoChunkRendered;
|
|
40
|
-
payload: Buffer;
|
|
41
|
-
} | {
|
|
42
|
-
type: typeof audioChunkRendered;
|
|
43
|
-
payload: Buffer;
|
|
44
|
-
} | {
|
|
45
|
-
type: typeof errorOccurred;
|
|
46
|
-
payload: {
|
|
47
|
-
error: string;
|
|
48
|
-
};
|
|
49
|
-
} | {
|
|
50
|
-
type: typeof renderIdDetermined;
|
|
51
|
-
payload: {
|
|
52
|
-
renderId: string;
|
|
53
|
-
};
|
|
54
|
-
} | {
|
|
55
|
-
type: typeof responseJson;
|
|
56
|
-
payload: Record<string, unknown>;
|
|
57
|
-
};
|
|
58
|
-
export declare const messageTypeIdToMessage: (messageTypeId: MessageTypeId) => MessageType;
|
|
59
|
-
export declare const messageTypeToMessageId: (messageType: MessageType) => MessageTypeId;
|
|
60
|
-
type StreamingMessage = {
|
|
61
|
-
successType: 'error' | 'success';
|
|
62
|
-
message: StreamingPayload;
|
|
63
|
-
};
|
|
64
|
-
export type OnMessage = (options: StreamingMessage) => void;
|
|
65
|
-
export declare const makeStreaming: (options: {
|
|
66
|
-
onMessage: OnMessage;
|
|
67
|
-
}) => {
|
|
68
|
-
addData: (data: Buffer) => void;
|
|
69
|
-
};
|
|
70
|
-
export declare const makePayloadMessage: ({ message, status, }: {
|
|
71
|
-
message: StreamingPayload;
|
|
72
|
-
status: 0 | 1;
|
|
73
|
-
}) => Buffer;
|
|
74
|
-
export type OnStream = (payload: StreamingPayload) => Promise<void>;
|
|
75
|
-
export {};
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makePayloadMessage = exports.makeStreaming = exports.messageTypeToMessageId = exports.messageTypeIdToMessage = exports.formatMap = void 0;
|
|
4
|
-
const framesRendered = 'frames-rendered';
|
|
5
|
-
const errorOccurred = 'error-occurred';
|
|
6
|
-
const renderIdDetermined = 'render-id-determined';
|
|
7
|
-
const videoChunkRendered = 'video-chunk-rendered';
|
|
8
|
-
const audioChunkRendered = 'audio-chunk-rendered';
|
|
9
|
-
const responseJson = 'response-json';
|
|
10
|
-
const messageTypes = {
|
|
11
|
-
'1': { type: framesRendered },
|
|
12
|
-
'2': { type: errorOccurred },
|
|
13
|
-
'3': { type: renderIdDetermined },
|
|
14
|
-
'4': { type: videoChunkRendered },
|
|
15
|
-
'5': { type: audioChunkRendered },
|
|
16
|
-
'6': { type: responseJson },
|
|
17
|
-
};
|
|
18
|
-
exports.formatMap = {
|
|
19
|
-
[framesRendered]: 'json',
|
|
20
|
-
[errorOccurred]: 'json',
|
|
21
|
-
[renderIdDetermined]: 'json',
|
|
22
|
-
[responseJson]: 'json',
|
|
23
|
-
[videoChunkRendered]: 'binary',
|
|
24
|
-
[audioChunkRendered]: 'binary',
|
|
25
|
-
};
|
|
26
|
-
const messageTypeIdToMessage = (messageTypeId) => {
|
|
27
|
-
const types = messageTypes[messageTypeId];
|
|
28
|
-
if (!types) {
|
|
29
|
-
throw new Error(`Unknown message type id ${messageTypeId}`);
|
|
30
|
-
}
|
|
31
|
-
return types.type;
|
|
32
|
-
};
|
|
33
|
-
exports.messageTypeIdToMessage = messageTypeIdToMessage;
|
|
34
|
-
const messageTypeToMessageId = (messageType) => {
|
|
35
|
-
const id = Object.keys(messageTypes).find((key) => messageTypes[key].type === messageType);
|
|
36
|
-
if (!id) {
|
|
37
|
-
throw new Error(`Unknown message type ${messageType}`);
|
|
38
|
-
}
|
|
39
|
-
return id;
|
|
40
|
-
};
|
|
41
|
-
exports.messageTypeToMessageId = messageTypeToMessageId;
|
|
42
|
-
const magicSeparator = Buffer.from('remotion_buffer:');
|
|
43
|
-
const parseJsonOrThrowSource = (data, type) => {
|
|
44
|
-
const asString = data.toString('utf-8');
|
|
45
|
-
try {
|
|
46
|
-
return JSON.parse(asString);
|
|
47
|
-
}
|
|
48
|
-
catch (err) {
|
|
49
|
-
throw new Error(`Invalid JSON (${type}): ${asString}`);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
const makeStreaming = (options) => {
|
|
53
|
-
let outputBuffer = Buffer.from('');
|
|
54
|
-
let unprocessedBuffers = [];
|
|
55
|
-
let missingData = null;
|
|
56
|
-
const processInput = () => {
|
|
57
|
-
let separatorIndex = outputBuffer.indexOf(magicSeparator);
|
|
58
|
-
if (separatorIndex === -1) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
separatorIndex += magicSeparator.length;
|
|
62
|
-
let messageTypeString = '';
|
|
63
|
-
let lengthString = '';
|
|
64
|
-
let statusString = '';
|
|
65
|
-
// Each message has the structure with `remotion_buffer:{[message_type_id]}:{[length]}`
|
|
66
|
-
// Let's read the buffer to extract the nonce, and if the full length is available,
|
|
67
|
-
// we'll extract the data and pass it to the callback.
|
|
68
|
-
// eslint-disable-next-line no-constant-condition
|
|
69
|
-
while (true) {
|
|
70
|
-
const nextDigit = outputBuffer[separatorIndex];
|
|
71
|
-
// 0x3a is the character ":"
|
|
72
|
-
if (nextDigit === 0x3a) {
|
|
73
|
-
separatorIndex++;
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
separatorIndex++;
|
|
77
|
-
messageTypeString += String.fromCharCode(nextDigit);
|
|
78
|
-
}
|
|
79
|
-
// eslint-disable-next-line no-constant-condition
|
|
80
|
-
while (true) {
|
|
81
|
-
const nextDigit = outputBuffer[separatorIndex];
|
|
82
|
-
if (nextDigit === 0x3a) {
|
|
83
|
-
separatorIndex++;
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
separatorIndex++;
|
|
87
|
-
lengthString += String.fromCharCode(nextDigit);
|
|
88
|
-
}
|
|
89
|
-
// eslint-disable-next-line no-constant-condition
|
|
90
|
-
while (true) {
|
|
91
|
-
const nextDigit = outputBuffer[separatorIndex];
|
|
92
|
-
if (nextDigit === 0x3a) {
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
separatorIndex++;
|
|
96
|
-
statusString += String.fromCharCode(nextDigit);
|
|
97
|
-
}
|
|
98
|
-
const length = Number(lengthString);
|
|
99
|
-
const status = Number(statusString);
|
|
100
|
-
const dataLength = outputBuffer.length - separatorIndex - 1;
|
|
101
|
-
if (dataLength < length) {
|
|
102
|
-
missingData = {
|
|
103
|
-
dataMissing: length - dataLength,
|
|
104
|
-
};
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
const data = outputBuffer.subarray(separatorIndex + 1, separatorIndex + 1 + Number(lengthString));
|
|
108
|
-
const messageType = (0, exports.messageTypeIdToMessage)(messageTypeString);
|
|
109
|
-
const innerPayload = exports.formatMap[messageType] === 'json'
|
|
110
|
-
? parseJsonOrThrowSource(data, messageType)
|
|
111
|
-
: data;
|
|
112
|
-
const payload = {
|
|
113
|
-
type: messageType,
|
|
114
|
-
payload: innerPayload,
|
|
115
|
-
};
|
|
116
|
-
options.onMessage({
|
|
117
|
-
successType: status === 1 ? 'error' : 'success',
|
|
118
|
-
message: payload,
|
|
119
|
-
});
|
|
120
|
-
missingData = null;
|
|
121
|
-
outputBuffer = outputBuffer.subarray(separatorIndex + Number(lengthString) + 1);
|
|
122
|
-
processInput();
|
|
123
|
-
};
|
|
124
|
-
return {
|
|
125
|
-
addData: (data) => {
|
|
126
|
-
unprocessedBuffers.push(data);
|
|
127
|
-
const separatorIndex = data.indexOf(magicSeparator);
|
|
128
|
-
if (separatorIndex === -1) {
|
|
129
|
-
if (missingData) {
|
|
130
|
-
missingData.dataMissing -= data.length;
|
|
131
|
-
}
|
|
132
|
-
if (!missingData || missingData.dataMissing > 0) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
unprocessedBuffers.unshift(outputBuffer);
|
|
137
|
-
outputBuffer = Buffer.concat(unprocessedBuffers);
|
|
138
|
-
unprocessedBuffers = [];
|
|
139
|
-
processInput();
|
|
140
|
-
},
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
exports.makeStreaming = makeStreaming;
|
|
144
|
-
const makePayloadMessage = ({ message, status, }) => {
|
|
145
|
-
const body = exports.formatMap[message.type] === 'json'
|
|
146
|
-
? Buffer.from(JSON.stringify(message.payload))
|
|
147
|
-
: message.payload;
|
|
148
|
-
const concat = Buffer.concat([
|
|
149
|
-
magicSeparator,
|
|
150
|
-
Buffer.from((0, exports.messageTypeToMessageId)(message.type).toString()),
|
|
151
|
-
Buffer.from(':'),
|
|
152
|
-
Buffer.from(body.length.toString()),
|
|
153
|
-
Buffer.from(':'),
|
|
154
|
-
Buffer.from(String(status)),
|
|
155
|
-
Buffer.from(':'),
|
|
156
|
-
body,
|
|
157
|
-
]);
|
|
158
|
-
return concat;
|
|
159
|
-
};
|
|
160
|
-
exports.makePayloadMessage = makePayloadMessage;
|