@remotion/serverless 4.0.379 → 4.0.381
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const bestFramesPerFunctionParam: (frameCount: number) => number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bestFramesPerFunctionParam = void 0;
|
|
4
|
+
const serverless_client_1 = require("@remotion/serverless-client");
|
|
5
|
+
// Always update the code in docs/lambda/concurrency.md too
|
|
6
|
+
const bestFramesPerFunctionParam = (frameCount) => {
|
|
7
|
+
// Between 0 and 10 minutes (at 30fps), interpolate the concurrency from 75 to 150
|
|
8
|
+
const concurrency = (0, serverless_client_1.interpolate)(frameCount, [0, 18000], [75, 150], {
|
|
9
|
+
extrapolateRight: 'clamp',
|
|
10
|
+
});
|
|
11
|
+
// At least have 20 as a `framesPerFunction` value
|
|
12
|
+
const framesPerFunction = Math.max(frameCount / concurrency, 20);
|
|
13
|
+
// Evenly distribute: For 21 frames over 2 functions, distribute as 11 + 10 ==> framesPerLambda = 11
|
|
14
|
+
const functionsNeeded = Math.ceil(frameCount / framesPerFunction);
|
|
15
|
+
return Math.ceil(frameCount / functionsNeeded);
|
|
16
|
+
};
|
|
17
|
+
exports.bestFramesPerFunctionParam = bestFramesPerFunctionParam;
|
|
@@ -38,11 +38,16 @@ const forgetBrowserEventLoopImplementation = ({ logLevel, launchedBrowser, }) =>
|
|
|
38
38
|
};
|
|
39
39
|
exports.forgetBrowserEventLoopImplementation = forgetBrowserEventLoopImplementation;
|
|
40
40
|
const getBrowserInstanceImplementation = async ({ logLevel, indent, chromiumOptions, providerSpecifics, insideFunctionSpecifics, }) => {
|
|
41
|
-
var _a;
|
|
41
|
+
var _a, _b, _c, _d, _e, _f;
|
|
42
42
|
const actualChromiumOptions = {
|
|
43
43
|
...chromiumOptions,
|
|
44
|
+
darkMode: (_a = chromiumOptions.darkMode) !== null && _a !== void 0 ? _a : false,
|
|
45
|
+
disableWebSecurity: (_b = chromiumOptions.disableWebSecurity) !== null && _b !== void 0 ? _b : false,
|
|
46
|
+
headless: (_c = chromiumOptions.headless) !== null && _c !== void 0 ? _c : true,
|
|
47
|
+
userAgent: (_d = chromiumOptions.userAgent) !== null && _d !== void 0 ? _d : null,
|
|
48
|
+
ignoreCertificateErrors: (_e = chromiumOptions.ignoreCertificateErrors) !== null && _e !== void 0 ? _e : false,
|
|
44
49
|
// Override the `null` value, which might come from CLI with swANGLE
|
|
45
|
-
gl: (
|
|
50
|
+
gl: (_f = chromiumOptions.gl) !== null && _f !== void 0 ? _f : 'swangle',
|
|
46
51
|
enableMultiProcessOnLinux: false,
|
|
47
52
|
};
|
|
48
53
|
const configurationString = makeConfigurationString(actualChromiumOptions, logLevel);
|
package/dist/handlers/launch.js
CHANGED
|
@@ -21,14 +21,16 @@ const innerLaunchHandler = async ({ params, options, overallProgress, registerCl
|
|
|
21
21
|
if (params.type !== serverless_client_2.ServerlessRoutines.launch) {
|
|
22
22
|
throw new Error('Expected launch type');
|
|
23
23
|
}
|
|
24
|
+
const startedDate = Date.now();
|
|
25
|
+
const chromiumParams = { ...params.chromiumOptions };
|
|
24
26
|
if (params.chromiumOptions.gl === 'angle') {
|
|
25
|
-
|
|
27
|
+
renderer_1.RenderInternals.Log.warn({ indent: false, logLevel: params.logLevel }, 'gl=angle is not supported in Lambda. Changing to gl=swangle instead.');
|
|
28
|
+
chromiumParams.gl = 'swangle';
|
|
26
29
|
}
|
|
27
|
-
const startedDate = Date.now();
|
|
28
30
|
const browserInstance = insideFunctionSpecifics.getBrowserInstance({
|
|
29
31
|
logLevel: params.logLevel,
|
|
30
32
|
indent: false,
|
|
31
|
-
chromiumOptions:
|
|
33
|
+
chromiumOptions: chromiumParams,
|
|
32
34
|
providerSpecifics,
|
|
33
35
|
insideFunctionSpecifics,
|
|
34
36
|
});
|
|
@@ -17,6 +17,10 @@ const renderHandler = async ({ params, options, logs, onStream, providerSpecific
|
|
|
17
17
|
if (params.type !== serverless_client_1.ServerlessRoutines.renderer) {
|
|
18
18
|
throw new Error('Params must be renderer');
|
|
19
19
|
}
|
|
20
|
+
if (params.chromiumOptions.gl === 'angle') {
|
|
21
|
+
renderer_1.RenderInternals.Log.warn({ indent: false, logLevel: params.logLevel }, 'gl=angle is not supported in Lambda. Changing to gl=swangle instead.');
|
|
22
|
+
params.chromiumOptions.gl = 'swangle';
|
|
23
|
+
}
|
|
20
24
|
if (params.launchFunctionConfig.version !== serverless_client_1.VERSION) {
|
|
21
25
|
throw new Error(`The version of the function that was specified as "rendererFunctionName" is ${serverless_client_1.VERSION} but the version of the function that invoked the render is ${params.launchFunctionConfig.version}. Please make sure that the version of the function that is specified as "rendererFunctionName" is the same as the version of the function that is invoked.`);
|
|
22
26
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/serverless"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/serverless",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.381",
|
|
7
7
|
"description": "A runtime for distributed rendering",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"sideEffects": false,
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@remotion/renderer": "4.0.
|
|
27
|
-
"@remotion/bundler": "4.0.
|
|
28
|
-
"@remotion/licensing": "4.0.
|
|
29
|
-
"@remotion/serverless-client": "4.0.
|
|
26
|
+
"@remotion/renderer": "4.0.381",
|
|
27
|
+
"@remotion/bundler": "4.0.381",
|
|
28
|
+
"@remotion/licensing": "4.0.381",
|
|
29
|
+
"@remotion/serverless-client": "4.0.381"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
32
|
+
"@remotion/eslint-config-internal": "4.0.381",
|
|
33
33
|
"eslint": "9.19.0"
|
|
34
34
|
},
|
|
35
35
|
"exports": {
|