@remotion/lambda 4.0.0-copy.4 → 4.0.0-esm.17

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 (100) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/admin/bundle-lambda.js +20 -4
  3. package/dist/admin/generate-etag-list.d.ts +1 -0
  4. package/dist/admin/generate-etag-list.js +14 -0
  5. package/dist/admin/make-layer-public.js +23 -1
  6. package/dist/api/deploy-function.js +3 -1
  7. package/dist/api/deploy-site.d.ts +5 -0
  8. package/dist/api/deploy-site.js +39 -21
  9. package/dist/api/get-aws-client.d.ts +2 -0
  10. package/dist/api/get-aws-client.js +2 -0
  11. package/dist/api/get-buckets.js +26 -9
  12. package/dist/api/get-compositions-on-lambda.d.ts +2 -1
  13. package/dist/api/get-compositions-on-lambda.js +1 -3
  14. package/dist/api/get-or-create-bucket.js +2 -7
  15. package/dist/api/get-regions.d.ts +5 -1
  16. package/dist/api/get-regions.js +5 -2
  17. package/dist/api/iam-validation/simulate-rule.js +0 -22
  18. package/dist/api/iam-validation/simulate.js +24 -5
  19. package/dist/api/iam-validation/user-permissions.js +0 -8
  20. package/dist/api/render-media-on-lambda.d.ts +2 -1
  21. package/dist/api/render-media-on-lambda.js +6 -10
  22. package/dist/api/render-still-on-lambda.d.ts +2 -1
  23. package/dist/api/render-still-on-lambda.js +1 -3
  24. package/dist/api/upload-dir.d.ts +4 -3
  25. package/dist/api/upload-dir.js +33 -19
  26. package/dist/cli/args.d.ts +1 -0
  27. package/dist/cli/commands/compositions/index.js +1 -3
  28. package/dist/cli/commands/regions.js +5 -1
  29. package/dist/cli/commands/render/progress.d.ts +6 -3
  30. package/dist/cli/commands/render/progress.js +49 -39
  31. package/dist/cli/commands/render/render.js +17 -4
  32. package/dist/cli/commands/sites/create.js +12 -4
  33. package/dist/cli/commands/still.js +5 -9
  34. package/dist/cli/helpers/progress-bar.d.ts +9 -3
  35. package/dist/cli/helpers/progress-bar.js +19 -3
  36. package/dist/cli/index.js +6 -1
  37. package/dist/functions/compositions.js +10 -3
  38. package/dist/functions/helpers/concat-videos.d.ts +10 -6
  39. package/dist/functions/helpers/concat-videos.js +8 -25
  40. package/dist/functions/helpers/create-post-render-data.js +0 -12
  41. package/dist/functions/helpers/expected-out-name.js +1 -1
  42. package/dist/functions/helpers/get-chromium-executable-path.js +2 -1
  43. package/dist/functions/helpers/get-current-region.d.ts +1 -1
  44. package/dist/functions/helpers/get-encoding-metadata.d.ts +4 -8
  45. package/dist/functions/helpers/get-encoding-metadata.js +4 -18
  46. package/dist/functions/helpers/get-final-encoding-status.d.ts +2 -4
  47. package/dist/functions/helpers/get-final-encoding-status.js +1 -4
  48. package/dist/functions/helpers/get-lambdas-invoked-stats.d.ts +1 -5
  49. package/dist/functions/helpers/get-lambdas-invoked-stats.js +1 -9
  50. package/dist/functions/helpers/get-overall-progress.d.ts +2 -1
  51. package/dist/functions/helpers/get-overall-progress.js +7 -5
  52. package/dist/functions/helpers/get-progress.js +40 -26
  53. package/dist/functions/helpers/get-rendered-frames-progress.d.ts +8 -0
  54. package/dist/functions/helpers/get-rendered-frames-progress.js +37 -0
  55. package/dist/functions/launch.js +50 -38
  56. package/dist/functions/renderer.js +19 -24
  57. package/dist/functions/start.js +9 -2
  58. package/dist/functions/still.js +16 -5
  59. package/dist/index.d.ts +9 -2
  60. package/dist/index.js +10 -2
  61. package/dist/pricing/aws-regions.d.ts +2 -1
  62. package/dist/pricing/aws-regions.js +31 -1
  63. package/dist/pricing/price-per-1-s.js +413 -39
  64. package/dist/shared/aws-clients.d.ts +3 -0
  65. package/dist/shared/aws-clients.js +75 -13
  66. package/dist/shared/check-credentials.js +3 -0
  67. package/dist/shared/chunk-progress.d.ts +9 -0
  68. package/dist/shared/chunk-progress.js +2034 -0
  69. package/dist/shared/constants.d.ts +13 -12
  70. package/dist/shared/convert-to-serve-url.d.ts +5 -1
  71. package/dist/shared/convert-to-serve-url.js +1 -5
  72. package/dist/shared/deserialize-input-props.d.ts +1 -1
  73. package/dist/shared/deserialize-input-props.js +1 -1
  74. package/dist/shared/function-zip-path.d.ts +2 -1
  75. package/dist/shared/function-zip-path.js +3 -2
  76. package/dist/shared/get-account-id.js +4 -6
  77. package/dist/shared/get-etag.d.ts +1 -0
  78. package/dist/shared/get-etag.js +24 -0
  79. package/dist/shared/get-s3-operations.d.ts +10 -0
  80. package/dist/shared/get-s3-operations.js +36 -0
  81. package/dist/shared/hosted-layers.js +368 -60
  82. package/dist/shared/invoke-webhook.d.ts +2 -0
  83. package/dist/shared/parse-chunk-key.d.ts +4 -0
  84. package/dist/shared/parse-chunk-key.js +14 -0
  85. package/dist/shared/read-dir.d.ts +9 -0
  86. package/dist/shared/read-dir.js +57 -0
  87. package/dist/shared/validate-bucketname.d.ts +5 -0
  88. package/dist/shared/validate-bucketname.js +19 -1
  89. package/dist/shared/validate-lambda-codec.d.ts +1 -1
  90. package/dist/shared/validate-lambda-codec.js +0 -1
  91. package/package.json +18 -14
  92. package/remotionlambda-arm64.zip +0 -0
  93. package/remotionlambda-x64.zip +0 -0
  94. package/remotionlambda.zip +0 -0
  95. package/.prettierrc.js +0 -14
  96. package/dist/api/enable-s3-website.d.ts +0 -5
  97. package/dist/api/enable-s3-website.js +0 -16
  98. package/dist/shared/get-cloudwatch-stream-url.d.ts +0 -8
  99. package/dist/shared/get-cloudwatch-stream-url.js +0 -7
  100. package/tsconfig.json +0 -16
@@ -15,31 +15,45 @@ const getDirFiles = (entry) => {
15
15
  throw new TypeError('should only be executed in test ' + JSON.stringify(entry));
16
16
  };
17
17
  exports.getDirFiles = getDirFiles;
18
- const uploadDir = async ({ bucket, region, dir, onProgress, folder, privacy, }) => {
19
- async function getFiles(directory) {
20
- const dirents = await fs_1.promises.readdir(directory, { withFileTypes: true });
21
- const _files = await Promise.all(dirents.map(async (dirent) => {
22
- const res = path_1.default.resolve(directory, dirent.name);
23
- const { size } = await fs_1.promises.stat(res);
24
- return dirent.isDirectory()
25
- ? getFiles(res)
26
- : [
27
- {
28
- name: res,
29
- size,
30
- },
31
- ];
32
- }));
33
- return _files.flat(1);
34
- }
35
- const files = await getFiles(dir);
18
+ async function getFiles(directory, originalDirectory, toUpload) {
19
+ const dirents = await fs_1.promises.readdir(directory, { withFileTypes: true });
20
+ const _files = await Promise.all(dirents
21
+ .map((dirent) => {
22
+ const res = path_1.default.resolve(directory, dirent.name);
23
+ return [dirent, res];
24
+ })
25
+ .filter(([dirent, res]) => {
26
+ const relative = path_1.default.relative(originalDirectory, res);
27
+ if (dirent.isDirectory()) {
28
+ return true;
29
+ }
30
+ if (!toUpload.includes(relative)) {
31
+ return false;
32
+ }
33
+ return true;
34
+ })
35
+ .map(async ([dirent, res]) => {
36
+ const { size } = await fs_1.promises.stat(res);
37
+ return dirent.isDirectory()
38
+ ? getFiles(res, originalDirectory, toUpload)
39
+ : [
40
+ {
41
+ name: res,
42
+ size,
43
+ },
44
+ ];
45
+ }));
46
+ return _files.flat(1);
47
+ }
48
+ const uploadDir = async ({ bucket, region, localDir, onProgress, keyPrefix, privacy, toUpload, }) => {
49
+ const files = await getFiles(localDir, localDir, toUpload);
36
50
  const progresses = {};
37
51
  for (const file of files) {
38
52
  progresses[file.name] = 0;
39
53
  }
40
54
  const client = (0, aws_clients_1.getS3Client)(region, null);
41
55
  const uploads = files.map(async (filePath) => {
42
- const Key = (0, make_s3_key_1.makeS3Key)(folder, dir, filePath.name);
56
+ const Key = (0, make_s3_key_1.makeS3Key)(keyPrefix, localDir, filePath.name);
43
57
  const Body = (0, fs_1.createReadStream)(filePath.name);
44
58
  const ContentType = mime_types_1.default.lookup(Key) || 'application/octet-stream';
45
59
  const ACL = privacy === 'no-acl'
@@ -13,6 +13,7 @@ declare type LambdaCommandLineOptions = {
13
13
  yes: boolean;
14
14
  force: boolean;
15
15
  f: boolean;
16
+ ['default-only']: boolean;
16
17
  ['site-name']: string | undefined;
17
18
  ['disable-chunk-optimization']: boolean;
18
19
  ['save-browser-logs']: boolean;
@@ -4,7 +4,6 @@ exports.compositionsCommand = exports.COMPOSITIONS_COMMAND = void 0;
4
4
  const cli_1 = require("@remotion/cli");
5
5
  const __1 = require("../../..");
6
6
  const constants_1 = require("../../../shared/constants");
7
- const convert_to_serve_url_1 = require("../../../shared/convert-to-serve-url");
8
7
  const validate_serveurl_1 = require("../../../shared/validate-serveurl");
9
8
  const get_aws_region_1 = require("../../get-aws-region");
10
9
  const find_function_name_1 = require("../../helpers/find-function-name");
@@ -28,10 +27,9 @@ const compositionsCommand = async (args, remotionRoot) => {
28
27
  const region = (0, get_aws_region_1.getAwsRegion)();
29
28
  (0, validate_serveurl_1.validateServeUrl)(serveUrl);
30
29
  const functionName = await (0, find_function_name_1.findFunctionName)();
31
- const realServeUrl = await (0, convert_to_serve_url_1.convertToServeUrl)(serveUrl, region);
32
30
  const comps = await (0, __1.getCompositionsOnLambda)({
33
31
  functionName,
34
- serveUrl: realServeUrl,
32
+ serveUrl,
35
33
  inputProps,
36
34
  region,
37
35
  chromiumOptions,
@@ -3,8 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.regionsCommand = exports.REGIONS_COMMAND = void 0;
4
4
  const log_1 = require("@remotion/cli/dist/log");
5
5
  const get_regions_1 = require("../../api/get-regions");
6
+ const args_1 = require("../args");
6
7
  exports.REGIONS_COMMAND = 'regions';
7
8
  const regionsCommand = () => {
8
- log_1.Log.info((0, get_regions_1.getRegions)().join(' '));
9
+ var _a;
10
+ log_1.Log.info((0, get_regions_1.getRegions)({
11
+ enabledByDefaultOnly: (_a = args_1.parsedLambdaCli['default-only']) !== null && _a !== void 0 ? _a : false,
12
+ }).join(' '));
9
13
  };
10
14
  exports.regionsCommand = regionsCommand;
@@ -3,12 +3,13 @@ import type { ChunkRetry } from '../../../functions/helpers/get-retry-stats';
3
3
  declare type LambdaInvokeProgress = {
4
4
  totalLambdas: number | null;
5
5
  lambdasInvoked: number;
6
- doneIn: number | null;
7
6
  };
8
7
  declare type ChunkProgress = {
8
+ doneIn: number | null;
9
+ framesRendered: number;
10
+ totalFrames: number | null;
9
11
  totalChunks: number | null;
10
12
  chunksInvoked: number;
11
- doneIn: number | null;
12
13
  };
13
14
  declare type MultiRenderProgress = {
14
15
  lambdaInvokeProgress: LambdaInvokeProgress;
@@ -22,11 +23,13 @@ declare type DownloadedInfo = {
22
23
  downloaded: number;
23
24
  doneIn: number | null;
24
25
  };
25
- export declare const makeProgressString: ({ progress, steps, downloadInfo, retriesInfo, verbose, }: {
26
+ export declare const makeProgressString: ({ progress, steps, downloadInfo, retriesInfo, verbose, timeToEncode, totalFrames, }: {
26
27
  progress: MultiRenderProgress;
27
28
  steps: number;
28
29
  downloadInfo: DownloadedInfo | null;
29
30
  retriesInfo: ChunkRetry[];
30
31
  verbose: boolean;
32
+ timeToEncode: number | null;
33
+ totalFrames: number | null;
31
34
  }) => string;
32
35
  export {};
@@ -2,45 +2,54 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeProgressString = exports.makeMultiProgressFromStatus = void 0;
4
4
  const cli_1 = require("@remotion/cli");
5
+ const renderer_1 = require("@remotion/renderer");
5
6
  const remotion_1 = require("remotion");
7
+ const truthy_1 = require("../../../shared/truthy");
6
8
  const makeInvokeProgress = (invokeProgress, totalSteps, retriesInfo) => {
7
- const { lambdasInvoked, totalLambdas, doneIn } = invokeProgress;
8
- const progress = doneIn
9
- ? 1
10
- : totalLambdas === null
11
- ? 0
12
- : lambdasInvoked / totalLambdas;
9
+ const { lambdasInvoked, totalLambdas } = invokeProgress;
10
+ const progress = totalLambdas === null ? 0 : lambdasInvoked / totalLambdas;
13
11
  return [
14
12
  '⚡️',
15
13
  `(1/${totalSteps})`,
16
14
  cli_1.CliInternals.makeProgressBar(progress),
17
- `${doneIn === null ? 'Invoking' : 'Invoked'} lambdas`,
18
- doneIn === null
19
- ? `${Math.round(progress * 100)}%`
20
- : cli_1.CliInternals.chalk.gray(`${doneIn}ms`),
15
+ `${progress === 0 ? 'Invoked' : 'Invoking'} lambdas`,
16
+ progress === 1
17
+ ? cli_1.CliInternals.chalk.gray('100%')
18
+ : `${Math.round(progress * 100)}%`,
21
19
  retriesInfo.length > 0 ? `(+${retriesInfo.length} retries)` : [],
22
20
  ].join(' ');
23
21
  };
24
- const makeChunkProgress = ({ chunkProgress, invokeProgress, totalSteps, }) => {
25
- const lambdaIsDone = invokeProgress.doneIn !== null;
22
+ const makeRenderProgress = ({ chunkProgress, totalSteps, }) => {
26
23
  const { chunksInvoked, totalChunks, doneIn } = chunkProgress;
27
- const progress = totalChunks === null ? 0 : chunksInvoked / totalChunks;
28
- const shouldShow = lambdaIsDone || progress > 0;
29
- if (!shouldShow) {
30
- return '';
31
- }
32
- return [
24
+ const renderProgress = chunkProgress.totalFrames === null
25
+ ? 0
26
+ : chunkProgress.framesRendered / chunkProgress.totalFrames;
27
+ const encodingProgress = totalChunks === null ? 0 : chunksInvoked / totalChunks;
28
+ const frames = chunkProgress.totalFrames === null
29
+ ? null
30
+ : `(${chunkProgress.framesRendered}/${chunkProgress.totalFrames})`;
31
+ const first = [
33
32
  '🧩',
34
33
  `(2/${totalSteps})`,
35
- cli_1.CliInternals.makeProgressBar(progress),
36
- `${doneIn === null ? 'Rendering' : 'Rendered'} chunks`,
34
+ cli_1.CliInternals.makeProgressBar(renderProgress),
35
+ doneIn === null ? 'Rendering frames' : 'Rendered frames',
36
+ doneIn === null ? frames : cli_1.CliInternals.chalk.gray(`${doneIn}ms`),
37
+ ]
38
+ .filter(truthy_1.truthy)
39
+ .join(' ');
40
+ const second = [
41
+ '🏗️ ',
42
+ `(3/${totalSteps})`,
43
+ cli_1.CliInternals.makeProgressBar(encodingProgress),
44
+ `${doneIn === null ? 'Encoding' : 'Encoded'} chunks`,
37
45
  doneIn === null
38
- ? `${Math.round(progress * 100)}%`
46
+ ? `${Math.round(encodingProgress * 100)}%`
39
47
  : cli_1.CliInternals.chalk.gray(`${doneIn}ms`),
40
48
  ].join(' ');
49
+ return [first, second];
41
50
  };
42
- const makeEncodingProgress = ({ encodingProgress, chunkProgress, totalSteps, }) => {
43
- const { framesEncoded, totalFrames, doneIn } = encodingProgress;
51
+ const makeEncodingProgress = ({ encodingProgress, chunkProgress, totalSteps, totalFrames, timeToEncode, }) => {
52
+ const { framesEncoded } = encodingProgress;
44
53
  const progress = totalFrames === null ? 0 : framesEncoded / totalFrames;
45
54
  const chunksDone = chunkProgress.doneIn !== null;
46
55
  const shouldShow = progress > 0 || chunksDone;
@@ -49,12 +58,12 @@ const makeEncodingProgress = ({ encodingProgress, chunkProgress, totalSteps, })
49
58
  }
50
59
  return [
51
60
  '📽 ',
52
- `(3/${totalSteps})`,
61
+ `(4/${totalSteps})`,
53
62
  cli_1.CliInternals.makeProgressBar(progress),
54
- `${doneIn === null ? 'Combining' : 'Combined'} videos`,
55
- doneIn === null
63
+ `${timeToEncode === null ? 'Combining' : 'Combined'} videos`,
64
+ timeToEncode === null
56
65
  ? `${Math.round(progress * 100)}%`
57
- : cli_1.CliInternals.chalk.gray(`${doneIn}ms`),
66
+ : cli_1.CliInternals.chalk.gray(`${timeToEncode}ms`),
58
67
  ].join(' ');
59
68
  };
60
69
  const makeCleanupProgress = (cleanupInfo, totalSteps, skipped) => {
@@ -64,7 +73,7 @@ const makeCleanupProgress = (cleanupInfo, totalSteps, skipped) => {
64
73
  if (skipped) {
65
74
  return [
66
75
  '🪣 ',
67
- `(4/${totalSteps})`,
76
+ `(5/${totalSteps})`,
68
77
  cli_1.CliInternals.chalk.blueBright(`Not cleaning up because --log=verbose was set`),
69
78
  ].join(' ');
70
79
  }
@@ -72,7 +81,7 @@ const makeCleanupProgress = (cleanupInfo, totalSteps, skipped) => {
72
81
  const progress = filesDeleted / minFilesToDelete;
73
82
  return [
74
83
  '🪣 ',
75
- `(4/${totalSteps})`,
84
+ `(5/${totalSteps})`,
76
85
  cli_1.CliInternals.makeProgressBar(progress),
77
86
  `${doneIn === null ? 'Cleaning up' : 'Cleaned up'} artifacts`,
78
87
  doneIn === null
@@ -83,7 +92,7 @@ const makeCleanupProgress = (cleanupInfo, totalSteps, skipped) => {
83
92
  const makeDownloadProgress = (downloadInfo, totalSteps) => {
84
93
  return [
85
94
  '💾',
86
- `(5/${totalSteps})`,
95
+ `(6/${totalSteps})`,
87
96
  downloadInfo.totalSize === null
88
97
  ? cli_1.CliInternals.getFileSizeDownloadBar(downloadInfo.downloaded)
89
98
  : cli_1.CliInternals.makeProgressBar(downloadInfo.downloaded / downloadInfo.totalSize),
@@ -101,40 +110,41 @@ const makeDownloadProgress = (downloadInfo, totalSteps) => {
101
110
  ].join(' ');
102
111
  };
103
112
  const makeMultiProgressFromStatus = (status) => {
104
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
113
+ var _a, _b, _c, _d, _e, _f;
105
114
  return {
106
115
  chunkProgress: {
107
116
  chunksInvoked: status.chunks,
108
117
  totalChunks: (_b = (_a = status.renderMetadata) === null || _a === void 0 ? void 0 : _a.totalChunks) !== null && _b !== void 0 ? _b : null,
109
118
  doneIn: status.timeToFinishChunks,
119
+ framesRendered: status.framesRendered,
120
+ totalFrames: status.renderMetadata
121
+ ? renderer_1.RenderInternals.getFramesToRender(status.renderMetadata.frameRange, status.renderMetadata.everyNthFrame).length
122
+ : null,
110
123
  },
111
124
  encodingProgress: {
112
125
  framesEncoded: (_d = (_c = status.encodingStatus) === null || _c === void 0 ? void 0 : _c.framesEncoded) !== null && _d !== void 0 ? _d : 0,
113
- totalFrames: (_f = (_e = status.renderMetadata) === null || _e === void 0 ? void 0 : _e.videoConfig.durationInFrames) !== null && _f !== void 0 ? _f : 1,
114
- doneIn: (_h = (_g = status.encodingStatus) === null || _g === void 0 ? void 0 : _g.doneIn) !== null && _h !== void 0 ? _h : null,
115
- timeToInvoke: (_k = (_j = status.encodingStatus) === null || _j === void 0 ? void 0 : _j.timeToInvoke) !== null && _k !== void 0 ? _k : null,
116
126
  },
117
127
  lambdaInvokeProgress: {
118
- doneIn: status.timeToInvokeLambdas,
119
128
  lambdasInvoked: status.lambdasInvoked,
120
- totalLambdas: (_m = (_l = status.renderMetadata) === null || _l === void 0 ? void 0 : _l.estimatedRenderLambdaInvokations) !== null && _m !== void 0 ? _m : null,
129
+ totalLambdas: (_f = (_e = status.renderMetadata) === null || _e === void 0 ? void 0 : _e.estimatedRenderLambdaInvokations) !== null && _f !== void 0 ? _f : null,
121
130
  },
122
131
  cleanupInfo: status.cleanup,
123
132
  };
124
133
  };
125
134
  exports.makeMultiProgressFromStatus = makeMultiProgressFromStatus;
126
- const makeProgressString = ({ progress, steps, downloadInfo, retriesInfo, verbose, }) => {
135
+ const makeProgressString = ({ progress, steps, downloadInfo, retriesInfo, verbose, timeToEncode, totalFrames, }) => {
127
136
  return [
128
137
  makeInvokeProgress(progress.lambdaInvokeProgress, steps, retriesInfo),
129
- makeChunkProgress({
138
+ ...makeRenderProgress({
130
139
  chunkProgress: progress.chunkProgress,
131
- invokeProgress: progress.lambdaInvokeProgress,
132
140
  totalSteps: steps,
133
141
  }),
134
142
  makeEncodingProgress({
135
143
  encodingProgress: progress.encodingProgress,
136
144
  chunkProgress: progress.chunkProgress,
137
145
  totalSteps: steps,
146
+ timeToEncode,
147
+ totalFrames,
138
148
  }),
139
149
  makeCleanupProgress(progress.cleanupInfo, steps, verbose),
140
150
  downloadInfo ? makeDownloadProgress(downloadInfo, steps) : null,
@@ -7,7 +7,6 @@ const download_media_1 = require("../../../api/download-media");
7
7
  const get_render_progress_1 = require("../../../api/get-render-progress");
8
8
  const render_media_on_lambda_1 = require("../../../api/render-media-on-lambda");
9
9
  const constants_1 = require("../../../shared/constants");
10
- const convert_to_serve_url_1 = require("../../../shared/convert-to-serve-url");
11
10
  const sleep_1 = require("../../../shared/sleep");
12
11
  const validate_frames_per_lambda_1 = require("../../../shared/validate-frames-per-lambda");
13
12
  const validate_privacy_1 = require("../../../shared/validate-privacy");
@@ -35,8 +34,7 @@ const renderCommand = async (args, remotionRoot) => {
35
34
  if (!composition) {
36
35
  log_1.Log.info('No compositions passed. Fetching compositions...');
37
36
  (0, validate_serveurl_1.validateServeUrl)(serveUrl);
38
- const realServeUrl = await (0, convert_to_serve_url_1.convertToServeUrl)(serveUrl, region);
39
- const comps = await (0, renderer_1.getCompositions)(realServeUrl);
37
+ const comps = await (0, renderer_1.getCompositions)(serveUrl);
40
38
  const { compositionId } = await cli_1.CliInternals.selectComposition(comps);
41
39
  composition = compositionId;
42
40
  }
@@ -97,7 +95,7 @@ const renderCommand = async (args, remotionRoot) => {
97
95
  }
98
96
  : undefined,
99
97
  });
100
- const totalSteps = downloadName ? 5 : 4;
98
+ const totalSteps = downloadName ? 6 : 5;
101
99
  const progressBar = cli_1.CliInternals.createOverwriteableCliOutput(cli_1.CliInternals.quietFlagProvided());
102
100
  log_1.Log.info(cli_1.CliInternals.chalk.gray(`bucket = ${res.bucketName}, function = ${functionName}`));
103
101
  log_1.Log.info(cli_1.CliInternals.chalk.gray(`renderId = ${res.renderId}, codec = ${codec} (${reason})`));
@@ -117,6 +115,8 @@ const renderCommand = async (args, remotionRoot) => {
117
115
  downloadInfo: null,
118
116
  retriesInfo: status.retriesInfo,
119
117
  verbose,
118
+ totalFrames: getTotalFrames(status),
119
+ timeToEncode: status.timeToEncode,
120
120
  }));
121
121
  // eslint-disable-next-line no-constant-condition
122
122
  while (true) {
@@ -134,6 +134,8 @@ const renderCommand = async (args, remotionRoot) => {
134
134
  retriesInfo: newStatus.retriesInfo,
135
135
  downloadInfo: null,
136
136
  verbose,
137
+ timeToEncode: newStatus.timeToEncode,
138
+ totalFrames: getTotalFrames(newStatus),
137
139
  }));
138
140
  if (newStatus.done) {
139
141
  progressBar.update((0, progress_1.makeProgressString)({
@@ -142,6 +144,8 @@ const renderCommand = async (args, remotionRoot) => {
142
144
  downloadInfo: null,
143
145
  retriesInfo: newStatus.retriesInfo,
144
146
  verbose,
147
+ timeToEncode: newStatus.timeToEncode,
148
+ totalFrames: getTotalFrames(newStatus),
145
149
  }));
146
150
  if (downloadName) {
147
151
  const downloadStart = Date.now();
@@ -161,6 +165,8 @@ const renderCommand = async (args, remotionRoot) => {
161
165
  totalSize,
162
166
  },
163
167
  verbose,
168
+ timeToEncode: newStatus.timeToEncode,
169
+ totalFrames: getTotalFrames(newStatus),
164
170
  }));
165
171
  },
166
172
  });
@@ -174,6 +180,8 @@ const renderCommand = async (args, remotionRoot) => {
174
180
  totalSize: sizeInBytes,
175
181
  },
176
182
  verbose,
183
+ timeToEncode: newStatus.timeToEncode,
184
+ totalFrames: getTotalFrames(newStatus),
177
185
  }));
178
186
  log_1.Log.info();
179
187
  log_1.Log.info();
@@ -226,3 +234,8 @@ const renderCommand = async (args, remotionRoot) => {
226
234
  }
227
235
  };
228
236
  exports.renderCommand = renderCommand;
237
+ function getTotalFrames(status) {
238
+ return status.renderMetadata
239
+ ? renderer_1.RenderInternals.getFramesToRender(status.renderMetadata.frameRange, status.renderMetadata.everyNthFrame).length
240
+ : null;
241
+ }
@@ -7,6 +7,7 @@ exports.sitesCreateSubcommand = exports.SITES_CREATE_SUBCOMMAND = void 0;
7
7
  const cli_1 = require("@remotion/cli");
8
8
  const fs_1 = require("fs");
9
9
  const path_1 = __importDefault(require("path"));
10
+ const remotion_1 = require("remotion");
10
11
  const deploy_site_1 = require("../../../api/deploy-site");
11
12
  const get_or_create_bucket_1 = require("../../../api/get-or-create-bucket");
12
13
  const constants_1 = require("../../../shared/constants");
@@ -51,12 +52,12 @@ const sitesCreateSubcommand = async (args, remotionRoot) => {
51
52
  bucketProgress: {
52
53
  bucketCreated: false,
53
54
  doneIn: null,
54
- websiteEnabled: false,
55
55
  },
56
56
  deployProgress: {
57
57
  doneIn: null,
58
58
  totalSize: null,
59
59
  sizeUploaded: 0,
60
+ stats: null,
60
61
  },
61
62
  };
62
63
  const updateProgress = () => {
@@ -74,12 +75,11 @@ const sitesCreateSubcommand = async (args, remotionRoot) => {
74
75
  updateProgress();
75
76
  },
76
77
  });
77
- multiProgress.bucketProgress.websiteEnabled = true;
78
78
  multiProgress.bucketProgress.doneIn = Date.now() - bucketStart;
79
79
  updateProgress();
80
80
  const bundleStart = Date.now();
81
81
  const uploadStart = Date.now();
82
- const { serveUrl, siteName } = await (0, deploy_site_1.deploySite)({
82
+ const { serveUrl, siteName, stats } = await (0, deploy_site_1.deploySite)({
83
83
  entryPoint: absoluteFile,
84
84
  siteName: desiredSiteName,
85
85
  bucketName,
@@ -95,6 +95,7 @@ const sitesCreateSubcommand = async (args, remotionRoot) => {
95
95
  sizeUploaded: p.sizeUploaded,
96
96
  totalSize: p.totalSize,
97
97
  doneIn: null,
98
+ stats: null,
98
99
  };
99
100
  updateProgress();
100
101
  },
@@ -108,6 +109,11 @@ const sitesCreateSubcommand = async (args, remotionRoot) => {
108
109
  sizeUploaded: 1,
109
110
  totalSize: 1,
110
111
  doneIn: uploadDuration,
112
+ stats: {
113
+ addedFiles: stats.uploadedFiles,
114
+ removedFiles: stats.deletedFiles,
115
+ untouchedFiles: stats.untouchedFiles,
116
+ },
111
117
  };
112
118
  updateProgress();
113
119
  log_1.Log.info();
@@ -117,6 +123,8 @@ const sitesCreateSubcommand = async (args, remotionRoot) => {
117
123
  log_1.Log.info(`Site Name: ${siteName}`);
118
124
  log_1.Log.info();
119
125
  log_1.Log.info(cli_1.CliInternals.chalk.blueBright('ℹ️ If you make changes to your code, you need to redeploy the site. You can overwrite the existing site by running:'));
120
- log_1.Log.info(cli_1.CliInternals.chalk.blueBright(`npx remotion lambda sites create ${args[0]} --site-name=${siteName}`));
126
+ log_1.Log.info(cli_1.CliInternals.chalk.blueBright(['npx remotion lambda sites create', args[0], `--site-name=${siteName}`]
127
+ .filter(remotion_1.Internals.truthy)
128
+ .join(' ')));
121
129
  };
122
130
  exports.sitesCreateSubcommand = sitesCreateSubcommand;
@@ -6,7 +6,6 @@ const renderer_1 = require("@remotion/renderer");
6
6
  const download_media_1 = require("../../api/download-media");
7
7
  const render_still_on_lambda_1 = require("../../api/render-still-on-lambda");
8
8
  const constants_1 = require("../../shared/constants");
9
- const convert_to_serve_url_1 = require("../../shared/convert-to-serve-url");
10
9
  const validate_privacy_1 = require("../../shared/validate-privacy");
11
10
  const validate_retries_1 = require("../../shared/validate-retries");
12
11
  const validate_serveurl_1 = require("../../shared/validate-serveurl");
@@ -29,14 +28,11 @@ const stillCommand = async (args, remotionRoot) => {
29
28
  const region = (0, get_aws_region_1.getAwsRegion)();
30
29
  let composition = args[1];
31
30
  if (!composition) {
32
- if (!composition) {
33
- log_1.Log.info('No compositions passed. Fetching compositions...');
34
- (0, validate_serveurl_1.validateServeUrl)(serveUrl);
35
- const realServeUrl = await (0, convert_to_serve_url_1.convertToServeUrl)(serveUrl, region);
36
- const comps = await (0, renderer_1.getCompositions)(realServeUrl);
37
- const { compositionId } = await cli_1.CliInternals.selectComposition(comps);
38
- composition = compositionId;
39
- }
31
+ log_1.Log.info('No compositions passed. Fetching compositions...');
32
+ (0, validate_serveurl_1.validateServeUrl)(serveUrl);
33
+ const comps = await (0, renderer_1.getCompositions)(serveUrl);
34
+ const { compositionId } = await cli_1.CliInternals.selectComposition(comps);
35
+ composition = compositionId;
40
36
  }
41
37
  const downloadName = (_a = args[2]) !== null && _a !== void 0 ? _a : null;
42
38
  const outName = args_1.parsedLambdaCli['out-name'];
@@ -5,13 +5,19 @@ export declare type BundleProgress = {
5
5
  export declare const makeBundleProgress: ({ progress, doneIn }: BundleProgress) => string;
6
6
  export declare type BucketCreationProgress = {
7
7
  bucketCreated: boolean;
8
- websiteEnabled: boolean;
9
8
  doneIn: number | null;
10
9
  };
11
- export declare const makeBucketProgress: ({ bucketCreated, websiteEnabled, doneIn, }: BucketCreationProgress) => string;
10
+ export declare const makeBucketProgress: ({ bucketCreated, doneIn, }: BucketCreationProgress) => string;
11
+ declare type UploadStats = {
12
+ addedFiles: number;
13
+ removedFiles: number;
14
+ untouchedFiles: number;
15
+ };
12
16
  export declare type DeployToS3Progress = {
13
17
  sizeUploaded: number;
14
18
  totalSize: number | null;
15
19
  doneIn: number | null;
20
+ stats: UploadStats | null;
16
21
  };
17
- export declare const makeDeployProgressBar: ({ sizeUploaded, totalSize, doneIn, }: DeployToS3Progress) => string;
22
+ export declare const makeDeployProgressBar: ({ sizeUploaded, totalSize, doneIn, stats, }: DeployToS3Progress) => string;
23
+ export {};
@@ -15,8 +15,8 @@ const makeBundleProgress = ({ progress, doneIn }) => {
15
15
  ].join(' ');
16
16
  };
17
17
  exports.makeBundleProgress = makeBundleProgress;
18
- const makeBucketProgress = ({ bucketCreated, websiteEnabled, doneIn, }) => {
19
- const states = [bucketCreated, websiteEnabled];
18
+ const makeBucketProgress = ({ bucketCreated, doneIn, }) => {
19
+ const states = [bucketCreated];
20
20
  const statesFinished = states.filter(Boolean).map((p) => p).length;
21
21
  const progress = statesFinished / states.length;
22
22
  return [
@@ -30,7 +30,22 @@ const makeBucketProgress = ({ bucketCreated, websiteEnabled, doneIn, }) => {
30
30
  ].join(' ');
31
31
  };
32
32
  exports.makeBucketProgress = makeBucketProgress;
33
- const makeDeployProgressBar = ({ sizeUploaded, totalSize, doneIn, }) => {
33
+ const makeUploadDiff = ({ stats }) => {
34
+ if (!stats) {
35
+ return null;
36
+ }
37
+ if (stats.addedFiles === 0 && stats.removedFiles === 0) {
38
+ return cli_1.CliInternals.chalk.gray(`(Unchanged)`);
39
+ }
40
+ const total = stats.addedFiles + stats.removedFiles;
41
+ return cli_1.CliInternals.chalk.gray(`(${[
42
+ stats.addedFiles ? `+${stats.addedFiles}` : null,
43
+ stats.removedFiles ? `-${stats.removedFiles}` : null,
44
+ ]
45
+ .filter(remotion_1.Internals.truthy)
46
+ .join(',')} ${total === 1 ? 'file' : 'files'})`);
47
+ };
48
+ const makeDeployProgressBar = ({ sizeUploaded, totalSize, doneIn, stats, }) => {
34
49
  const progress = totalSize === null ? 0 : sizeUploaded / totalSize;
35
50
  return [
36
51
  '☁️ ',
@@ -42,6 +57,7 @@ const makeDeployProgressBar = ({ sizeUploaded, totalSize, doneIn, }) => {
42
57
  ? `${cli_1.CliInternals.formatBytes(sizeUploaded)}/${cli_1.CliInternals.formatBytes(totalSize)}`
43
58
  : ''
44
59
  : cli_1.CliInternals.chalk.gray(`${doneIn}ms`),
60
+ makeUploadDiff({ stats }),
45
61
  ]
46
62
  .filter(remotion_1.Internals.truthy)
47
63
  .join(' ');
package/dist/cli/index.js CHANGED
@@ -97,7 +97,7 @@ const matchCommand = (args, remotionRoot) => {
97
97
  (0, quit_1.quit)(1);
98
98
  };
99
99
  const executeCommand = async (args, remotionRoot) => {
100
- var _a, _b;
100
+ var _a, _b, _c;
101
101
  try {
102
102
  (0, is_cli_1.setIsCli)(true);
103
103
  await matchCommand(args, remotionRoot);
@@ -131,6 +131,11 @@ AWS returned an "AccessDenied" error message meaning a permission is missing. Re
131
131
  log_1.Log.error(`
132
132
  AWS returned an "TooManyRequestsException" error message which could mean you reached the concurrency limit of AWS Lambda. You can increase the limit - read this troubleshooting page: ${docs_url_1.DOCS_URL}/docs/lambda/troubleshooting/rate-limit. The original error message is:
133
133
  `.trim());
134
+ }
135
+ if ((_c = error.stack) === null || _c === void 0 ? void 0 : _c.includes('The security token included in the request is invalid')) {
136
+ log_1.Log.error(`
137
+ AWS returned an error message "The security token included in the request is invalid". A possible reason for this is that you did not enable the region in your AWS account under "Account". The original message is:
138
+ `);
134
139
  }
135
140
  log_1.Log.error(error.stack);
136
141
  (0, quit_1.quit)(1);
@@ -5,6 +5,7 @@ const renderer_1 = require("@remotion/renderer");
5
5
  const version_1 = require("remotion/version");
6
6
  const get_or_create_bucket_1 = require("../api/get-or-create-bucket");
7
7
  const defaults_1 = require("../defaults");
8
+ const convert_to_serve_url_1 = require("../shared/convert-to-serve-url");
8
9
  const deserialize_input_props_1 = require("../shared/deserialize-input-props");
9
10
  const get_browser_instance_1 = require("./helpers/get-browser-instance");
10
11
  const get_current_region_1 = require("./helpers/get-current-region");
@@ -19,9 +20,10 @@ const compositionsHandler = async (lambdaParams, options) => {
19
20
  }
20
21
  throw new Error(`Version mismatch: When calling getCompositionsOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${version_1.VERSION}, but the @remotion/lambda package you used to invoke the function has version ${lambdaParams.version}. Deploy a new function and use it to call getCompositionsOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);
21
22
  }
23
+ const region = (0, get_current_region_1.getCurrentRegionInFunction)();
22
24
  const [{ bucketName }, browserInstance] = await Promise.all([
23
25
  (0, get_or_create_bucket_1.getOrCreateBucket)({
24
- region: (0, get_current_region_1.getCurrentRegionInFunction)(),
26
+ region,
25
27
  }),
26
28
  (0, get_browser_instance_1.getBrowserInstance)(renderer_1.RenderInternals.isEqualOrBelowLogLevel(lambdaParams.logLevel, 'verbose'), (_a = lambdaParams.chromiumOptions) !== null && _a !== void 0 ? _a : {}),
27
29
  ]);
@@ -31,10 +33,15 @@ const compositionsHandler = async (lambdaParams, options) => {
31
33
  region: (0, get_current_region_1.getCurrentRegionInFunction)(),
32
34
  serialized: lambdaParams.inputProps,
33
35
  });
36
+ const realServeUrl = (0, convert_to_serve_url_1.convertToServeUrl)({
37
+ urlOrId: lambdaParams.serveUrl,
38
+ region,
39
+ bucketName,
40
+ });
34
41
  const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
35
- const compositions = await (0, renderer_1.getCompositions)(lambdaParams.serveUrl, {
42
+ const compositions = await (0, renderer_1.getCompositions)(realServeUrl, {
36
43
  puppeteerInstance: browserInstance,
37
- inputProps: inputProps,
44
+ inputProps,
38
45
  envVariables: lambdaParams.envVariables,
39
46
  ffmpegExecutable: null,
40
47
  ffprobeExecutable: null,
@@ -2,22 +2,26 @@ import type { FfmpegExecutable } 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';
5
- export declare const concatVideosS3: ({ bucket, expectedFiles, onProgress, numberOfFrames, renderId, region, codec, expectedBucketOwner, fps, numberOfGifLoops, ffmpegExecutable, remotionRoot, onErrors, }: {
5
+ export declare const getAllFilesS3: ({ bucket, expectedFiles, outdir, renderId, region, expectedBucketOwner, onErrors, }: {
6
6
  bucket: string;
7
7
  expectedFiles: number;
8
- onProgress: (frames: number, encodingStart: number) => void;
9
- onErrors: (errors: EnhancedErrorInfo[]) => Promise<void>;
10
- numberOfFrames: number;
8
+ outdir: string;
11
9
  renderId: string;
12
10
  region: AwsRegion;
13
- codec: LambdaCodec;
14
11
  expectedBucketOwner: string;
12
+ onErrors: (errors: EnhancedErrorInfo[]) => Promise<void>;
13
+ }) => Promise<string[]>;
14
+ export declare const concatVideosS3: ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, ffmpegExecutable, remotionRoot, files, outdir, }: {
15
+ onProgress: (frames: number) => void;
16
+ numberOfFrames: number;
17
+ codec: LambdaCodec;
15
18
  fps: number;
16
19
  numberOfGifLoops: number | null;
17
20
  ffmpegExecutable: FfmpegExecutable;
18
21
  remotionRoot: string;
22
+ files: string[];
23
+ outdir: string;
19
24
  }) => Promise<{
20
25
  outfile: string;
21
26
  cleanupChunksProm: Promise<void>;
22
- encodingStart: number;
23
27
  }>;