@remotion/lambda 4.0.0-alpha4 → 4.0.0-alpha5

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 (63) hide show
  1. package/dist/admin/bundle-lambda.js +17 -23
  2. package/dist/admin/make-layer-public.js +59 -87
  3. package/dist/api/clean-items.js +1 -1
  4. package/dist/api/create-function.d.ts +1 -3
  5. package/dist/api/create-function.js +6 -6
  6. package/dist/api/deploy-function.d.ts +0 -3
  7. package/dist/api/deploy-function.js +1 -7
  8. package/dist/api/deploy-site.js +3 -8
  9. package/dist/api/download-media.d.ts +0 -4
  10. package/dist/api/download-media.js +1 -5
  11. package/dist/api/estimate-price.d.ts +1 -3
  12. package/dist/api/estimate-price.js +3 -9
  13. package/dist/api/get-compositions-on-lambda.d.ts +2 -2
  14. package/dist/api/get-or-create-bucket.d.ts +0 -1
  15. package/dist/api/get-or-create-bucket.js +0 -3
  16. package/dist/api/iam-validation/simulate.js +4 -2
  17. package/dist/api/render-media-on-lambda.d.ts +10 -6
  18. package/dist/api/render-media-on-lambda.js +6 -3
  19. package/dist/api/render-still-on-lambda.d.ts +7 -3
  20. package/dist/api/render-still-on-lambda.js +6 -3
  21. package/dist/cli/args.d.ts +0 -2
  22. package/dist/cli/commands/functions/deploy.js +7 -9
  23. package/dist/cli/commands/functions/ls.js +4 -1
  24. package/dist/cli/commands/functions/rm.js +8 -2
  25. package/dist/cli/commands/functions/rmall.js +8 -2
  26. package/dist/cli/commands/render/render.js +22 -12
  27. package/dist/cli/commands/sites/create.js +7 -8
  28. package/dist/cli/commands/still.js +7 -5
  29. package/dist/cli/helpers/progress-bar.d.ts +1 -2
  30. package/dist/cli/helpers/progress-bar.js +3 -7
  31. package/dist/cli/log.d.ts +12 -0
  32. package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +4 -1
  33. package/dist/functions/compositions.d.ts +1 -1
  34. package/dist/functions/compositions.js +0 -2
  35. package/dist/functions/helpers/calculate-price-from-bucket.d.ts +1 -3
  36. package/dist/functions/helpers/calculate-price-from-bucket.js +1 -2
  37. package/dist/functions/helpers/concat-videos.d.ts +2 -4
  38. package/dist/functions/helpers/concat-videos.js +2 -5
  39. package/dist/functions/helpers/create-post-render-data.js +0 -2
  40. package/dist/functions/helpers/get-chromium-executable-path.js +6 -1
  41. package/dist/functions/helpers/get-progress.js +0 -2
  42. package/dist/functions/helpers/is-enosp-err.js +1 -1
  43. package/dist/functions/helpers/validate-composition.d.ts +3 -5
  44. package/dist/functions/helpers/validate-composition.js +1 -3
  45. package/dist/functions/index.d.ts +15 -4
  46. package/dist/functions/index.js +1 -1
  47. package/dist/functions/launch.js +2 -6
  48. package/dist/functions/renderer.js +9 -9
  49. package/dist/functions/start.js +1 -1
  50. package/dist/functions/still.js +1 -5
  51. package/dist/index.d.ts +5 -6
  52. package/dist/index.js +1 -2
  53. package/dist/shared/constants.d.ts +20 -17
  54. package/dist/shared/constants.js +1 -2
  55. package/dist/shared/function-zip-path.d.ts +0 -1
  56. package/dist/shared/function-zip-path.js +1 -2
  57. package/dist/shared/hosted-layers.d.ts +2 -91
  58. package/dist/shared/hosted-layers.js +64 -363
  59. package/dist/shared/invoke-webhook.d.ts +0 -2
  60. package/package.json +9 -10
  61. package/remotionlambda-arm64.zip +0 -0
  62. package/remotionlambda-x64.zip +0 -0
  63. package/remotionlambda.zip +0 -0
@@ -12,7 +12,11 @@ export declare type RenderStillOnLambdaInput = {
12
12
  privacy: Privacy;
13
13
  maxRetries?: number;
14
14
  envVariables?: Record<string, string>;
15
- quality?: number;
15
+ /**
16
+ * @deprecated Renamed to `jpegQuality`
17
+ */
18
+ quality?: never;
19
+ jpegQuality?: number;
16
20
  frame?: number;
17
21
  logLevel?: LogLevel;
18
22
  outName?: OutNameInput;
@@ -42,7 +46,7 @@ export declare type RenderStillOnLambdaOutput = {
42
46
  * @param params.inputProps The input props that should be passed to the composition.
43
47
  * @param params.imageFormat In which image format the frames should be rendered.
44
48
  * @param params.envVariables Object containing environment variables to be inserted into the video environment
45
- * @param params.quality JPEG quality if JPEG was selected as the image format.
49
+ * @param params.jpegQuality JPEG quality if JPEG was selected as the image format.
46
50
  * @param params.region The AWS region in which the video should be rendered.
47
51
  * @param params.maxRetries How often rendering a chunk may fail before the video render gets aborted.
48
52
  * @param params.frame Which frame should be used for the still image. Default 0.
@@ -50,4 +54,4 @@ export declare type RenderStillOnLambdaOutput = {
50
54
  * @param params.dumpBrowserLogs Whether to print browser logs to CloudWatch.
51
55
  * @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
52
56
  */
53
- export declare const renderStillOnLambda: ({ functionName, serveUrl, inputProps, imageFormat, envVariables, quality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, dumpBrowserLogs, }: RenderStillOnLambdaInput) => Promise<RenderStillOnLambdaOutput>;
57
+ 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>;
@@ -15,7 +15,7 @@ const serialize_input_props_1 = require("../shared/serialize-input-props");
15
15
  * @param params.inputProps The input props that should be passed to the composition.
16
16
  * @param params.imageFormat In which image format the frames should be rendered.
17
17
  * @param params.envVariables Object containing environment variables to be inserted into the video environment
18
- * @param params.quality JPEG quality if JPEG was selected as the image format.
18
+ * @param params.jpegQuality JPEG quality if JPEG was selected as the image format.
19
19
  * @param params.region The AWS region in which the video should be rendered.
20
20
  * @param params.maxRetries How often rendering a chunk may fail before the video render gets aborted.
21
21
  * @param params.frame Which frame should be used for the still image. Default 0.
@@ -23,8 +23,11 @@ const serialize_input_props_1 = require("../shared/serialize-input-props");
23
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
- const renderStillOnLambda = async ({ functionName, serveUrl, inputProps, imageFormat, envVariables, quality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, dumpBrowserLogs, }) => {
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, }) => {
27
27
  var _a;
28
+ if (quality) {
29
+ throw new Error('The `quality` option is deprecated. Use `jpegQuality` instead.');
30
+ }
28
31
  const serializedInputProps = await (0, serialize_input_props_1.serializeInputProps)({
29
32
  inputProps,
30
33
  region,
@@ -41,7 +44,7 @@ const renderStillOnLambda = async ({ functionName, serveUrl, inputProps, imageFo
41
44
  inputProps: serializedInputProps,
42
45
  imageFormat,
43
46
  envVariables,
44
- quality,
47
+ jpegQuality,
45
48
  maxRetries: maxRetries !== null && maxRetries !== void 0 ? maxRetries : constants_1.DEFAULT_MAX_RETRIES,
46
49
  frame: frame !== null && frame !== void 0 ? frame : 0,
47
50
  privacy,
@@ -1,7 +1,6 @@
1
1
  /// <reference types="minimist" />
2
2
  import type { AwsRegion } from '../pricing/aws-regions';
3
3
  import type { Privacy } from '../shared/constants';
4
- import type { LambdaArchitecture } from '../shared/validate-architecture';
5
4
  declare type LambdaCommandLineOptions = {
6
5
  help: boolean;
7
6
  region: AwsRegion;
@@ -22,7 +21,6 @@ declare type LambdaCommandLineOptions = {
22
21
  ['frames-per-lambda']: number;
23
22
  ['concurrency-per-lambda']: number;
24
23
  ['out-name']: string | undefined;
25
- ['architecture']: LambdaArchitecture;
26
24
  ['custom-role-arn']: string | undefined;
27
25
  privacy: Privacy;
28
26
  webhook: string | undefined;
@@ -5,7 +5,6 @@ const cli_1 = require("@remotion/cli");
5
5
  const version_1 = require("remotion/version");
6
6
  const deploy_function_1 = require("../../../api/deploy-function");
7
7
  const constants_1 = require("../../../shared/constants");
8
- const validate_architecture_1 = require("../../../shared/validate-architecture");
9
8
  const validate_custom_role_arn_1 = require("../../../shared/validate-custom-role-arn");
10
9
  const validate_disk_size_in_mb_1 = require("../../../shared/validate-disk-size-in-mb");
11
10
  const validate_memory_size_1 = require("../../../shared/validate-memory-size");
@@ -14,18 +13,16 @@ const args_1 = require("../../args");
14
13
  const get_aws_region_1 = require("../../get-aws-region");
15
14
  exports.FUNCTIONS_DEPLOY_SUBCOMMAND = 'deploy';
16
15
  const functionsDeploySubcommand = async () => {
17
- var _a, _b, _c, _d, _e, _f;
16
+ var _a, _b, _c, _d, _e;
18
17
  const region = (0, get_aws_region_1.getAwsRegion)();
19
18
  const timeoutInSeconds = (_a = args_1.parsedLambdaCli.timeout) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_TIMEOUT;
20
19
  const memorySizeInMb = (_b = args_1.parsedLambdaCli.memory) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_MEMORY_SIZE;
21
20
  const diskSizeInMb = (_c = args_1.parsedLambdaCli.disk) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB;
22
- const architecture = (_d = args_1.parsedLambdaCli.architecture) !== null && _d !== void 0 ? _d : constants_1.DEFAULT_ARCHITECTURE;
23
- const customRoleArn = (_e = args_1.parsedLambdaCli['custom-role-arn']) !== null && _e !== void 0 ? _e : undefined;
21
+ const customRoleArn = (_d = args_1.parsedLambdaCli['custom-role-arn']) !== null && _d !== void 0 ? _d : undefined;
24
22
  const createCloudWatchLogGroup = !args_1.parsedLambdaCli['disable-cloudwatch'];
25
- const cloudWatchLogRetentionPeriodInDays = (_f = args_1.parsedLambdaCli['retention-period']) !== null && _f !== void 0 ? _f : constants_1.DEFAULT_CLOUDWATCH_RETENTION_PERIOD;
23
+ const cloudWatchLogRetentionPeriodInDays = (_e = args_1.parsedLambdaCli['retention-period']) !== null && _e !== void 0 ? _e : constants_1.DEFAULT_CLOUDWATCH_RETENTION_PERIOD;
26
24
  (0, validate_memory_size_1.validateMemorySize)(memorySizeInMb);
27
25
  (0, validate_timeout_1.validateTimeout)(timeoutInSeconds);
28
- (0, validate_architecture_1.validateArchitecture)(architecture);
29
26
  (0, validate_disk_size_in_mb_1.validateDiskSizeInMb)(diskSizeInMb);
30
27
  (0, validate_custom_role_arn_1.validateCustomRoleArn)(customRoleArn);
31
28
  if (!cli_1.CliInternals.quietFlagProvided()) {
@@ -35,12 +32,14 @@ Memory = ${memorySizeInMb}MB
35
32
  Disk size = ${diskSizeInMb}MB
36
33
  Timeout = ${timeoutInSeconds}sec
37
34
  Version = ${version_1.VERSION}
38
- Architecture = ${architecture}
39
35
  CloudWatch Logging Enabled = ${createCloudWatchLogGroup}
40
36
  CloudWatch Retention Period = ${cloudWatchLogRetentionPeriodInDays} days
41
37
  `.trim()));
42
38
  }
43
- const output = cli_1.CliInternals.createOverwriteableCliOutput(cli_1.CliInternals.quietFlagProvided());
39
+ const output = cli_1.CliInternals.createOverwriteableCliOutput({
40
+ quiet: cli_1.CliInternals.quietFlagProvided(),
41
+ cancelSignal: null,
42
+ });
44
43
  output.update('Deploying Lambda...');
45
44
  const { functionName, alreadyExisted } = await (0, deploy_function_1.deployFunction)({
46
45
  createCloudWatchLogGroup,
@@ -48,7 +47,6 @@ CloudWatch Retention Period = ${cloudWatchLogRetentionPeriodInDays} days
48
47
  timeoutInSeconds,
49
48
  memorySizeInMb,
50
49
  cloudWatchLogRetentionPeriodInDays,
51
- architecture,
52
50
  diskSizeInMb,
53
51
  customRoleArn,
54
52
  });
@@ -12,7 +12,10 @@ const VERSION_COLS = 15;
12
12
  exports.FUNCTIONS_LS_SUBCOMMAND = 'ls';
13
13
  const functionsLsCommand = async () => {
14
14
  const region = (0, get_aws_region_1.getAwsRegion)();
15
- const fetchingOutput = cli_1.CliInternals.createOverwriteableCliOutput(cli_1.CliInternals.quietFlagProvided());
15
+ const fetchingOutput = cli_1.CliInternals.createOverwriteableCliOutput({
16
+ quiet: cli_1.CliInternals.quietFlagProvided(),
17
+ cancelSignal: null,
18
+ });
16
19
  fetchingOutput.update('Getting functions...');
17
20
  const functions = await (0, get_functions_1.getFunctions)({
18
21
  region,
@@ -26,7 +26,10 @@ const functionsRmCommand = async (args) => {
26
26
  }
27
27
  const region = (0, get_aws_region_1.getAwsRegion)();
28
28
  for (const functionName of args) {
29
- const infoOutput = cli_1.CliInternals.createOverwriteableCliOutput(cli_1.CliInternals.quietFlagProvided());
29
+ const infoOutput = cli_1.CliInternals.createOverwriteableCliOutput({
30
+ quiet: cli_1.CliInternals.quietFlagProvided(),
31
+ cancelSignal: null,
32
+ });
30
33
  infoOutput.update('Getting function info...');
31
34
  const info = await (0, get_function_info_1.getFunctionInfo)({
32
35
  region,
@@ -40,7 +43,10 @@ const functionsRmCommand = async (args) => {
40
43
  ].join('\n'));
41
44
  log_1.Log.info();
42
45
  await (0, confirm_1.confirmCli)({ delMessage: 'Delete? (Y/n)', allowForceFlag: true });
43
- const output = cli_1.CliInternals.createOverwriteableCliOutput(cli_1.CliInternals.quietFlagProvided());
46
+ const output = cli_1.CliInternals.createOverwriteableCliOutput({
47
+ quiet: cli_1.CliInternals.quietFlagProvided(),
48
+ cancelSignal: null,
49
+ });
44
50
  output.update('Deleting...');
45
51
  await (0, delete_function_1.deleteFunction)({ region, functionName });
46
52
  output.update('Deleted!\n');
@@ -17,7 +17,10 @@ const functionsRmallCommand = async () => {
17
17
  compatibleOnly: false,
18
18
  });
19
19
  for (const fun of functions) {
20
- const infoOutput = cli_1.CliInternals.createOverwriteableCliOutput(cli_1.CliInternals.quietFlagProvided());
20
+ const infoOutput = cli_1.CliInternals.createOverwriteableCliOutput({
21
+ quiet: cli_1.CliInternals.quietFlagProvided(),
22
+ cancelSignal: null,
23
+ });
21
24
  infoOutput.update('Getting function info...');
22
25
  const info = await (0, get_function_info_1.getFunctionInfo)({
23
26
  region,
@@ -31,7 +34,10 @@ const functionsRmallCommand = async () => {
31
34
  ].join('\n'));
32
35
  log_1.Log.info();
33
36
  await (0, confirm_1.confirmCli)({ delMessage: 'Delete? (Y/n)', allowForceFlag: true });
34
- const output = cli_1.CliInternals.createOverwriteableCliOutput(cli_1.CliInternals.quietFlagProvided());
37
+ const output = cli_1.CliInternals.createOverwriteableCliOutput({
38
+ quiet: cli_1.CliInternals.quietFlagProvided(),
39
+ cancelSignal: null,
40
+ });
35
41
  output.update('Deleting...');
36
42
  await (0, delete_function_1.deleteFunction)({ region, functionName: fun.functionName });
37
43
  output.update('Deleted!\n');
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renderCommand = exports.RENDER_COMMAND = void 0;
4
4
  const cli_1 = require("@remotion/cli");
5
+ const config_1 = require("@remotion/cli/config");
5
6
  const renderer_1 = require("@remotion/renderer");
6
7
  const download_media_1 = require("../../../api/download-media");
7
8
  const get_render_progress_1 = require("../../../api/get-render-progress");
@@ -20,7 +21,7 @@ const log_1 = require("../../log");
20
21
  const progress_1 = require("./progress");
21
22
  exports.RENDER_COMMAND = 'render';
22
23
  const renderCommand = async (args, remotionRoot) => {
23
- var _a, _b, _c, _d, _e, _f;
24
+ var _a, _b, _c, _d, _e, _f, _g;
24
25
  const serveUrl = args[0];
25
26
  if (!serveUrl) {
26
27
  log_1.Log.error('No serve URL passed.');
@@ -40,22 +41,28 @@ const renderCommand = async (args, remotionRoot) => {
40
41
  }
41
42
  const outName = args_1.parsedLambdaCli['out-name'];
42
43
  const downloadName = (_a = args[2]) !== null && _a !== void 0 ? _a : null;
43
- const { codec, reason } = cli_1.CliInternals.getFinalCodec({
44
+ const { codec, reason } = cli_1.CliInternals.getFinalOutputCodec({
45
+ cliFlag: cli_1.CliInternals.parsedCli.codec,
44
46
  downloadName,
45
47
  outName: outName !== null && outName !== void 0 ? outName : null,
48
+ configFile: (_b = config_1.ConfigInternals.getOutputCodecOrUndefined()) !== null && _b !== void 0 ? _b : null,
49
+ uiCodec: null,
46
50
  });
47
- const { chromiumOptions, crf, envVariables, frameRange, inputProps, logLevel, pixelFormat, proResProfile, puppeteerTimeout, quality, scale, everyNthFrame, numberOfGifLoops, muted, overwrite, audioBitrate, videoBitrate, height, width, } = await cli_1.CliInternals.getCliOptions({
51
+ const { chromiumOptions, crf, envVariables, frameRange, inputProps, logLevel, pixelFormat, proResProfile, puppeteerTimeout, jpegQuality, scale, everyNthFrame, numberOfGifLoops, muted, overwrite, audioBitrate, videoBitrate, height, width, } = await cli_1.CliInternals.getCliOptions({
48
52
  type: 'series',
49
53
  isLambda: true,
50
54
  remotionRoot,
51
55
  });
52
- const imageFormat = cli_1.CliInternals.getImageFormat(codec);
56
+ const imageFormat = cli_1.CliInternals.getVideoImageFormat({
57
+ codec,
58
+ uiImageFormat: null,
59
+ });
53
60
  const functionName = await (0, find_function_name_1.findFunctionName)();
54
- const maxRetries = (_b = args_1.parsedLambdaCli['max-retries']) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_MAX_RETRIES;
61
+ const maxRetries = (_c = args_1.parsedLambdaCli['max-retries']) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_MAX_RETRIES;
55
62
  (0, validate_retries_1.validateMaxRetries)(maxRetries);
56
- const privacy = (_c = args_1.parsedLambdaCli.privacy) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_OUTPUT_PRIVACY;
63
+ const privacy = (_d = args_1.parsedLambdaCli.privacy) !== null && _d !== void 0 ? _d : constants_1.DEFAULT_OUTPUT_PRIVACY;
57
64
  (0, validate_privacy_1.validatePrivacy)(privacy);
58
- const framesPerLambda = (_d = args_1.parsedLambdaCli['frames-per-lambda']) !== null && _d !== void 0 ? _d : undefined;
65
+ const framesPerLambda = (_e = args_1.parsedLambdaCli['frames-per-lambda']) !== null && _e !== void 0 ? _e : undefined;
59
66
  (0, validate_frames_per_lambda_1.validateFramesPerLambda)({ framesPerLambda, durationInFrames: 1 });
60
67
  const res = await (0, render_media_on_lambda_1.renderMediaOnLambda)({
61
68
  functionName,
@@ -67,7 +74,7 @@ const renderCommand = async (args, remotionRoot) => {
67
74
  envVariables,
68
75
  pixelFormat,
69
76
  proResProfile,
70
- quality,
77
+ jpegQuality,
71
78
  region,
72
79
  maxRetries,
73
80
  composition,
@@ -91,18 +98,21 @@ const renderCommand = async (args, remotionRoot) => {
91
98
  webhook: args_1.parsedLambdaCli.webhook
92
99
  ? {
93
100
  url: args_1.parsedLambdaCli.webhook,
94
- secret: (_e = args_1.parsedLambdaCli['webhook-secret']) !== null && _e !== void 0 ? _e : null,
101
+ secret: (_f = args_1.parsedLambdaCli['webhook-secret']) !== null && _f !== void 0 ? _f : null,
95
102
  }
96
103
  : undefined,
97
- rendererFunctionName: (_f = args_1.parsedLambdaCli['renderer-function-name']) !== null && _f !== void 0 ? _f : null,
104
+ rendererFunctionName: (_g = args_1.parsedLambdaCli['renderer-function-name']) !== null && _g !== void 0 ? _g : null,
98
105
  forceBucketName: args_1.parsedLambdaCli['force-bucket-name'],
99
106
  audioCodec: cli_1.CliInternals.parsedCli['audio-codec'],
100
107
  });
101
108
  const totalSteps = downloadName ? 6 : 5;
102
- const progressBar = cli_1.CliInternals.createOverwriteableCliOutput(cli_1.CliInternals.quietFlagProvided());
109
+ const progressBar = cli_1.CliInternals.createOverwriteableCliOutput({
110
+ quiet: cli_1.CliInternals.quietFlagProvided(),
111
+ cancelSignal: null,
112
+ });
103
113
  log_1.Log.info(cli_1.CliInternals.chalk.gray(`bucket = ${res.bucketName}, function = ${functionName}`));
104
114
  log_1.Log.info(cli_1.CliInternals.chalk.gray(`renderId = ${res.renderId}, codec = ${codec} (${reason})`));
105
- const verbose = renderer_1.RenderInternals.isEqualOrBelowLogLevel(cli_1.ConfigInternals.Logging.getLogLevel(), 'verbose');
115
+ const verbose = renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose');
106
116
  log_1.Log.verbose(`CloudWatch logs (if enabled): ${res.cloudWatchLogs}`);
107
117
  log_1.Log.verbose(`Render folder: ${res.folderInS3Console}`);
108
118
  const status = await (0, get_render_progress_1.getRenderProgress)({
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sitesCreateSubcommand = exports.SITES_CREATE_SUBCOMMAND = void 0;
4
4
  const cli_1 = require("@remotion/cli");
5
+ const config_1 = require("@remotion/cli/config");
5
6
  const remotion_1 = require("remotion");
6
7
  const deploy_site_1 = require("../../../api/deploy-site");
7
8
  const get_or_create_bucket_1 = require("../../../api/get-or-create-bucket");
@@ -29,14 +30,16 @@ const sitesCreateSubcommand = async (args, remotionRoot) => {
29
30
  if (desiredSiteName !== undefined) {
30
31
  (0, validate_site_name_1.validateSiteName)(desiredSiteName);
31
32
  }
32
- const progressBar = cli_1.CliInternals.createOverwriteableCliOutput(cli_1.CliInternals.quietFlagProvided());
33
+ const progressBar = cli_1.CliInternals.createOverwriteableCliOutput({
34
+ quiet: cli_1.CliInternals.quietFlagProvided(),
35
+ cancelSignal: null,
36
+ });
33
37
  const multiProgress = {
34
38
  bundleProgress: {
35
39
  doneIn: null,
36
40
  progress: 0,
37
41
  },
38
42
  bucketProgress: {
39
- bucketCreated: false,
40
43
  doneIn: null,
41
44
  },
42
45
  deployProgress: {
@@ -57,10 +60,6 @@ const sitesCreateSubcommand = async (args, remotionRoot) => {
57
60
  const cliBucketName = (_b = args_1.parsedLambdaCli['force-bucket-name']) !== null && _b !== void 0 ? _b : null;
58
61
  const bucketName = cliBucketName !== null && cliBucketName !== void 0 ? cliBucketName : (await (0, get_or_create_bucket_1.getOrCreateBucket)({
59
62
  region: (0, get_aws_region_1.getAwsRegion)(),
60
- onBucketEnsured: () => {
61
- multiProgress.bucketProgress.bucketCreated = true;
62
- updateProgress();
63
- },
64
63
  })).bucketName;
65
64
  multiProgress.bucketProgress.doneIn = Date.now() - bucketStart;
66
65
  updateProgress();
@@ -86,8 +85,8 @@ const sitesCreateSubcommand = async (args, remotionRoot) => {
86
85
  };
87
86
  updateProgress();
88
87
  },
89
- enableCaching: cli_1.ConfigInternals.getWebpackCaching(),
90
- webpackOverride: (_c = cli_1.ConfigInternals.getWebpackOverrideFn()) !== null && _c !== void 0 ? _c : ((f) => f),
88
+ enableCaching: config_1.ConfigInternals.getWebpackCaching(),
89
+ webpackOverride: (_c = config_1.ConfigInternals.getWebpackOverrideFn()) !== null && _c !== void 0 ? _c : ((f) => f),
91
90
  },
92
91
  region: (0, get_aws_region_1.getAwsRegion)(),
93
92
  });
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stillCommand = exports.STILL_COMMAND = void 0;
4
4
  const cli_1 = require("@remotion/cli");
5
+ const config_1 = require("@remotion/cli/config");
5
6
  const renderer_1 = require("@remotion/renderer");
6
7
  const download_media_1 = require("../../api/download-media");
7
8
  const render_still_on_lambda_1 = require("../../api/render-still-on-lambda");
@@ -36,7 +37,7 @@ const stillCommand = async (args, remotionRoot) => {
36
37
  }
37
38
  const downloadName = (_a = args[2]) !== null && _a !== void 0 ? _a : null;
38
39
  const outName = args_1.parsedLambdaCli['out-name'];
39
- const { chromiumOptions, envVariables, inputProps, logLevel, puppeteerTimeout, quality, stillFrame, scale, height, width, } = await cli_1.CliInternals.getCliOptions({
40
+ const { chromiumOptions, envVariables, inputProps, logLevel, puppeteerTimeout, jpegQuality, stillFrame, scale, height, width, } = await cli_1.CliInternals.getCliOptions({
40
41
  type: 'still',
41
42
  isLambda: true,
42
43
  remotionRoot,
@@ -46,12 +47,13 @@ const stillCommand = async (args, remotionRoot) => {
46
47
  (0, validate_retries_1.validateMaxRetries)(maxRetries);
47
48
  const privacy = (_c = args_1.parsedLambdaCli.privacy) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_OUTPUT_PRIVACY;
48
49
  (0, validate_privacy_1.validatePrivacy)(privacy);
49
- const { format: imageFormat, source: imageFormatReason } = cli_1.CliInternals.determineFinalImageFormat({
50
+ const { format: imageFormat, source: imageFormatReason } = cli_1.CliInternals.determineFinalStillImageFormat({
50
51
  downloadName,
51
52
  outName: outName !== null && outName !== void 0 ? outName : null,
52
- configImageFormat: (_d = cli_1.ConfigInternals.getUserPreferredImageFormat()) !== null && _d !== void 0 ? _d : null,
53
- cliFlag: (_e = cli_1.CliInternals.parsedCli['image-format']) !== null && _e !== void 0 ? _e : null,
53
+ cliFlag: (_d = cli_1.CliInternals.parsedCli['image-format']) !== null && _d !== void 0 ? _d : null,
54
54
  isLambda: true,
55
+ fromUi: null,
56
+ configImageFormat: (_e = config_1.ConfigInternals.getUserPreferredStillImageFormat()) !== null && _e !== void 0 ? _e : null,
55
57
  });
56
58
  try {
57
59
  log_1.Log.info(cli_1.CliInternals.chalk.gray(`functionName = ${functionName}, imageFormat = ${imageFormat} (${imageFormatReason})`));
@@ -66,7 +68,7 @@ const stillCommand = async (args, remotionRoot) => {
66
68
  maxRetries,
67
69
  envVariables,
68
70
  frame: stillFrame,
69
- quality,
71
+ jpegQuality,
70
72
  logLevel,
71
73
  outName,
72
74
  chromiumOptions,
@@ -4,10 +4,9 @@ export declare type BundleProgress = {
4
4
  };
5
5
  export declare const makeBundleProgress: ({ progress, doneIn }: BundleProgress) => string;
6
6
  export declare type BucketCreationProgress = {
7
- bucketCreated: boolean;
8
7
  doneIn: number | null;
9
8
  };
10
- export declare const makeBucketProgress: ({ bucketCreated, doneIn, }: BucketCreationProgress) => string;
9
+ export declare const makeBucketProgress: ({ doneIn }: BucketCreationProgress) => string;
11
10
  declare type UploadStats = {
12
11
  addedFiles: number;
13
12
  removedFiles: number;
@@ -14,17 +14,13 @@ const makeBundleProgress = ({ progress, doneIn }) => {
14
14
  ].join(' ');
15
15
  };
16
16
  exports.makeBundleProgress = makeBundleProgress;
17
- const makeBucketProgress = ({ bucketCreated, doneIn, }) => {
18
- const states = [bucketCreated];
19
- const statesFinished = states.filter(Boolean).map((p) => p).length;
20
- const progress = statesFinished / states.length;
17
+ const makeBucketProgress = ({ doneIn }) => {
18
+ const progress = doneIn === null ? 0 : 1;
21
19
  return [
22
20
  `(2/3)`,
23
21
  cli_1.CliInternals.makeProgressBar(progress),
24
22
  `${doneIn === null ? 'Creating' : 'Created'} bucket`,
25
- doneIn === null
26
- ? `${statesFinished} / ${states.length}`
27
- : cli_1.CliInternals.chalk.gray(`${doneIn}ms`),
23
+ doneIn === null ? `0/1` : cli_1.CliInternals.chalk.gray(`${doneIn}ms`),
28
24
  ].join(' ');
29
25
  };
30
26
  exports.makeBucketProgress = makeBucketProgress;
package/dist/cli/log.d.ts CHANGED
@@ -1,6 +1,18 @@
1
1
  export declare const Log: {
2
2
  verbose: (message?: any, ...optionalParams: any[]) => void;
3
+ verboseAdvanced: (options: {
4
+ indent: boolean;
5
+ logLevel: "error" | "verbose" | "info" | "warn";
6
+ }, message?: any, ...optionalParams: any[]) => void;
3
7
  info: (message?: any, ...optionalParams: any[]) => void;
8
+ infoAdvanced: (options: {
9
+ indent: boolean;
10
+ logLevel: "error" | "verbose" | "info" | "warn";
11
+ }, message?: any, ...optionalParams: any[]) => void;
4
12
  warn: (message?: any, ...optionalParams: any[]) => void;
13
+ warnAdvanced: (options: {
14
+ indent: boolean;
15
+ logLevel: "error" | "verbose" | "info" | "warn";
16
+ }, message?: any, ...optionalParams: any[]) => void;
5
17
  error: (message?: any, ...optionalParams: any[]) => void;
6
18
  };
@@ -3,5 +3,8 @@ export declare const planFrameRanges: ({ framesPerLambda, frameRange, everyNthFr
3
3
  frameRange: [number, number];
4
4
  everyNthFrame: number;
5
5
  }) => {
6
- chunks: [number, number][];
6
+ chunks: [
7
+ number,
8
+ number
9
+ ][];
7
10
  };
@@ -3,6 +3,6 @@ declare type Options = {
3
3
  expectedBucketOwner: string;
4
4
  };
5
5
  export declare const compositionsHandler: (lambdaParams: LambdaPayload, options: Options) => Promise<{
6
- compositions: import("remotion").TCompMetadata[];
6
+ compositions: import("remotion").AnyCompMetadata[];
7
7
  }>;
8
8
  export {};
@@ -43,8 +43,6 @@ const compositionsHandler = async (lambdaParams, options) => {
43
43
  puppeteerInstance: browserInstance,
44
44
  inputProps,
45
45
  envVariables: lambdaParams.envVariables,
46
- ffmpegExecutable: null,
47
- ffprobeExecutable: null,
48
46
  timeoutInMilliseconds: lambdaParams.timeoutInMilliseconds,
49
47
  chromiumOptions: lambdaParams.chromiumOptions,
50
48
  port: null,
@@ -1,13 +1,11 @@
1
1
  import type { _Object } from '@aws-sdk/client-s3';
2
2
  import type { RenderMetadata } from '../../shared/constants';
3
- import type { LambdaArchitecture } from '../../shared/validate-architecture';
4
3
  import type { OutputFileMetadata } from './find-output-file-in-bucket';
5
- export declare const estimatePriceFromBucket: ({ contents, renderMetadata, memorySizeInMb, outputFileMetadata, architecture, diskSizeInMb, lambdasInvoked, }: {
4
+ export declare const estimatePriceFromBucket: ({ contents, renderMetadata, memorySizeInMb, outputFileMetadata, diskSizeInMb, lambdasInvoked, }: {
6
5
  contents: _Object[];
7
6
  renderMetadata: RenderMetadata | null;
8
7
  memorySizeInMb: number;
9
8
  outputFileMetadata: OutputFileMetadata | null;
10
- architecture: LambdaArchitecture;
11
9
  diskSizeInMb: number;
12
10
  lambdasInvoked: number;
13
11
  }) => number | null;
@@ -7,7 +7,7 @@ const parse_lambda_timings_key_1 = require("../../shared/parse-lambda-timings-ke
7
7
  const calculate_chunk_times_1 = require("./calculate-chunk-times");
8
8
  const get_current_region_1 = require("./get-current-region");
9
9
  const get_time_to_finish_1 = require("./get-time-to-finish");
10
- const estimatePriceFromBucket = ({ contents, renderMetadata, memorySizeInMb, outputFileMetadata, architecture, diskSizeInMb, lambdasInvoked, }) => {
10
+ const estimatePriceFromBucket = ({ contents, renderMetadata, memorySizeInMb, outputFileMetadata, diskSizeInMb, lambdasInvoked, }) => {
11
11
  var _a, _b, _c;
12
12
  if (!renderMetadata) {
13
13
  return null;
@@ -35,7 +35,6 @@ const estimatePriceFromBucket = ({ contents, renderMetadata, memorySizeInMb, out
35
35
  type: 'combined-time-for-cost-calculation',
36
36
  }) + timeElapsedOfUnfinished,
37
37
  memorySizeInMb,
38
- architecture,
39
38
  diskSizeInMb,
40
39
  lambdasInvoked,
41
40
  }).toPrecision(5));
@@ -1,4 +1,4 @@
1
- import type { AudioCodec, FfmpegExecutable } from '@remotion/renderer';
1
+ import type { AudioCodec } from '@remotion/renderer';
2
2
  import type { AwsRegion } from '../../pricing/aws-regions';
3
3
  import type { LambdaCodec } from '../../shared/validate-lambda-codec';
4
4
  import type { EnhancedErrorInfo } from './write-lambda-error';
@@ -11,14 +11,12 @@ export declare const getAllFilesS3: ({ bucket, expectedFiles, outdir, renderId,
11
11
  expectedBucketOwner: string;
12
12
  onErrors: (errors: EnhancedErrorInfo[]) => Promise<void>;
13
13
  }) => Promise<string[]>;
14
- export declare const concatVideosS3: ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, ffmpegExecutable, remotionRoot, files, outdir, audioCodec, }: {
14
+ export declare const concatVideosS3: ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, files, outdir, audioCodec, }: {
15
15
  onProgress: (frames: number) => void;
16
16
  numberOfFrames: number;
17
17
  codec: LambdaCodec;
18
18
  fps: number;
19
19
  numberOfGifLoops: number | null;
20
- ffmpegExecutable: FfmpegExecutable;
21
- remotionRoot: string;
22
20
  files: string[];
23
21
  outdir: string;
24
22
  audioCodec: AudioCodec | null;
@@ -128,8 +128,7 @@ const getAllFilesS3 = ({ bucket, expectedFiles, outdir, renderId, region, expect
128
128
  });
129
129
  };
130
130
  exports.getAllFilesS3 = getAllFilesS3;
131
- const concatVideosS3 = async ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, ffmpegExecutable, remotionRoot, files, outdir, audioCodec, }) => {
132
- var _a;
131
+ const concatVideosS3 = async ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, files, outdir, audioCodec, }) => {
133
132
  const outfile = (0, path_1.join)(renderer_1.RenderInternals.tmpDir(constants_1.REMOTION_CONCATED_TOKEN), 'concat.' + renderer_1.RenderInternals.getFileExtensionFromCodec(codec, audioCodec));
134
133
  const combine = (0, timer_1.timer)('Combine videos');
135
134
  const filelistDir = renderer_1.RenderInternals.tmpDir(constants_1.REMOTION_FILELIST_TOKEN);
@@ -142,12 +141,10 @@ const concatVideosS3 = async ({ onProgress, numberOfFrames, codec, fps, numberOf
142
141
  codec,
143
142
  fps,
144
143
  numberOfGifLoops,
145
- ffmpegExecutable,
146
- remotionRoot,
147
144
  audioCodec,
148
145
  });
149
146
  combine.end();
150
- const cleanupChunksProm = ((_a = fs_1.default.promises.rm) !== null && _a !== void 0 ? _a : fs_1.default.promises.rmdir)(outdir, {
147
+ const cleanupChunksProm = fs_1.default.promises.rm(outdir, {
151
148
  recursive: true,
152
149
  });
153
150
  return { outfile, cleanupChunksProm };
@@ -6,7 +6,6 @@ const constants_1 = require("../../shared/constants");
6
6
  const get_most_expensive_chunks_1 = require("../../shared/get-most-expensive-chunks");
7
7
  const parse_lambda_timings_key_1 = require("../../shared/parse-lambda-timings-key");
8
8
  const calculate_chunk_times_1 = require("./calculate-chunk-times");
9
- const get_current_architecture_1 = require("./get-current-architecture");
10
9
  const get_files_to_delete_1 = require("./get-files-to-delete");
11
10
  const get_retry_stats_1 = require("./get-retry-stats");
12
11
  const get_time_to_finish_1 = require("./get-time-to-finish");
@@ -20,7 +19,6 @@ const createPostRenderData = ({ renderId, region, memorySizeInMb, renderMetadata
20
19
  durationInMiliseconds: times,
21
20
  memorySizeInMb,
22
21
  region,
23
- architecture: (0, get_current_architecture_1.getCurrentArchitecture)(),
24
22
  lambdasInvoked: renderMetadata.estimatedTotalLambdaInvokations,
25
23
  // We cannot determine the ephemeral storage size, so we
26
24
  // overestimate the price, but will only have a miniscule effect (~0.2%)
@@ -2,12 +2,17 @@
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.executablePath = void 0;
5
- if (/^AWS_Lambda_nodejs(?:10|12|14|16|18)[.]x$/.test((_a = process.env.AWS_EXECUTION_ENV) !== null && _a !== void 0 ? _a : '') === true) {
5
+ if (/^AWS_Lambda_nodejs(?:18)[.]x$/.test((_a = process.env.AWS_EXECUTION_ENV) !== null && _a !== void 0 ? _a : '') ===
6
+ true) {
6
7
  if (process.env.FONTCONFIG_PATH === undefined) {
7
8
  process.env.FONTCONFIG_PATH = '/opt';
8
9
  process.env.FONTCONFIG_FILE = '/opt/fonts.conf';
9
10
  }
10
11
  process.env.LD_LIBRARY_PATH = '/opt/lib:/opt/bin';
12
+ process.env.FFMPEG_BIN_PATH = '/opt/ffmpeg/remotion/bin/ffmpeg';
13
+ process.env.FFPROBE_BIN_PATH = '/opt/ffmpeg/remotion/bin/ffprobe';
14
+ process.env.FFMPEG_CWD = '/opt/ffmpeg';
15
+ process.env.COMPOSITOR_PATH = './compositor';
11
16
  }
12
17
  const executablePath = () => {
13
18
  return '/opt/bin/chromium';
@@ -12,7 +12,6 @@ const expected_out_name_1 = require("./expected-out-name");
12
12
  const find_output_file_in_bucket_1 = require("./find-output-file-in-bucket");
13
13
  const format_costs_info_1 = require("./format-costs-info");
14
14
  const get_cleanup_progress_1 = require("./get-cleanup-progress");
15
- const get_current_architecture_1 = require("./get-current-architecture");
16
15
  const get_current_region_1 = require("./get-current-region");
17
16
  const get_encoding_metadata_1 = require("./get-encoding-metadata");
18
17
  const get_final_encoding_status_1 = require("./get-final-encoding-status");
@@ -116,7 +115,6 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
116
115
  renderMetadata,
117
116
  memorySizeInMb,
118
117
  outputFileMetadata: outputFile,
119
- architecture: (0, get_current_architecture_1.getCurrentArchitecture)(),
120
118
  lambdasInvoked: (_b = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.estimatedRenderLambdaInvokations) !== null && _b !== void 0 ? _b : 0,
121
119
  // We cannot determine the ephemeral storage size, so we
122
120
  // overestimate the price, but will only have a miniscule effect (~0.2%)
@@ -11,6 +11,6 @@ const isErrInsufficientResourcesErr = (err) => {
11
11
  };
12
12
  exports.isErrInsufficientResourcesErr = isErrInsufficientResourcesErr;
13
13
  const isBrowserCrashedError = (err) => {
14
- return err.includes('Target closed.');
14
+ return err.includes('Target closed.') || err.includes('Session closed');
15
15
  };
16
16
  exports.isBrowserCrashedError = isBrowserCrashedError;
@@ -1,5 +1,5 @@
1
- import type { ChromiumOptions, DownloadMap, FfmpegExecutable, openBrowser } from '@remotion/renderer';
2
- import type { TCompMetadata } from 'remotion';
1
+ import type { ChromiumOptions, DownloadMap, openBrowser } from '@remotion/renderer';
2
+ import type { AnyCompMetadata } from 'remotion';
3
3
  import type { Await } from '../../shared/await';
4
4
  declare type ValidateCompositionOptions = {
5
5
  serveUrl: string;
@@ -7,8 +7,6 @@ declare type ValidateCompositionOptions = {
7
7
  browserInstance: Await<ReturnType<typeof openBrowser>>;
8
8
  inputProps: unknown;
9
9
  envVariables: Record<string, string> | undefined;
10
- ffmpegExecutable: FfmpegExecutable;
11
- ffprobeExecutable: FfmpegExecutable;
12
10
  timeoutInMilliseconds: number;
13
11
  chromiumOptions: ChromiumOptions;
14
12
  port: number | null;
@@ -16,5 +14,5 @@ declare type ValidateCompositionOptions = {
16
14
  forceHeight: number | null;
17
15
  forceWidth: number | null;
18
16
  };
19
- export declare const validateComposition: ({ serveUrl, composition, browserInstance, inputProps, envVariables, timeoutInMilliseconds, ffmpegExecutable, ffprobeExecutable, chromiumOptions, port, downloadMap, forceHeight, forceWidth, }: ValidateCompositionOptions) => Promise<TCompMetadata>;
17
+ export declare const validateComposition: ({ serveUrl, composition, browserInstance, inputProps, envVariables, timeoutInMilliseconds, chromiumOptions, port, downloadMap, forceHeight, forceWidth, }: ValidateCompositionOptions) => Promise<AnyCompMetadata>;
20
18
  export {};