@remotion/lambda 4.1.0-alpha2 → 4.1.0-alpha3

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.
@@ -4,6 +4,6 @@ export type BucketWithLocation = {
4
4
  creationDate: number;
5
5
  region: AwsRegion;
6
6
  };
7
- export declare const getRemotionS3Buckets: (region: AwsRegion) => Promise<{
7
+ export declare const getRemotionS3Buckets: (region: AwsRegion, forceBucketName?: string) => Promise<{
8
8
  remotionBuckets: BucketWithLocation[];
9
9
  }>;
@@ -2,15 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRemotionS3Buckets = void 0;
4
4
  const client_s3_1 = require("@aws-sdk/client-s3");
5
+ const defaults_1 = require("../defaults");
5
6
  const aws_clients_1 = require("../shared/aws-clients");
6
- const constants_1 = require("../shared/constants");
7
7
  const validate_bucketname_1 = require("../shared/validate-bucketname");
8
- const getRemotionS3Buckets = async (region) => {
8
+ const getRemotionS3Buckets = async (region, forceBucketName) => {
9
9
  const { Buckets } = await (0, aws_clients_1.getS3Client)(region, null).send(new client_s3_1.ListBucketsCommand({}));
10
10
  if (!Buckets) {
11
11
  return { remotionBuckets: [] };
12
12
  }
13
- const remotionBuckets = Buckets.filter((b) => { var _a; return (_a = b.Name) === null || _a === void 0 ? void 0 : _a.startsWith(constants_1.REMOTION_BUCKET_PREFIX); });
13
+ const remotionBuckets = Buckets.filter((b) => {
14
+ var _a;
15
+ if (forceBucketName) {
16
+ return b.Name === forceBucketName;
17
+ }
18
+ return (_a = b.Name) === null || _a === void 0 ? void 0 : _a.startsWith(defaults_1.REMOTION_BUCKET_PREFIX);
19
+ });
14
20
  const locations = await Promise.all(remotionBuckets.map(async (bucket) => {
15
21
  var _a, _b;
16
22
  const { region: parsedRegion } = (0, validate_bucketname_1.parseBucketName)(bucket.Name);
@@ -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: logLevel !== null && logLevel !== void 0 ? logLevel : 'info',
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
  });
@@ -9,6 +9,7 @@ type Site = {
9
9
  };
10
10
  export type GetSitesInput = {
11
11
  region: AwsRegion;
12
+ forceBucketName?: string;
12
13
  };
13
14
  export type GetSitesOutput = {
14
15
  sites: Site[];
@@ -20,5 +21,5 @@ export type GetSitesOutput = {
20
21
  * @param {AwsRegion} params.region The AWS region that you want to query for.
21
22
  * @returns {Promise<GetSitesOutput>} A Promise containing an object with `sites` and `bucket` keys. Consult documentation for details.
22
23
  */
23
- export declare const getSites: ({ region, }: GetSitesInput) => Promise<GetSitesOutput>;
24
+ export declare const getSites: ({ region, forceBucketName, }: GetSitesInput) => Promise<GetSitesOutput>;
24
25
  export {};
@@ -12,9 +12,11 @@ const get_buckets_1 = require("./get-buckets");
12
12
  * @param {AwsRegion} params.region The AWS region that you want to query for.
13
13
  * @returns {Promise<GetSitesOutput>} A Promise containing an object with `sites` and `bucket` keys. Consult documentation for details.
14
14
  */
15
- const getSites = async ({ region, }) => {
15
+ const getSites = async ({ region, forceBucketName, }) => {
16
16
  var _a;
17
- const { remotionBuckets } = await (0, get_buckets_1.getRemotionS3Buckets)(region);
17
+ const { remotionBuckets } = forceBucketName
18
+ ? await (0, get_buckets_1.getRemotionS3Buckets)(region, forceBucketName)
19
+ : await (0, get_buckets_1.getRemotionS3Buckets)(region);
18
20
  const accountId = await (0, get_account_id_1.getAccountId)({ region });
19
21
  const sites = {};
20
22
  for (const bucket of remotionBuckets) {
@@ -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: logLevel !== null && logLevel !== void 0 ? logLevel : 'info',
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: logLevel !== null && logLevel !== void 0 ? logLevel : 'info',
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
- verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),
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
- verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),
64
+ logLevel,
65
65
  width,
66
66
  server: await server,
67
67
  });
@@ -90,6 +90,7 @@ const sitesCreateSubcommand = async (args, remotionRoot) => {
90
90
  },
91
91
  enableCaching: config_1.ConfigInternals.getWebpackCaching(),
92
92
  webpackOverride: (_c = config_1.ConfigInternals.getWebpackOverrideFn()) !== null && _c !== void 0 ? _c : ((f) => f),
93
+ bypassBucketNameValidation: Boolean(args_1.parsedLambdaCli['force-bucket-name']),
93
94
  },
94
95
  region: (0, get_aws_region_1.getAwsRegion)(),
95
96
  privacy: args_1.parsedLambdaCli.privacy,
@@ -24,9 +24,10 @@ const sitesRmSubcommand = async (args) => {
24
24
  const region = (0, get_aws_region_1.getAwsRegion)();
25
25
  const deployedSites = await (0, get_sites_1.getSites)({
26
26
  region,
27
+ forceBucketName: args_1.parsedLambdaCli['force-bucket-name'],
27
28
  });
29
+ const bucketName = (_a = args_1.parsedLambdaCli['force-bucket-name']) !== null && _a !== void 0 ? _a : (await (0, get_or_create_bucket_1.getOrCreateBucket)({ region })).bucketName;
28
30
  for (const siteName of args) {
29
- const bucketName = (_a = args_1.parsedLambdaCli['force-bucket-name']) !== null && _a !== void 0 ? _a : (await (0, get_or_create_bucket_1.getOrCreateBucket)({ region })).bucketName;
30
31
  const site = deployedSites.sites.find((s) => s.id === siteName.trim());
31
32
  if (!site) {
32
33
  log_1.Log.error(`No site ${siteName.trim()} was found in your bucket ${bucketName}.`);
@@ -41,7 +41,7 @@ const stillCommand = async (args, remotionRoot) => {
41
41
  indent: false,
42
42
  port,
43
43
  remotionRoot,
44
- verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),
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
- verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),
52
+ logLevel,
53
53
  browserExecutable,
54
54
  chromiumOptions,
55
55
  envVariables,
package/dist/cli/log.d.ts CHANGED
@@ -5,7 +5,6 @@ export declare const Log: {
5
5
  logLevel: "error" | "verbose" | "info" | "warn";
6
6
  } & {
7
7
  tag?: string | undefined;
8
- secondTag?: string | undefined;
9
8
  }, message?: any, ...optionalParams: any[]) => void;
10
9
  info: (message?: any, ...optionalParams: any[]) => void;
11
10
  infoAdvanced: (options: {
@@ -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, _d;
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)((_b = lambdaParams.dumpBrowserLogs) !== null && _b !== void 0 ? _b : verbose, (_c = lambdaParams.chromiumOptions) !== null && _c !== void 0 ? _c : {}),
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: (_d = lambdaParams.envVariables) !== null && _d !== void 0 ? _d : {},
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
- verbose,
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: (shouldDumpIo: boolean, chromiumOptions: ChromiumOptions) => ReturnType<typeof openBrowser>;
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 (shouldDumpIo, chromiumOptions) => {
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
- verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),
17
+ logLevel,
18
18
  indent: false,
19
19
  onBrowserLog: null,
20
20
  server,
@@ -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)(verbose, params.chromiumOptions);
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)(renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose'), (_a = params.chromiumOptions) !== null && _a !== void 0 ? _a : {});
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, _e;
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
- dumpBrowserLogs: (_c = params.dumpBrowserLogs) !== null && _c !== void 0 ? _c : renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose'),
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: (_d = params.crf) !== null && _d !== void 0 ? _d : null,
115
- pixelFormat: (_e = params.pixelFormat) !== null && _e !== void 0 ? _e : renderer_1.RenderInternals.DEFAULT_PIXEL_FORMAT,
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
  })
@@ -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,
@@ -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, _g;
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)(renderer_1.RenderInternals.isEqualOrBelowLogLevel(lambdaParams.logLevel, 'verbose'), (_b = lambdaParams.chromiumOptions) !== null && _b !== void 0 ? _b : {}),
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
- verbose,
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
- dumpBrowserLogs: (_e = lambdaParams.dumpBrowserLogs) !== null && _e !== void 0 ? _e : verbose,
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: (_g = lambdaParams.jpegQuality) !== null && _g !== void 0 ? _g : renderer_1.RenderInternals.DEFAULT_JPEG_QUALITY,
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
- verbose,
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);
package/dist/index.d.ts CHANGED
@@ -55,6 +55,6 @@ declare const presignUrl: <CheckIfObjectExists extends boolean = false>({ region
55
55
  /**
56
56
  * @deprecated Import this from `@remotion/lambda/client` instead
57
57
  */
58
- declare const getSites: ({ region, }: GetSitesInput) => Promise<GetSitesOutput>;
58
+ declare const getSites: ({ region, forceBucketName, }: GetSitesInput) => Promise<GetSitesOutput>;
59
59
  export { deleteSite, deployFunction, deploySite, downloadMedia, getFunctions, getUserPolicy, getRolePolicy, getSites, getOrCreateBucket, getRenderProgress, renderVideoOnLambda, renderMediaOnLambda, simulatePermissions, deleteFunction, getFunctionInfo, estimatePrice, LambdaInternals, renderStillOnLambda, getRegions, getAwsClient, presignUrl, deleteRender, validateWebhookSignature, getCompositionsOnLambda, };
60
60
  export type { AwsRegion, RenderProgress, DeploySiteInput, DeploySiteOutput, LambdaLsReturnType, LambdaLSInput, DeleteSiteInput, DeleteSiteOutput, EstimatePriceInput, DeployFunctionInput, DeployFunctionOutput, DeleteFunctionInput, GetFunctionInfoInput, FunctionInfo, GetFunctionsInput, GetSitesInput, GetSitesOutput, DownloadMediaInput, DownloadMediaOutput, GetOrCreateBucketInput, GetOrCreateBucketOutput, GetRenderInput, RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput, RenderStillOnLambdaInput, RenderStillOnLambdaOutput, SimulatePermissionsInput, SimulatePermissionsOutput, GetAwsClientInput, GetAwsClientOutput, CustomCredentials, WebhookPayload, LambdaErrorInfo, EnhancedErrorInfo, DeleteRenderInput, GetCompositionsOnLambdaOutput, GetCompositionsOnLambdaInput, };
@@ -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.1.0-alpha2",
3
+ "version": "4.1.0-alpha3",
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/bundler": "4.1.0-alpha2",
29
- "@remotion/renderer": "4.1.0-alpha2",
30
- "remotion": "4.1.0-alpha2",
31
- "@remotion/cli": "4.1.0-alpha2"
28
+ "@remotion/bundler": "4.1.0-alpha3",
29
+ "@remotion/cli": "4.1.0-alpha3",
30
+ "@remotion/renderer": "4.1.0-alpha3",
31
+ "remotion": "4.1.0-alpha3"
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.1.0-alpha2",
47
- "@remotion/compositor-linux-arm64-gnu": "4.1.0-alpha2"
46
+ "@remotion/bundler": "4.1.0-alpha3",
47
+ "@remotion/compositor-linux-arm64-gnu": "4.1.0-alpha3"
48
48
  },
49
49
  "peerDependencies": {
50
- "@remotion/bundler": "4.1.0-alpha2"
50
+ "@remotion/bundler": "4.1.0-alpha3"
51
51
  },
52
52
  "publishConfig": {
53
53
  "access": "public"
Binary file