@remotion/lambda 3.3.59 → 3.3.61

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.
@@ -3,8 +3,5 @@ export declare const planFrameRanges: ({ framesPerLambda, frameRange, everyNthFr
3
3
  frameRange: [number, number];
4
4
  everyNthFrame: number;
5
5
  }) => {
6
- chunks: [
7
- number,
8
- number
9
- ][];
6
+ chunks: [number, number][];
10
7
  };
@@ -1 +1 @@
1
- export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "sa-east-1" | "eu-south-1" | "af-south-1" | "ap-east-1" | "me-south-1";
1
+ export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-south-1" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "af-south-1" | "ap-south-1" | "ap-east-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "me-south-1" | "sa-east-1";
@@ -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,
@@ -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/';
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
1
3
  import http from 'http';
2
4
  import https from 'https';
3
5
  import type { EnhancedErrorInfo } from '../functions/helpers/write-lambda-error';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "3.3.59",
3
+ "version": "3.3.61",
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.59",
37
- "@remotion/cli": "3.3.59",
38
- "@remotion/renderer": "3.3.59",
36
+ "@remotion/bundler": "3.3.61",
37
+ "@remotion/cli": "3.3.61",
38
+ "@remotion/renderer": "3.3.61",
39
39
  "aws-policies": "^1.0.1",
40
40
  "mime-types": "2.1.34",
41
- "remotion": "3.3.59"
41
+ "remotion": "3.3.61"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@jonny/eslint-config": "3.0.266",
45
45
  "@remotion/bundler": "3.3.58",
46
- "@remotion/compositor-linux-arm64-musl": "3.3.59",
47
- "@remotion/compositor-linux-x64-musl": "3.3.59",
46
+ "@remotion/compositor-linux-arm64-musl": "3.3.61",
47
+ "@remotion/compositor-linux-x64-musl": "3.3.61",
48
48
  "@types/mime-types": "2.1.1",
49
49
  "@types/minimist": "1.2.2",
50
50
  "@types/node": "^14.14.14",
@@ -87,5 +87,5 @@
87
87
  ]
88
88
  }
89
89
  },
90
- "gitHead": "4ee88b056704d7224838a8fbc32d2d3522c5afbe"
90
+ "gitHead": "c2d7a7088e4a9939c95168e03d7e29e3f6d63973"
91
91
  }
Binary file
Binary file