@remotion/lambda 4.0.213 → 4.0.214
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/clean-items.d.ts +1 -1
- package/dist/api/delete-site.d.ts +1 -1
- package/dist/api/deploy-site.d.ts +13 -13
- package/dist/api/get-compositions-on-lambda.js +1 -1
- package/dist/api/get-sites.d.ts +1 -1
- package/dist/api/render-still-on-lambda.js +1 -1
- package/dist/cli/args.d.ts +0 -1
- package/dist/cli/commands/render/progress.d.ts +1 -1
- package/dist/cli/log.d.ts +8 -8
- package/dist/client.d.ts +1 -1
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -4
- package/dist/functions/helpers/calculate-chunk-times.d.ts +1 -1
- package/dist/functions/helpers/calculate-price-from-bucket.d.ts +1 -1
- package/dist/functions/helpers/can-concat-seamlessly.d.ts +1 -1
- package/dist/functions/helpers/cleanup-props.d.ts +1 -1
- package/dist/functions/helpers/create-post-render-data.d.ts +1 -1
- package/dist/functions/helpers/find-output-file-in-bucket.d.ts +1 -1
- package/dist/functions/helpers/get-current-region.d.ts +2 -1
- package/dist/functions/helpers/get-output-url-from-metadata.d.ts +1 -1
- package/dist/functions/helpers/get-overall-progress-s3.d.ts +1 -1
- package/dist/functions/helpers/get-progress.d.ts +1 -1
- package/dist/functions/helpers/lifecycle.d.ts +1 -1
- package/dist/functions/helpers/make-timeout-error.d.ts +1 -1
- package/dist/functions/helpers/make-timeout-message.d.ts +1 -1
- package/dist/functions/helpers/merge-chunks.d.ts +1 -1
- package/dist/functions/helpers/overall-render-progress.d.ts +2 -2
- package/dist/functions/helpers/render-has-audio-video.d.ts +1 -1
- package/dist/functions/helpers/stream-renderer.d.ts +1 -1
- package/dist/functions/helpers/streamify-response.js +1 -2
- package/dist/functions/index.d.ts +1 -1
- package/dist/functions/launch.d.ts +2 -2
- package/dist/functions/launch.js +1 -1
- package/dist/functions/progress.d.ts +1 -1
- package/dist/functions/renderer.d.ts +2 -2
- package/dist/functions/start.d.ts +1 -1
- package/dist/functions/still.d.ts +3 -3
- package/dist/internals.d.ts +15 -41
- package/dist/io/read-file.d.ts +0 -1
- package/dist/io/write-file.js +1 -1
- package/dist/shared/call-lambda.d.ts +2 -2
- package/dist/shared/cleanup-serialized-input-props.d.ts +2 -2
- package/dist/shared/invoke-webhook.d.ts +0 -2
- package/dist/shared/invoke-webhook.js +2 -2
- package/dist/shared/p-limit.d.ts +1 -1
- package/dist/shared/read-dir.js +1 -2
- package/dist/shared/stackback.d.ts +0 -8
- package/dist/shared/validate-aws-region.js +1 -2
- package/dist/shared/validate-privacy.js +1 -2
- package/dist/shared/validate-retries.js +1 -2
- package/dist/shared/why-is-node-running.d.ts +0 -2
- package/dist/shared/why-is-node-running.js +2 -2
- package/package.json +12 -12
- package/remotionlambda-arm64.zip +0 -0
- package/dist/functions/compositions.d.ts +0 -10
- package/dist/functions/compositions.js +0 -77
- package/dist/functions/helpers/expected-out-name.d.ts +0 -4
- package/dist/functions/helpers/expected-out-name.js +0 -52
- package/dist/functions/helpers/get-browser-instance.d.ts +0 -10
- package/dist/functions/helpers/get-browser-instance.js +0 -99
- package/dist/functions/helpers/get-chromium-executable-path.d.ts +0 -1
- package/dist/functions/helpers/get-chromium-executable-path.js +0 -14
- package/dist/functions/helpers/get-custom-out-name.d.ts +0 -6
- package/dist/functions/helpers/get-custom-out-name.js +0 -32
- package/dist/functions/helpers/get-files-in-folder.d.ts +0 -5
- package/dist/functions/helpers/get-files-in-folder.js +0 -38
- package/dist/functions/helpers/io.d.ts +0 -20
- package/dist/functions/helpers/io.js +0 -13
- package/dist/functions/helpers/is-enosp-err.d.ts +0 -3
- package/dist/functions/helpers/is-enosp-err.js +0 -16
- package/dist/functions/helpers/print-cloudwatch-helper.d.ts +0 -3
- package/dist/functions/helpers/print-cloudwatch-helper.js +0 -12
- package/dist/functions/helpers/serialize-artifact.d.ts +0 -9
- package/dist/functions/helpers/serialize-artifact.js +0 -37
- package/dist/functions/helpers/validate-composition.d.ts +0 -24
- package/dist/functions/helpers/validate-composition.js +0 -31
- package/dist/functions/helpers/write-lambda-error.d.ts +0 -25
- package/dist/functions/helpers/write-lambda-error.js +0 -20
- package/dist/functions/info.d.ts +0 -5
- package/dist/functions/info.js +0 -16
- package/dist/functions/provider-implementation.d.ts +0 -0
- package/dist/functions/provider-implementation.js +0 -1
- package/dist/functions/streaming/stream-writer.d.ts +0 -6
- package/dist/functions/streaming/stream-writer.js +0 -35
- package/dist/functions/streaming/streaming.d.ts +0 -102
- package/dist/functions/streaming/streaming.js +0 -61
- package/dist/shared/await.d.ts +0 -1
- package/dist/shared/await.js +0 -2
- package/dist/shared/compress-props.d.ts +0 -22
- package/dist/shared/compress-props.js +0 -88
- package/dist/shared/stream-to-string.d.ts +0 -4
- package/dist/shared/stream-to-string.js +0 -15
- package/dist/shared/truthy.d.ts +0 -3
- package/dist/shared/truthy.js +0 -7
- package/dist/shared/validate-outname.d.ts +0 -8
- package/dist/shared/validate-outname.js +0 -37
- package/dist/shared/validate-webhook.d.ts +0 -3
- package/dist/shared/validate-webhook.js +0 -16
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateAwsRegion =
|
|
3
|
+
exports.validateAwsRegion = validateAwsRegion;
|
|
4
4
|
const regions_1 = require("../regions");
|
|
5
5
|
function validateAwsRegion(region) {
|
|
6
6
|
if (!regions_1.AWS_REGIONS.includes(region)) {
|
|
7
7
|
throw new TypeError(`${region} is not a valid AWS region. Must be one of: ${regions_1.AWS_REGIONS.join(', ')}`);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
exports.validateAwsRegion = validateAwsRegion;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validatePrivacy =
|
|
3
|
+
exports.validatePrivacy = validatePrivacy;
|
|
4
4
|
function validatePrivacy(privacy, allowPrivate) {
|
|
5
5
|
if (typeof privacy !== 'string') {
|
|
6
6
|
throw new TypeError('Privacy must be a string');
|
|
@@ -12,4 +12,3 @@ function validatePrivacy(privacy, allowPrivate) {
|
|
|
12
12
|
throw new TypeError('Privacy must be either "private", "public" or "no-acl"');
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
exports.validatePrivacy = validatePrivacy;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateMaxRetries =
|
|
3
|
+
exports.validateMaxRetries = validateMaxRetries;
|
|
4
4
|
function validateMaxRetries(maxRetries) {
|
|
5
5
|
if (typeof maxRetries !== 'number') {
|
|
6
6
|
throw new TypeError('maxRetries must be a number, but is ' + JSON.stringify(maxRetries));
|
|
@@ -18,4 +18,3 @@ function validateMaxRetries(maxRetries) {
|
|
|
18
18
|
throw new TypeError(`maxRetries should be an integer, but is ${maxRetries}.`);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
exports.validateMaxRetries = validateMaxRetries;
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.enableNodeIntrospection = void 0;
|
|
7
|
+
exports.whyIsNodeRunning = whyIsNodeRunning;
|
|
7
8
|
const async_hooks_1 = __importDefault(require("async_hooks"));
|
|
8
9
|
const fs_1 = __importDefault(require("fs"));
|
|
9
10
|
const path_1 = require("path");
|
|
@@ -85,4 +86,3 @@ function whyIsNodeRunning({ active, hook }) {
|
|
|
85
86
|
printStacks(o);
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
|
-
exports.whyIsNodeRunning = whyIsNodeRunning;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/lambda"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/lambda",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.214",
|
|
7
7
|
"description": "Render Remotion videos on AWS Lambda",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"sideEffects": false,
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"@aws-sdk/s3-request-presigner": "3.645.0",
|
|
23
23
|
"mime-types": "2.1.34",
|
|
24
24
|
"zod": "3.22.3",
|
|
25
|
-
"@remotion/
|
|
26
|
-
"@remotion/bundler": "4.0.
|
|
27
|
-
"@remotion/
|
|
28
|
-
"@remotion/
|
|
29
|
-
"@remotion/streaming": "4.0.
|
|
30
|
-
"
|
|
31
|
-
"remotion": "4.0.
|
|
25
|
+
"@remotion/cli": "4.0.214",
|
|
26
|
+
"@remotion/bundler": "4.0.214",
|
|
27
|
+
"@remotion/renderer": "4.0.214",
|
|
28
|
+
"@remotion/serverless": "4.0.214",
|
|
29
|
+
"@remotion/streaming": "4.0.214",
|
|
30
|
+
"remotion": "4.0.214",
|
|
31
|
+
"@remotion/studio-server": "4.0.214"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/mime-types": "2.1.1",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"pureimage": "0.4.13",
|
|
38
38
|
"vitest": "0.31.1",
|
|
39
39
|
"zip-lib": "^0.7.2",
|
|
40
|
-
"@remotion/bundler": "4.0.
|
|
41
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
40
|
+
"@remotion/bundler": "4.0.214",
|
|
41
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.214"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@remotion/bundler": "4.0.
|
|
44
|
+
"@remotion/bundler": "4.0.214"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
@@ -77,6 +77,6 @@
|
|
|
77
77
|
"testintegration": "vitest src/test/integration --run",
|
|
78
78
|
"lint": "eslint src --ext ts,tsx",
|
|
79
79
|
"test": "vitest src/test/unit --run",
|
|
80
|
-
"
|
|
80
|
+
"make": "bun src/admin/bundle-lambda.ts"
|
|
81
81
|
}
|
|
82
82
|
}
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ProviderSpecifics } from '@remotion/serverless';
|
|
2
|
-
import type { ServerlessPayload } from '@remotion/serverless/client';
|
|
3
|
-
type Options = {
|
|
4
|
-
expectedBucketOwner: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const compositionsHandler: <Region extends string>(lambdaParams: ServerlessPayload<Region>, options: Options, providerSpecifics: ProviderSpecifics<Region>) => Promise<{
|
|
7
|
-
compositions: import("remotion").VideoConfig[];
|
|
8
|
-
type: "success";
|
|
9
|
-
}>;
|
|
10
|
-
export {};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.compositionsHandler = void 0;
|
|
4
|
-
const renderer_1 = require("@remotion/renderer");
|
|
5
|
-
const serverless_1 = require("@remotion/serverless");
|
|
6
|
-
const client_1 = require("@remotion/serverless/client");
|
|
7
|
-
const version_1 = require("remotion/version");
|
|
8
|
-
const compositionsHandler = async (lambdaParams, options, providerSpecifics) => {
|
|
9
|
-
var _a;
|
|
10
|
-
if (lambdaParams.type !== client_1.ServerlessRoutines.compositions) {
|
|
11
|
-
throw new TypeError('Expected info compositions');
|
|
12
|
-
}
|
|
13
|
-
if (lambdaParams.version !== version_1.VERSION) {
|
|
14
|
-
if (!lambdaParams.version) {
|
|
15
|
-
throw new Error(`Version mismatch: When calling getCompositionsOnLambda(), you called the function ${process.env.AWS_LAMBDA_FUNCTION_NAME} which has the version ${version_1.VERSION} but the @remotion/lambda package is an older version. Deploy a new function and use it to call getCompositionsOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);
|
|
16
|
-
}
|
|
17
|
-
throw new Error(`Version mismatch: When calling getCompositionsOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${version_1.VERSION}, but the @remotion/lambda package you used to invoke the function has version ${lambdaParams.version}. Deploy a new function and use it to call getCompositionsOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);
|
|
18
|
-
}
|
|
19
|
-
try {
|
|
20
|
-
const region = providerSpecifics.getCurrentRegionInFunction();
|
|
21
|
-
const browserInstancePromise = (0, serverless_1.getBrowserInstance)({
|
|
22
|
-
logLevel: lambdaParams.logLevel,
|
|
23
|
-
indent: false,
|
|
24
|
-
chromiumOptions: lambdaParams.chromiumOptions,
|
|
25
|
-
providerSpecifics,
|
|
26
|
-
});
|
|
27
|
-
const bucketNamePromise = lambdaParams.bucketName
|
|
28
|
-
? Promise.resolve(lambdaParams.bucketName)
|
|
29
|
-
: (0, client_1.internalGetOrCreateBucket)({
|
|
30
|
-
region,
|
|
31
|
-
enableFolderExpiry: null,
|
|
32
|
-
customCredentials: null,
|
|
33
|
-
providerSpecifics,
|
|
34
|
-
}).then((b) => b.bucketName);
|
|
35
|
-
const bucketName = await bucketNamePromise;
|
|
36
|
-
const serializedInputPropsWithCustomSchema = await (0, client_1.decompressInputProps)({
|
|
37
|
-
bucketName: await bucketNamePromise,
|
|
38
|
-
expectedBucketOwner: options.expectedBucketOwner,
|
|
39
|
-
region: providerSpecifics.getCurrentRegionInFunction(),
|
|
40
|
-
serialized: lambdaParams.inputProps,
|
|
41
|
-
propsType: 'input-props',
|
|
42
|
-
providerSpecifics,
|
|
43
|
-
});
|
|
44
|
-
const realServeUrl = providerSpecifics.convertToServeUrl({
|
|
45
|
-
urlOrId: lambdaParams.serveUrl,
|
|
46
|
-
region,
|
|
47
|
-
bucketName,
|
|
48
|
-
});
|
|
49
|
-
const compositions = await renderer_1.RenderInternals.internalGetCompositions({
|
|
50
|
-
serveUrlOrWebpackUrl: realServeUrl,
|
|
51
|
-
puppeteerInstance: (await browserInstancePromise).instance,
|
|
52
|
-
serializedInputPropsWithCustomSchema,
|
|
53
|
-
envVariables: (_a = lambdaParams.envVariables) !== null && _a !== void 0 ? _a : {},
|
|
54
|
-
timeoutInMilliseconds: lambdaParams.timeoutInMilliseconds,
|
|
55
|
-
chromiumOptions: lambdaParams.chromiumOptions,
|
|
56
|
-
port: null,
|
|
57
|
-
server: undefined,
|
|
58
|
-
logLevel: lambdaParams.logLevel,
|
|
59
|
-
indent: false,
|
|
60
|
-
browserExecutable: null,
|
|
61
|
-
onBrowserLog: null,
|
|
62
|
-
offthreadVideoCacheSizeInBytes: lambdaParams.offthreadVideoCacheSizeInBytes,
|
|
63
|
-
binariesDirectory: null,
|
|
64
|
-
onBrowserDownload: () => {
|
|
65
|
-
throw new Error('Should not download a browser in Lambda');
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
return Promise.resolve({
|
|
69
|
-
compositions,
|
|
70
|
-
type: 'success',
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
finally {
|
|
74
|
-
(0, serverless_1.forgetBrowserEventLoop)(lambdaParams.logLevel);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
exports.compositionsHandler = compositionsHandler;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { CustomCredentials, OutNameInput } from '@remotion/serverless/client';
|
|
2
|
-
import type { OutNameOutput, RenderMetadata } from '../../defaults';
|
|
3
|
-
export declare const getCredentialsFromOutName: <Region extends string>(name: OutNameInput<Region> | null) => CustomCredentials<Region> | null;
|
|
4
|
-
export declare const getExpectedOutName: <Region extends string>(renderMetadata: RenderMetadata, bucketName: string, customCredentials: CustomCredentials<Region> | null) => OutNameOutput<Region>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getExpectedOutName = exports.getCredentialsFromOutName = void 0;
|
|
4
|
-
const pure_1 = require("@remotion/renderer/pure");
|
|
5
|
-
const defaults_1 = require("../../defaults");
|
|
6
|
-
const validate_outname_1 = require("../../shared/validate-outname");
|
|
7
|
-
const get_custom_out_name_1 = require("./get-custom-out-name");
|
|
8
|
-
const getCredentialsFromOutName = (name) => {
|
|
9
|
-
var _a;
|
|
10
|
-
if (typeof name === 'string') {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
if (name === null) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
if (typeof name === 'undefined') {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
return (_a = name.s3OutputProvider) !== null && _a !== void 0 ? _a : null;
|
|
20
|
-
};
|
|
21
|
-
exports.getCredentialsFromOutName = getCredentialsFromOutName;
|
|
22
|
-
const getExpectedOutName = (renderMetadata, bucketName, customCredentials) => {
|
|
23
|
-
const outNameValue = (0, get_custom_out_name_1.getCustomOutName)({
|
|
24
|
-
customCredentials,
|
|
25
|
-
renderMetadata,
|
|
26
|
-
});
|
|
27
|
-
if (outNameValue) {
|
|
28
|
-
(0, validate_outname_1.validateOutname)({
|
|
29
|
-
outName: outNameValue,
|
|
30
|
-
codec: renderMetadata.codec,
|
|
31
|
-
audioCodecSetting: renderMetadata.audioCodec,
|
|
32
|
-
separateAudioTo: null,
|
|
33
|
-
});
|
|
34
|
-
return (0, defaults_1.customOutName)(renderMetadata.renderId, bucketName, outNameValue);
|
|
35
|
-
}
|
|
36
|
-
if (renderMetadata.type === 'still') {
|
|
37
|
-
return {
|
|
38
|
-
renderBucketName: bucketName,
|
|
39
|
-
key: (0, defaults_1.outStillName)(renderMetadata.renderId, renderMetadata.imageFormat),
|
|
40
|
-
customCredentials: null,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
if (renderMetadata.type === 'video') {
|
|
44
|
-
return {
|
|
45
|
-
renderBucketName: bucketName,
|
|
46
|
-
key: (0, defaults_1.outName)(renderMetadata.renderId, pure_1.NoReactAPIs.getFileExtensionFromCodec(renderMetadata.codec, renderMetadata.audioCodec)),
|
|
47
|
-
customCredentials: null,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
throw new TypeError('no type passed');
|
|
51
|
-
};
|
|
52
|
-
exports.getExpectedOutName = getExpectedOutName;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ChromiumOptions, LogLevel, openBrowser } from '@remotion/renderer';
|
|
2
|
-
import type { ProviderSpecifics } from '@remotion/serverless';
|
|
3
|
-
import type { Await } from '@remotion/serverless/client';
|
|
4
|
-
type LaunchedBrowser = {
|
|
5
|
-
instance: Await<ReturnType<typeof openBrowser>>;
|
|
6
|
-
configurationString: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const forgetBrowserEventLoop: (logLevel: LogLevel) => void;
|
|
9
|
-
export declare const getBrowserInstance: (logLevel: LogLevel, indent: boolean, chromiumOptions: ChromiumOptions, providerSpecifics: ProviderSpecifics) => Promise<LaunchedBrowser>;
|
|
10
|
-
export {};
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBrowserInstance = exports.forgetBrowserEventLoop = void 0;
|
|
4
|
-
const renderer_1 = require("@remotion/renderer");
|
|
5
|
-
const version_1 = require("remotion/version");
|
|
6
|
-
const makeConfigurationString = (options, logLevel) => {
|
|
7
|
-
var _a, _b, _c;
|
|
8
|
-
return [
|
|
9
|
-
`web-security-${Boolean(options.disableWebSecurity)}`,
|
|
10
|
-
`multi-process-${Boolean(options.enableMultiProcessOnLinux)}`,
|
|
11
|
-
`ignore-certificate-errors-${Boolean(options.ignoreCertificateErrors)}`,
|
|
12
|
-
`log-level-${logLevel}`,
|
|
13
|
-
`gl-${(_a = options.gl) !== null && _a !== void 0 ? _a : null}`,
|
|
14
|
-
`userAgent-${(_b = options.userAgent) !== null && _b !== void 0 ? _b : null}`,
|
|
15
|
-
`headless-${(_c = options.headless) !== null && _c !== void 0 ? _c : false}`,
|
|
16
|
-
].join('/');
|
|
17
|
-
};
|
|
18
|
-
let _browserInstance;
|
|
19
|
-
let launching = false;
|
|
20
|
-
const waitForLaunched = () => {
|
|
21
|
-
return new Promise((resolve, reject) => {
|
|
22
|
-
const check = () => setTimeout(() => {
|
|
23
|
-
if (launching) {
|
|
24
|
-
check();
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
resolve();
|
|
28
|
-
}
|
|
29
|
-
}, 16);
|
|
30
|
-
setTimeout(() => reject(new Error('Timeout launching browser')), 5000);
|
|
31
|
-
check();
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
const forgetBrowserEventLoop = (logLevel) => {
|
|
35
|
-
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Keeping browser open for next invocation');
|
|
36
|
-
_browserInstance === null || _browserInstance === void 0 ? void 0 : _browserInstance.instance.forgetEventLoop();
|
|
37
|
-
};
|
|
38
|
-
exports.forgetBrowserEventLoop = forgetBrowserEventLoop;
|
|
39
|
-
const getBrowserInstance = async (logLevel, indent, chromiumOptions, providerSpecifics) => {
|
|
40
|
-
var _a;
|
|
41
|
-
const actualChromiumOptions = {
|
|
42
|
-
...chromiumOptions,
|
|
43
|
-
// Override the `null` value, which might come from CLI with swANGLE
|
|
44
|
-
gl: (_a = chromiumOptions.gl) !== null && _a !== void 0 ? _a : 'swangle',
|
|
45
|
-
enableMultiProcessOnLinux: false,
|
|
46
|
-
};
|
|
47
|
-
const configurationString = makeConfigurationString(actualChromiumOptions, logLevel);
|
|
48
|
-
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `Rendering with Remotion v${version_1.VERSION}.`);
|
|
49
|
-
if (launching) {
|
|
50
|
-
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Already waiting for browser launch...');
|
|
51
|
-
await waitForLaunched();
|
|
52
|
-
if (!_browserInstance) {
|
|
53
|
-
throw new Error('expected to launch');
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
if (!_browserInstance) {
|
|
57
|
-
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Cold Lambda function, launching new browser instance');
|
|
58
|
-
launching = true;
|
|
59
|
-
const execPath = providerSpecifics.getChromiumPath();
|
|
60
|
-
const instance = await renderer_1.RenderInternals.internalOpenBrowser({
|
|
61
|
-
browser: 'chrome',
|
|
62
|
-
browserExecutable: execPath,
|
|
63
|
-
chromiumOptions: actualChromiumOptions,
|
|
64
|
-
forceDeviceScaleFactor: undefined,
|
|
65
|
-
indent: false,
|
|
66
|
-
viewport: null,
|
|
67
|
-
logLevel,
|
|
68
|
-
onBrowserDownload: () => {
|
|
69
|
-
throw new Error('Should not download a browser in Lambda');
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
instance.on('disconnected', () => {
|
|
73
|
-
var _a;
|
|
74
|
-
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Browser disconnected or crashed.');
|
|
75
|
-
(0, exports.forgetBrowserEventLoop)(logLevel);
|
|
76
|
-
(_a = _browserInstance === null || _browserInstance === void 0 ? void 0 : _browserInstance.instance) === null || _a === void 0 ? void 0 : _a.close(true, logLevel, indent).catch((err) => {
|
|
77
|
-
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Could not close browser instance', err);
|
|
78
|
-
});
|
|
79
|
-
_browserInstance = null;
|
|
80
|
-
});
|
|
81
|
-
_browserInstance = {
|
|
82
|
-
instance,
|
|
83
|
-
configurationString,
|
|
84
|
-
};
|
|
85
|
-
launching = false;
|
|
86
|
-
return _browserInstance;
|
|
87
|
-
}
|
|
88
|
-
if (_browserInstance.configurationString !== configurationString) {
|
|
89
|
-
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Warm Lambda function, but Browser configuration changed. Killing old browser instance.');
|
|
90
|
-
_browserInstance.instance.rememberEventLoop();
|
|
91
|
-
await _browserInstance.instance.close(true, logLevel, indent);
|
|
92
|
-
_browserInstance = null;
|
|
93
|
-
return (0, exports.getBrowserInstance)(logLevel, indent, chromiumOptions, providerSpecifics);
|
|
94
|
-
}
|
|
95
|
-
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Warm Lambda function, reusing browser instance');
|
|
96
|
-
_browserInstance.instance.rememberEventLoop();
|
|
97
|
-
return _browserInstance;
|
|
98
|
-
};
|
|
99
|
-
exports.getBrowserInstance = getBrowserInstance;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const executablePath: () => string;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.executablePath = void 0;
|
|
5
|
-
if (/^AWS_Lambda_nodejs(?:18|20)[.]x$/.test((_a = process.env.AWS_EXECUTION_ENV) !== null && _a !== void 0 ? _a : '') === true) {
|
|
6
|
-
process.env.FONTCONFIG_PATH = '/opt';
|
|
7
|
-
process.env.FONTCONFIG_FILE = '/opt/fonts.conf';
|
|
8
|
-
process.env.DISABLE_FROM_SURFACE = '1';
|
|
9
|
-
process.env.NO_COLOR = '1';
|
|
10
|
-
}
|
|
11
|
-
const executablePath = () => {
|
|
12
|
-
return '/opt/bin/chromium';
|
|
13
|
-
};
|
|
14
|
-
exports.executablePath = executablePath;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CustomCredentials, OutNameInput } from '@remotion/serverless/client';
|
|
2
|
-
import type { RenderMetadata } from '../../defaults';
|
|
3
|
-
export declare const getCustomOutName: <Region extends string>({ renderMetadata, customCredentials, }: {
|
|
4
|
-
renderMetadata: RenderMetadata;
|
|
5
|
-
customCredentials: CustomCredentials<Region> | null;
|
|
6
|
-
}) => OutNameInput<Region> | null;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCustomOutName = void 0;
|
|
4
|
-
const getCustomOutName = ({ renderMetadata, customCredentials, }) => {
|
|
5
|
-
var _a, _b;
|
|
6
|
-
if (!renderMetadata.outName) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
if (typeof renderMetadata.outName === 'string') {
|
|
10
|
-
return renderMetadata.outName;
|
|
11
|
-
}
|
|
12
|
-
if (renderMetadata.outName.s3OutputProvider) {
|
|
13
|
-
if (!customCredentials && renderMetadata.privacy === 'private') {
|
|
14
|
-
throw new TypeError(`The file was rendered with a custom S3 implementation and is not public, but no custom credentials were passed to downloadMedia().`);
|
|
15
|
-
}
|
|
16
|
-
return {
|
|
17
|
-
bucketName: renderMetadata.outName.bucketName,
|
|
18
|
-
key: renderMetadata.outName.key,
|
|
19
|
-
s3OutputProvider: {
|
|
20
|
-
endpoint: renderMetadata.outName.s3OutputProvider.endpoint,
|
|
21
|
-
accessKeyId: (_a = customCredentials === null || customCredentials === void 0 ? void 0 : customCredentials.accessKeyId) !== null && _a !== void 0 ? _a : null,
|
|
22
|
-
secretAccessKey: (_b = customCredentials === null || customCredentials === void 0 ? void 0 : customCredentials.secretAccessKey) !== null && _b !== void 0 ? _b : null,
|
|
23
|
-
region: customCredentials === null || customCredentials === void 0 ? void 0 : customCredentials.region,
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
return {
|
|
28
|
-
bucketName: renderMetadata.outName.bucketName,
|
|
29
|
-
key: renderMetadata.outName.key,
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
exports.getCustomOutName = getCustomOutName;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getFolderFiles = void 0;
|
|
7
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
-
function getFolderFiles(folder) {
|
|
10
|
-
const files = node_fs_1.default.readdirSync(folder);
|
|
11
|
-
const paths = [];
|
|
12
|
-
files.forEach((file) => {
|
|
13
|
-
const full = node_path_1.default.join(folder, file);
|
|
14
|
-
try {
|
|
15
|
-
const stat = node_fs_1.default.statSync(full);
|
|
16
|
-
if (stat.isDirectory()) {
|
|
17
|
-
paths.push(...getFolderFiles(full));
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
paths.push({
|
|
21
|
-
filename: full,
|
|
22
|
-
size: stat.size,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
catch (err) {
|
|
27
|
-
if (err.message.includes('ENOENT')) {
|
|
28
|
-
// Race condition: File was deleted in the meanwhile.
|
|
29
|
-
// Do nothing
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
throw err;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
return paths;
|
|
37
|
-
}
|
|
38
|
-
exports.getFolderFiles = getFolderFiles;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { _Object } from '@aws-sdk/client-s3';
|
|
2
|
-
import type { CustomCredentials } from '@remotion/serverless/client';
|
|
3
|
-
import type { AwsRegion } from '../../regions';
|
|
4
|
-
export type LambdaLSInput = {
|
|
5
|
-
bucketName: string;
|
|
6
|
-
prefix: string;
|
|
7
|
-
region: AwsRegion;
|
|
8
|
-
expectedBucketOwner: string | null;
|
|
9
|
-
continuationToken?: string;
|
|
10
|
-
};
|
|
11
|
-
export type LambdaLsReturnType = Promise<_Object[]>;
|
|
12
|
-
export declare const lambdaHeadCommand: ({ bucketName, key, region, customCredentials, }: {
|
|
13
|
-
bucketName: string;
|
|
14
|
-
key: string;
|
|
15
|
-
region: AwsRegion;
|
|
16
|
-
customCredentials: CustomCredentials<AwsRegion> | null;
|
|
17
|
-
}) => Promise<{
|
|
18
|
-
LastModified?: Date | undefined;
|
|
19
|
-
ContentLength?: number | undefined;
|
|
20
|
-
}>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lambdaHeadCommand = void 0;
|
|
4
|
-
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
5
|
-
const get_s3_client_1 = require("../../shared/get-s3-client");
|
|
6
|
-
const lambdaHeadCommand = async ({ bucketName, key, region, customCredentials, }) => {
|
|
7
|
-
const head = await (0, get_s3_client_1.getS3Client)(region, customCredentials).send(new client_s3_1.HeadObjectCommand({
|
|
8
|
-
Bucket: bucketName,
|
|
9
|
-
Key: key,
|
|
10
|
-
}));
|
|
11
|
-
return head;
|
|
12
|
-
};
|
|
13
|
-
exports.lambdaHeadCommand = lambdaHeadCommand;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isBrowserCrashedError = exports.isErrInsufficientResourcesErr = exports.errorIsOutOfSpaceError = void 0;
|
|
4
|
-
const errorIsOutOfSpaceError = (err) => {
|
|
5
|
-
return (err.includes('ENOSPC') ||
|
|
6
|
-
err.toLowerCase().includes('no space left on device'));
|
|
7
|
-
};
|
|
8
|
-
exports.errorIsOutOfSpaceError = errorIsOutOfSpaceError;
|
|
9
|
-
const isErrInsufficientResourcesErr = (err) => {
|
|
10
|
-
return err.includes('net::ERR_INSUFFICIENT_RESOURCES');
|
|
11
|
-
};
|
|
12
|
-
exports.isErrInsufficientResourcesErr = isErrInsufficientResourcesErr;
|
|
13
|
-
const isBrowserCrashedError = (err) => {
|
|
14
|
-
return err.includes('Target closed.') || err.includes('Session closed');
|
|
15
|
-
};
|
|
16
|
-
exports.isBrowserCrashedError = isBrowserCrashedError;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.printCloudwatchHelper = void 0;
|
|
4
|
-
const renderer_1 = require("@remotion/renderer");
|
|
5
|
-
const printCloudwatchHelper = (type, data, logLevel) => {
|
|
6
|
-
const d = Object.keys(data).reduce((a, b) => {
|
|
7
|
-
return [...a, `${b}=${data[b]}`];
|
|
8
|
-
}, []);
|
|
9
|
-
const msg = [`method=${type}`, ...d].join(',');
|
|
10
|
-
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, msg);
|
|
11
|
-
};
|
|
12
|
-
exports.printCloudwatchHelper = printCloudwatchHelper;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { EmittedArtifact } from '@remotion/renderer';
|
|
2
|
-
export type SerializedArtifact = {
|
|
3
|
-
filename: string;
|
|
4
|
-
stringContent: string;
|
|
5
|
-
frame: number;
|
|
6
|
-
binary: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare const deserializeArtifact: (serializedArtifact: SerializedArtifact) => EmittedArtifact;
|
|
9
|
-
export declare const serializeArtifact: (artifact: EmittedArtifact) => SerializedArtifact;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serializeArtifact = exports.deserializeArtifact = void 0;
|
|
4
|
-
const deserializeArtifact = (serializedArtifact) => {
|
|
5
|
-
if (serializedArtifact.binary) {
|
|
6
|
-
const content = new TextEncoder().encode(atob(serializedArtifact.stringContent));
|
|
7
|
-
return {
|
|
8
|
-
filename: serializedArtifact.filename,
|
|
9
|
-
content,
|
|
10
|
-
frame: serializedArtifact.frame,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
return {
|
|
14
|
-
filename: serializedArtifact.filename,
|
|
15
|
-
content: serializedArtifact.stringContent,
|
|
16
|
-
frame: serializedArtifact.frame,
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
exports.deserializeArtifact = deserializeArtifact;
|
|
20
|
-
const serializeArtifact = (artifact) => {
|
|
21
|
-
if (artifact.content instanceof Uint8Array) {
|
|
22
|
-
const b64encoded = btoa(new TextDecoder('utf8').decode(artifact.content));
|
|
23
|
-
return {
|
|
24
|
-
filename: artifact.filename,
|
|
25
|
-
stringContent: b64encoded,
|
|
26
|
-
frame: artifact.frame,
|
|
27
|
-
binary: true,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
filename: artifact.filename,
|
|
32
|
-
stringContent: artifact.content,
|
|
33
|
-
frame: artifact.frame,
|
|
34
|
-
binary: false,
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
exports.serializeArtifact = serializeArtifact;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ChromiumOptions, LogLevel, OnBrowserDownload, openBrowser, RemotionServer } from '@remotion/renderer';
|
|
2
|
-
import type { ProviderSpecifics } from '@remotion/serverless';
|
|
3
|
-
import type { Await } from '@remotion/serverless/client';
|
|
4
|
-
import type { VideoConfig } from 'remotion/no-react';
|
|
5
|
-
type ValidateCompositionOptions<Region extends string> = {
|
|
6
|
-
serveUrl: string;
|
|
7
|
-
composition: string;
|
|
8
|
-
browserInstance: Await<ReturnType<typeof openBrowser>>;
|
|
9
|
-
serializedInputPropsWithCustomSchema: string;
|
|
10
|
-
envVariables: Record<string, string>;
|
|
11
|
-
timeoutInMilliseconds: number;
|
|
12
|
-
chromiumOptions: ChromiumOptions;
|
|
13
|
-
port: number | null;
|
|
14
|
-
forceHeight: number | null;
|
|
15
|
-
forceWidth: number | null;
|
|
16
|
-
logLevel: LogLevel;
|
|
17
|
-
server: RemotionServer | undefined;
|
|
18
|
-
offthreadVideoCacheSizeInBytes: number | null;
|
|
19
|
-
onBrowserDownload: OnBrowserDownload;
|
|
20
|
-
onServeUrlVisited: () => void;
|
|
21
|
-
providerSpecifics: ProviderSpecifics<Region>;
|
|
22
|
-
};
|
|
23
|
-
export declare const validateComposition: <Region extends string>({ serveUrl, composition, browserInstance, serializedInputPropsWithCustomSchema, envVariables, timeoutInMilliseconds, chromiumOptions, port, forceHeight, forceWidth, logLevel, server, offthreadVideoCacheSizeInBytes, onBrowserDownload, onServeUrlVisited, providerSpecifics, }: ValidateCompositionOptions<Region>) => Promise<VideoConfig>;
|
|
24
|
-
export {};
|