@remotion/lambda 4.0.0-publish.10 → 4.0.0-publish.3

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.
@@ -2,13 +2,14 @@ import type { ChromiumOptions } from '@remotion/renderer';
2
2
  import type { FrameRange, ImageFormat, LogLevel, PixelFormat, ProResProfile } from 'remotion';
3
3
  import type { AwsRegion } from '../pricing/aws-regions';
4
4
  import type { Privacy } from '../shared/constants';
5
+ import type { LambdaCodec } from '../shared/validate-lambda-codec';
5
6
  export declare type RenderMediaOnLambdaInput = {
6
7
  region: AwsRegion;
7
8
  functionName: string;
8
9
  serveUrl: string;
9
10
  composition: string;
10
11
  inputProps: unknown;
11
- codec: 'h264-mkv' | 'mp3' | 'aac' | 'wav';
12
+ codec: LambdaCodec;
12
13
  imageFormat: ImageFormat;
13
14
  crf?: number | undefined;
14
15
  envVariables?: Record<string, string>;
@@ -6,6 +6,7 @@ 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
8
  const validate_frames_per_lambda_1 = require("../shared/validate-frames-per-lambda");
9
+ const validate_lambda_codec_1 = require("../shared/validate-lambda-codec");
9
10
  const validate_serveurl_1 = require("../shared/validate-serveurl");
10
11
  /**
11
12
  * @description Triggers a render on a lambda given a composition and a lambda function.
@@ -26,6 +27,7 @@ const validate_serveurl_1 = require("../shared/validate-serveurl");
26
27
  * @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
27
28
  */
28
29
  const renderMediaOnLambda = async ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, logLevel, frameRange, outName, timeoutInMilliseconds, chromiumOptions, scale, }) => {
30
+ const actualCodec = (0, validate_lambda_codec_1.validateLambdaCodec)(codec);
29
31
  (0, validate_serveurl_1.validateServeUrl)(serveUrl);
30
32
  (0, validate_frames_per_lambda_1.validateFramesPerLambda)(framesPerLambda !== null && framesPerLambda !== void 0 ? framesPerLambda : null);
31
33
  const realServeUrl = await (0, convert_to_serve_url_1.convertToServeUrl)(serveUrl, region);
@@ -37,7 +39,7 @@ const renderMediaOnLambda = async ({ functionName, serveUrl, inputProps, codec,
37
39
  composition,
38
40
  serveUrl: realServeUrl,
39
41
  inputProps,
40
- codec,
42
+ codec: actualCodec,
41
43
  imageFormat,
42
44
  crf,
43
45
  envVariables,
@@ -6,6 +6,9 @@ export declare const planFrameRanges: ({ chunkCount, framesPerLambda, optimizati
6
6
  shouldUseOptimization: boolean;
7
7
  frameRange: [number, number];
8
8
  }) => {
9
- chunks: [number, number][];
9
+ chunks: [
10
+ number,
11
+ number
12
+ ][];
10
13
  didUseOptimization: boolean;
11
14
  };
@@ -1,5 +1,5 @@
1
- import type { Codec } from 'remotion';
2
1
  import type { AwsRegion } from '../../pricing/aws-regions';
2
+ import type { LambdaCodec } from '../../shared/validate-lambda-codec';
3
3
  export declare const concatVideosS3: ({ bucket, expectedFiles, onProgress, numberOfFrames, renderId, region, codec, expectedBucketOwner, fps, }: {
4
4
  bucket: string;
5
5
  expectedFiles: number;
@@ -7,7 +7,7 @@ export declare const concatVideosS3: ({ bucket, expectedFiles, onProgress, numbe
7
7
  numberOfFrames: number;
8
8
  renderId: string;
9
9
  region: AwsRegion;
10
- codec: Codec;
10
+ codec: LambdaCodec;
11
11
  expectedBucketOwner: string;
12
12
  fps: number;
13
13
  }) => Promise<{
@@ -110,7 +110,7 @@ const innerLaunchHandler = async (params, options) => {
110
110
  inputProps: params.inputProps,
111
111
  renderId: params.renderId,
112
112
  imageFormat: params.imageFormat,
113
- codec: params.codec,
113
+ codec: params.codec === 'h264' ? 'h264-mkv' : params.codec,
114
114
  crf: params.crf,
115
115
  envVariables: params.envVariables,
116
116
  pixelFormat: params.pixelFormat,
@@ -5,6 +5,7 @@ import type { EnhancedErrorInfo } from '../functions/helpers/write-lambda-error'
5
5
  import type { AwsRegion } from '../pricing/aws-regions';
6
6
  import type { ExpensiveChunk } from './get-most-expensive-chunks';
7
7
  import type { LambdaArchitecture } from './validate-architecture';
8
+ import type { LambdaCodec } from './validate-lambda-codec';
8
9
  export declare const MIN_MEMORY = 512;
9
10
  export declare const MAX_MEMORY = 10240;
10
11
  export declare const DEFAULT_MEMORY_SIZE = 2048;
@@ -92,7 +93,7 @@ export declare type LambdaPayloads = {
92
93
  composition: string;
93
94
  framesPerLambda: number | null;
94
95
  inputProps: unknown;
95
- codec: Codec;
96
+ codec: LambdaCodec;
96
97
  imageFormat: ImageFormat;
97
98
  crf: number | undefined;
98
99
  envVariables: Record<string, string> | undefined;
@@ -117,7 +118,7 @@ export declare type LambdaPayloads = {
117
118
  inputProps: unknown;
118
119
  renderId: string;
119
120
  imageFormat: ImageFormat;
120
- codec: Codec;
121
+ codec: LambdaCodec;
121
122
  crf: number | undefined;
122
123
  envVariables: Record<string, string> | undefined;
123
124
  pixelFormat: PixelFormat | undefined;
@@ -152,7 +153,7 @@ export declare type LambdaPayloads = {
152
153
  inputProps: unknown;
153
154
  renderId: string;
154
155
  imageFormat: ImageFormat;
155
- codec: Codec;
156
+ codec: Exclude<Codec, 'h264'>;
156
157
  crf: number | undefined;
157
158
  proResProfile: ProResProfile | undefined;
158
159
  pixelFormat: PixelFormat | undefined;
@@ -211,7 +212,7 @@ export declare type RenderMetadata = {
211
212
  renderId: string;
212
213
  outName: OutNameInput | undefined;
213
214
  };
214
- export declare type LambdaVersions = '2022-06-30' | '2022-06-29' | '2022-06-25' | '2022-06-22' | '2022-06-21' | '2022-06-14' | '2022-06-08' | '2022-06-07' | '2022-06-02' | '2022-05-31' | '2022-05-28' | '2022-05-27' | '2022-05-19' | '2022-05-16' | '2022-05-11' | '2022-05-07' | '2022-05-06' | '2022-05-03' | '2022-04-20' | '2022-04-19' | '2022-04-18' | '2022-04-09' | '2022-04-08' | '2022-04-05' | '2022-04-02' | '2022-03-29' | '2022-03-17' | '2022-03-02' | '2022-03-01' | '2022-02-27' | '2022-02-14' | '2022-02-12' | '2022-02-09' | '2022-02-08' | '2022-02-07' | '2022-02-06' | '2022-02-05' | '2022-02-04' | '2022-02-03' | '2022-01-23' | '2022-01-19' | '2022-01-11' | '2022-01-10' | '2022-01-09' | '2022-01-06' | '2022-01-05' | '2021-12-22' | '2021-12-17' | '2021-12-16' | '2021-12-15' | '2021-12-14' | '2021-12-13' | '2021-12-11' | '2021-12-10' | '2021-12-04' | '2021-11-29' | '2021-11-27' | '2021-11-24' | '2021-11-22' | '2021-11-19' | '2021-11-18' | '2021-11-15' | '2021-11-12' | '2021-11-10' | '2021-11-01' | '2021-10-29' | '2021-10-27' | '2021-10-21' | '2021-10-19' | '2021-10-07' | '2021-10-03' | '2021-10-01' | '2021-09-15' | '2021-09-06' | '2021-08-06' | '2021-07-14' | '2021-07-05' | '2021-07-02' | '2021-06-23' | 'n/a';
215
+ export declare type LambdaVersions = '2022-07-04' | '2022-06-30' | '2022-06-29' | '2022-06-25' | '2022-06-22' | '2022-06-21' | '2022-06-14' | '2022-06-08' | '2022-06-07' | '2022-06-02' | '2022-05-31' | '2022-05-28' | '2022-05-27' | '2022-05-19' | '2022-05-16' | '2022-05-11' | '2022-05-07' | '2022-05-06' | '2022-05-03' | '2022-04-20' | '2022-04-19' | '2022-04-18' | '2022-04-09' | '2022-04-08' | '2022-04-05' | '2022-04-02' | '2022-03-29' | '2022-03-17' | '2022-03-02' | '2022-03-01' | '2022-02-27' | '2022-02-14' | '2022-02-12' | '2022-02-09' | '2022-02-08' | '2022-02-07' | '2022-02-06' | '2022-02-05' | '2022-02-04' | '2022-02-03' | '2022-01-23' | '2022-01-19' | '2022-01-11' | '2022-01-10' | '2022-01-09' | '2022-01-06' | '2022-01-05' | '2021-12-22' | '2021-12-17' | '2021-12-16' | '2021-12-15' | '2021-12-14' | '2021-12-13' | '2021-12-11' | '2021-12-10' | '2021-12-04' | '2021-11-29' | '2021-11-27' | '2021-11-24' | '2021-11-22' | '2021-11-19' | '2021-11-18' | '2021-11-15' | '2021-11-12' | '2021-11-10' | '2021-11-01' | '2021-10-29' | '2021-10-27' | '2021-10-21' | '2021-10-19' | '2021-10-07' | '2021-10-03' | '2021-10-01' | '2021-09-15' | '2021-09-06' | '2021-08-06' | '2021-07-14' | '2021-07-05' | '2021-07-02' | '2021-06-23' | 'n/a';
215
216
  export declare const CURRENT_VERSION: LambdaVersions;
216
217
  export declare type PostRenderData = {
217
218
  cost: {
@@ -84,6 +84,6 @@ var LambdaRoutines;
84
84
  LambdaRoutines["renderer"] = "renderer";
85
85
  LambdaRoutines["still"] = "still";
86
86
  })(LambdaRoutines = exports.LambdaRoutines || (exports.LambdaRoutines = {}));
87
- exports.CURRENT_VERSION = '2022-06-30';
87
+ exports.CURRENT_VERSION = '2022-07-04';
88
88
  exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = 'L-B99A9384';
89
89
  exports.LAMBDA_BURST_LIMIT_QUOTA = 'L-548AE339';
@@ -0,0 +1,4 @@
1
+ declare const lambdaCodecs: readonly ["h264-mkv", "h264", "vp8", "mp3", "aac", "wav"];
2
+ export declare type LambdaCodec = typeof lambdaCodecs[number];
3
+ export declare const validateLambdaCodec: (codec: unknown) => LambdaCodec;
4
+ export {};
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateLambdaCodec = void 0;
4
+ const lambdaCodecs = ['h264-mkv', 'h264', 'vp8', 'mp3', 'aac', 'wav'];
5
+ const validateLambdaCodec = (codec) => {
6
+ if (typeof codec !== 'string') {
7
+ throw new TypeError('"codec" must be a string ');
8
+ }
9
+ if (!lambdaCodecs.includes(codec)) {
10
+ throw new TypeError("'" +
11
+ codec +
12
+ "' is not a valid codec for Lambda. The following values are supported: " +
13
+ lambdaCodecs.join(', '));
14
+ }
15
+ if (codec === 'h264-mkv') {
16
+ console.warn('The "h264-mkv" codec for renderMediaOnLambda() is deprecated - it\'s now just "h264".');
17
+ return 'h264';
18
+ }
19
+ return codec;
20
+ };
21
+ exports.validateLambdaCodec = validateLambdaCodec;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "4.0.0-publish.10+e1fc98f51",
3
+ "version": "4.0.0-publish.3+61971d192",
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.58.0",
32
32
  "@aws-sdk/lib-storage": "3.58.0",
33
33
  "@aws-sdk/s3-request-presigner": "3.58.0",
34
- "@remotion/bundler": "4.0.0-publish.10+e1fc98f51",
35
- "@remotion/cli": "4.0.0-publish.10+e1fc98f51",
36
- "@remotion/renderer": "4.0.0-publish.10+e1fc98f51",
34
+ "@remotion/bundler": "4.0.0-publish.3+61971d192",
35
+ "@remotion/cli": "4.0.0-publish.3+61971d192",
36
+ "@remotion/renderer": "4.0.0-publish.3+61971d192",
37
37
  "aws-policies": "^1.0.1",
38
38
  "mime-types": "2.1.34",
39
- "remotion": "4.0.0-publish.10+e1fc98f51"
39
+ "remotion": "4.0.0-publish.3+61971d192"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=16.8.0",
@@ -61,5 +61,5 @@
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "e1fc98f51c2140394b69ed736d0dc5b547de7e82"
64
+ "gitHead": "61971d1927db43af8654095ad5467effd994938e"
65
65
  }
Binary file