@remotion/lambda 4.0.0-alpha16 → 4.0.0-alpha18
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/get-compositions-on-lambda.d.ts +3 -1
- package/dist/api/get-compositions-on-lambda.js +4 -3
- package/dist/api/make-lambda-payload.js +4 -2
- package/dist/api/render-media-on-lambda.d.ts +3 -1
- package/dist/api/render-media-on-lambda.js +0 -1
- package/dist/api/render-still-on-lambda.d.ts +3 -1
- package/dist/api/render-still-on-lambda.js +4 -3
- package/dist/cli/commands/render/render.js +2 -2
- package/dist/cli/commands/still.js +2 -2
- package/dist/cli/log.d.ts +3 -3
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +4 -1
- package/dist/functions/compositions.js +4 -5
- package/dist/functions/helpers/get-browser-instance.d.ts +2 -2
- package/dist/functions/helpers/get-browser-instance.js +3 -3
- package/dist/functions/helpers/validate-composition.js +1 -1
- package/dist/functions/launch.js +1 -2
- package/dist/functions/renderer.js +6 -8
- package/dist/functions/start.js +0 -1
- package/dist/functions/still.js +6 -8
- package/dist/shared/constants.d.ts +0 -5
- package/dist/shared/invoke-webhook.d.ts +0 -2
- package/package.json +8 -8
- package/remotionlambda-arm64.zip +0 -0
|
@@ -11,6 +11,9 @@ export type GetCompositionsOnLambdaInput = {
|
|
|
11
11
|
logLevel?: LogLevel;
|
|
12
12
|
timeoutInMilliseconds?: number;
|
|
13
13
|
forceBucketName?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated in favor of `logLevel`: true
|
|
16
|
+
*/
|
|
14
17
|
dumpBrowserLogs?: boolean;
|
|
15
18
|
};
|
|
16
19
|
export type GetCompositionsOnLambdaOutput = AnyCompMetadata[];
|
|
@@ -25,7 +28,6 @@ export type GetCompositionsOnLambdaOutput = AnyCompMetadata[];
|
|
|
25
28
|
* @param params.logLevel The log level of the Lambda function
|
|
26
29
|
* @param params.timeoutInMilliseconds The timeout of the Lambda function
|
|
27
30
|
* @param params.chromiumOptions The options to pass to Chromium
|
|
28
|
-
* @param params.dumpBrowserLogs Whether to print browser logs to CloudWatch
|
|
29
31
|
* @returns The compositions
|
|
30
32
|
*/
|
|
31
33
|
export declare const getCompositionsOnLambda: ({ chromiumOptions, serveUrl, region, inputProps, functionName, envVariables, logLevel, timeoutInMilliseconds, forceBucketName: bucketName, dumpBrowserLogs, }: GetCompositionsOnLambdaInput) => Promise<GetCompositionsOnLambdaOutput>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCompositionsOnLambda = void 0;
|
|
4
|
+
const renderer_1 = require("@remotion/renderer");
|
|
4
5
|
const version_1 = require("remotion/version");
|
|
5
6
|
const defaults_1 = require("../defaults");
|
|
6
7
|
const call_lambda_1 = require("../shared/call-lambda");
|
|
@@ -16,7 +17,6 @@ const serialize_input_props_1 = require("../shared/serialize-input-props");
|
|
|
16
17
|
* @param params.logLevel The log level of the Lambda function
|
|
17
18
|
* @param params.timeoutInMilliseconds The timeout of the Lambda function
|
|
18
19
|
* @param params.chromiumOptions The options to pass to Chromium
|
|
19
|
-
* @param params.dumpBrowserLogs Whether to print browser logs to CloudWatch
|
|
20
20
|
* @returns The compositions
|
|
21
21
|
*/
|
|
22
22
|
const getCompositionsOnLambda = async ({ chromiumOptions, serveUrl, region, inputProps, functionName, envVariables, logLevel, timeoutInMilliseconds, forceBucketName: bucketName, dumpBrowserLogs, }) => {
|
|
@@ -36,11 +36,12 @@ const getCompositionsOnLambda = async ({ chromiumOptions, serveUrl, region, inpu
|
|
|
36
36
|
serveUrl,
|
|
37
37
|
envVariables,
|
|
38
38
|
inputProps: serializedInputProps,
|
|
39
|
-
logLevel:
|
|
39
|
+
logLevel: dumpBrowserLogs
|
|
40
|
+
? 'verbose'
|
|
41
|
+
: logLevel !== null && logLevel !== void 0 ? logLevel : renderer_1.RenderInternals.getLogLevel(),
|
|
40
42
|
timeoutInMilliseconds: timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : 30000,
|
|
41
43
|
version: version_1.VERSION,
|
|
42
44
|
bucketName: bucketName !== null && bucketName !== void 0 ? bucketName : null,
|
|
43
|
-
dumpBrowserLogs: dumpBrowserLogs !== null && dumpBrowserLogs !== void 0 ? dumpBrowserLogs : false,
|
|
44
45
|
},
|
|
45
46
|
region,
|
|
46
47
|
});
|
|
@@ -8,6 +8,7 @@ const validate_download_behavior_1 = require("../shared/validate-download-behavi
|
|
|
8
8
|
const validate_frames_per_lambda_1 = require("../shared/validate-frames-per-lambda");
|
|
9
9
|
const validate_lambda_codec_1 = require("../shared/validate-lambda-codec");
|
|
10
10
|
const validate_serveurl_1 = require("../shared/validate-serveurl");
|
|
11
|
+
const renderer_1 = require("@remotion/renderer");
|
|
11
12
|
const makeLambdaRenderMediaPayload = async ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, downloadBehavior, muted, overwrite, dumpBrowserLogs, jpegQuality, quality, }) => {
|
|
12
13
|
if (quality) {
|
|
13
14
|
throw new Error('quality has been renamed to jpegQuality. Please rename the option.');
|
|
@@ -40,7 +41,9 @@ const makeLambdaRenderMediaPayload = async ({ rendererFunctionName, frameRange,
|
|
|
40
41
|
jpegQuality,
|
|
41
42
|
maxRetries: maxRetries !== null && maxRetries !== void 0 ? maxRetries : 1,
|
|
42
43
|
privacy: privacy !== null && privacy !== void 0 ? privacy : 'public',
|
|
43
|
-
logLevel:
|
|
44
|
+
logLevel: dumpBrowserLogs
|
|
45
|
+
? 'verbose'
|
|
46
|
+
: logLevel !== null && logLevel !== void 0 ? logLevel : renderer_1.RenderInternals.getLogLevel(),
|
|
44
47
|
frameRange: frameRange !== null && frameRange !== void 0 ? frameRange : null,
|
|
45
48
|
outName: outName !== null && outName !== void 0 ? outName : null,
|
|
46
49
|
timeoutInMilliseconds: timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : 30000,
|
|
@@ -60,7 +63,6 @@ const makeLambdaRenderMediaPayload = async ({ rendererFunctionName, frameRange,
|
|
|
60
63
|
forceWidth: forceWidth !== null && forceWidth !== void 0 ? forceWidth : null,
|
|
61
64
|
bucketName: bucketName !== null && bucketName !== void 0 ? bucketName : null,
|
|
62
65
|
audioCodec: audioCodec !== null && audioCodec !== void 0 ? audioCodec : null,
|
|
63
|
-
dumpBrowserLogs: dumpBrowserLogs !== null && dumpBrowserLogs !== void 0 ? dumpBrowserLogs : false,
|
|
64
66
|
type: defaults_1.LambdaRoutines.start,
|
|
65
67
|
};
|
|
66
68
|
};
|
|
@@ -46,6 +46,9 @@ export type RenderMediaOnLambdaInput = {
|
|
|
46
46
|
rendererFunctionName?: string | null;
|
|
47
47
|
forceBucketName?: string;
|
|
48
48
|
audioCodec?: AudioCodec | null;
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated in favor of `logLevel`: true
|
|
51
|
+
*/
|
|
49
52
|
dumpBrowserLogs?: boolean;
|
|
50
53
|
};
|
|
51
54
|
export type RenderMediaOnLambdaOutput = {
|
|
@@ -71,7 +74,6 @@ export type RenderMediaOnLambdaOutput = {
|
|
|
71
74
|
* @param params.maxRetries How often rendering a chunk may fail before the media render gets aborted. Default "1"
|
|
72
75
|
* @param params.logLevel Level of logging that Lambda function should perform. Default "info".
|
|
73
76
|
* @param params.webhook Configuration for webhook called upon completion or timeout of the render.
|
|
74
|
-
* @param params.dumpBrowserLogs Whether to print browser logs to CloudWatch
|
|
75
77
|
* @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
|
|
76
78
|
*/
|
|
77
79
|
export declare const renderMediaOnLambda: (input: RenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
|
|
@@ -22,7 +22,6 @@ const make_lambda_payload_1 = require("./make-lambda-payload");
|
|
|
22
22
|
* @param params.maxRetries How often rendering a chunk may fail before the media render gets aborted. Default "1"
|
|
23
23
|
* @param params.logLevel Level of logging that Lambda function should perform. Default "info".
|
|
24
24
|
* @param params.webhook Configuration for webhook called upon completion or timeout of the render.
|
|
25
|
-
* @param params.dumpBrowserLogs Whether to print browser logs to CloudWatch
|
|
26
25
|
* @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
|
|
27
26
|
*/
|
|
28
27
|
const renderMediaOnLambda = async (input) => {
|
|
@@ -27,6 +27,9 @@ export type RenderStillOnLambdaInput = {
|
|
|
27
27
|
forceWidth?: number | null;
|
|
28
28
|
forceHeight?: number | null;
|
|
29
29
|
forceBucketName?: string;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Renamed to `dumpBrowserLogs`
|
|
32
|
+
*/
|
|
30
33
|
dumpBrowserLogs?: boolean;
|
|
31
34
|
};
|
|
32
35
|
export type RenderStillOnLambdaOutput = {
|
|
@@ -51,7 +54,6 @@ export type RenderStillOnLambdaOutput = {
|
|
|
51
54
|
* @param params.maxRetries How often rendering a chunk may fail before the video render gets aborted.
|
|
52
55
|
* @param params.frame Which frame should be used for the still image. Default 0.
|
|
53
56
|
* @param params.privacy Whether the item in the S3 bucket should be public. Possible values: `"private"` and `"public"`
|
|
54
|
-
* @param params.dumpBrowserLogs Whether to print browser logs to CloudWatch.
|
|
55
57
|
* @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
|
|
56
58
|
*/
|
|
57
59
|
export declare const renderStillOnLambda: ({ functionName, serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, dumpBrowserLogs, }: RenderStillOnLambdaInput) => Promise<RenderStillOnLambdaOutput>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.renderStillOnLambda = void 0;
|
|
4
|
+
const renderer_1 = require("@remotion/renderer");
|
|
4
5
|
const version_1 = require("remotion/version");
|
|
5
6
|
const call_lambda_1 = require("../shared/call-lambda");
|
|
6
7
|
const constants_1 = require("../shared/constants");
|
|
@@ -20,7 +21,6 @@ const serialize_input_props_1 = require("../shared/serialize-input-props");
|
|
|
20
21
|
* @param params.maxRetries How often rendering a chunk may fail before the video render gets aborted.
|
|
21
22
|
* @param params.frame Which frame should be used for the still image. Default 0.
|
|
22
23
|
* @param params.privacy Whether the item in the S3 bucket should be public. Possible values: `"private"` and `"public"`
|
|
23
|
-
* @param params.dumpBrowserLogs Whether to print browser logs to CloudWatch.
|
|
24
24
|
* @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
|
|
25
25
|
*/
|
|
26
26
|
const renderStillOnLambda = async ({ functionName, serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, dumpBrowserLogs, }) => {
|
|
@@ -49,7 +49,9 @@ const renderStillOnLambda = async ({ functionName, serveUrl, inputProps, imageFo
|
|
|
49
49
|
frame: frame !== null && frame !== void 0 ? frame : 0,
|
|
50
50
|
privacy,
|
|
51
51
|
attempt: 1,
|
|
52
|
-
logLevel:
|
|
52
|
+
logLevel: dumpBrowserLogs
|
|
53
|
+
? 'verbose'
|
|
54
|
+
: logLevel !== null && logLevel !== void 0 ? logLevel : renderer_1.RenderInternals.getLogLevel(),
|
|
53
55
|
outName: outName !== null && outName !== void 0 ? outName : null,
|
|
54
56
|
timeoutInMilliseconds: timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : 30000,
|
|
55
57
|
chromiumOptions: chromiumOptions !== null && chromiumOptions !== void 0 ? chromiumOptions : {},
|
|
@@ -59,7 +61,6 @@ const renderStillOnLambda = async ({ functionName, serveUrl, inputProps, imageFo
|
|
|
59
61
|
forceHeight: forceHeight !== null && forceHeight !== void 0 ? forceHeight : null,
|
|
60
62
|
forceWidth: forceWidth !== null && forceWidth !== void 0 ? forceWidth : null,
|
|
61
63
|
bucketName: forceBucketName !== null && forceBucketName !== void 0 ? forceBucketName : null,
|
|
62
|
-
dumpBrowserLogs: dumpBrowserLogs !== null && dumpBrowserLogs !== void 0 ? dumpBrowserLogs : false,
|
|
63
64
|
},
|
|
64
65
|
region,
|
|
65
66
|
});
|
|
@@ -45,7 +45,7 @@ const renderCommand = async (args, remotionRoot) => {
|
|
|
45
45
|
indent: false,
|
|
46
46
|
port,
|
|
47
47
|
remotionRoot,
|
|
48
|
-
|
|
48
|
+
logLevel,
|
|
49
49
|
webpackConfigOrServeUrl: serveUrl,
|
|
50
50
|
});
|
|
51
51
|
const { compositionId } = await cli_1.CliInternals.getCompositionWithDimensionOverride({
|
|
@@ -61,7 +61,7 @@ const renderCommand = async (args, remotionRoot) => {
|
|
|
61
61
|
puppeteerInstance: undefined,
|
|
62
62
|
serveUrlOrWebpackUrl: serveUrl,
|
|
63
63
|
timeoutInMilliseconds: puppeteerTimeout,
|
|
64
|
-
|
|
64
|
+
logLevel,
|
|
65
65
|
width,
|
|
66
66
|
server: await server,
|
|
67
67
|
});
|
|
@@ -41,7 +41,7 @@ const stillCommand = async (args, remotionRoot) => {
|
|
|
41
41
|
indent: false,
|
|
42
42
|
port,
|
|
43
43
|
remotionRoot,
|
|
44
|
-
|
|
44
|
+
logLevel,
|
|
45
45
|
webpackConfigOrServeUrl: serveUrl,
|
|
46
46
|
});
|
|
47
47
|
const { compositionId } = await cli_1.CliInternals.getCompositionWithDimensionOverride({
|
|
@@ -49,7 +49,7 @@ const stillCommand = async (args, remotionRoot) => {
|
|
|
49
49
|
compositionIdFromUi: null,
|
|
50
50
|
indent: false,
|
|
51
51
|
serveUrlOrWebpackUrl: serveUrl,
|
|
52
|
-
|
|
52
|
+
logLevel,
|
|
53
53
|
browserExecutable,
|
|
54
54
|
chromiumOptions,
|
|
55
55
|
envVariables,
|
package/dist/cli/log.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare const Log: {
|
|
|
2
2
|
verbose: (message?: any, ...optionalParams: any[]) => void;
|
|
3
3
|
verboseAdvanced: (options: {
|
|
4
4
|
indent: boolean;
|
|
5
|
-
logLevel: "
|
|
5
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
6
6
|
} & {
|
|
7
7
|
tag?: string | undefined;
|
|
8
8
|
secondTag?: string | undefined;
|
|
@@ -10,12 +10,12 @@ export declare const Log: {
|
|
|
10
10
|
info: (message?: any, ...optionalParams: any[]) => void;
|
|
11
11
|
infoAdvanced: (options: {
|
|
12
12
|
indent: boolean;
|
|
13
|
-
logLevel: "
|
|
13
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
14
14
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
15
15
|
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
16
16
|
warnAdvanced: (options: {
|
|
17
17
|
indent: boolean;
|
|
18
|
-
logLevel: "
|
|
18
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
19
19
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
20
20
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
21
21
|
};
|
|
@@ -10,7 +10,7 @@ const deserialize_input_props_1 = require("../shared/deserialize-input-props");
|
|
|
10
10
|
const get_browser_instance_1 = require("./helpers/get-browser-instance");
|
|
11
11
|
const get_current_region_1 = require("./helpers/get-current-region");
|
|
12
12
|
const compositionsHandler = async (lambdaParams, options) => {
|
|
13
|
-
var _a, _b, _c
|
|
13
|
+
var _a, _b, _c;
|
|
14
14
|
if (lambdaParams.type !== defaults_1.LambdaRoutines.compositions) {
|
|
15
15
|
throw new TypeError('Expected info compositions');
|
|
16
16
|
}
|
|
@@ -21,12 +21,11 @@ const compositionsHandler = async (lambdaParams, options) => {
|
|
|
21
21
|
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`);
|
|
22
22
|
}
|
|
23
23
|
const region = (0, get_current_region_1.getCurrentRegionInFunction)();
|
|
24
|
-
const verbose = renderer_1.RenderInternals.isEqualOrBelowLogLevel(lambdaParams.logLevel, 'verbose');
|
|
25
24
|
const [bucketName, browserInstance] = await Promise.all([
|
|
26
25
|
(_a = lambdaParams.bucketName) !== null && _a !== void 0 ? _a : (0, get_or_create_bucket_1.getOrCreateBucket)({
|
|
27
26
|
region,
|
|
28
27
|
}).then((b) => b.bucketName),
|
|
29
|
-
(0, get_browser_instance_1.getBrowserInstance)(
|
|
28
|
+
(0, get_browser_instance_1.getBrowserInstance)(lambdaParams.logLevel, false, (_b = lambdaParams.chromiumOptions) !== null && _b !== void 0 ? _b : {}),
|
|
30
29
|
]);
|
|
31
30
|
const inputProps = await (0, deserialize_input_props_1.deserializeInputProps)({
|
|
32
31
|
bucketName,
|
|
@@ -43,12 +42,12 @@ const compositionsHandler = async (lambdaParams, options) => {
|
|
|
43
42
|
serveUrlOrWebpackUrl: realServeUrl,
|
|
44
43
|
puppeteerInstance: browserInstance,
|
|
45
44
|
inputProps,
|
|
46
|
-
envVariables: (
|
|
45
|
+
envVariables: (_c = lambdaParams.envVariables) !== null && _c !== void 0 ? _c : {},
|
|
47
46
|
timeoutInMilliseconds: lambdaParams.timeoutInMilliseconds,
|
|
48
47
|
chromiumOptions: lambdaParams.chromiumOptions,
|
|
49
48
|
port: null,
|
|
50
49
|
server: undefined,
|
|
51
|
-
|
|
50
|
+
logLevel: lambdaParams.logLevel,
|
|
52
51
|
indent: false,
|
|
53
52
|
browserExecutable: null,
|
|
54
53
|
onBrowserLog: null,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ChromiumOptions, openBrowser } from '@remotion/renderer';
|
|
2
|
-
export declare const getBrowserInstance: (
|
|
1
|
+
import type { ChromiumOptions, LogLevel, openBrowser } from '@remotion/renderer';
|
|
2
|
+
export declare const getBrowserInstance: (logLevel: LogLevel, indent: boolean, chromiumOptions: ChromiumOptions) => ReturnType<typeof openBrowser>;
|
|
@@ -19,7 +19,7 @@ const waitForLaunched = () => {
|
|
|
19
19
|
check();
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
const getBrowserInstance = async (
|
|
22
|
+
const getBrowserInstance = async (logLevel, indent, chromiumOptions) => {
|
|
23
23
|
var _a;
|
|
24
24
|
if (launching) {
|
|
25
25
|
await waitForLaunched();
|
|
@@ -41,15 +41,15 @@ const getBrowserInstance = async (shouldDumpIo, chromiumOptions) => {
|
|
|
41
41
|
_browserInstance = await renderer_1.RenderInternals.internalOpenBrowser({
|
|
42
42
|
browser: 'chrome',
|
|
43
43
|
browserExecutable: execPath,
|
|
44
|
-
shouldDumpIo,
|
|
45
44
|
chromiumOptions: actualChromiumOptions,
|
|
46
45
|
forceDeviceScaleFactor: undefined,
|
|
47
46
|
indent: false,
|
|
48
47
|
viewport: null,
|
|
48
|
+
logLevel,
|
|
49
49
|
});
|
|
50
50
|
_browserInstance.on('disconnected', () => {
|
|
51
51
|
console.log('Browser disconnected / crashed');
|
|
52
|
-
_browserInstance === null || _browserInstance === void 0 ? void 0 : _browserInstance.close(true).catch(() => undefined);
|
|
52
|
+
_browserInstance === null || _browserInstance === void 0 ? void 0 : _browserInstance.close(true, logLevel, indent).catch(() => undefined);
|
|
53
53
|
_browserInstance = null;
|
|
54
54
|
});
|
|
55
55
|
launching = false;
|
|
@@ -14,7 +14,7 @@ const validateComposition = async ({ serveUrl, composition, browserInstance, inp
|
|
|
14
14
|
port,
|
|
15
15
|
browserExecutable: (0, get_chromium_executable_path_1.executablePath)(),
|
|
16
16
|
serveUrl,
|
|
17
|
-
|
|
17
|
+
logLevel,
|
|
18
18
|
indent: false,
|
|
19
19
|
onBrowserLog: null,
|
|
20
20
|
server,
|
package/dist/functions/launch.js
CHANGED
|
@@ -135,7 +135,7 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
}, Math.max(options.getRemainingTimeInMillis() - 1000, 1000));
|
|
138
|
-
const browserInstance = await (0, get_browser_instance_1.getBrowserInstance)(
|
|
138
|
+
const browserInstance = await (0, get_browser_instance_1.getBrowserInstance)(params.logLevel, false, params.chromiumOptions);
|
|
139
139
|
const inputPropsPromise = (0, deserialize_input_props_1.deserializeInputProps)({
|
|
140
140
|
bucketName: params.bucketName,
|
|
141
141
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
@@ -225,7 +225,6 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
225
225
|
launchFunctionConfig: {
|
|
226
226
|
version: version_1.VERSION,
|
|
227
227
|
},
|
|
228
|
-
dumpBrowserLogs: params.dumpBrowserLogs,
|
|
229
228
|
};
|
|
230
229
|
return payload;
|
|
231
230
|
});
|
|
@@ -32,7 +32,7 @@ const renderHandler = async (params, options, logs) => {
|
|
|
32
32
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
33
33
|
serialized: params.inputProps,
|
|
34
34
|
});
|
|
35
|
-
const browserInstance = await (0, get_browser_instance_1.getBrowserInstance)(
|
|
35
|
+
const browserInstance = await (0, get_browser_instance_1.getBrowserInstance)(params.logLevel, false, (_a = params.chromiumOptions) !== null && _a !== void 0 ? _a : {});
|
|
36
36
|
const outputPath = renderer_1.RenderInternals.tmpDir('remotion-render-');
|
|
37
37
|
if (typeof params.chunk !== 'number') {
|
|
38
38
|
throw new Error('must pass chunk');
|
|
@@ -58,7 +58,7 @@ const renderHandler = async (params, options, logs) => {
|
|
|
58
58
|
const downloads = {};
|
|
59
59
|
const inputProps = await inputPropsPromise;
|
|
60
60
|
await new Promise((resolve, reject) => {
|
|
61
|
-
var _a, _b, _c, _d
|
|
61
|
+
var _a, _b, _c, _d;
|
|
62
62
|
renderer_1.RenderInternals.internalRenderMedia({
|
|
63
63
|
composition: {
|
|
64
64
|
id: params.composition,
|
|
@@ -104,15 +104,14 @@ const renderHandler = async (params, options, logs) => {
|
|
|
104
104
|
serveUrl: params.serveUrl,
|
|
105
105
|
jpegQuality: (_a = params.jpegQuality) !== null && _a !== void 0 ? _a : renderer_1.RenderInternals.DEFAULT_JPEG_QUALITY,
|
|
106
106
|
envVariables: (_b = params.envVariables) !== null && _b !== void 0 ? _b : {},
|
|
107
|
-
|
|
108
|
-
verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose'),
|
|
107
|
+
logLevel: params.logLevel,
|
|
109
108
|
onBrowserLog: (log) => {
|
|
110
109
|
logs.push(log);
|
|
111
110
|
},
|
|
112
111
|
outputLocation,
|
|
113
112
|
codec: chunkCodec,
|
|
114
|
-
crf: (
|
|
115
|
-
pixelFormat: (
|
|
113
|
+
crf: (_c = params.crf) !== null && _c !== void 0 ? _c : null,
|
|
114
|
+
pixelFormat: (_d = params.pixelFormat) !== null && _d !== void 0 ? _d : renderer_1.RenderInternals.DEFAULT_PIXEL_FORMAT,
|
|
116
115
|
proResProfile: params.proResProfile,
|
|
117
116
|
onDownload: (src) => {
|
|
118
117
|
console.log('Downloading', src);
|
|
@@ -160,10 +159,9 @@ const renderHandler = async (params, options, logs) => {
|
|
|
160
159
|
server: undefined,
|
|
161
160
|
})
|
|
162
161
|
.then(({ slowestFrames }) => {
|
|
163
|
-
console.log();
|
|
164
162
|
console.log(`Slowest frames:`);
|
|
165
163
|
slowestFrames.forEach(({ frame, time }) => {
|
|
166
|
-
console.log(`Frame ${frame} (${time.toFixed(3)}ms)`);
|
|
164
|
+
console.log(` Frame ${frame} (${time.toFixed(3)}ms)`);
|
|
167
165
|
});
|
|
168
166
|
resolve();
|
|
169
167
|
})
|
package/dist/functions/start.js
CHANGED
|
@@ -77,7 +77,6 @@ const startHandler = async (params, options) => {
|
|
|
77
77
|
forceWidth: params.forceWidth,
|
|
78
78
|
rendererFunctionName: params.rendererFunctionName,
|
|
79
79
|
audioCodec: params.audioCodec,
|
|
80
|
-
dumpBrowserLogs: params.dumpBrowserLogs,
|
|
81
80
|
};
|
|
82
81
|
await (0, aws_clients_1.getLambdaClient)((0, get_current_region_1.getCurrentRegionInFunction)()).send(new client_lambda_1.InvokeCommand({
|
|
83
82
|
FunctionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
|
package/dist/functions/still.js
CHANGED
|
@@ -31,7 +31,7 @@ const io_1 = require("./helpers/io");
|
|
|
31
31
|
const validate_composition_1 = require("./helpers/validate-composition");
|
|
32
32
|
const write_lambda_error_1 = require("./helpers/write-lambda-error");
|
|
33
33
|
const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
34
|
-
var _a, _b, _c, _d, _e, _f
|
|
34
|
+
var _a, _b, _c, _d, _e, _f;
|
|
35
35
|
if (lambdaParams.type !== constants_1.LambdaRoutines.still) {
|
|
36
36
|
throw new TypeError('Expected still type');
|
|
37
37
|
}
|
|
@@ -49,7 +49,7 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
49
49
|
(_a = lambdaParams.bucketName) !== null && _a !== void 0 ? _a : (0, get_or_create_bucket_1.getOrCreateBucket)({
|
|
50
50
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
51
51
|
}).then((b) => b.bucketName),
|
|
52
|
-
(0, get_browser_instance_1.getBrowserInstance)(
|
|
52
|
+
(0, get_browser_instance_1.getBrowserInstance)(lambdaParams.logLevel, false, (_b = lambdaParams.chromiumOptions) !== null && _b !== void 0 ? _b : {}),
|
|
53
53
|
]);
|
|
54
54
|
const outputDir = renderer_1.RenderInternals.tmpDir('remotion-render-');
|
|
55
55
|
const outputPath = node_path_1.default.join(outputDir, 'output');
|
|
@@ -65,13 +65,12 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
65
65
|
region,
|
|
66
66
|
bucketName,
|
|
67
67
|
});
|
|
68
|
-
const verbose = renderer_1.RenderInternals.isEqualOrBelowLogLevel(lambdaParams.logLevel, 'verbose');
|
|
69
68
|
const server = await renderer_1.RenderInternals.prepareServer({
|
|
70
69
|
concurrency: 1,
|
|
71
70
|
indent: false,
|
|
72
71
|
port: null,
|
|
73
72
|
remotionRoot: process.cwd(),
|
|
74
|
-
|
|
73
|
+
logLevel: lambdaParams.logLevel,
|
|
75
74
|
webpackConfigOrServeUrl: serveUrl,
|
|
76
75
|
});
|
|
77
76
|
const composition = await (0, validate_composition_1.validateComposition)({
|
|
@@ -125,8 +124,7 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
125
124
|
composition,
|
|
126
125
|
output: outputPath,
|
|
127
126
|
serveUrl,
|
|
128
|
-
|
|
129
|
-
envVariables: (_f = lambdaParams.envVariables) !== null && _f !== void 0 ? _f : {},
|
|
127
|
+
envVariables: (_e = lambdaParams.envVariables) !== null && _e !== void 0 ? _e : {},
|
|
130
128
|
frame: renderer_1.RenderInternals.convertToPositiveFrameIndex({
|
|
131
129
|
frame: lambdaParams.frame,
|
|
132
130
|
durationInFrames: composition.durationInFrames,
|
|
@@ -135,7 +133,7 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
135
133
|
inputProps,
|
|
136
134
|
overwrite: false,
|
|
137
135
|
puppeteerInstance: browserInstance,
|
|
138
|
-
jpegQuality: (
|
|
136
|
+
jpegQuality: (_f = lambdaParams.jpegQuality) !== null && _f !== void 0 ? _f : renderer_1.RenderInternals.DEFAULT_JPEG_QUALITY,
|
|
139
137
|
chromiumOptions: lambdaParams.chromiumOptions,
|
|
140
138
|
scale: lambdaParams.scale,
|
|
141
139
|
timeoutInMilliseconds: lambdaParams.timeoutInMilliseconds,
|
|
@@ -146,7 +144,7 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
146
144
|
onDownload: null,
|
|
147
145
|
port: null,
|
|
148
146
|
server,
|
|
149
|
-
|
|
147
|
+
logLevel: lambdaParams.logLevel,
|
|
150
148
|
});
|
|
151
149
|
const { key, renderBucketName, customCredentials } = (0, expected_out_name_1.getExpectedOutName)(renderMetadata, bucketName, (0, expected_out_name_1.getCredentialsFromOutName)(lambdaParams.outName));
|
|
152
150
|
const { size } = await node_fs_1.default.promises.stat(outputPath);
|
|
@@ -140,7 +140,6 @@ export type LambdaStartPayload = {
|
|
|
140
140
|
forceHeight: number | null;
|
|
141
141
|
forceWidth: number | null;
|
|
142
142
|
bucketName: string | null;
|
|
143
|
-
dumpBrowserLogs: boolean;
|
|
144
143
|
};
|
|
145
144
|
export type LambdaStatusPayload = {
|
|
146
145
|
type: LambdaRoutines.status;
|
|
@@ -190,7 +189,6 @@ export type LambdaPayloads = {
|
|
|
190
189
|
webhook: WebhookOption;
|
|
191
190
|
forceHeight: number | null;
|
|
192
191
|
forceWidth: number | null;
|
|
193
|
-
dumpBrowserLogs: boolean;
|
|
194
192
|
};
|
|
195
193
|
status: LambdaStatusPayload;
|
|
196
194
|
renderer: {
|
|
@@ -228,7 +226,6 @@ export type LambdaPayloads = {
|
|
|
228
226
|
launchFunctionConfig: {
|
|
229
227
|
version: string;
|
|
230
228
|
};
|
|
231
|
-
dumpBrowserLogs: boolean;
|
|
232
229
|
};
|
|
233
230
|
still: {
|
|
234
231
|
type: LambdaRoutines.still;
|
|
@@ -252,7 +249,6 @@ export type LambdaPayloads = {
|
|
|
252
249
|
forceHeight: number | null;
|
|
253
250
|
forceWidth: number | null;
|
|
254
251
|
bucketName: string | null;
|
|
255
|
-
dumpBrowserLogs: boolean;
|
|
256
252
|
};
|
|
257
253
|
compositions: {
|
|
258
254
|
type: LambdaRoutines.compositions;
|
|
@@ -264,7 +260,6 @@ export type LambdaPayloads = {
|
|
|
264
260
|
timeoutInMilliseconds: number;
|
|
265
261
|
serveUrl: string;
|
|
266
262
|
bucketName: string | null;
|
|
267
|
-
dumpBrowserLogs: boolean;
|
|
268
263
|
};
|
|
269
264
|
};
|
|
270
265
|
export type LambdaPayload = LambdaPayloads[LambdaRoutines];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-alpha18",
|
|
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.338.0",
|
|
26
26
|
"aws-policies": "^1.0.1",
|
|
27
27
|
"mime-types": "2.1.34",
|
|
28
|
-
"@remotion/
|
|
29
|
-
"remotion": "4.0.0-
|
|
30
|
-
"
|
|
31
|
-
"@remotion/renderer": "4.0.0-
|
|
28
|
+
"@remotion/bundler": "4.0.0-alpha18",
|
|
29
|
+
"@remotion/cli": "4.0.0-alpha18",
|
|
30
|
+
"remotion": "4.0.0-alpha18",
|
|
31
|
+
"@remotion/renderer": "4.0.0-alpha18"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@jonny/eslint-config": "3.0.266",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"typescript": "4.9.5",
|
|
44
44
|
"vitest": "0.31.1",
|
|
45
45
|
"zip-lib": "^0.7.2",
|
|
46
|
-
"@remotion/bundler": "4.0.0-
|
|
47
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.0-
|
|
46
|
+
"@remotion/bundler": "4.0.0-alpha18",
|
|
47
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.0-alpha18"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@remotion/bundler": "4.0.0-
|
|
50
|
+
"@remotion/bundler": "4.0.0-alpha18"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|