@remotion/lambda 3.2.27 → 3.2.29

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.
@@ -36,10 +36,16 @@ const renderCommand = async (args) => {
36
36
  log_1.Log.info(`${constants_1.BINARY_NAME} ${exports.RENDER_COMMAND} <serve-url> <composition-id> [output-location]`);
37
37
  (0, quit_1.quit)(1);
38
38
  }
39
- const outName = (_a = args[2]) !== null && _a !== void 0 ? _a : null;
40
- const { chromiumOptions, codec, crf, envVariables, frameRange, imageFormat, inputProps, logLevel, pixelFormat, proResProfile, puppeteerTimeout, quality, scale, everyNthFrame, numberOfGifLoops, muted, overwrite, } = await cli_1.CliInternals.getCliOptions({
39
+ const outName = args_1.parsedLambdaCli['out-name'];
40
+ const downloadName = (_a = args[2]) !== null && _a !== void 0 ? _a : null;
41
+ const { codec, reason } = cli_1.CliInternals.getFinalCodec({
42
+ downloadName,
43
+ outName: outName !== null && outName !== void 0 ? outName : null,
44
+ });
45
+ const { chromiumOptions, crf, envVariables, frameRange, imageFormat, inputProps, logLevel, pixelFormat, proResProfile, puppeteerTimeout, quality, scale, everyNthFrame, numberOfGifLoops, muted, overwrite, } = await cli_1.CliInternals.getCliOptions({
41
46
  type: 'series',
42
47
  isLambda: true,
48
+ codec,
43
49
  });
44
50
  const functionName = await (0, find_function_name_1.findFunctionName)();
45
51
  const region = (0, get_aws_region_1.getAwsRegion)();
@@ -77,9 +83,10 @@ const renderCommand = async (args) => {
77
83
  muted,
78
84
  overwrite,
79
85
  });
80
- const totalSteps = outName ? 5 : 4;
86
+ const totalSteps = downloadName ? 5 : 4;
81
87
  const progressBar = cli_1.CliInternals.createOverwriteableCliOutput(cli_1.CliInternals.quietFlagProvided());
82
- log_1.Log.info(cli_1.CliInternals.chalk.gray(`Bucket = ${res.bucketName}, renderId = ${res.renderId}, functionName = ${functionName}`));
88
+ log_1.Log.info(cli_1.CliInternals.chalk.gray(`bucket = ${res.bucketName}, function = ${functionName}`));
89
+ log_1.Log.info(cli_1.CliInternals.chalk.gray(`renderId = ${res.renderId}, codec = ${codec} (${reason})`));
83
90
  log_1.Log.verbose(`CloudWatch logs (if enabled): ${res.cloudWatchLogs}`);
84
91
  const status = await (0, get_render_progress_1.getRenderProgress)({
85
92
  functionName,
@@ -117,11 +124,11 @@ const renderCommand = async (args) => {
117
124
  downloadInfo: null,
118
125
  retriesInfo: newStatus.retriesInfo,
119
126
  }));
120
- if (outName) {
127
+ if (downloadName) {
121
128
  const downloadStart = Date.now();
122
129
  const { outputPath, sizeInBytes } = await (0, download_media_1.downloadMedia)({
123
130
  bucketName: res.bucketName,
124
- outPath: outName,
131
+ outPath: downloadName,
125
132
  region: (0, get_aws_region_1.getAwsRegion)(),
126
133
  renderId: res.renderId,
127
134
  onProgress: ({ downloaded, totalSize }) => {
@@ -15,7 +15,7 @@ const quit_1 = require("../helpers/quit");
15
15
  const log_1 = require("../log");
16
16
  exports.STILL_COMMAND = 'still';
17
17
  const stillCommand = async (args) => {
18
- var _a, _b, _c, _d;
18
+ var _a, _b, _c, _d, _e, _f;
19
19
  const serveUrl = args[0];
20
20
  if (!serveUrl) {
21
21
  log_1.Log.error('No serve URL passed.');
@@ -32,22 +32,32 @@ const stillCommand = async (args) => {
32
32
  log_1.Log.info(`${constants_1.BINARY_NAME} ${exports.STILL_COMMAND} <serve-url> <composition-id> [output-location]`);
33
33
  (0, quit_1.quit)(1);
34
34
  }
35
- const outName = (_a = args[2]) !== null && _a !== void 0 ? _a : null;
36
- const { chromiumOptions, envVariables, imageFormat, inputProps, logLevel, puppeteerTimeout, quality, stillFrame, scale, } = await cli_1.CliInternals.getCliOptions({
35
+ const downloadName = (_a = args[2]) !== null && _a !== void 0 ? _a : null;
36
+ const outName = args_1.parsedLambdaCli['out-name'];
37
+ const { chromiumOptions, envVariables, inputProps, logLevel, puppeteerTimeout, quality, stillFrame, scale, } = await cli_1.CliInternals.getCliOptions({
37
38
  type: 'still',
38
39
  isLambda: true,
40
+ codec: 'h264',
39
41
  });
40
42
  const functionName = await (0, find_function_name_1.findFunctionName)();
41
43
  const maxRetries = (_b = args_1.parsedLambdaCli['max-retries']) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_MAX_RETRIES;
42
44
  (0, validate_retries_1.validateMaxRetries)(maxRetries);
43
45
  const privacy = (_c = args_1.parsedLambdaCli.privacy) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_OUTPUT_PRIVACY;
44
46
  (0, validate_privacy_1.validatePrivacy)(privacy);
47
+ const { format: imageFormat, source: imageFormatReason } = cli_1.CliInternals.determineFinalImageFormat({
48
+ downloadName,
49
+ outName: outName !== null && outName !== void 0 ? outName : null,
50
+ configImageFormat: (_d = cli_1.ConfigInternals.getUserPreferredImageFormat()) !== null && _d !== void 0 ? _d : null,
51
+ cliFlag: (_e = cli_1.CliInternals.parsedCli['image-format']) !== null && _e !== void 0 ? _e : null,
52
+ isLambda: true,
53
+ });
45
54
  try {
55
+ log_1.Log.info(cli_1.CliInternals.chalk.gray(`functionName = ${functionName}, imageFormat = ${imageFormat} (${imageFormatReason})`));
46
56
  const res = await (0, render_still_on_lambda_1.renderStillOnLambda)({
47
57
  functionName,
48
58
  serveUrl,
49
59
  inputProps,
50
- imageFormat: imageFormat,
60
+ imageFormat,
51
61
  composition,
52
62
  privacy,
53
63
  region: (0, get_aws_region_1.getAwsRegion)(),
@@ -56,18 +66,18 @@ const stillCommand = async (args) => {
56
66
  frame: stillFrame,
57
67
  quality,
58
68
  logLevel,
59
- outName: args_1.parsedLambdaCli['out-name'],
69
+ outName,
60
70
  chromiumOptions,
61
71
  timeoutInMilliseconds: puppeteerTimeout,
62
72
  scale,
63
73
  });
64
- log_1.Log.verbose(cli_1.CliInternals.chalk.gray(`Bucket = ${res.bucketName}, renderId = ${res.renderId}, functionName = ${functionName}`));
74
+ log_1.Log.info(cli_1.CliInternals.chalk.gray(`Bucket = ${res.bucketName}, renderId = ${res.renderId}`));
65
75
  log_1.Log.verbose(`CloudWatch logs (if enabled): ${res.cloudWatchLogs}`);
66
- if (outName) {
76
+ if (downloadName) {
67
77
  log_1.Log.info('Finished rendering. Downloading...');
68
78
  const { outputPath, sizeInBytes } = await (0, download_media_1.downloadMedia)({
69
79
  bucketName: res.bucketName,
70
- outPath: outName,
80
+ outPath: downloadName,
71
81
  region: (0, get_aws_region_1.getAwsRegion)(),
72
82
  renderId: res.renderId,
73
83
  });
@@ -80,7 +90,7 @@ const stillCommand = async (args) => {
80
90
  }
81
91
  }
82
92
  catch (err) {
83
- const frames = renderer_1.RenderInternals.parseStack(((_d = err.stack) !== null && _d !== void 0 ? _d : '').split('\n'));
93
+ const frames = renderer_1.RenderInternals.parseStack(((_f = err.stack) !== null && _f !== void 0 ? _f : '').split('\n'));
84
94
  const errorWithStackFrame = new renderer_1.RenderInternals.SymbolicateableError({
85
95
  message: err.message,
86
96
  frame: null,
@@ -6,6 +6,9 @@ export declare const planFrameRanges: ({ framesPerLambda, optimization, shouldUs
6
6
  frameRange: [number, number];
7
7
  everyNthFrame: number;
8
8
  }) => {
9
- chunks: [number, number][];
9
+ chunks: [
10
+ number,
11
+ number
12
+ ][];
10
13
  didUseOptimization: boolean;
11
14
  };
@@ -108,7 +108,7 @@ const innerLaunchHandler = async (params, options) => {
108
108
  if (chunkCount > constants_1.MAX_FUNCTIONS_PER_RENDER) {
109
109
  throw new Error(`Too many functions: This render would cause ${chunkCount} functions to spawn. We limit this amount to ${constants_1.MAX_FUNCTIONS_PER_RENDER} functions as more would result in diminishing returns. Values set: frameCount = ${frameCount}, framesPerLambda=${framesPerLambda}. See ${docs_url_1.DOCS_URL}/docs/lambda/concurrency for how this parameter is calculated.`);
110
110
  }
111
- (0, validate_outname_1.validateOutname)(params.outName);
111
+ (0, validate_outname_1.validateOutname)(params.outName, params.codec);
112
112
  (0, validate_privacy_1.validatePrivacy)(params.privacy);
113
113
  renderer_1.RenderInternals.validatePuppeteerTimeout(params.timeoutInMilliseconds);
114
114
  const { chunks, didUseOptimization } = (0, plan_frame_ranges_1.planFrameRanges)({
@@ -1,2 +1,3 @@
1
+ import type { Codec } from '@remotion/renderer';
1
2
  import type { OutNameInputWithoutCredentials } from './constants';
2
- export declare const validateOutname: (outName: OutNameInputWithoutCredentials | undefined | null) => void;
3
+ export declare const validateOutname: (outName: OutNameInputWithoutCredentials | undefined | null, codec?: Codec) => void;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateOutname = void 0;
4
+ const renderer_1 = require("@remotion/renderer");
4
5
  const validate_bucketname_1 = require("./validate-bucketname");
5
6
  const validateS3Key = (s3Key) => {
6
7
  if (typeof s3Key !== 'string') {
@@ -12,11 +13,14 @@ const validateS3Key = (s3Key) => {
12
13
  '. Check for invalid characters.');
13
14
  }
14
15
  };
15
- const validateOutname = (outName) => {
16
+ const validateOutname = (outName, codec) => {
16
17
  if (typeof outName === 'undefined' || outName === null) {
17
18
  return;
18
19
  }
19
20
  if (typeof outName === 'string') {
21
+ if (codec) {
22
+ (0, renderer_1.validateOutputFilename)(codec, renderer_1.RenderInternals.getExtensionOfFilename(outName !== null && outName !== void 0 ? outName : null));
23
+ }
20
24
  validateS3Key(outName);
21
25
  return;
22
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "3.2.27",
3
+ "version": "3.2.29",
4
4
  "description": "Distributed renderer for Remotion based on AWS Lambda",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "module": "true",
11
11
  "scripts": {
12
- "testintegration": "jest src/test/integration --runInBand",
12
+ "testintegration": "jest src/test/integration --runInBand --forceExit",
13
13
  "lint": "eslint src --ext ts,tsx",
14
14
  "test": "jest src/test/unit",
15
15
  "watch": "tsc -w",
@@ -32,12 +32,12 @@
32
32
  "@aws-sdk/client-service-quotas": "3.58.0",
33
33
  "@aws-sdk/lib-storage": "3.58.0",
34
34
  "@aws-sdk/s3-request-presigner": "3.58.0",
35
- "@remotion/bundler": "3.2.27",
36
- "@remotion/cli": "3.2.27",
37
- "@remotion/renderer": "3.2.27",
35
+ "@remotion/bundler": "3.2.29",
36
+ "@remotion/cli": "3.2.29",
37
+ "@remotion/renderer": "3.2.29",
38
38
  "aws-policies": "^1.0.1",
39
39
  "mime-types": "2.1.34",
40
- "remotion": "3.2.27"
40
+ "remotion": "3.2.29"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "react": ">=16.8.0",
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "662c69bcb2fee4d51553b2f8e61635fb4d6688b1"
65
+ "gitHead": "9a2ff4d68324af8d1fe55ebdf94bdadccf446a10"
66
66
  }
Binary file