@remotion/lambda 4.0.56 → 4.0.58

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.
Files changed (40) hide show
  1. package/dist/cli/commands/compositions/index.d.ts +2 -1
  2. package/dist/cli/commands/compositions/index.js +4 -3
  3. package/dist/cli/commands/quotas/increase.d.ts +2 -1
  4. package/dist/cli/commands/quotas/increase.js +7 -3
  5. package/dist/cli/commands/quotas/index.d.ts +2 -1
  6. package/dist/cli/commands/quotas/index.js +3 -3
  7. package/dist/cli/commands/quotas/list.d.ts +2 -1
  8. package/dist/cli/commands/quotas/list.js +3 -3
  9. package/dist/cli/commands/render/progress.d.ts +3 -2
  10. package/dist/cli/commands/render/progress.js +2 -2
  11. package/dist/cli/commands/render/render.d.ts +2 -1
  12. package/dist/cli/commands/render/render.js +14 -14
  13. package/dist/cli/commands/sites/create.d.ts +2 -1
  14. package/dist/cli/commands/sites/create.js +3 -3
  15. package/dist/cli/commands/sites/index.d.ts +2 -1
  16. package/dist/cli/commands/sites/index.js +3 -3
  17. package/dist/cli/commands/sites/ls.d.ts +2 -1
  18. package/dist/cli/commands/sites/ls.js +2 -2
  19. package/dist/cli/commands/still.d.ts +2 -1
  20. package/dist/cli/commands/still.js +5 -4
  21. package/dist/cli/helpers/find-function-name.d.ts +2 -1
  22. package/dist/cli/helpers/find-function-name.js +22 -18
  23. package/dist/cli/helpers/get-webhook-custom-data.d.ts +2 -1
  24. package/dist/cli/helpers/get-webhook-custom-data.js +10 -6
  25. package/dist/cli/index.d.ts +3 -2
  26. package/dist/cli/index.js +10 -10
  27. package/dist/cli/log.d.ts +4 -18
  28. package/dist/functions/helpers/merge-chunks.d.ts +0 -1
  29. package/dist/functions/helpers/merge-chunks.js +1 -1
  30. package/dist/functions/launch.js +18 -14
  31. package/dist/functions/merge.js +0 -1
  32. package/dist/functions/renderer.js +6 -6
  33. package/dist/internals.d.ts +1 -1
  34. package/dist/shared/constants.d.ts +0 -1
  35. package/package.json +8 -8
  36. package/remotionlambda-arm64.zip +0 -0
  37. package/dist/cli/helpers/validate.d.ts +0 -4
  38. package/dist/cli/helpers/validate.js +0 -8
  39. package/dist/functions/streaming/streaming.d.ts +0 -12
  40. package/dist/functions/streaming/streaming.js +0 -100
@@ -1,2 +1,3 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  export declare const COMPOSITIONS_COMMAND = "compositions";
2
- export declare const compositionsCommand: (args: string[], remotionRoot: string) => Promise<void>;
3
+ export declare const compositionsCommand: (args: string[], remotionRoot: string, logLevel: LogLevel) => Promise<void>;
@@ -11,7 +11,7 @@ const find_function_name_1 = require("../../helpers/find-function-name");
11
11
  const quit_1 = require("../../helpers/quit");
12
12
  const log_1 = require("../../log");
13
13
  exports.COMPOSITIONS_COMMAND = 'compositions';
14
- const compositionsCommand = async (args, remotionRoot) => {
14
+ const compositionsCommand = async (args, remotionRoot, logLevel) => {
15
15
  const serveUrl = args[0];
16
16
  if (!serveUrl) {
17
17
  log_1.Log.error('No serve URL passed.');
@@ -20,14 +20,15 @@ const compositionsCommand = async (args, remotionRoot) => {
20
20
  log_1.Log.info(`${constants_1.BINARY_NAME} ${exports.COMPOSITIONS_COMMAND} <serve-url>`);
21
21
  (0, quit_1.quit)(1);
22
22
  }
23
- const { chromiumOptions, envVariables, inputProps, logLevel, puppeteerTimeout, } = await cli_1.CliInternals.getCliOptions({
23
+ const { chromiumOptions, envVariables, inputProps, puppeteerTimeout } = await cli_1.CliInternals.getCliOptions({
24
24
  type: 'get-compositions',
25
25
  isLambda: true,
26
26
  remotionRoot,
27
+ logLevel,
27
28
  });
28
29
  const region = (0, get_aws_region_1.getAwsRegion)();
29
30
  (0, validate_serveurl_1.validateServeUrl)(serveUrl);
30
- const functionName = await (0, find_function_name_1.findFunctionName)();
31
+ const functionName = await (0, find_function_name_1.findFunctionName)(logLevel);
31
32
  const comps = await (0, __1.getCompositionsOnLambda)({
32
33
  functionName,
33
34
  serveUrl,
@@ -1,2 +1,3 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  export declare const INCREASE_SUBCOMMAND = "increase";
2
- export declare const quotasIncreaseCommand: () => Promise<void>;
3
+ export declare const quotasIncreaseCommand: (logLevel: LogLevel) => Promise<void>;
@@ -15,7 +15,7 @@ exports.INCREASE_SUBCOMMAND = 'increase';
15
15
  const makeQuotaUrl = ({ region, quotaId, }) => {
16
16
  return `https://${region}.console.aws.amazon.com/servicequotas/home/services/lambda/quotas/${quotaId}`;
17
17
  };
18
- const quotasIncreaseCommand = async () => {
18
+ const quotasIncreaseCommand = async (logLevel) => {
19
19
  var _a, _b, _c;
20
20
  const region = (0, get_aws_region_1.getAwsRegion)();
21
21
  const [concurrencyLimit, defaultConcurrencyLimit, changes] = await Promise.all([
@@ -34,8 +34,12 @@ const quotasIncreaseCommand = async () => {
34
34
  ]);
35
35
  const openCase = (_a = changes.RequestedQuotas) === null || _a === void 0 ? void 0 : _a.find((r) => r.Status === 'CASE_OPENED');
36
36
  if (openCase) {
37
- log_1.Log.warn(`A request to increase it to ${openCase.DesiredValue} is already pending:`);
38
- log_1.Log.warn(`https://${region}.console.aws.amazon.com/support/home#/case/?displayId=${openCase.CaseId}`);
37
+ const logOptions = {
38
+ indent: false,
39
+ logLevel,
40
+ };
41
+ log_1.Log.warn(logOptions, `A request to increase it to ${openCase.DesiredValue} is already pending:`);
42
+ log_1.Log.warn(logOptions, `https://${region}.console.aws.amazon.com/support/home#/case/?displayId=${openCase.CaseId}`);
39
43
  (0, node_process_1.exit)(1);
40
44
  }
41
45
  const concurrencyCurrent = (_b = concurrencyLimit.Quota) === null || _b === void 0 ? void 0 : _b.Value;
@@ -1,2 +1,3 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  export declare const QUOTAS_COMMAND = "quotas";
2
- export declare const quotasCommand: (args: string[]) => Promise<void> | undefined;
3
+ export declare const quotasCommand: (args: string[], logLevel: LogLevel) => Promise<void> | undefined;
@@ -15,12 +15,12 @@ const printHelp = () => {
15
15
  cli_1.CliInternals.Log.info(`npx ${defaults_1.BINARY_NAME} ${exports.QUOTAS_COMMAND} ${increase_1.INCREASE_SUBCOMMAND}`);
16
16
  cli_1.CliInternals.Log.info(cli_1.CliInternals.chalk.gray('Increase Lambda quotas.'));
17
17
  };
18
- const quotasCommand = (args) => {
18
+ const quotasCommand = (args, logLevel) => {
19
19
  if (args.filter(Boolean).length === 0) {
20
- return (0, list_1.quotasListCommand)();
20
+ return (0, list_1.quotasListCommand)(logLevel);
21
21
  }
22
22
  if (args[0] === increase_1.INCREASE_SUBCOMMAND) {
23
- return (0, increase_1.quotasIncreaseCommand)();
23
+ return (0, increase_1.quotasIncreaseCommand)(logLevel);
24
24
  }
25
25
  cli_1.CliInternals.Log.error('Subcommand ' + args[0] + ' not found.');
26
26
  printHelp();
@@ -1 +1,2 @@
1
- export declare const quotasListCommand: () => Promise<void>;
1
+ import type { LogLevel } from '@remotion/renderer';
2
+ export declare const quotasListCommand: (logLevel: LogLevel) => Promise<void>;
@@ -9,7 +9,7 @@ const aws_clients_1 = require("../../../shared/aws-clients");
9
9
  const get_aws_region_1 = require("../../get-aws-region");
10
10
  const log_1 = require("../../log");
11
11
  const increase_1 = require("./increase");
12
- const quotasListCommand = async () => {
12
+ const quotasListCommand = async (logLevel) => {
13
13
  var _a, _b, _c, _d;
14
14
  const region = (0, get_aws_region_1.getAwsRegion)();
15
15
  log_1.Log.info(cli_1.CliInternals.chalk.gray(`Region = ${region}`));
@@ -47,8 +47,8 @@ const quotasListCommand = async () => {
47
47
  log_1.Log.info(`Concurrency limit: ${concurrencyCurrent}`);
48
48
  }
49
49
  if (openCase) {
50
- log_1.Log.warn(`A request to increase it to ${openCase.DesiredValue} is pending:`);
51
- log_1.Log.warn(`https://${region}.console.aws.amazon.com/support/home#/case/?displayId=${openCase.CaseId}`);
50
+ log_1.Log.warn({ indent: false, logLevel }, `A request to increase it to ${openCase.DesiredValue} is pending:`);
51
+ log_1.Log.warn({ indent: false, logLevel }, `https://${region}.console.aws.amazon.com/support/home#/case/?displayId=${openCase.CaseId}`);
52
52
  }
53
53
  log_1.Log.info(cli_1.CliInternals.chalk.gray('The maximum amount of Lambda functions which can concurrently execute.'));
54
54
  log_1.Log.info(cli_1.CliInternals.chalk.gray(`Run \`npx ${defaults_1.BINARY_NAME} ${_1.QUOTAS_COMMAND} ${increase_1.INCREASE_SUBCOMMAND}\` to ask AWS to increase your limit.`));
@@ -1,3 +1,4 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  import type { CleanupInfo, EncodingProgress, RenderProgress } from '../../../defaults';
2
3
  import type { ChunkRetry } from '../../../functions/helpers/get-retry-stats';
3
4
  type LambdaInvokeProgress = {
@@ -23,12 +24,12 @@ type DownloadedInfo = {
23
24
  downloaded: number;
24
25
  doneIn: number | null;
25
26
  };
26
- export declare const makeProgressString: ({ progress, steps, downloadInfo, retriesInfo, verbose, timeToEncode, totalFrames, }: {
27
+ export declare const makeProgressString: ({ progress, steps, downloadInfo, retriesInfo, logLevel, timeToEncode, totalFrames, }: {
27
28
  progress: MultiRenderProgress;
28
29
  steps: number;
29
30
  downloadInfo: DownloadedInfo | null;
30
31
  retriesInfo: ChunkRetry[];
31
- verbose: boolean;
32
+ logLevel: LogLevel;
32
33
  timeToEncode: number | null;
33
34
  totalFrames: number | null;
34
35
  }) => string;
@@ -125,7 +125,7 @@ const makeMultiProgressFromStatus = (status) => {
125
125
  };
126
126
  };
127
127
  exports.makeMultiProgressFromStatus = makeMultiProgressFromStatus;
128
- const makeProgressString = ({ progress, steps, downloadInfo, retriesInfo, verbose, timeToEncode, totalFrames, }) => {
128
+ const makeProgressString = ({ progress, steps, downloadInfo, retriesInfo, logLevel, timeToEncode, totalFrames, }) => {
129
129
  return [
130
130
  makeInvokeProgress(progress.lambdaInvokeProgress, steps, retriesInfo),
131
131
  ...makeRenderProgress({
@@ -139,7 +139,7 @@ const makeProgressString = ({ progress, steps, downloadInfo, retriesInfo, verbos
139
139
  timeToEncode,
140
140
  totalFrames,
141
141
  }),
142
- makeCleanupProgress(progress.cleanupInfo, steps, verbose),
142
+ makeCleanupProgress(progress.cleanupInfo, steps, logLevel === 'verbose'),
143
143
  downloadInfo ? makeDownloadProgress(downloadInfo, steps) : null,
144
144
  ]
145
145
  .filter(remotion_1.Internals.truthy)
@@ -1,2 +1,3 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  export declare const RENDER_COMMAND = "render";
2
- export declare const renderCommand: (args: string[], remotionRoot: string) => Promise<never>;
3
+ export declare const renderCommand: (args: string[], remotionRoot: string, logLevel: LogLevel) => Promise<never>;
@@ -27,7 +27,7 @@ function getTotalFrames(status) {
27
27
  ? renderer_1.RenderInternals.getFramesToRender(status.renderMetadata.frameRange, status.renderMetadata.everyNthFrame).length
28
28
  : null;
29
29
  }
30
- const renderCommand = async (args, remotionRoot) => {
30
+ const renderCommand = async (args, remotionRoot, logLevel) => {
31
31
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
32
32
  const serveUrl = args[0];
33
33
  if (!serveUrl) {
@@ -38,10 +38,11 @@ const renderCommand = async (args, remotionRoot) => {
38
38
  (0, quit_1.quit)(1);
39
39
  }
40
40
  const region = (0, get_aws_region_1.getAwsRegion)();
41
- const { chromiumOptions, crf, envVariables, frameRange, inputProps, logLevel, pixelFormat, proResProfile, puppeteerTimeout, jpegQuality, scale, everyNthFrame, numberOfGifLoops, muted, overwrite, audioBitrate, videoBitrate, height, width, browserExecutable, port, offthreadVideoCacheSizeInBytes, colorSpace, deleteAfter, x264Preset, } = await cli_1.CliInternals.getCliOptions({
41
+ const { chromiumOptions, crf, envVariables, frameRange, inputProps, pixelFormat, proResProfile, puppeteerTimeout, jpegQuality, scale, everyNthFrame, numberOfGifLoops, muted, overwrite, audioBitrate, videoBitrate, height, width, browserExecutable, port, offthreadVideoCacheSizeInBytes, colorSpace, deleteAfter, x264Preset, } = await cli_1.CliInternals.getCliOptions({
42
42
  type: 'series',
43
43
  isLambda: true,
44
44
  remotionRoot,
45
+ logLevel,
45
46
  });
46
47
  let composition = args[1];
47
48
  if (!composition) {
@@ -97,14 +98,14 @@ const renderCommand = async (args, remotionRoot) => {
97
98
  codec,
98
99
  uiImageFormat: null,
99
100
  });
100
- const functionName = await (0, find_function_name_1.findFunctionName)();
101
+ const functionName = await (0, find_function_name_1.findFunctionName)(logLevel);
101
102
  const maxRetries = (_c = args_1.parsedLambdaCli['max-retries']) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_MAX_RETRIES;
102
103
  (0, validate_retries_1.validateMaxRetries)(maxRetries);
103
104
  const privacy = (_d = args_1.parsedLambdaCli.privacy) !== null && _d !== void 0 ? _d : constants_1.DEFAULT_OUTPUT_PRIVACY;
104
105
  (0, validate_privacy_1.validatePrivacy)(privacy, true);
105
106
  const framesPerLambda = (_e = args_1.parsedLambdaCli['frames-per-lambda']) !== null && _e !== void 0 ? _e : undefined;
106
107
  (0, validate_frames_per_lambda_1.validateFramesPerLambda)({ framesPerLambda, durationInFrames: 1 });
107
- const webhookCustomData = (0, get_webhook_custom_data_1.getWebhookCustomData)();
108
+ const webhookCustomData = (0, get_webhook_custom_data_1.getWebhookCustomData)(logLevel);
108
109
  const res = await (0, render_media_on_lambda_1.internalRenderMediaOnLambdaRaw)({
109
110
  functionName,
110
111
  serveUrl,
@@ -162,9 +163,8 @@ const renderCommand = async (args, remotionRoot) => {
162
163
  });
163
164
  log_1.Log.info(cli_1.CliInternals.chalk.gray(`bucket = ${res.bucketName}, function = ${functionName}`));
164
165
  log_1.Log.info(cli_1.CliInternals.chalk.gray(`renderId = ${res.renderId}, codec = ${codec} (${reason})`));
165
- const verbose = renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose');
166
- log_1.Log.verbose(`CloudWatch logs (if enabled): ${res.cloudWatchLogs}`);
167
- log_1.Log.verbose(`Render folder: ${res.folderInS3Console}`);
166
+ log_1.Log.verbose({ indent: false, logLevel }, `CloudWatch logs (if enabled): ${res.cloudWatchLogs}`);
167
+ log_1.Log.verbose({ indent: false, logLevel }, `Render folder: ${res.folderInS3Console}`);
168
168
  const status = await (0, get_render_progress_1.getRenderProgress)({
169
169
  functionName,
170
170
  bucketName: res.bucketName,
@@ -177,7 +177,7 @@ const renderCommand = async (args, remotionRoot) => {
177
177
  steps: totalSteps,
178
178
  downloadInfo: null,
179
179
  retriesInfo: status.retriesInfo,
180
- verbose,
180
+ logLevel,
181
181
  totalFrames: getTotalFrames(status),
182
182
  timeToEncode: status.timeToEncode,
183
183
  }), false);
@@ -196,7 +196,7 @@ const renderCommand = async (args, remotionRoot) => {
196
196
  steps: totalSteps,
197
197
  retriesInfo: newStatus.retriesInfo,
198
198
  downloadInfo: null,
199
- verbose,
199
+ logLevel,
200
200
  timeToEncode: newStatus.timeToEncode,
201
201
  totalFrames: getTotalFrames(newStatus),
202
202
  }), false);
@@ -206,7 +206,7 @@ const renderCommand = async (args, remotionRoot) => {
206
206
  steps: totalSteps,
207
207
  downloadInfo: null,
208
208
  retriesInfo: newStatus.retriesInfo,
209
- verbose,
209
+ logLevel,
210
210
  timeToEncode: newStatus.timeToEncode,
211
211
  totalFrames: getTotalFrames(newStatus),
212
212
  }), false);
@@ -228,7 +228,7 @@ const renderCommand = async (args, remotionRoot) => {
228
228
  downloaded,
229
229
  totalSize,
230
230
  },
231
- verbose,
231
+ logLevel,
232
232
  timeToEncode: newStatus.timeToEncode,
233
233
  totalFrames: getTotalFrames(newStatus),
234
234
  }), false);
@@ -243,7 +243,7 @@ const renderCommand = async (args, remotionRoot) => {
243
243
  downloaded: sizeInBytes,
244
244
  totalSize: sizeInBytes,
245
245
  },
246
- verbose,
246
+ logLevel,
247
247
  timeToEncode: newStatus.timeToEncode,
248
248
  totalFrames: getTotalFrames(newStatus),
249
249
  }), false);
@@ -268,8 +268,8 @@ const renderCommand = async (args, remotionRoot) => {
268
268
  .filter(Boolean)
269
269
  .join(', '));
270
270
  if (newStatus.mostExpensiveFrameRanges) {
271
- log_1.Log.verbose('Most expensive frame ranges:');
272
- log_1.Log.verbose(newStatus.mostExpensiveFrameRanges
271
+ log_1.Log.verbose({ indent: false, logLevel }, 'Most expensive frame ranges:');
272
+ log_1.Log.verbose({ indent: false, logLevel }, newStatus.mostExpensiveFrameRanges
273
273
  .map((f) => {
274
274
  return `${f.frameRange[0]}-${f.frameRange[1]} (${f.timeInMilliseconds}ms)`;
275
275
  })
@@ -1,2 +1,3 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  export declare const SITES_CREATE_SUBCOMMAND = "create";
2
- export declare const sitesCreateSubcommand: (args: string[], remotionRoot: string) => Promise<void>;
3
+ export declare const sitesCreateSubcommand: (args: string[], remotionRoot: string, logLevel: LogLevel) => Promise<void>;
@@ -15,9 +15,9 @@ const progress_bar_1 = require("../../helpers/progress-bar");
15
15
  const quit_1 = require("../../helpers/quit");
16
16
  const log_1 = require("../../log");
17
17
  exports.SITES_CREATE_SUBCOMMAND = 'create';
18
- const sitesCreateSubcommand = async (args, remotionRoot) => {
18
+ const sitesCreateSubcommand = async (args, remotionRoot, logLevel) => {
19
19
  var _a, _b, _c;
20
- const { file, reason } = cli_1.CliInternals.findEntryPoint(args, remotionRoot);
20
+ const { file, reason } = cli_1.CliInternals.findEntryPoint(args, remotionRoot, logLevel);
21
21
  if (!file) {
22
22
  log_1.Log.error('No entry file passed.');
23
23
  log_1.Log.info('Pass an additional argument specifying the entry file of your Remotion project:');
@@ -26,7 +26,7 @@ const sitesCreateSubcommand = async (args, remotionRoot) => {
26
26
  (0, quit_1.quit)(1);
27
27
  return;
28
28
  }
29
- log_1.Log.verbose('Entry point:', file, 'Reason:', reason);
29
+ log_1.Log.verbose({ indent: false, logLevel }, 'Entry point:', file, 'Reason:', reason);
30
30
  const desiredSiteName = (_a = args_1.parsedLambdaCli['site-name']) !== null && _a !== void 0 ? _a : undefined;
31
31
  if (desiredSiteName !== undefined) {
32
32
  (0, validate_site_name_1.validateSiteName)(desiredSiteName);
@@ -1,2 +1,3 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  export declare const SITES_COMMAND = "sites";
2
- export declare const sitesCommand: (args: string[], remotionRoot: string) => Promise<void> | undefined;
3
+ export declare const sitesCommand: (args: string[], remotionRoot: string, logLevel: LogLevel) => Promise<void> | undefined;
@@ -26,9 +26,9 @@ const printSitesHelp = () => {
26
26
  cli_1.CliInternals.Log.info(`${constants_1.BINARY_NAME} ${exports.SITES_COMMAND} ${rmall_1.SITES_RMALL_COMMAND}`);
27
27
  cli_1.CliInternals.Log.info(cli_1.CliInternals.chalk.gray('Remove all sites from the S3 bucket.'));
28
28
  };
29
- const sitesCommand = (args, remotionRoot) => {
29
+ const sitesCommand = (args, remotionRoot, logLevel) => {
30
30
  if (args[0] === ls_1.SITES_LS_SUBCOMMAND) {
31
- return (0, ls_1.sitesLsSubcommand)();
31
+ return (0, ls_1.sitesLsSubcommand)(logLevel);
32
32
  }
33
33
  if (args[0] === rm_1.SITES_RM_COMMAND) {
34
34
  return (0, rm_1.sitesRmSubcommand)(args.slice(1));
@@ -37,7 +37,7 @@ const sitesCommand = (args, remotionRoot) => {
37
37
  return (0, rmall_1.sitesRmallSubcommand)();
38
38
  }
39
39
  if (args[0] === create_1.SITES_CREATE_SUBCOMMAND) {
40
- return (0, create_1.sitesCreateSubcommand)(args.slice(1), remotionRoot);
40
+ return (0, create_1.sitesCreateSubcommand)(args.slice(1), remotionRoot, logLevel);
41
41
  }
42
42
  if (args[0]) {
43
43
  cli_1.CliInternals.Log.error(`Subcommand ${args[0]} not found.`);
@@ -1,2 +1,3 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  export declare const SITES_LS_SUBCOMMAND = "ls";
2
- export declare const sitesLsSubcommand: () => Promise<void>;
3
+ export declare const sitesLsSubcommand: (logLevel: LogLevel) => Promise<void>;
@@ -15,11 +15,11 @@ const logRow = (data) => {
15
15
  String(data[3]).padEnd(COLS[3], ' '),
16
16
  ].join('');
17
17
  };
18
- const sitesLsSubcommand = async () => {
18
+ const sitesLsSubcommand = async (logLevel) => {
19
19
  const region = (0, get_aws_region_1.getAwsRegion)();
20
20
  const { sites, buckets } = await (0, get_sites_1.getSites)({ region });
21
21
  if (buckets.length > 1 && !cli_1.CliInternals.quietFlagProvided()) {
22
- cli_1.CliInternals.Log.warn('Warning: You have more than one Remotion S3 bucket, but only one is needed. This can lead to conflicts. Remove all but one of them.');
22
+ cli_1.CliInternals.Log.warn({ indent: false, logLevel }, 'Warning: You have more than one Remotion S3 bucket, but only one is needed. This can lead to conflicts. Remove all but one of them.');
23
23
  }
24
24
  const sitesPluralized = sites.length === 1 ? 'site' : 'sites';
25
25
  if (!cli_1.CliInternals.quietFlagProvided()) {
@@ -1,2 +1,3 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  export declare const STILL_COMMAND = "still";
2
- export declare const stillCommand: (args: string[], remotionRoot: string) => Promise<void>;
3
+ export declare const stillCommand: (args: string[], remotionRoot: string, logLevel: LogLevel) => Promise<void>;
@@ -18,7 +18,7 @@ const find_function_name_1 = require("../helpers/find-function-name");
18
18
  const quit_1 = require("../helpers/quit");
19
19
  const log_1 = require("../log");
20
20
  exports.STILL_COMMAND = 'still';
21
- const stillCommand = async (args, remotionRoot) => {
21
+ const stillCommand = async (args, remotionRoot, logLevel) => {
22
22
  var _a, _b, _c, _d, _e;
23
23
  const serveUrl = args[0];
24
24
  if (!serveUrl) {
@@ -28,10 +28,11 @@ const stillCommand = async (args, remotionRoot) => {
28
28
  log_1.Log.info(`${constants_1.BINARY_NAME} ${exports.STILL_COMMAND} <serve-url> <composition-id> [output-location]`);
29
29
  (0, quit_1.quit)(1);
30
30
  }
31
- const { chromiumOptions, envVariables, inputProps, logLevel, puppeteerTimeout, jpegQuality, stillFrame, scale, height, width, browserExecutable, port, offthreadVideoCacheSizeInBytes, } = await cli_1.CliInternals.getCliOptions({
31
+ const { chromiumOptions, envVariables, inputProps, puppeteerTimeout, jpegQuality, stillFrame, scale, height, width, browserExecutable, port, offthreadVideoCacheSizeInBytes, } = await cli_1.CliInternals.getCliOptions({
32
32
  type: 'still',
33
33
  isLambda: true,
34
34
  remotionRoot,
35
+ logLevel,
35
36
  });
36
37
  const region = (0, get_aws_region_1.getAwsRegion)();
37
38
  let composition = args[1];
@@ -76,7 +77,7 @@ const stillCommand = async (args, remotionRoot) => {
76
77
  }
77
78
  const downloadName = (_a = args[2]) !== null && _a !== void 0 ? _a : null;
78
79
  const outName = args_1.parsedLambdaCli['out-name'];
79
- const functionName = await (0, find_function_name_1.findFunctionName)();
80
+ const functionName = await (0, find_function_name_1.findFunctionName)(logLevel);
80
81
  const maxRetries = (_b = args_1.parsedLambdaCli['max-retries']) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_MAX_RETRIES;
81
82
  (0, validate_retries_1.validateMaxRetries)(maxRetries);
82
83
  const privacy = (_c = args_1.parsedLambdaCli.privacy) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_OUTPUT_PRIVACY;
@@ -112,7 +113,7 @@ const stillCommand = async (args, remotionRoot) => {
112
113
  forceWidth: width,
113
114
  onInit: ({ cloudWatchLogs, renderId }) => {
114
115
  log_1.Log.info(cli_1.CliInternals.chalk.gray(`Render invoked with ID = ${renderId}`));
115
- log_1.Log.verbose(`CloudWatch logs (if enabled): ${cloudWatchLogs}`);
116
+ log_1.Log.verbose({ indent: false, logLevel }, `CloudWatch logs (if enabled): ${cloudWatchLogs}`);
116
117
  },
117
118
  deleteAfter,
118
119
  });
@@ -1 +1,2 @@
1
- export declare const findFunctionName: () => Promise<string>;
1
+ import type { LogLevel } from '@remotion/renderer';
2
+ export declare const findFunctionName: (logLevel: LogLevel) => Promise<string>;
@@ -12,20 +12,24 @@ const rm_1 = require("../commands/functions/rm");
12
12
  const get_aws_region_1 = require("../get-aws-region");
13
13
  const log_1 = require("../log");
14
14
  const quit_1 = require("./quit");
15
- const findFunctionName = async () => {
15
+ const findFunctionName = async (logLevel) => {
16
16
  const remotionLambdas = await (0, get_functions_1.getFunctions)({
17
17
  region: (0, get_aws_region_1.getAwsRegion)(),
18
18
  compatibleOnly: false,
19
19
  });
20
20
  let lambdasWithMatchingVersion = remotionLambdas.filter((l) => l.version === version_1.VERSION);
21
+ const logOptions = {
22
+ indent: false,
23
+ logLevel,
24
+ };
21
25
  if (lambdasWithMatchingVersion.length === 0) {
22
26
  log_1.Log.error(`No lambda functions with version ${version_1.VERSION} found in your account.`);
23
27
  if (remotionLambdas.length > 0) {
24
28
  log_1.Log.error('Other functions were found, but are not compatible with this version of the CLI.');
25
29
  }
26
- log_1.Log.info('Run');
27
- log_1.Log.info(` npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${deploy_1.FUNCTIONS_DEPLOY_SUBCOMMAND}`);
28
- log_1.Log.info(`to deploy a new lambda function.`);
30
+ log_1.Log.infoAdvanced(logOptions, 'Run');
31
+ log_1.Log.infoAdvanced(logOptions, ` npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${deploy_1.FUNCTIONS_DEPLOY_SUBCOMMAND}`);
32
+ log_1.Log.infoAdvanced(logOptions, `to deploy a new lambda function.`);
29
33
  (0, quit_1.quit)(1);
30
34
  }
31
35
  if (lambdasWithMatchingVersion.length > 1) {
@@ -34,31 +38,31 @@ const findFunctionName = async () => {
34
38
  lambdasWithMatchingVersion = lambdasWithMatchingVersion.filter((l) => l.functionName === args_1.parsedLambdaCli['function-name']);
35
39
  if (lambdasWithMatchingVersion.length === 0) {
36
40
  log_1.Log.error(`No lambda function with name "${args_1.parsedLambdaCli['function-name']}" and version ${version_1.VERSION} found in your account.`);
37
- log_1.Log.info();
41
+ log_1.Log.infoAdvanced(logOptions);
38
42
  if (prevFunctions.length === 0) {
39
- log_1.Log.info(`No functions for version ${version_1.VERSION} were found, deploy one using:`);
40
- log_1.Log.info(` npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${deploy_1.FUNCTIONS_DEPLOY_SUBCOMMAND}`);
43
+ log_1.Log.infoAdvanced(logOptions, `No functions for version ${version_1.VERSION} were found, deploy one using:`);
44
+ log_1.Log.infoAdvanced(logOptions, ` npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${deploy_1.FUNCTIONS_DEPLOY_SUBCOMMAND}`);
41
45
  (0, quit_1.quit)(1);
42
46
  }
43
- log_1.Log.info('The following functions were found:');
47
+ log_1.Log.infoAdvanced(logOptions, 'The following functions were found:');
44
48
  for (const l of prevFunctions) {
45
- log_1.Log.info(`- ${l.functionName} (v${l.version})`);
49
+ log_1.Log.infoAdvanced(logOptions, `- ${l.functionName} (v${l.version})`);
46
50
  }
47
- log_1.Log.info('Remove the `--function-name` parameter use one of them.');
51
+ log_1.Log.infoAdvanced(logOptions, 'Remove the `--function-name` parameter use one of them.');
48
52
  (0, quit_1.quit)(1);
49
53
  }
50
54
  }
51
55
  else {
52
56
  log_1.Log.error('More than 1 lambda function found in your account. Unsure which one to use.');
53
- log_1.Log.info();
54
- log_1.Log.info('Possible solutions:');
55
- log_1.Log.info('- Define using `--function-name` which function you want to use.');
56
- log_1.Log.info(`- Delete extraneous lambda functions in your AWS console or using:`);
57
- log_1.Log.info(` npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${rm_1.FUNCTIONS_RM_SUBCOMMAND} $(npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${ls_1.FUNCTIONS_LS_SUBCOMMAND} -q) -y`);
58
- log_1.Log.info();
59
- log_1.Log.info(`The following functions were found (only showing v${version_1.VERSION}):`);
57
+ log_1.Log.infoAdvanced(logOptions);
58
+ log_1.Log.infoAdvanced(logOptions, 'Possible solutions:');
59
+ log_1.Log.infoAdvanced(logOptions, '- Define using `--function-name` which function you want to use.');
60
+ log_1.Log.infoAdvanced(logOptions, `- Delete extraneous lambda functions in your AWS console or using:`);
61
+ log_1.Log.infoAdvanced(logOptions, ` npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${rm_1.FUNCTIONS_RM_SUBCOMMAND} $(npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${ls_1.FUNCTIONS_LS_SUBCOMMAND} -q) -y`);
62
+ log_1.Log.infoAdvanced(logOptions);
63
+ log_1.Log.infoAdvanced(logOptions, `The following functions were found (only showing v${version_1.VERSION}):`);
60
64
  for (const l of lambdasWithMatchingVersion) {
61
- log_1.Log.info(`- ${l.functionName}`);
65
+ log_1.Log.infoAdvanced(logOptions, `- ${l.functionName}`);
62
66
  }
63
67
  (0, quit_1.quit)(1);
64
68
  }
@@ -1 +1,2 @@
1
- export declare const getWebhookCustomData: () => Record<string, unknown> | null;
1
+ import type { LogLevel } from '@remotion/renderer';
2
+ export declare const getWebhookCustomData: (logLevel: LogLevel) => Record<string, unknown> | null;
@@ -10,7 +10,7 @@ const node_os_1 = __importDefault(require("node:os"));
10
10
  const node_path_1 = __importDefault(require("node:path"));
11
11
  const args_1 = require("../args");
12
12
  const log_1 = require("../log");
13
- const getWebhookCustomData = () => {
13
+ const getWebhookCustomData = (logLevel) => {
14
14
  const flagName = client_1.BrowserSafeApis.options.webhookCustomDataOption.cliFlag;
15
15
  const webhookFlag = args_1.parsedLambdaCli[flagName];
16
16
  if (!webhookFlag) {
@@ -29,11 +29,15 @@ const getWebhookCustomData = () => {
29
29
  log_1.Log.info('Got the following value:', webhookFlag);
30
30
  log_1.Log.error('Check that your input is parseable using `JSON.parse` and try again.');
31
31
  if (node_os_1.default.platform() === 'win32') {
32
- log_1.Log.warn('Note: Windows handles escaping of quotes very weirdly in the command line.');
33
- log_1.Log.warn('This might have led to you having this problem.');
34
- log_1.Log.warn('Consider using the alternative API for --props which is to pass');
35
- log_1.Log.warn('a path to a JSON file:');
36
- log_1.Log.warn(` --${flagName}=path/to/props.json`);
32
+ const logOptions = {
33
+ indent: false,
34
+ logLevel,
35
+ };
36
+ log_1.Log.warn(logOptions, 'Note: Windows handles escaping of quotes very weirdly in the command line.');
37
+ log_1.Log.warn(logOptions, 'This might have led to you having this problem.');
38
+ log_1.Log.warn(logOptions, 'Consider using the alternative API for --props which is to pass');
39
+ log_1.Log.warn(logOptions, 'a path to a JSON file:');
40
+ log_1.Log.warn(logOptions, ` --${flagName}=path/to/props.json`);
37
41
  }
38
42
  process.exit(1);
39
43
  }
@@ -1,2 +1,3 @@
1
- export declare const executeCommand: (args: string[], remotionRoot: string) => Promise<void>;
2
- export declare const cli: () => Promise<void>;
1
+ import type { LogLevel } from '@remotion/renderer';
2
+ export declare const executeCommand: (args: string[], remotionRoot: string, logLevel: LogLevel) => Promise<void>;
3
+ export declare const cli: (logLevel: LogLevel) => Promise<void>;
package/dist/cli/index.js CHANGED
@@ -37,7 +37,7 @@ const requiresCredentials = (args) => {
37
37
  }
38
38
  return true;
39
39
  };
40
- const matchCommand = (args, remotionRoot) => {
40
+ const matchCommand = (args, remotionRoot, logLevel) => {
41
41
  if (args_1.parsedLambdaCli.help || args.length === 0) {
42
42
  (0, help_1.printHelp)();
43
43
  (0, quit_1.quit)(0);
@@ -46,19 +46,19 @@ const matchCommand = (args, remotionRoot) => {
46
46
  (0, check_credentials_1.checkCredentials)();
47
47
  }
48
48
  if (args[0] === render_1.RENDER_COMMAND) {
49
- return (0, render_1.renderCommand)(args.slice(1), remotionRoot);
49
+ return (0, render_1.renderCommand)(args.slice(1), remotionRoot, logLevel);
50
50
  }
51
51
  if (args[0] === still_1.STILL_COMMAND) {
52
- return (0, still_1.stillCommand)(args.slice(1), remotionRoot);
52
+ return (0, still_1.stillCommand)(args.slice(1), remotionRoot, logLevel);
53
53
  }
54
54
  if (args[0] === compositions_1.COMPOSITIONS_COMMAND) {
55
- return (0, compositions_1.compositionsCommand)(args.slice(1), remotionRoot);
55
+ return (0, compositions_1.compositionsCommand)(args.slice(1), remotionRoot, logLevel);
56
56
  }
57
57
  if (args[0] === functions_1.FUNCTIONS_COMMAND) {
58
58
  return (0, functions_1.functionsCommand)(args.slice(1));
59
59
  }
60
60
  if (args[0] === quotas_1.QUOTAS_COMMAND) {
61
- return (0, quotas_1.quotasCommand)(args.slice(1));
61
+ return (0, quotas_1.quotasCommand)(args.slice(1), logLevel);
62
62
  }
63
63
  if (args[0] === policies_1.POLICIES_COMMAND) {
64
64
  return (0, policies_1.policiesCommand)(args.slice(1));
@@ -67,7 +67,7 @@ const matchCommand = (args, remotionRoot) => {
67
67
  return (0, regions_1.regionsCommand)();
68
68
  }
69
69
  if (args[0] === sites_1.SITES_COMMAND) {
70
- return (0, sites_1.sitesCommand)(args.slice(1), remotionRoot);
70
+ return (0, sites_1.sitesCommand)(args.slice(1), remotionRoot, logLevel);
71
71
  }
72
72
  if (args[0] === 'upload') {
73
73
  log_1.Log.info('The command has been renamed.');
@@ -97,11 +97,11 @@ const matchCommand = (args, remotionRoot) => {
97
97
  (0, help_1.printHelp)();
98
98
  (0, quit_1.quit)(1);
99
99
  };
100
- const executeCommand = async (args, remotionRoot) => {
100
+ const executeCommand = async (args, remotionRoot, logLevel) => {
101
101
  var _a, _b, _c, _d, _e;
102
102
  try {
103
103
  (0, is_cli_1.setIsCli)(true);
104
- await matchCommand(args, remotionRoot);
104
+ await matchCommand(args, remotionRoot, logLevel);
105
105
  }
106
106
  catch (err) {
107
107
  const error = err;
@@ -156,9 +156,9 @@ AWS returned an error message "The security token included in the request is inv
156
156
  }
157
157
  };
158
158
  exports.executeCommand = executeCommand;
159
- const cli = async () => {
159
+ const cli = async (logLevel) => {
160
160
  const remotionRoot = renderer_1.RenderInternals.findRemotionRoot();
161
161
  await cli_1.CliInternals.initializeCli(remotionRoot);
162
- await (0, exports.executeCommand)(args_1.parsedLambdaCli._, remotionRoot);
162
+ await (0, exports.executeCommand)(args_1.parsedLambdaCli._, remotionRoot, logLevel);
163
163
  };
164
164
  exports.cli = cli;
package/dist/cli/log.d.ts CHANGED
@@ -1,26 +1,12 @@
1
1
  export declare const Log: {
2
- verbose: (message?: any, ...optionalParams: any[]) => void;
3
- verboseAdvanced: (options: {
4
- indent: boolean;
5
- logLevel: "verbose" | "info" | "warn" | "error";
6
- } & {
2
+ verbose: (options: import("@remotion/renderer").LogOptions & {
7
3
  tag?: string | undefined;
8
4
  }, message?: any, ...optionalParams: any[]) => void;
9
5
  info: (message?: any, ...optionalParams: any[]) => void;
10
- infoAdvanced: (options: {
11
- indent: boolean;
12
- logLevel: "verbose" | "info" | "warn" | "error";
13
- }, message?: any, ...optionalParams: any[]) => void;
14
- warn: (message?: any, ...optionalParams: any[]) => void;
15
- warnAdvanced: (options: {
16
- indent: boolean;
17
- logLevel: "verbose" | "info" | "warn" | "error";
18
- }, message?: any, ...optionalParams: any[]) => void;
6
+ infoAdvanced: (options: import("@remotion/renderer").LogOptions, message?: any, ...optionalParams: any[]) => void;
7
+ warn: (options: import("@remotion/renderer").LogOptions, message?: any, ...optionalParams: any[]) => void;
19
8
  error: (message?: any, ...optionalParams: any[]) => void;
20
- errorAdvanced: (options: {
21
- indent: boolean;
22
- logLevel: "verbose" | "info" | "warn" | "error";
23
- } & {
9
+ errorAdvanced: (options: import("@remotion/renderer").LogOptions & {
24
10
  tag?: string | undefined;
25
11
  }, message?: any, ...optionalParams: any[]) => void;
26
12
  };
@@ -23,7 +23,6 @@ export declare const mergeChunksAndFinishRender: (options: {
23
23
  key: string;
24
24
  privacy: Privacy;
25
25
  inputProps: SerializedInputProps;
26
- verbose: boolean;
27
26
  serializedResolvedProps: SerializedInputProps;
28
27
  renderMetadata: RenderMetadata;
29
28
  onAllChunks: OnAllChunksAvailable;
@@ -141,7 +141,7 @@ const mergeChunksAndFinishRender = async (options) => {
141
141
  chunkCount: options.chunkCount,
142
142
  renderId: options.renderId,
143
143
  });
144
- const deletProm = options.verbose
144
+ const deletProm = options.logLevel === 'verbose'
145
145
  ? Promise.resolve(0)
146
146
  : (0, delete_chunks_1.cleanupFiles)({
147
147
  region: (0, get_current_region_1.getCurrentRegionInFunction)(),
@@ -51,7 +51,7 @@ const callFunctionWithRetry = async ({ payload, retries, functionName, }) => {
51
51
  throw err;
52
52
  }
53
53
  };
54
- const innerLaunchHandler = async ({ functionName, params, options, onAllChunksAvailable, verbose, }) => {
54
+ const innerLaunchHandler = async ({ functionName, params, options, onAllChunksAvailable, }) => {
55
55
  var _a, _b, _c, _d, _e;
56
56
  if (params.type !== constants_1.LambdaRoutines.launch) {
57
57
  throw new Error('Expected launch type');
@@ -65,8 +65,12 @@ const innerLaunchHandler = async ({ functionName, params, options, onAllChunksAv
65
65
  serialized: params.inputProps,
66
66
  propsType: 'input-props',
67
67
  });
68
+ const logOptions = {
69
+ indent: false,
70
+ logLevel: params.logLevel,
71
+ };
68
72
  const serializedInputPropsWithCustomSchema = await inputPropsPromise;
69
- renderer_1.RenderInternals.Log.info('Validating composition, input props:', serializedInputPropsWithCustomSchema);
73
+ renderer_1.RenderInternals.Log.infoAdvanced(logOptions, 'Validating composition, input props:', serializedInputPropsWithCustomSchema);
70
74
  const comp = await (0, validate_composition_1.validateComposition)({
71
75
  serveUrl: params.serveUrl,
72
76
  composition: params.composition,
@@ -82,7 +86,7 @@ const innerLaunchHandler = async ({ functionName, params, options, onAllChunksAv
82
86
  server: undefined,
83
87
  offthreadVideoCacheSizeInBytes: params.offthreadVideoCacheSizeInBytes,
84
88
  });
85
- renderer_1.RenderInternals.Log.info('Composition validated, resolved props', comp.props);
89
+ renderer_1.RenderInternals.Log.infoAdvanced(logOptions, 'Composition validated, resolved props', comp.props);
86
90
  (0, validate_1.validateDurationInFrames)(comp.durationInFrames, {
87
91
  component: 'passed to a Lambda render',
88
92
  allowFloats: false,
@@ -176,7 +180,7 @@ const innerLaunchHandler = async ({ functionName, params, options, onAllChunksAv
176
180
  };
177
181
  return payload;
178
182
  });
179
- renderer_1.RenderInternals.Log.info('Render plan: ', chunks.map((c, i) => `Chunk ${i} (Frames ${c[0]} - ${c[1]})`).join(', '));
183
+ renderer_1.RenderInternals.Log.infoAdvanced(logOptions, 'Render plan: ', chunks.map((c, i) => `Chunk ${i} (Frames ${c[0]} - ${c[1]})`).join(', '));
180
184
  const renderMetadata = {
181
185
  startedDate,
182
186
  videoConfig: comp,
@@ -265,7 +269,6 @@ const innerLaunchHandler = async ({ functionName, params, options, onAllChunksAv
265
269
  renderBucketName,
266
270
  inputProps: params.inputProps,
267
271
  serializedResolvedProps,
268
- verbose,
269
272
  renderMetadata,
270
273
  onAllChunks: onAllChunksAvailable,
271
274
  audioBitrate: params.audioBitrate,
@@ -280,12 +283,15 @@ const launchHandler = async (params, options) => {
280
283
  }
281
284
  let allChunksAvailable = null;
282
285
  const functionName = (_a = params.rendererFunctionName) !== null && _a !== void 0 ? _a : process.env.AWS_LAMBDA_FUNCTION_NAME;
283
- const verbose = renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose');
286
+ const logOptions = {
287
+ indent: false,
288
+ logLevel: params.logLevel,
289
+ };
284
290
  const onTimeout = async () => {
285
291
  var _a;
286
292
  if (allChunksAvailable) {
287
- renderer_1.RenderInternals.Log.info('All chunks are available, but the function is about to time out.');
288
- renderer_1.RenderInternals.Log.info('Spawning another function to merge chunks.');
293
+ renderer_1.RenderInternals.Log.infoAdvanced(logOptions, 'All chunks are available, but the function is about to time out.');
294
+ renderer_1.RenderInternals.Log.infoAdvanced(logOptions, 'Spawning another function to merge chunks.');
289
295
  try {
290
296
  await callFunctionWithRetry({
291
297
  functionName,
@@ -293,7 +299,6 @@ const launchHandler = async (params, options) => {
293
299
  type: constants_1.LambdaRoutines.merge,
294
300
  renderId: params.renderId,
295
301
  bucketName: params.bucketName,
296
- verbose,
297
302
  outName: params.outName,
298
303
  serializedResolvedProps: allChunksAvailable.serializedResolvedProps,
299
304
  inputProps: allChunksAvailable.inputProps,
@@ -301,15 +306,15 @@ const launchHandler = async (params, options) => {
301
306
  },
302
307
  retries: 2,
303
308
  });
304
- renderer_1.RenderInternals.Log.info(`New function successfully invoked. See the CloudWatch logs for it:`);
305
- renderer_1.RenderInternals.Log.info((0, get_aws_urls_1.getCloudwatchMethodUrl)({
309
+ renderer_1.RenderInternals.Log.infoAdvanced(logOptions, `New function successfully invoked. See the CloudWatch logs for it:`);
310
+ renderer_1.RenderInternals.Log.infoAdvanced(logOptions, (0, get_aws_urls_1.getCloudwatchMethodUrl)({
306
311
  functionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
307
312
  method: constants_1.LambdaRoutines.merge,
308
313
  region: (0, get_current_region_1.getCurrentRegionInFunction)(),
309
314
  rendererFunctionName: params.rendererFunctionName,
310
315
  renderId: params.renderId,
311
316
  }));
312
- renderer_1.RenderInternals.Log.info('This function will now time out.');
317
+ renderer_1.RenderInternals.Log.infoAdvanced(logOptions, 'This function will now time out.');
313
318
  }
314
319
  catch (err) {
315
320
  if (process.env.NODE_ENV === 'test') {
@@ -385,7 +390,7 @@ const launchHandler = async (params, options) => {
385
390
  };
386
391
  let webhookInvoked = false;
387
392
  const webhookDueToTimeout = setTimeout(onTimeout, Math.max(options.getRemainingTimeInMillis() - 1000, 1000));
388
- renderer_1.RenderInternals.Log.info(`Function has ${Math.max(options.getRemainingTimeInMillis() - 1000, 1000)} before it times out`);
393
+ renderer_1.RenderInternals.Log.infoAdvanced(logOptions, `Function has ${Math.max(options.getRemainingTimeInMillis() - 1000, 1000)} before it times out`);
389
394
  try {
390
395
  const postRenderData = await innerLaunchHandler({
391
396
  functionName,
@@ -394,7 +399,6 @@ const launchHandler = async (params, options) => {
394
399
  onAllChunksAvailable: ({ inputProps, serializedResolvedProps }) => {
395
400
  allChunksAvailable = { inputProps, serializedResolvedProps };
396
401
  },
397
- verbose,
398
402
  });
399
403
  clearTimeout(webhookDueToTimeout);
400
404
  if (!params.webhook || webhookInvoked) {
@@ -46,7 +46,6 @@ const mergeHandler = async (params, options) => {
46
46
  renderId: params.renderId,
47
47
  renderMetadata,
48
48
  serializedResolvedProps: params.serializedResolvedProps,
49
- verbose: params.verbose,
50
49
  onAllChunks: () => {
51
50
  renderer_1.RenderInternals.Log.info('All chunks have been downloaded now.');
52
51
  },
@@ -48,7 +48,7 @@ const renderHandler = async (params, options, logs) => {
48
48
  if (!params.frameRange) {
49
49
  throw new Error('must pass framerange');
50
50
  }
51
- renderer_1.RenderInternals.Log.verbose(`Rendering frames ${params.frameRange[0]}-${params.frameRange[1]} in this Lambda function`);
51
+ renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel: params.logLevel }, `Rendering frames ${params.frameRange[0]}-${params.frameRange[1]} in this Lambda function`);
52
52
  const start = Date.now();
53
53
  const chunkTimingData = {
54
54
  timings: {},
@@ -96,7 +96,7 @@ const renderHandler = async (params, options, logs) => {
96
96
  });
97
97
  }
98
98
  else {
99
- renderer_1.RenderInternals.Log.verbose(`Rendered ${renderedFrames} frames, encoded ${encodedFrames} frames, stage = ${stitchStage}`);
99
+ renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel: params.logLevel }, `Rendered ${renderedFrames} frames, encoded ${encodedFrames} frames, stage = ${stitchStage}`);
100
100
  }
101
101
  const allFrames = renderer_1.RenderInternals.getFramesToRender(params.frameRange, params.everyNthFrame);
102
102
  if (renderedFrames === allFrames.length) {
@@ -171,7 +171,7 @@ const renderHandler = async (params, options, logs) => {
171
171
  ...chunkTimingData,
172
172
  timings: Object.values(chunkTimingData.timings),
173
173
  };
174
- renderer_1.RenderInternals.Log.verbose('Writing chunk to S3');
174
+ renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel: params.logLevel }, 'Writing chunk to S3');
175
175
  const writeStart = Date.now();
176
176
  await (0, io_1.lambdaWriteFile)({
177
177
  bucketName: params.bucketName,
@@ -186,10 +186,10 @@ const renderHandler = async (params, options, logs) => {
186
186
  downloadBehavior: null,
187
187
  customCredentials: null,
188
188
  });
189
- renderer_1.RenderInternals.Log.verbose('Wrote chunk to S3', {
189
+ renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel: params.logLevel }, 'Wrote chunk to S3', {
190
190
  time: Date.now() - writeStart,
191
191
  });
192
- renderer_1.RenderInternals.Log.verbose('Cleaning up and writing timings');
192
+ renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel: params.logLevel }, 'Cleaning up and writing timings');
193
193
  await Promise.all([
194
194
  node_fs_1.default.promises.rm(outputLocation, { recursive: true }),
195
195
  node_fs_1.default.promises.rm(outputPath, { recursive: true }),
@@ -210,7 +210,7 @@ const renderHandler = async (params, options, logs) => {
210
210
  }),
211
211
  ]);
212
212
  browserInstance.instance.forgetEventLoop();
213
- renderer_1.RenderInternals.Log.verbose('Done!');
213
+ renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel: params.logLevel }, 'Done!');
214
214
  return {};
215
215
  };
216
216
  const rendererHandler = async (params, options) => {
@@ -1,5 +1,5 @@
1
1
  export declare const LambdaInternals: {
2
- executeCommand: (args: string[], remotionRoot: string) => Promise<void>;
2
+ executeCommand: (args: string[], remotionRoot: string, logLevel: "verbose" | "info" | "warn" | "error") => Promise<void>;
3
3
  makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, }: import("./api/make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("./defaults").LambdaStartPayload>;
4
4
  getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, }: import(".").GetRenderProgressInput) => import("./defaults").LambdaStatusPayload;
5
5
  };
@@ -292,7 +292,6 @@ export type LambdaPayloads = {
292
292
  outName: OutNameInput | null;
293
293
  inputProps: SerializedInputProps;
294
294
  serializedResolvedProps: SerializedInputProps;
295
- verbose: boolean;
296
295
  logLevel: LogLevel;
297
296
  };
298
297
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "4.0.56",
3
+ "version": "4.0.58",
4
4
  "description": "Distributed renderer for Remotion based on AWS Lambda",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -26,10 +26,10 @@
26
26
  "aws-policies": "^1.0.1",
27
27
  "mime-types": "2.1.34",
28
28
  "zod": "3.22.3",
29
- "@remotion/bundler": "4.0.56",
30
- "@remotion/renderer": "4.0.56",
31
- "remotion": "4.0.56",
32
- "@remotion/cli": "4.0.56"
29
+ "@remotion/bundler": "4.0.58",
30
+ "@remotion/renderer": "4.0.58",
31
+ "remotion": "4.0.58",
32
+ "@remotion/cli": "4.0.58"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@jonny/eslint-config": "3.0.276",
@@ -43,11 +43,11 @@
43
43
  "ts-node": "^10.8.0",
44
44
  "vitest": "0.31.1",
45
45
  "zip-lib": "^0.7.2",
46
- "@remotion/bundler": "4.0.56",
47
- "@remotion/compositor-linux-arm64-gnu": "4.0.56"
46
+ "@remotion/bundler": "4.0.58",
47
+ "@remotion/compositor-linux-arm64-gnu": "4.0.58"
48
48
  },
49
49
  "peerDependencies": {
50
- "@remotion/bundler": "4.0.56"
50
+ "@remotion/bundler": "4.0.58"
51
51
  },
52
52
  "publishConfig": {
53
53
  "access": "public"
Binary file
@@ -1,4 +0,0 @@
1
- import { Internals } from 'remotion';
2
- export declare const validateFps: typeof Internals.validateFps;
3
- export declare const validateDimension: typeof Internals.validateDimension;
4
- export declare const validateDurationInFrames: typeof Internals.validateDurationInFrames;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateDurationInFrames = exports.validateDimension = exports.validateFps = void 0;
4
- /* eslint-disable prefer-destructuring */
5
- const remotion_1 = require("remotion");
6
- exports.validateFps = remotion_1.Internals.validateFps;
7
- exports.validateDimension = remotion_1.Internals.validateDimension;
8
- exports.validateDurationInFrames = remotion_1.Internals.validateDurationInFrames;
@@ -1,12 +0,0 @@
1
- /// <reference types="node" />
2
- type OnMessage = (type: 'error' | 'success', nonce: string, data: Buffer) => void;
3
- export declare const makeStreaming: (onMessage: OnMessage) => {
4
- addData: (data: Buffer) => void;
5
- };
6
- export declare const makePayloadMessage: (nonce: number, data: Buffer, status: 0 | 1) => Buffer;
7
- export type StreamingPayload = {
8
- type: 'frames-rendered';
9
- frames: number;
10
- };
11
- export type OnStream = (payload: StreamingPayload) => void;
12
- export {};
@@ -1,100 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makePayloadMessage = exports.makeStreaming = void 0;
4
- const makeStreaming = (onMessage) => {
5
- let outputBuffer = Buffer.from('');
6
- const separator = Buffer.from('remotion_buffer:');
7
- let unprocessedBuffers = [];
8
- let missingData = null;
9
- const processInput = () => {
10
- let separatorIndex = outputBuffer.indexOf(separator);
11
- if (separatorIndex === -1) {
12
- return;
13
- }
14
- separatorIndex += separator.length;
15
- let nonceString = '';
16
- let lengthString = '';
17
- let statusString = '';
18
- // Each message from Rust is prefixed with `remotion_buffer;{[nonce]}:{[length]}`
19
- // Let's read the buffer to extract the nonce, and if the full length is available,
20
- // we'll extract the data and pass it to the callback.
21
- // eslint-disable-next-line no-constant-condition
22
- while (true) {
23
- const nextDigit = outputBuffer[separatorIndex];
24
- // 0x3a is the character ":"
25
- if (nextDigit === 0x3a) {
26
- separatorIndex++;
27
- break;
28
- }
29
- separatorIndex++;
30
- nonceString += String.fromCharCode(nextDigit);
31
- }
32
- // eslint-disable-next-line no-constant-condition
33
- while (true) {
34
- const nextDigit = outputBuffer[separatorIndex];
35
- if (nextDigit === 0x3a) {
36
- separatorIndex++;
37
- break;
38
- }
39
- separatorIndex++;
40
- lengthString += String.fromCharCode(nextDigit);
41
- }
42
- // eslint-disable-next-line no-constant-condition
43
- while (true) {
44
- const nextDigit = outputBuffer[separatorIndex];
45
- if (nextDigit === 0x3a) {
46
- break;
47
- }
48
- separatorIndex++;
49
- statusString += String.fromCharCode(nextDigit);
50
- }
51
- const length = Number(lengthString);
52
- const status = Number(statusString);
53
- const dataLength = outputBuffer.length - separatorIndex - 1;
54
- if (dataLength < length) {
55
- missingData = {
56
- dataMissing: length - dataLength,
57
- };
58
- return;
59
- }
60
- const data = outputBuffer.subarray(separatorIndex + 1, separatorIndex + 1 + Number(lengthString));
61
- onMessage(status === 1 ? 'error' : 'success', nonceString, data);
62
- missingData = null;
63
- outputBuffer = outputBuffer.subarray(separatorIndex + Number(lengthString) + 1);
64
- processInput();
65
- };
66
- return {
67
- addData: (data) => {
68
- unprocessedBuffers.push(data);
69
- const separatorIndex = data.indexOf(separator);
70
- if (separatorIndex === -1) {
71
- if (missingData) {
72
- missingData.dataMissing -= data.length;
73
- }
74
- if (!missingData || missingData.dataMissing > 0) {
75
- return;
76
- }
77
- }
78
- unprocessedBuffers.unshift(outputBuffer);
79
- outputBuffer = Buffer.concat(unprocessedBuffers);
80
- unprocessedBuffers = [];
81
- console.log('the unprocessed input is now', new TextDecoder('utf-8').decode(outputBuffer));
82
- processInput();
83
- },
84
- };
85
- };
86
- exports.makeStreaming = makeStreaming;
87
- const makePayloadMessage = (nonce, data, status) => {
88
- const concat = Buffer.concat([
89
- Buffer.from('remotion_buffer:'),
90
- Buffer.from(nonce.toString()),
91
- Buffer.from(':'),
92
- Buffer.from(data.length.toString()),
93
- Buffer.from(':'),
94
- Buffer.from(String(status)),
95
- Buffer.from(':'),
96
- data,
97
- ]);
98
- return concat;
99
- };
100
- exports.makePayloadMessage = makePayloadMessage;