@remotion/lambda 3.2.43-retry.19 → 3.3.0

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.
@@ -44,6 +44,7 @@ export declare type RenderMediaOnLambdaOutput = {
44
44
  renderId: string;
45
45
  bucketName: string;
46
46
  cloudWatchLogs: string;
47
+ folderInS3Console: string;
47
48
  };
48
49
  /**
49
50
  * @description Triggers a render on a lambda given a composition and a lambda function.
@@ -5,7 +5,7 @@ const version_1 = require("remotion/version");
5
5
  const call_lambda_1 = require("../shared/call-lambda");
6
6
  const constants_1 = require("../shared/constants");
7
7
  const convert_to_serve_url_1 = require("../shared/convert-to-serve-url");
8
- const get_cloudwatch_stream_url_1 = require("../shared/get-cloudwatch-stream-url");
8
+ const get_aws_urls_1 = require("../shared/get-aws-urls");
9
9
  const serialize_input_props_1 = require("../shared/serialize-input-props");
10
10
  const validate_download_behavior_1 = require("../shared/validate-download-behavior");
11
11
  const validate_frames_per_lambda_1 = require("../shared/validate-frames-per-lambda");
@@ -89,12 +89,17 @@ const renderMediaOnLambda = async ({ functionName, serveUrl, inputProps, codec,
89
89
  return {
90
90
  renderId: res.renderId,
91
91
  bucketName: res.bucketName,
92
- cloudWatchLogs: (0, get_cloudwatch_stream_url_1.getCloudwatchStreamUrl)({
92
+ cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchStreamUrl)({
93
93
  functionName,
94
94
  method: constants_1.LambdaRoutines.renderer,
95
95
  region,
96
96
  renderId: res.renderId,
97
97
  }),
98
+ folderInS3Console: (0, get_aws_urls_1.getS3RenderUrl)({
99
+ bucketName: res.bucketName,
100
+ renderId: res.renderId,
101
+ region,
102
+ }),
98
103
  };
99
104
  }
100
105
  catch (err) {
@@ -5,7 +5,7 @@ const version_1 = require("remotion/version");
5
5
  const call_lambda_1 = require("../shared/call-lambda");
6
6
  const constants_1 = require("../shared/constants");
7
7
  const convert_to_serve_url_1 = require("../shared/convert-to-serve-url");
8
- const get_cloudwatch_stream_url_1 = require("../shared/get-cloudwatch-stream-url");
8
+ const get_aws_urls_1 = require("../shared/get-aws-urls");
9
9
  const serialize_input_props_1 = require("../shared/serialize-input-props");
10
10
  /**
11
11
  * @description Renders a still frame on Lambda
@@ -64,7 +64,7 @@ const renderStillOnLambda = async ({ functionName, serveUrl, inputProps, imageFo
64
64
  sizeInBytes: res.size,
65
65
  bucketName: res.bucketName,
66
66
  renderId: res.renderId,
67
- cloudWatchLogs: (0, get_cloudwatch_stream_url_1.getCloudwatchStreamUrl)({
67
+ cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchStreamUrl)({
68
68
  functionName,
69
69
  method: constants_1.LambdaRoutines.still,
70
70
  region,
@@ -22,10 +22,11 @@ declare type DownloadedInfo = {
22
22
  downloaded: number;
23
23
  doneIn: number | null;
24
24
  };
25
- export declare const makeProgressString: ({ progress, steps, downloadInfo, retriesInfo, }: {
25
+ export declare const makeProgressString: ({ progress, steps, downloadInfo, retriesInfo, verbose, }: {
26
26
  progress: MultiRenderProgress;
27
27
  steps: number;
28
28
  downloadInfo: DownloadedInfo | null;
29
29
  retriesInfo: ChunkRetry[];
30
+ verbose: boolean;
30
31
  }) => string;
31
32
  export {};
@@ -57,10 +57,17 @@ const makeEncodingProgress = ({ encodingProgress, chunkProgress, totalSteps, })
57
57
  : cli_1.CliInternals.chalk.gray(`${doneIn}ms`),
58
58
  ].join(' ');
59
59
  };
60
- const makeCleanupProgress = (cleanupInfo, totalSteps) => {
60
+ const makeCleanupProgress = (cleanupInfo, totalSteps, skipped) => {
61
61
  if (!cleanupInfo) {
62
62
  return '';
63
63
  }
64
+ if (skipped) {
65
+ return [
66
+ '🪣 ',
67
+ `(4/${totalSteps})`,
68
+ cli_1.CliInternals.chalk.blueBright(`Not cleaning up because --log=verbose was set`),
69
+ ].join(' ');
70
+ }
64
71
  const { doneIn, filesDeleted, minFilesToDelete } = cleanupInfo;
65
72
  const progress = filesDeleted / minFilesToDelete;
66
73
  return [
@@ -116,7 +123,7 @@ const makeMultiProgressFromStatus = (status) => {
116
123
  };
117
124
  };
118
125
  exports.makeMultiProgressFromStatus = makeMultiProgressFromStatus;
119
- const makeProgressString = ({ progress, steps, downloadInfo, retriesInfo, }) => {
126
+ const makeProgressString = ({ progress, steps, downloadInfo, retriesInfo, verbose, }) => {
120
127
  return [
121
128
  makeInvokeProgress(progress.lambdaInvokeProgress, steps, retriesInfo),
122
129
  makeChunkProgress({
@@ -129,7 +136,7 @@ const makeProgressString = ({ progress, steps, downloadInfo, retriesInfo, }) =>
129
136
  chunkProgress: progress.chunkProgress,
130
137
  totalSteps: steps,
131
138
  }),
132
- makeCleanupProgress(progress.cleanupInfo, steps),
139
+ makeCleanupProgress(progress.cleanupInfo, steps, verbose),
133
140
  downloadInfo ? makeDownloadProgress(downloadInfo, steps) : null,
134
141
  ]
135
142
  .filter(remotion_1.Internals.truthy)
@@ -1,2 +1,2 @@
1
1
  export declare const RENDER_COMMAND = "render";
2
- export declare const renderCommand: (args: string[]) => Promise<never>;
2
+ export declare const renderCommand: (args: string[], remotionRoot: string) => Promise<never>;
@@ -20,7 +20,7 @@ const quit_1 = require("../../helpers/quit");
20
20
  const log_1 = require("../../log");
21
21
  const progress_1 = require("./progress");
22
22
  exports.RENDER_COMMAND = 'render';
23
- const renderCommand = async (args) => {
23
+ const renderCommand = async (args, remotionRoot) => {
24
24
  var _a, _b, _c, _d, _e;
25
25
  const serveUrl = args[0];
26
26
  if (!serveUrl) {
@@ -49,6 +49,7 @@ const renderCommand = async (args) => {
49
49
  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({
50
50
  type: 'series',
51
51
  isLambda: true,
52
+ remotionRoot,
52
53
  });
53
54
  const imageFormat = cli_1.CliInternals.getImageFormat(codec);
54
55
  const functionName = await (0, find_function_name_1.findFunctionName)();
@@ -100,7 +101,9 @@ const renderCommand = async (args) => {
100
101
  const progressBar = cli_1.CliInternals.createOverwriteableCliOutput(cli_1.CliInternals.quietFlagProvided());
101
102
  log_1.Log.info(cli_1.CliInternals.chalk.gray(`bucket = ${res.bucketName}, function = ${functionName}`));
102
103
  log_1.Log.info(cli_1.CliInternals.chalk.gray(`renderId = ${res.renderId}, codec = ${codec} (${reason})`));
104
+ const verbose = renderer_1.RenderInternals.isEqualOrBelowLogLevel(cli_1.ConfigInternals.Logging.getLogLevel(), 'verbose');
103
105
  log_1.Log.verbose(`CloudWatch logs (if enabled): ${res.cloudWatchLogs}`);
106
+ log_1.Log.verbose(`Render folder: ${res.folderInS3Console}`);
104
107
  const status = await (0, get_render_progress_1.getRenderProgress)({
105
108
  functionName,
106
109
  bucketName: res.bucketName,
@@ -113,6 +116,7 @@ const renderCommand = async (args) => {
113
116
  steps: totalSteps,
114
117
  downloadInfo: null,
115
118
  retriesInfo: status.retriesInfo,
119
+ verbose,
116
120
  }));
117
121
  // eslint-disable-next-line no-constant-condition
118
122
  while (true) {
@@ -129,6 +133,7 @@ const renderCommand = async (args) => {
129
133
  steps: totalSteps,
130
134
  retriesInfo: newStatus.retriesInfo,
131
135
  downloadInfo: null,
136
+ verbose,
132
137
  }));
133
138
  if (newStatus.done) {
134
139
  progressBar.update((0, progress_1.makeProgressString)({
@@ -136,6 +141,7 @@ const renderCommand = async (args) => {
136
141
  steps: totalSteps,
137
142
  downloadInfo: null,
138
143
  retriesInfo: newStatus.retriesInfo,
144
+ verbose,
139
145
  }));
140
146
  if (downloadName) {
141
147
  const downloadStart = Date.now();
@@ -154,6 +160,7 @@ const renderCommand = async (args) => {
154
160
  downloaded,
155
161
  totalSize,
156
162
  },
163
+ verbose,
157
164
  }));
158
165
  },
159
166
  });
@@ -166,6 +173,7 @@ const renderCommand = async (args) => {
166
173
  downloaded: sizeInBytes,
167
174
  totalSize: sizeInBytes,
168
175
  },
176
+ verbose,
169
177
  }));
170
178
  log_1.Log.info();
171
179
  log_1.Log.info();
@@ -1,2 +1,2 @@
1
1
  export declare const STILL_COMMAND = "still";
2
- export declare const stillCommand: (args: string[]) => Promise<void>;
2
+ export declare const stillCommand: (args: string[], remotionRoot: string) => Promise<void>;
@@ -16,7 +16,7 @@ const find_function_name_1 = require("../helpers/find-function-name");
16
16
  const quit_1 = require("../helpers/quit");
17
17
  const log_1 = require("../log");
18
18
  exports.STILL_COMMAND = 'still';
19
- const stillCommand = async (args) => {
19
+ const stillCommand = async (args, remotionRoot) => {
20
20
  var _a, _b, _c, _d, _e, _f;
21
21
  const serveUrl = args[0];
22
22
  if (!serveUrl) {
@@ -43,6 +43,7 @@ const stillCommand = async (args) => {
43
43
  const { chromiumOptions, envVariables, inputProps, logLevel, puppeteerTimeout, quality, stillFrame, scale, height, width, } = await cli_1.CliInternals.getCliOptions({
44
44
  type: 'still',
45
45
  isLambda: true,
46
+ remotionRoot,
46
47
  });
47
48
  const functionName = await (0, find_function_name_1.findFunctionName)();
48
49
  const maxRetries = (_b = args_1.parsedLambdaCli['max-retries']) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_MAX_RETRIES;
package/dist/cli/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cli = exports.executeCommand = void 0;
4
4
  const cli_1 = require("@remotion/cli");
5
+ const renderer_1 = require("@remotion/renderer");
5
6
  const suggested_policy_1 = require("../api/iam-validation/suggested-policy");
6
7
  const defaults_1 = require("../defaults");
7
8
  const check_credentials_1 = require("../shared/check-credentials");
@@ -43,10 +44,10 @@ const matchCommand = (args, remotionRoot) => {
43
44
  (0, check_credentials_1.checkCredentials)();
44
45
  }
45
46
  if (args[0] === render_1.RENDER_COMMAND) {
46
- return (0, render_1.renderCommand)(args.slice(1));
47
+ return (0, render_1.renderCommand)(args.slice(1), remotionRoot);
47
48
  }
48
49
  if (args[0] === still_1.STILL_COMMAND) {
49
- return (0, still_1.stillCommand)(args.slice(1));
50
+ return (0, still_1.stillCommand)(args.slice(1), remotionRoot);
50
51
  }
51
52
  if (args[0] === functions_1.FUNCTIONS_COMMAND) {
52
53
  return (0, functions_1.functionsCommand)(args.slice(1));
@@ -133,7 +134,7 @@ AWS returned an "TooManyRequestsException" error message which could mean you re
133
134
  };
134
135
  exports.executeCommand = executeCommand;
135
136
  const cli = async () => {
136
- const remotionRoot = cli_1.CliInternals.findRemotionRoot();
137
+ const remotionRoot = renderer_1.RenderInternals.findRemotionRoot();
137
138
  await cli_1.CliInternals.initializeCli(remotionRoot);
138
139
  await (0, exports.executeCommand)(args_1.parsedLambdaCli._, remotionRoot);
139
140
  };
@@ -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
  };
@@ -1,7 +1,8 @@
1
+ import type { FfmpegExecutable } from '@remotion/renderer';
1
2
  import type { AwsRegion } from '../../pricing/aws-regions';
2
3
  import type { LambdaCodec } from '../../shared/validate-lambda-codec';
3
4
  import type { EnhancedErrorInfo } from './write-lambda-error';
4
- export declare const concatVideosS3: ({ bucket, expectedFiles, onProgress, numberOfFrames, renderId, region, codec, expectedBucketOwner, fps, numberOfGifLoops, onErrors, }: {
5
+ export declare const concatVideosS3: ({ bucket, expectedFiles, onProgress, numberOfFrames, renderId, region, codec, expectedBucketOwner, fps, numberOfGifLoops, ffmpegExecutable, remotionRoot, onErrors, }: {
5
6
  bucket: string;
6
7
  expectedFiles: number;
7
8
  onProgress: (frames: number, encodingStart: number) => void;
@@ -13,6 +14,8 @@ export declare const concatVideosS3: ({ bucket, expectedFiles, onProgress, numbe
13
14
  expectedBucketOwner: string;
14
15
  fps: number;
15
16
  numberOfGifLoops: number | null;
17
+ ffmpegExecutable: FfmpegExecutable;
18
+ remotionRoot: string;
16
19
  }) => Promise<{
17
20
  outfile: string;
18
21
  cleanupChunksProm: Promise<void>;
@@ -127,7 +127,7 @@ const getAllFilesS3 = ({ bucket, expectedFiles, outdir, renderId, region, expect
127
127
  loop().catch((err) => reject(err));
128
128
  });
129
129
  };
130
- const concatVideosS3 = async ({ bucket, expectedFiles, onProgress, numberOfFrames, renderId, region, codec, expectedBucketOwner, fps, numberOfGifLoops, onErrors, }) => {
130
+ const concatVideosS3 = async ({ bucket, expectedFiles, onProgress, numberOfFrames, renderId, region, codec, expectedBucketOwner, fps, numberOfGifLoops, ffmpegExecutable, remotionRoot, onErrors, }) => {
131
131
  var _a;
132
132
  const outdir = (0, path_1.join)(renderer_1.RenderInternals.tmpDir(constants_1.CONCAT_FOLDER_TOKEN), 'bucket');
133
133
  if ((0, fs_1.existsSync)(outdir)) {
@@ -159,6 +159,8 @@ const concatVideosS3 = async ({ bucket, expectedFiles, onProgress, numberOfFrame
159
159
  codec: codecForCombining,
160
160
  fps,
161
161
  numberOfGifLoops,
162
+ ffmpegExecutable,
163
+ remotionRoot,
162
164
  });
163
165
  combine.end();
164
166
  const cleanupChunksProm = ((_a = fs_1.default.promises.rm) !== null && _a !== void 0 ? _a : fs_1.default.promises.rmdir)(outdir, {
@@ -66,6 +66,7 @@ const innerLaunchHandler = async (params, options) => {
66
66
  const startedDate = Date.now();
67
67
  let webhookInvoked = false;
68
68
  console.log(`Function has ${Math.max(options.getRemainingTimeInMillis() - 1000, 1000)} before it times out`);
69
+ const verbose = renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose');
69
70
  const webhookDueToTimeout = setTimeout(async () => {
70
71
  if (params.webhook && !webhookInvoked) {
71
72
  try {
@@ -108,7 +109,7 @@ const innerLaunchHandler = async (params, options) => {
108
109
  }
109
110
  }
110
111
  }, Math.max(options.getRemainingTimeInMillis() - 1000, 1000));
111
- const browserInstance = await (0, get_browser_instance_1.getBrowserInstance)(renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose'), params.chromiumOptions);
112
+ const browserInstance = await (0, get_browser_instance_1.getBrowserInstance)(verbose, params.chromiumOptions);
112
113
  const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
113
114
  const inputPropsPromise = (0, deserialize_input_props_1.deserializeInputProps)({
114
115
  bucketName: params.bucketName,
@@ -348,6 +349,8 @@ const innerLaunchHandler = async (params, options) => {
348
349
  expectedBucketOwner: options.expectedBucketOwner,
349
350
  fps,
350
351
  numberOfGifLoops: params.numberOfGifLoops,
352
+ ffmpegExecutable: null,
353
+ remotionRoot: process.cwd(),
351
354
  onErrors,
352
355
  });
353
356
  if (!encodingStop) {
@@ -403,12 +406,14 @@ const innerLaunchHandler = async (params, options) => {
403
406
  chunkCount,
404
407
  renderId: params.renderId,
405
408
  });
406
- const deletProm = (0, delete_chunks_1.cleanupFiles)({
407
- region: (0, get_current_region_1.getCurrentRegionInFunction)(),
408
- bucket: params.bucketName,
409
- contents,
410
- jobs,
411
- });
409
+ const deletProm = verbose
410
+ ? Promise.resolve(0)
411
+ : (0, delete_chunks_1.cleanupFiles)({
412
+ region: (0, get_current_region_1.getCurrentRegionInFunction)(),
413
+ bucket: params.bucketName,
414
+ contents,
415
+ jobs,
416
+ });
412
417
  const cleanupSerializedInputPropsProm = (0, cleanup_serialized_input_props_1.cleanupSerializedInputProps)({
413
418
  bucketName: params.bucketName,
414
419
  region: (0, get_current_region_1.getCurrentRegionInFunction)(),
@@ -110,7 +110,6 @@ const renderHandler = async (params, options, logs) => {
110
110
  outputLocation,
111
111
  codec: chunkCodec,
112
112
  crf: (_a = params.crf) !== null && _a !== void 0 ? _a : undefined,
113
- ffmpegExecutable: process.env.NODE_ENV === 'test' ? null : '/opt/bin/ffmpeg',
114
113
  pixelFormat: params.pixelFormat,
115
114
  proResProfile: params.proResProfile,
116
115
  onDownload: (src) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "3.2.43-retry.19+5671d7797",
3
+ "version": "3.3.0",
4
4
  "description": "Distributed renderer for Remotion based on AWS Lambda",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -31,12 +31,12 @@
31
31
  "@aws-sdk/client-service-quotas": "3.190.0",
32
32
  "@aws-sdk/lib-storage": "3.190.0",
33
33
  "@aws-sdk/s3-request-presigner": "3.190.0",
34
- "@remotion/bundler": "3.2.43-retry.19+5671d7797",
35
- "@remotion/cli": "3.2.43-retry.19+5671d7797",
36
- "@remotion/renderer": "3.2.43-retry.19+5671d7797",
34
+ "@remotion/bundler": "3.3.0",
35
+ "@remotion/cli": "3.3.0",
36
+ "@remotion/renderer": "3.3.0",
37
37
  "aws-policies": "^1.0.1",
38
38
  "mime-types": "2.1.34",
39
- "remotion": "3.2.43-retry.19+5671d7797"
39
+ "remotion": "3.3.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=16.8.0",
@@ -59,5 +59,5 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "5671d779758f7837f2f50f75e2cccdd7c6b58f43"
62
+ "gitHead": "29322c95729df0229eecc5f674d019145a783b46"
63
63
  }
Binary file