@remotion/lambda 4.0.58 → 4.0.60
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/cli/helpers/validate.d.ts +4 -0
- package/dist/cli/helpers/validate.js +8 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.js +3 -1
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/helpers/streaming-payloads.d.ts +3 -3
- package/dist/functions/streaming/streaming.d.ts +12 -0
- package/dist/functions/streaming/streaming.js +100 -0
- package/dist/internals.d.ts +1 -1
- package/package.json +8 -8
- package/remotionlambda-arm64.zip +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateDurationInFrames = exports.validateDimension = exports.validateFps = void 0;
|
|
4
|
+
/* eslint-disable prefer-destructuring */
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
exports.validateFps = remotion_1.Internals.validateFps;
|
|
7
|
+
exports.validateDimension = remotion_1.Internals.validateDimension;
|
|
8
|
+
exports.validateDurationInFrames = remotion_1.Internals.validateDurationInFrames;
|
package/dist/client.d.ts
CHANGED
|
@@ -16,5 +16,6 @@ import { DeleteAfter } from './functions/helpers/lifecycle';
|
|
|
16
16
|
import type { AwsRegion } from './pricing/aws-regions';
|
|
17
17
|
import type { RenderProgress } from './shared/constants';
|
|
18
18
|
import type { WebhookPayload } from './shared/invoke-webhook';
|
|
19
|
+
export { CustomCredentials, getServiceClient } from './shared/aws-clients';
|
|
19
20
|
export { renderVideoOnLambda, renderMediaOnLambda, renderStillOnLambda, getRenderProgress, getFunctions, validateWebhookSignature, getCompositionsOnLambda, presignUrl, getSites, speculateFunctionName, DeleteAfter, };
|
|
20
21
|
export type { AwsRegion, RenderProgress, SpeculateFunctionNameInput, WebhookPayload, PresignUrlInput, RenderStillOnLambdaInput, RenderStillOnLambdaOutput, RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput, GetRenderProgressInput, };
|
package/dist/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.speculateFunctionName = exports.getSites = exports.presignUrl = exports.getCompositionsOnLambda = exports.validateWebhookSignature = exports.getFunctions = exports.getRenderProgress = exports.renderStillOnLambda = exports.renderMediaOnLambda = exports.renderVideoOnLambda = void 0;
|
|
3
|
+
exports.speculateFunctionName = exports.getSites = exports.presignUrl = exports.getCompositionsOnLambda = exports.validateWebhookSignature = exports.getFunctions = exports.getRenderProgress = exports.renderStillOnLambda = exports.renderMediaOnLambda = exports.renderVideoOnLambda = exports.getServiceClient = void 0;
|
|
4
4
|
const get_compositions_on_lambda_1 = require("./api/get-compositions-on-lambda");
|
|
5
5
|
Object.defineProperty(exports, "getCompositionsOnLambda", { enumerable: true, get: function () { return get_compositions_on_lambda_1.getCompositionsOnLambda; } });
|
|
6
6
|
const get_functions_1 = require("./api/get-functions");
|
|
@@ -20,3 +20,5 @@ const speculate_function_name_1 = require("./api/speculate-function-name");
|
|
|
20
20
|
Object.defineProperty(exports, "speculateFunctionName", { enumerable: true, get: function () { return speculate_function_name_1.speculateFunctionName; } });
|
|
21
21
|
const validate_webhook_signature_1 = require("./api/validate-webhook-signature");
|
|
22
22
|
Object.defineProperty(exports, "validateWebhookSignature", { enumerable: true, get: function () { return validate_webhook_signature_1.validateWebhookSignature; } });
|
|
23
|
+
var aws_clients_1 = require("./shared/aws-clients");
|
|
24
|
+
Object.defineProperty(exports, "getServiceClient", { enumerable: true, get: function () { return aws_clients_1.getServiceClient; } });
|
|
@@ -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";
|
|
@@ -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 {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
type OnMessage = (type: 'error' | 'success', nonce: string, data: Buffer) => void;
|
|
3
|
+
export declare const makeStreaming: (onMessage: OnMessage) => {
|
|
4
|
+
addData: (data: Buffer) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const makePayloadMessage: (nonce: number, data: Buffer, status: 0 | 1) => Buffer;
|
|
7
|
+
export type StreamingPayload = {
|
|
8
|
+
type: 'frames-rendered';
|
|
9
|
+
frames: number;
|
|
10
|
+
};
|
|
11
|
+
export type OnStream = (payload: StreamingPayload) => void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makePayloadMessage = exports.makeStreaming = void 0;
|
|
4
|
+
const makeStreaming = (onMessage) => {
|
|
5
|
+
let outputBuffer = Buffer.from('');
|
|
6
|
+
const separator = Buffer.from('remotion_buffer:');
|
|
7
|
+
let unprocessedBuffers = [];
|
|
8
|
+
let missingData = null;
|
|
9
|
+
const processInput = () => {
|
|
10
|
+
let separatorIndex = outputBuffer.indexOf(separator);
|
|
11
|
+
if (separatorIndex === -1) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
separatorIndex += separator.length;
|
|
15
|
+
let nonceString = '';
|
|
16
|
+
let lengthString = '';
|
|
17
|
+
let statusString = '';
|
|
18
|
+
// Each message from Rust is prefixed with `remotion_buffer;{[nonce]}:{[length]}`
|
|
19
|
+
// Let's read the buffer to extract the nonce, and if the full length is available,
|
|
20
|
+
// we'll extract the data and pass it to the callback.
|
|
21
|
+
// eslint-disable-next-line no-constant-condition
|
|
22
|
+
while (true) {
|
|
23
|
+
const nextDigit = outputBuffer[separatorIndex];
|
|
24
|
+
// 0x3a is the character ":"
|
|
25
|
+
if (nextDigit === 0x3a) {
|
|
26
|
+
separatorIndex++;
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
separatorIndex++;
|
|
30
|
+
nonceString += String.fromCharCode(nextDigit);
|
|
31
|
+
}
|
|
32
|
+
// eslint-disable-next-line no-constant-condition
|
|
33
|
+
while (true) {
|
|
34
|
+
const nextDigit = outputBuffer[separatorIndex];
|
|
35
|
+
if (nextDigit === 0x3a) {
|
|
36
|
+
separatorIndex++;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
separatorIndex++;
|
|
40
|
+
lengthString += String.fromCharCode(nextDigit);
|
|
41
|
+
}
|
|
42
|
+
// eslint-disable-next-line no-constant-condition
|
|
43
|
+
while (true) {
|
|
44
|
+
const nextDigit = outputBuffer[separatorIndex];
|
|
45
|
+
if (nextDigit === 0x3a) {
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
separatorIndex++;
|
|
49
|
+
statusString += String.fromCharCode(nextDigit);
|
|
50
|
+
}
|
|
51
|
+
const length = Number(lengthString);
|
|
52
|
+
const status = Number(statusString);
|
|
53
|
+
const dataLength = outputBuffer.length - separatorIndex - 1;
|
|
54
|
+
if (dataLength < length) {
|
|
55
|
+
missingData = {
|
|
56
|
+
dataMissing: length - dataLength,
|
|
57
|
+
};
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const data = outputBuffer.subarray(separatorIndex + 1, separatorIndex + 1 + Number(lengthString));
|
|
61
|
+
onMessage(status === 1 ? 'error' : 'success', nonceString, data);
|
|
62
|
+
missingData = null;
|
|
63
|
+
outputBuffer = outputBuffer.subarray(separatorIndex + Number(lengthString) + 1);
|
|
64
|
+
processInput();
|
|
65
|
+
};
|
|
66
|
+
return {
|
|
67
|
+
addData: (data) => {
|
|
68
|
+
unprocessedBuffers.push(data);
|
|
69
|
+
const separatorIndex = data.indexOf(separator);
|
|
70
|
+
if (separatorIndex === -1) {
|
|
71
|
+
if (missingData) {
|
|
72
|
+
missingData.dataMissing -= data.length;
|
|
73
|
+
}
|
|
74
|
+
if (!missingData || missingData.dataMissing > 0) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
unprocessedBuffers.unshift(outputBuffer);
|
|
79
|
+
outputBuffer = Buffer.concat(unprocessedBuffers);
|
|
80
|
+
unprocessedBuffers = [];
|
|
81
|
+
console.log('the unprocessed input is now', new TextDecoder('utf-8').decode(outputBuffer));
|
|
82
|
+
processInput();
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
exports.makeStreaming = makeStreaming;
|
|
87
|
+
const makePayloadMessage = (nonce, data, status) => {
|
|
88
|
+
const concat = Buffer.concat([
|
|
89
|
+
Buffer.from('remotion_buffer:'),
|
|
90
|
+
Buffer.from(nonce.toString()),
|
|
91
|
+
Buffer.from(':'),
|
|
92
|
+
Buffer.from(data.length.toString()),
|
|
93
|
+
Buffer.from(':'),
|
|
94
|
+
Buffer.from(String(status)),
|
|
95
|
+
Buffer.from(':'),
|
|
96
|
+
data,
|
|
97
|
+
]);
|
|
98
|
+
return concat;
|
|
99
|
+
};
|
|
100
|
+
exports.makePayloadMessage = makePayloadMessage;
|
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: "error" | "verbose" | "info" | "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, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, }: import("./api/make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("./defaults").LambdaStartPayload>;
|
|
4
4
|
getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, }: import(".").GetRenderProgressInput) => import("./defaults").LambdaStatusPayload;
|
|
5
5
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.60",
|
|
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/
|
|
30
|
-
"@remotion/
|
|
31
|
-
"remotion": "4.0.
|
|
32
|
-
"
|
|
29
|
+
"@remotion/renderer": "4.0.60",
|
|
30
|
+
"@remotion/bundler": "4.0.60",
|
|
31
|
+
"@remotion/cli": "4.0.60",
|
|
32
|
+
"remotion": "4.0.60"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@jonny/eslint-config": "3.0.276",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"ts-node": "^10.8.0",
|
|
44
44
|
"vitest": "0.31.1",
|
|
45
45
|
"zip-lib": "^0.7.2",
|
|
46
|
-
"@remotion/bundler": "4.0.
|
|
47
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
46
|
+
"@remotion/bundler": "4.0.60",
|
|
47
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.60"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@remotion/bundler": "4.0.
|
|
50
|
+
"@remotion/bundler": "4.0.60"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|