@remotion/lambda 4.0.18 → 4.0.20
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/commands/render/render.js +4 -1
- package/dist/cli/commands/still.js +4 -1
- package/dist/cli/log.d.ts +4 -4
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -4
- package/dist/functions/helpers/streaming-payloads.d.ts +3 -3
- package/dist/functions/launch.js +1 -2
- package/dist/functions/still.js +1 -2
- package/dist/shared/invoke-webhook.d.ts +2 -0
- package/dist/shared/make-s3-url.d.ts +0 -1
- package/dist/shared/make-s3-url.js +1 -15
- package/package.json +9 -9
- package/remotionlambda-arm64.zip +0 -0
- package/dist/shared/deserialize-input-props.d.ts +0 -8
- package/dist/shared/deserialize-input-props.js +0 -26
- package/dist/shared/serialize-input-props.d.ts +0 -14
- package/dist/shared/serialize-input-props.js +0 -63
|
@@ -41,6 +41,9 @@ const renderCommand = async (args, remotionRoot) => {
|
|
|
41
41
|
if (!composition) {
|
|
42
42
|
log_1.Log.info('No compositions passed. Fetching compositions...');
|
|
43
43
|
(0, validate_serveurl_1.validateServeUrl)(serveUrl);
|
|
44
|
+
if (!serveUrl.startsWith('https://') && !serveUrl.startsWith('http://')) {
|
|
45
|
+
throw Error('Passing the shorthand serve URL without composition name is currently not supported.\n Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.');
|
|
46
|
+
}
|
|
44
47
|
const server = await renderer_1.RenderInternals.prepareServer({
|
|
45
48
|
concurrency: 1,
|
|
46
49
|
indent: false,
|
|
@@ -50,7 +53,7 @@ const renderCommand = async (args, remotionRoot) => {
|
|
|
50
53
|
webpackConfigOrServeUrl: serveUrl,
|
|
51
54
|
});
|
|
52
55
|
const { compositionId } = await cli_1.CliInternals.getCompositionWithDimensionOverride({
|
|
53
|
-
args,
|
|
56
|
+
args: args.slice(1),
|
|
54
57
|
compositionIdFromUi: null,
|
|
55
58
|
browserExecutable,
|
|
56
59
|
chromiumOptions,
|
|
@@ -37,6 +37,9 @@ const stillCommand = async (args, remotionRoot) => {
|
|
|
37
37
|
if (!composition) {
|
|
38
38
|
log_1.Log.info('No compositions passed. Fetching compositions...');
|
|
39
39
|
(0, validate_serveurl_1.validateServeUrl)(serveUrl);
|
|
40
|
+
if (!serveUrl.startsWith('https://') && !serveUrl.startsWith('http://')) {
|
|
41
|
+
throw Error('Passing the shorthand serve URL without composition name is currently not supported.\n Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.');
|
|
42
|
+
}
|
|
40
43
|
const server = await renderer_1.RenderInternals.prepareServer({
|
|
41
44
|
concurrency: 1,
|
|
42
45
|
indent: false,
|
|
@@ -46,7 +49,7 @@ const stillCommand = async (args, remotionRoot) => {
|
|
|
46
49
|
webpackConfigOrServeUrl: serveUrl,
|
|
47
50
|
});
|
|
48
51
|
const { compositionId } = await cli_1.CliInternals.getCompositionWithDimensionOverride({
|
|
49
|
-
args,
|
|
52
|
+
args: args.slice(1),
|
|
50
53
|
compositionIdFromUi: null,
|
|
51
54
|
indent: false,
|
|
52
55
|
serveUrlOrWebpackUrl: serveUrl,
|
package/dist/cli/log.d.ts
CHANGED
|
@@ -2,24 +2,24 @@ export declare const Log: {
|
|
|
2
2
|
verbose: (message?: any, ...optionalParams: any[]) => void;
|
|
3
3
|
verboseAdvanced: (options: {
|
|
4
4
|
indent: boolean;
|
|
5
|
-
logLevel: "
|
|
5
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
6
6
|
} & {
|
|
7
7
|
tag?: string | undefined;
|
|
8
8
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
9
9
|
info: (message?: any, ...optionalParams: any[]) => void;
|
|
10
10
|
infoAdvanced: (options: {
|
|
11
11
|
indent: boolean;
|
|
12
|
-
logLevel: "
|
|
12
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
13
13
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
14
14
|
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
15
15
|
warnAdvanced: (options: {
|
|
16
16
|
indent: boolean;
|
|
17
|
-
logLevel: "
|
|
17
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
18
18
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
19
19
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
20
20
|
errorAdvanced: (options: {
|
|
21
21
|
indent: boolean;
|
|
22
|
-
logLevel: "
|
|
22
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
23
23
|
} & {
|
|
24
24
|
tag?: string | undefined;
|
|
25
25
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
@@ -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/launch.js
CHANGED
|
@@ -36,7 +36,6 @@ const compress_props_1 = require("../shared/compress-props");
|
|
|
36
36
|
const constants_1 = require("../shared/constants");
|
|
37
37
|
const docs_url_1 = require("../shared/docs-url");
|
|
38
38
|
const invoke_webhook_1 = require("../shared/invoke-webhook");
|
|
39
|
-
const make_s3_url_1 = require("../shared/make-s3-url");
|
|
40
39
|
const validate_frames_per_lambda_1 = require("../shared/validate-frames-per-lambda");
|
|
41
40
|
const validate_outname_1 = require("../shared/validate-outname");
|
|
42
41
|
const validate_privacy_1 = require("../shared/validate-privacy");
|
|
@@ -214,7 +213,7 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
214
213
|
].reduce((a, b) => a + b, 0),
|
|
215
214
|
estimatedRenderLambdaInvokations: chunks.length,
|
|
216
215
|
compositionId: comp.id,
|
|
217
|
-
siteId:
|
|
216
|
+
siteId: params.serveUrl,
|
|
218
217
|
codec: params.codec,
|
|
219
218
|
type: 'video',
|
|
220
219
|
imageFormat: params.imageFormat,
|
package/dist/functions/still.js
CHANGED
|
@@ -17,7 +17,6 @@ const compress_props_1 = require("../shared/compress-props");
|
|
|
17
17
|
const constants_1 = require("../shared/constants");
|
|
18
18
|
const convert_to_serve_url_1 = require("../shared/convert-to-serve-url");
|
|
19
19
|
const is_flaky_error_1 = require("../shared/is-flaky-error");
|
|
20
|
-
const make_s3_url_1 = require("../shared/make-s3-url");
|
|
21
20
|
const validate_download_behavior_1 = require("../shared/validate-download-behavior");
|
|
22
21
|
const validate_outname_1 = require("../shared/validate-outname");
|
|
23
22
|
const validate_privacy_1 = require("../shared/validate-privacy");
|
|
@@ -96,7 +95,7 @@ const innerStillHandler = async ({ params: lambdaParams, expectedBucketOwner, re
|
|
|
96
95
|
compositionId: lambdaParams.composition,
|
|
97
96
|
estimatedTotalLambdaInvokations: 1,
|
|
98
97
|
estimatedRenderLambdaInvokations: 1,
|
|
99
|
-
siteId:
|
|
98
|
+
siteId: serveUrl,
|
|
100
99
|
totalChunks: 1,
|
|
101
100
|
type: 'still',
|
|
102
101
|
imageFormat: lambdaParams.imageFormat,
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
3
|
+
exports.makeS3ServeUrl = void 0;
|
|
8
4
|
const makeS3ServeUrl = ({ bucketName, subFolder, region, }) => {
|
|
9
5
|
return `https://${bucketName}.s3.${region}.amazonaws.com/${subFolder}/index.html`;
|
|
10
6
|
};
|
|
11
7
|
exports.makeS3ServeUrl = makeS3ServeUrl;
|
|
12
|
-
const hashCache = {};
|
|
13
|
-
const getServeUrlHash = (url) => {
|
|
14
|
-
if (hashCache[url]) {
|
|
15
|
-
return hashCache[url];
|
|
16
|
-
}
|
|
17
|
-
const hash = node_crypto_1.default.createHash('md5').update(url).digest('hex');
|
|
18
|
-
hashCache[url] = hash;
|
|
19
|
-
return hash;
|
|
20
|
-
};
|
|
21
|
-
exports.getServeUrlHash = getServeUrlHash;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.20",
|
|
4
4
|
"description": "Distributed renderer for Remotion based on AWS Lambda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"url": "https://github.com/JonnyBurger/remotion"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@
|
|
16
|
+
"@smithy/abort-controller": "2.0.1",
|
|
17
17
|
"@aws-sdk/client-cloudwatch-logs": "3.382.0",
|
|
18
18
|
"@aws-sdk/client-iam": "3.382.0",
|
|
19
19
|
"@aws-sdk/client-lambda": "3.382.0",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"aws-policies": "^1.0.1",
|
|
27
27
|
"mime-types": "2.1.34",
|
|
28
28
|
"zod": "3.21.4",
|
|
29
|
-
"
|
|
30
|
-
"@remotion/
|
|
31
|
-
"remotion": "4.0.
|
|
32
|
-
"@remotion/
|
|
29
|
+
"remotion": "4.0.20",
|
|
30
|
+
"@remotion/bundler": "4.0.20",
|
|
31
|
+
"@remotion/renderer": "4.0.20",
|
|
32
|
+
"@remotion/cli": "4.0.20"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@jonny/eslint-config": "3.0.266",
|
|
@@ -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.20",
|
|
47
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.20"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@remotion/bundler": "4.0.
|
|
50
|
+
"@remotion/bundler": "4.0.20"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { AwsRegion } from '../client';
|
|
2
|
-
import type { SerializedInputProps } from './constants';
|
|
3
|
-
export declare const deserializeInputProps: ({ serialized, region, bucketName, expectedBucketOwner, }: {
|
|
4
|
-
serialized: SerializedInputProps;
|
|
5
|
-
region: AwsRegion;
|
|
6
|
-
bucketName: string;
|
|
7
|
-
expectedBucketOwner: string;
|
|
8
|
-
}) => Promise<Record<string, unknown>>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deserializeInputProps = void 0;
|
|
4
|
-
const io_1 = require("../functions/helpers/io");
|
|
5
|
-
const constants_1 = require("./constants");
|
|
6
|
-
const stream_to_string_1 = require("./stream-to-string");
|
|
7
|
-
const deserializeInputProps = async ({ serialized, region, bucketName, expectedBucketOwner, }) => {
|
|
8
|
-
if (serialized.type === 'payload') {
|
|
9
|
-
return JSON.parse(serialized.payload);
|
|
10
|
-
}
|
|
11
|
-
try {
|
|
12
|
-
const response = await (0, io_1.lambdaReadFile)({
|
|
13
|
-
bucketName,
|
|
14
|
-
expectedBucketOwner,
|
|
15
|
-
key: (0, constants_1.inputPropsKey)(serialized.hash),
|
|
16
|
-
region,
|
|
17
|
-
});
|
|
18
|
-
const body = await (0, stream_to_string_1.streamToString)(response);
|
|
19
|
-
const payload = JSON.parse(body);
|
|
20
|
-
return payload;
|
|
21
|
-
}
|
|
22
|
-
catch (err) {
|
|
23
|
-
throw new Error(`Failed to parse input props that were serialized: ${err.stack}`);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
exports.deserializeInputProps = deserializeInputProps;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { AwsRegion } from '../client';
|
|
2
|
-
import type { SerializedInputProps } from './constants';
|
|
3
|
-
export declare const serializeInputProps: ({ inputProps, region, type, userSpecifiedBucketName, }: {
|
|
4
|
-
inputProps: Record<string, unknown>;
|
|
5
|
-
region: AwsRegion;
|
|
6
|
-
type: 'still' | 'video-or-audio';
|
|
7
|
-
userSpecifiedBucketName: string | null;
|
|
8
|
-
}) => Promise<SerializedInputProps>;
|
|
9
|
-
export declare const deserializeInputProps: ({ serialized, region, bucketName, expectedBucketOwner, }: {
|
|
10
|
-
serialized: SerializedInputProps;
|
|
11
|
-
region: AwsRegion;
|
|
12
|
-
bucketName: string;
|
|
13
|
-
expectedBucketOwner: string;
|
|
14
|
-
}) => Promise<Record<string, unknown>>;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deserializeInputProps = exports.serializeInputProps = void 0;
|
|
4
|
-
const get_or_create_bucket_1 = require("../api/get-or-create-bucket");
|
|
5
|
-
const io_1 = require("../functions/helpers/io");
|
|
6
|
-
const constants_1 = require("./constants");
|
|
7
|
-
const random_hash_1 = require("./random-hash");
|
|
8
|
-
const stream_to_string_1 = require("./stream-to-string");
|
|
9
|
-
const serializeInputProps = async ({ inputProps, region, type, userSpecifiedBucketName, }) => {
|
|
10
|
-
try {
|
|
11
|
-
const payload = JSON.stringify(inputProps);
|
|
12
|
-
const hash = (0, random_hash_1.randomHash)();
|
|
13
|
-
const MAX_INLINE_PAYLOAD_SIZE = type === 'still' ? 5000000 : 200000;
|
|
14
|
-
if (payload.length > MAX_INLINE_PAYLOAD_SIZE) {
|
|
15
|
-
console.warn(`Warning: inputProps are over ${Math.round(MAX_INLINE_PAYLOAD_SIZE / 1000)}KB (${Math.ceil(payload.length / 1024)}KB) in size. Uploading them to S3 to circumvent AWS Lambda payload size.`);
|
|
16
|
-
const bucketName = userSpecifiedBucketName !== null && userSpecifiedBucketName !== void 0 ? userSpecifiedBucketName : (await (0, get_or_create_bucket_1.getOrCreateBucket)({
|
|
17
|
-
region,
|
|
18
|
-
})).bucketName;
|
|
19
|
-
await (0, io_1.lambdaWriteFile)({
|
|
20
|
-
body: payload,
|
|
21
|
-
bucketName,
|
|
22
|
-
region,
|
|
23
|
-
customCredentials: null,
|
|
24
|
-
downloadBehavior: null,
|
|
25
|
-
expectedBucketOwner: null,
|
|
26
|
-
key: (0, constants_1.inputPropsKey)(hash),
|
|
27
|
-
privacy: 'public',
|
|
28
|
-
});
|
|
29
|
-
return {
|
|
30
|
-
type: 'bucket-url',
|
|
31
|
-
hash,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
return {
|
|
35
|
-
type: 'payload',
|
|
36
|
-
payload,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
catch (err) {
|
|
40
|
-
throw new Error('Error serializing inputProps. Check it has no circular references or reduce the size if the object is big.');
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.serializeInputProps = serializeInputProps;
|
|
44
|
-
const deserializeInputProps = async ({ serialized, region, bucketName, expectedBucketOwner, }) => {
|
|
45
|
-
if (serialized.type === 'payload') {
|
|
46
|
-
return JSON.parse(serialized.payload);
|
|
47
|
-
}
|
|
48
|
-
try {
|
|
49
|
-
const response = await (0, io_1.lambdaReadFile)({
|
|
50
|
-
bucketName,
|
|
51
|
-
expectedBucketOwner,
|
|
52
|
-
key: (0, constants_1.inputPropsKey)(serialized.hash),
|
|
53
|
-
region,
|
|
54
|
-
});
|
|
55
|
-
const body = await (0, stream_to_string_1.streamToString)(response);
|
|
56
|
-
const payload = JSON.parse(body);
|
|
57
|
-
return payload;
|
|
58
|
-
}
|
|
59
|
-
catch (err) {
|
|
60
|
-
throw new Error(`Failed to parse input props that were serialized: ${err.stack}`);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
exports.deserializeInputProps = deserializeInputProps;
|