@remotion/lambda 3.3.58 → 3.3.60

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.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deploySite = void 0;
4
+ const fs_1 = require("fs");
4
5
  const io_1 = require("../functions/helpers/io");
5
6
  const bundle_site_1 = require("../shared/bundle-site");
6
7
  const constants_1 = require("../shared/constants");
@@ -82,6 +83,9 @@ const deploySite = async ({ bucketName, entryPoint, siteName, options, region, }
82
83
  });
83
84
  })),
84
85
  ]);
86
+ if (!process.env.VITEST) {
87
+ (0, fs_1.rmdirSync)(bundled, { recursive: true });
88
+ }
85
89
  return {
86
90
  serveUrl: (0, make_s3_url_1.makeS3ServeUrl)({ bucketName, subFolder, region }),
87
91
  siteName: siteId,
@@ -50,6 +50,7 @@ const compositionsHandler = async (lambdaParams, options) => {
50
50
  port: null,
51
51
  downloadMap,
52
52
  });
53
+ renderer_1.RenderInternals.cleanDownloadMap(downloadMap);
53
54
  return Promise.resolve({
54
55
  compositions,
55
56
  });
@@ -1,5 +1,6 @@
1
1
  import type { _Object } from '@aws-sdk/client-s3';
2
2
  import type { EncodingProgress } from '../../defaults';
3
- export declare const getEncodingMetadata: ({ exists, }: {
3
+ export declare const getEncodingMetadata: ({ exists, frameCount, }: {
4
4
  exists: _Object | undefined;
5
+ frameCount: number;
5
6
  }) => EncodingProgress | null;
@@ -1,12 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getEncodingMetadata = void 0;
4
+ const defaults_1 = require("../../defaults");
4
5
  const chunk_progress_1 = require("../../shared/chunk-progress");
5
- const getEncodingMetadata = ({ exists, }) => {
6
+ const getEncodingMetadata = ({ exists, frameCount, }) => {
6
7
  if (!exists) {
7
8
  return null;
8
9
  }
9
10
  const framesEncoded = (0, chunk_progress_1.getProgressOfChunk)(exists.ETag);
10
- return { framesEncoded };
11
+ // We only report every 100 frames encoded so that we are able to report up to 2000 * 100 ETags => 200000 frames
12
+ return {
13
+ framesEncoded: Math.min(frameCount, framesEncoded * defaults_1.ENCODING_PROGRESS_STEP_SIZE),
14
+ };
11
15
  };
12
16
  exports.getEncodingMetadata = getEncodingMetadata;
@@ -82,9 +82,6 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
82
82
  expectedBucketOwner,
83
83
  });
84
84
  const renderMetadataExists = Boolean(contents.find((c) => c.Key === (0, constants_1.renderMetadataKey)(renderId)));
85
- const encodingStatus = (0, get_encoding_metadata_1.getEncodingMetadata)({
86
- exists: contents.find((c) => c.Key === (0, constants_1.encodingProgressKey)(renderId)),
87
- });
88
85
  const [renderMetadata, errorExplanations] = await Promise.all([
89
86
  renderMetadataExists
90
87
  ? (0, get_render_metadata_1.getRenderMetadata)({
@@ -162,6 +159,13 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
162
159
  contents,
163
160
  renderId,
164
161
  });
162
+ const frameCount = renderMetadata
163
+ ? renderer_1.RenderInternals.getFramesToRender(renderMetadata.frameRange, renderMetadata.everyNthFrame).length
164
+ : null;
165
+ const encodingStatus = (0, get_encoding_metadata_1.getEncodingMetadata)({
166
+ exists: contents.find((c) => c.Key === (0, constants_1.encodingProgressKey)(renderId)),
167
+ frameCount: frameCount === null ? 0 : frameCount,
168
+ });
165
169
  const finalEncodingStatus = (0, get_final_encoding_status_1.getFinalEncodingStatus)({
166
170
  encodingProgress: encodingStatus,
167
171
  outputFileExists: Boolean(outputFile),
@@ -179,9 +183,6 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
179
183
  : null,
180
184
  ...errorExplanations,
181
185
  ].filter(remotion_1.Internals.truthy);
182
- const frameCount = renderMetadata
183
- ? renderer_1.RenderInternals.getFramesToRender(renderMetadata.frameRange, renderMetadata.everyNthFrame).length
184
- : null;
185
186
  return {
186
187
  framesRendered,
187
188
  chunks: chunkCount,
@@ -157,7 +157,11 @@ const innerLaunchHandler = async (params, options) => {
157
157
  forceHeight: params.forceHeight,
158
158
  forceWidth: params.forceWidth,
159
159
  });
160
- remotion_1.Internals.validateDurationInFrames(comp.durationInFrames, 'passed to a Lambda render');
160
+ remotion_1.Internals.validateDurationInFrames({
161
+ durationInFrames: comp.durationInFrames,
162
+ component: 'passed to a Lambda render',
163
+ allowFloats: false,
164
+ });
161
165
  remotion_1.Internals.validateFps(comp.fps, 'passed to a Lambda render', false);
162
166
  remotion_1.Internals.validateDimension(comp.height, 'height', 'passed to a Lambda render');
163
167
  remotion_1.Internals.validateDimension(comp.width, 'width', 'passed to a Lambda render');
@@ -305,7 +309,7 @@ const innerLaunchHandler = async (params, options) => {
305
309
  (0, io_1.lambdaWriteFile)({
306
310
  bucketName: params.bucketName,
307
311
  key: (0, constants_1.encodingProgressKey)(params.renderId),
308
- body: String(framesEncoded),
312
+ body: String(Math.round(framesEncoded / constants_1.ENCODING_PROGRESS_STEP_SIZE)),
309
313
  region: (0, get_current_region_1.getCurrentRegionInFunction)(),
310
314
  privacy: 'private',
311
315
  expectedBucketOwner: options.expectedBucketOwner,
@@ -409,7 +413,7 @@ const innerLaunchHandler = async (params, options) => {
409
413
  const finalEncodingProgressProm = (0, io_1.lambdaWriteFile)({
410
414
  bucketName: params.bucketName,
411
415
  key: (0, constants_1.encodingProgressKey)(params.renderId),
412
- body: String(frameCount.length),
416
+ body: String(Math.ceil(frameCount.length / constants_1.ENCODING_PROGRESS_STEP_SIZE)),
413
417
  region: (0, get_current_region_1.getCurrentRegionInFunction)(),
414
418
  privacy: 'private',
415
419
  expectedBucketOwner: options.expectedBucketOwner,
@@ -471,6 +475,7 @@ const innerLaunchHandler = async (params, options) => {
471
475
  region: (0, get_current_region_1.getCurrentRegionInFunction)(),
472
476
  customCredentials: null,
473
477
  });
478
+ renderer_1.RenderInternals.cleanDownloadMap(downloadMap);
474
479
  await Promise.all([cleanupChunksProm, fs_1.default.promises.rm(outfile)]);
475
480
  clearTimeout(webhookDueToTimeout);
476
481
  if (params.webhook && !webhookInvoked) {
@@ -143,7 +143,9 @@ const renderHandler = async (params, options, logs) => {
143
143
  port: null,
144
144
  everyNthFrame: params.everyNthFrame,
145
145
  numberOfGifLoops: null,
146
- downloadMap,
146
+ internal: {
147
+ downloadMap,
148
+ },
147
149
  muted: params.muted,
148
150
  enforceAudioTrack: true,
149
151
  audioBitrate: params.audioBitrate,
@@ -201,6 +203,7 @@ const renderHandler = async (params, options, logs) => {
201
203
  downloadBehavior: null,
202
204
  customCredentials: null,
203
205
  }),
206
+ renderer_1.RenderInternals.cleanDownloadMap(downloadMap),
204
207
  ]);
205
208
  };
206
209
  const rendererHandler = async (params, options) => {
@@ -166,6 +166,7 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
166
166
  // overestimate the price, but will only have a miniscule effect (~0.2%)
167
167
  diskSizeInMb: constants_1.MAX_EPHEMERAL_STORAGE_IN_MB,
168
168
  });
169
+ renderer_1.RenderInternals.cleanDownloadMap(downloadMap);
169
170
  return {
170
171
  output: (0, get_output_url_from_metadata_1.getOutputUrlFromMetadata)(renderMetadata, bucketName, customCredentials),
171
172
  size,
@@ -27,6 +27,7 @@ export declare const MIN_EPHEMERAL_STORAGE_IN_MB = 512;
27
27
  export declare const MAX_EPHEMERAL_STORAGE_IN_MB = 10240;
28
28
  export declare const DEFAULT_OUTPUT_PRIVACY: Privacy;
29
29
  export declare const DEFAULT_CLOUDWATCH_RETENTION_PERIOD = 14;
30
+ export declare const ENCODING_PROGRESS_STEP_SIZE = 100;
30
31
  export declare const REMOTION_BUCKET_PREFIX = "remotionlambda-";
31
32
  export declare const RENDER_FN_PREFIX = "remotion-render-";
32
33
  export declare const LOG_GROUP_PREFIX = "/aws/lambda/";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LAMBDA_BURST_LIMIT_QUOTA = exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = exports.LambdaRoutines = exports.REMOTION_FILELIST_TOKEN = exports.REMOTION_CONCATED_TOKEN = exports.CONCAT_FOLDER_TOKEN = exports.RENDERER_PATH_TOKEN = exports.inputPropsKey = exports.postRenderDataKey = exports.customOutName = exports.outStillName = exports.outName = exports.getSitesKey = exports.getErrorFileName = exports.getErrorKeyPrefix = exports.chunkKeyForIndex = exports.chunkKey = exports.lambdaTimingsKey = exports.lambdaLogsPrefix = exports.lambdaTimingsPrefixForChunk = exports.lambdaTimingsPrefix = exports.lambdaChunkInitializedKey = exports.lambdaChunkInitializedPrefix = exports.initalizedMetadataKey = exports.renderMetadataKey = exports.encodingProgressKey = exports.rendersPrefix = exports.LOG_GROUP_PREFIX = exports.RENDER_FN_PREFIX = exports.REMOTION_BUCKET_PREFIX = exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = exports.DEFAULT_OUTPUT_PRIVACY = exports.MAX_EPHEMERAL_STORAGE_IN_MB = exports.MIN_EPHEMERAL_STORAGE_IN_MB = exports.DEFAULT_EPHEMERAL_STORAGE_IN_MB = exports.MAX_FUNCTIONS_PER_RENDER = exports.DEFAULT_MAX_RETRIES = exports.DEFAULT_REGION = exports.COMMAND_NOT_FOUND = exports.BINARY_NAME = exports.DEFAULT_FRAMES_PER_LAMBDA = exports.MINIMUM_FRAMES_PER_LAMBDA = exports.MAX_TIMEOUT = exports.MIN_TIMEOUT = exports.DEFAULT_TIMEOUT = exports.DEFAULT_ARCHITECTURE = exports.DEFAULT_MEMORY_SIZE = exports.MAX_MEMORY = exports.MIN_MEMORY = void 0;
3
+ exports.LAMBDA_BURST_LIMIT_QUOTA = exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = exports.LambdaRoutines = exports.REMOTION_FILELIST_TOKEN = exports.REMOTION_CONCATED_TOKEN = exports.CONCAT_FOLDER_TOKEN = exports.RENDERER_PATH_TOKEN = exports.inputPropsKey = exports.postRenderDataKey = exports.customOutName = exports.outStillName = exports.outName = exports.getSitesKey = exports.getErrorFileName = exports.getErrorKeyPrefix = exports.chunkKeyForIndex = exports.chunkKey = exports.lambdaTimingsKey = exports.lambdaLogsPrefix = exports.lambdaTimingsPrefixForChunk = exports.lambdaTimingsPrefix = exports.lambdaChunkInitializedKey = exports.lambdaChunkInitializedPrefix = exports.initalizedMetadataKey = exports.renderMetadataKey = exports.encodingProgressKey = exports.rendersPrefix = exports.LOG_GROUP_PREFIX = exports.RENDER_FN_PREFIX = exports.REMOTION_BUCKET_PREFIX = exports.ENCODING_PROGRESS_STEP_SIZE = exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = exports.DEFAULT_OUTPUT_PRIVACY = exports.MAX_EPHEMERAL_STORAGE_IN_MB = exports.MIN_EPHEMERAL_STORAGE_IN_MB = exports.DEFAULT_EPHEMERAL_STORAGE_IN_MB = exports.MAX_FUNCTIONS_PER_RENDER = exports.DEFAULT_MAX_RETRIES = exports.DEFAULT_REGION = exports.COMMAND_NOT_FOUND = exports.BINARY_NAME = exports.DEFAULT_FRAMES_PER_LAMBDA = exports.MINIMUM_FRAMES_PER_LAMBDA = exports.MAX_TIMEOUT = exports.MIN_TIMEOUT = exports.DEFAULT_TIMEOUT = exports.DEFAULT_ARCHITECTURE = exports.DEFAULT_MEMORY_SIZE = exports.MAX_MEMORY = exports.MIN_MEMORY = void 0;
4
4
  exports.MIN_MEMORY = 512;
5
5
  exports.MAX_MEMORY = 10240;
6
6
  exports.DEFAULT_MEMORY_SIZE = 2048;
@@ -20,6 +20,7 @@ exports.MIN_EPHEMERAL_STORAGE_IN_MB = 512;
20
20
  exports.MAX_EPHEMERAL_STORAGE_IN_MB = 10240;
21
21
  exports.DEFAULT_OUTPUT_PRIVACY = 'public';
22
22
  exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = 14;
23
+ exports.ENCODING_PROGRESS_STEP_SIZE = 100;
23
24
  exports.REMOTION_BUCKET_PREFIX = 'remotionlambda-';
24
25
  exports.RENDER_FN_PREFIX = 'remotion-render-';
25
26
  exports.LOG_GROUP_PREFIX = '/aws/lambda/';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "3.3.58",
3
+ "version": "3.3.60",
4
4
  "description": "Distributed renderer for Remotion based on AWS Lambda",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -33,18 +33,18 @@
33
33
  "@aws-sdk/credential-providers": "3.272.0",
34
34
  "@aws-sdk/lib-storage": "3.272.0",
35
35
  "@aws-sdk/s3-request-presigner": "3.272.0",
36
- "@remotion/bundler": "3.3.58",
37
- "@remotion/cli": "3.3.58",
38
- "@remotion/renderer": "3.3.58",
36
+ "@remotion/bundler": "3.3.60",
37
+ "@remotion/cli": "3.3.60",
38
+ "@remotion/renderer": "3.3.60",
39
39
  "aws-policies": "^1.0.1",
40
40
  "mime-types": "2.1.34",
41
- "remotion": "3.3.58"
41
+ "remotion": "3.3.60"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@jonny/eslint-config": "3.0.266",
45
- "@remotion/bundler": "3.3.44",
46
- "@remotion/compositor-linux-arm64-musl": "3.3.58",
47
- "@remotion/compositor-linux-x64-musl": "3.3.58",
45
+ "@remotion/bundler": "3.3.58",
46
+ "@remotion/compositor-linux-arm64-musl": "3.3.60",
47
+ "@remotion/compositor-linux-x64-musl": "3.3.60",
48
48
  "@types/mime-types": "2.1.1",
49
49
  "@types/minimist": "1.2.2",
50
50
  "@types/node": "^14.14.14",
@@ -58,7 +58,7 @@
58
58
  "zip-lib": "^0.7.2"
59
59
  },
60
60
  "peerDependencies": {
61
- "@remotion/bundler": "3.3.44"
61
+ "@remotion/bundler": "3.3.58"
62
62
  },
63
63
  "publishConfig": {
64
64
  "access": "public"
@@ -87,5 +87,5 @@
87
87
  ]
88
88
  }
89
89
  },
90
- "gitHead": "13dc20d2ef36d2db62b64318687cce80ee0cc31b"
90
+ "gitHead": "60797b0861ef1017cec53ba656214cbc10db011b"
91
91
  }
Binary file
Binary file