@remotion/lambda 4.0.77 → 4.0.79

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.
@@ -36,6 +36,8 @@ export type InnerRenderMediaOnLambdaInput = {
36
36
  overwrite: boolean;
37
37
  audioBitrate: string | null;
38
38
  videoBitrate: string | null;
39
+ encodingMaxRate: string | null;
40
+ encodingBufferSize: string | null;
39
41
  webhook: WebhookOption | null;
40
42
  forceWidth: number | null;
41
43
  forceHeight: number | null;
@@ -45,5 +47,5 @@ export type InnerRenderMediaOnLambdaInput = {
45
47
  colorSpace: ColorSpace;
46
48
  deleteAfter: DeleteAfter | null;
47
49
  } & ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda>;
48
- export declare const makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, }: InnerRenderMediaOnLambdaInput) => Promise<LambdaStartPayload>;
50
+ export declare const makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, }: InnerRenderMediaOnLambdaInput) => Promise<LambdaStartPayload>;
49
51
  export declare const getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, }: GetRenderProgressInput) => LambdaStatusPayload;
@@ -9,7 +9,7 @@ const validate_frames_per_lambda_1 = require("../shared/validate-frames-per-lamb
9
9
  const validate_lambda_codec_1 = require("../shared/validate-lambda-codec");
10
10
  const validate_serveurl_1 = require("../shared/validate-serveurl");
11
11
  const validate_webhook_1 = require("../shared/validate-webhook");
12
- const makeLambdaRenderMediaPayload = async ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, }) => {
12
+ const makeLambdaRenderMediaPayload = async ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, }) => {
13
13
  const actualCodec = (0, validate_lambda_codec_1.validateLambdaCodec)(codec);
14
14
  (0, validate_serveurl_1.validateServeUrl)(serveUrl);
15
15
  (0, validate_frames_per_lambda_1.validateFramesPerLambda)({
@@ -59,6 +59,8 @@ const makeLambdaRenderMediaPayload = async ({ rendererFunctionName, frameRange,
59
59
  overwrite: overwrite !== null && overwrite !== void 0 ? overwrite : false,
60
60
  audioBitrate: audioBitrate !== null && audioBitrate !== void 0 ? audioBitrate : null,
61
61
  videoBitrate: videoBitrate !== null && videoBitrate !== void 0 ? videoBitrate : null,
62
+ encodingBufferSize: encodingBufferSize !== null && encodingBufferSize !== void 0 ? encodingBufferSize : null,
63
+ encodingMaxRate: encodingMaxRate !== null && encodingMaxRate !== void 0 ? encodingMaxRate : null,
62
64
  webhook: webhook !== null && webhook !== void 0 ? webhook : null,
63
65
  forceHeight: forceHeight !== null && forceHeight !== void 0 ? forceHeight : null,
64
66
  forceWidth: forceWidth !== null && forceWidth !== void 0 ? forceWidth : null,
@@ -41,6 +41,8 @@ export type RenderMediaOnLambdaInput = {
41
41
  overwrite?: boolean;
42
42
  audioBitrate?: string | null;
43
43
  videoBitrate?: string | null;
44
+ encodingMaxRate?: string | null;
45
+ encodingBufferSize?: string | null;
44
46
  webhook?: WebhookOption | null;
45
47
  forceWidth?: number | null;
46
48
  forceHeight?: number | null;
@@ -68,7 +68,7 @@ exports.internalRenderMediaOnLambdaRaw = internalRenderMediaOnLambdaRaw;
68
68
  * @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
69
69
  */
70
70
  const renderMediaOnLambda = (options) => {
71
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
71
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
72
72
  const wrapped = pure_1.PureJSAPIs.wrapWithErrorHandling(exports.internalRenderMediaOnLambdaRaw);
73
73
  if (options.quality) {
74
74
  throw new Error('quality has been renamed to jpegQuality. Please rename the option.');
@@ -110,9 +110,11 @@ const renderMediaOnLambda = (options) => {
110
110
  serveUrl: options.serveUrl,
111
111
  timeoutInMilliseconds: (_4 = options.timeoutInMilliseconds) !== null && _4 !== void 0 ? _4 : 30000,
112
112
  videoBitrate: (_5 = options.videoBitrate) !== null && _5 !== void 0 ? _5 : null,
113
- webhook: (_6 = options.webhook) !== null && _6 !== void 0 ? _6 : null,
114
- x264Preset: (_7 = options.x264Preset) !== null && _7 !== void 0 ? _7 : null,
115
- deleteAfter: (_8 = options.deleteAfter) !== null && _8 !== void 0 ? _8 : null,
113
+ encodingMaxRate: (_6 = options.encodingMaxRate) !== null && _6 !== void 0 ? _6 : null,
114
+ encodingBufferSize: (_7 = options.encodingBufferSize) !== null && _7 !== void 0 ? _7 : null,
115
+ webhook: (_8 = options.webhook) !== null && _8 !== void 0 ? _8 : null,
116
+ x264Preset: (_9 = options.x264Preset) !== null && _9 !== void 0 ? _9 : null,
117
+ deleteAfter: (_10 = options.deleteAfter) !== null && _10 !== void 0 ? _10 : null,
116
118
  });
117
119
  };
118
120
  exports.renderMediaOnLambda = renderMediaOnLambda;
@@ -38,7 +38,7 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
38
38
  (0, quit_1.quit)(1);
39
39
  }
40
40
  const region = (0, get_aws_region_1.getAwsRegion)();
41
- const { chromiumOptions, crf, envVariables, frameRange, inputProps, pixelFormat, proResProfile, puppeteerTimeout, jpegQuality, scale, everyNthFrame, numberOfGifLoops, muted, overwrite, audioBitrate, videoBitrate, height, width, browserExecutable, offthreadVideoCacheSizeInBytes, colorSpace, deleteAfter, x264Preset, } = await cli_1.CliInternals.getCliOptions({
41
+ const { chromiumOptions, crf, envVariables, frameRange, inputProps, pixelFormat, proResProfile, puppeteerTimeout, jpegQuality, scale, everyNthFrame, numberOfGifLoops, muted, overwrite, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, height, width, browserExecutable, offthreadVideoCacheSizeInBytes, colorSpace, deleteAfter, x264Preset, } = await cli_1.CliInternals.getCliOptions({
42
42
  type: 'series',
43
43
  isLambda: true,
44
44
  remotionRoot,
@@ -135,6 +135,8 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
135
135
  overwrite,
136
136
  audioBitrate,
137
137
  videoBitrate,
138
+ encodingBufferSize,
139
+ encodingMaxRate,
138
140
  forceHeight: height,
139
141
  forceWidth: width,
140
142
  webhook: args_1.parsedLambdaCli.webhook
@@ -272,7 +274,7 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
272
274
  log_1.Log.verbose({ indent: false, logLevel }, 'Most expensive frame ranges:');
273
275
  log_1.Log.verbose({ indent: false, logLevel }, newStatus.mostExpensiveFrameRanges
274
276
  .map((f) => {
275
- return `${f.frameRange[0]}-${f.frameRange[1]} (${f.timeInMilliseconds}ms)`;
277
+ return `${f.frameRange[0]}-${f.frameRange[1]} (Chunk ${f.chunk}, ${f.timeInMilliseconds}ms)`;
276
278
  })
277
279
  .join(', '));
278
280
  }
@@ -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
  };
@@ -172,6 +172,8 @@ const innerLaunchHandler = async ({ functionName, params, options, onAllChunksAv
172
172
  muted: params.muted,
173
173
  audioBitrate: params.audioBitrate,
174
174
  videoBitrate: params.videoBitrate,
175
+ encodingMaxRate: params.encodingMaxRate,
176
+ encodingBufferSize: params.encodingBufferSize,
175
177
  launchFunctionConfig: {
176
178
  version: version_1.VERSION,
177
179
  },
@@ -143,6 +143,8 @@ const renderHandler = async (params, options, logs) => {
143
143
  enforceAudioTrack: true,
144
144
  audioBitrate: params.audioBitrate,
145
145
  videoBitrate: params.videoBitrate,
146
+ encodingBufferSize: params.encodingBufferSize,
147
+ encodingMaxRate: params.encodingMaxRate,
146
148
  // Lossless flag takes priority over audio codec
147
149
  // https://github.com/remotion-dev/remotion/issues/1647
148
150
  // Special flag only in Lambda renderer which improves the audio quality
@@ -77,6 +77,8 @@ const startHandler = async (params, options) => {
77
77
  webhook: params.webhook,
78
78
  audioBitrate: params.audioBitrate,
79
79
  videoBitrate: params.videoBitrate,
80
+ encodingBufferSize: params.encodingBufferSize,
81
+ encodingMaxRate: params.encodingMaxRate,
80
82
  forceHeight: params.forceHeight,
81
83
  forceWidth: params.forceWidth,
82
84
  rendererFunctionName: params.rendererFunctionName,
@@ -1,5 +1,5 @@
1
1
  export declare const LambdaInternals: {
2
2
  executeCommand: (args: string[], remotionRoot: string, logLevel: "verbose" | "info" | "warn" | "error") => Promise<void>;
3
- makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, }: import("./api/make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("./defaults").LambdaStartPayload>;
3
+ makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, }: import("./api/make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("./defaults").LambdaStartPayload>;
4
4
  getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, }: import(".").GetRenderProgressInput) => import("./defaults").LambdaStatusPayload;
5
5
  };
@@ -8,7 +8,7 @@ const client_s3_1 = require("@aws-sdk/client-s3");
8
8
  const client_service_quotas_1 = require("@aws-sdk/client-service-quotas");
9
9
  const client_sts_1 = require("@aws-sdk/client-sts");
10
10
  const credential_providers_1 = require("@aws-sdk/credential-providers");
11
- const node_crypto_1 = require("node:crypto");
11
+ const no_react_1 = require("remotion/no-react");
12
12
  const check_credentials_1 = require("./check-credentials");
13
13
  const is_in_lambda_1 = require("./is-in-lambda");
14
14
  const _clients = {};
@@ -90,9 +90,7 @@ const getCredentialsHash = ({ customCredentials, region, service, }) => {
90
90
  hashComponents.customCredentials = customCredentials;
91
91
  hashComponents.region = region;
92
92
  hashComponents.service = service;
93
- return (0, node_crypto_1.createHash)('sha256')
94
- .update(JSON.stringify(hashComponents))
95
- .digest('base64');
93
+ return (0, no_react_1.random)(JSON.stringify(hashComponents)).toString().replace('0.', '');
96
94
  };
97
95
  const getServiceClient = ({ region, service, customCredentials, }) => {
98
96
  const Client = (() => {
@@ -83,7 +83,7 @@ const callLambdaWithoutRetry = async ({ functionName, type, payload, region, rec
83
83
  if (event.InvokeComplete.ErrorCode) {
84
84
  const logs = `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-3600~timeType~'RELATIVE~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40requestId*2c*20*40message*0a*7c*20filter*20*40requestId*20like*20*${res.$metadata.requestId}*22*0a*7c*20sort*20*40timestamp*20asc~source~(~'*2faws*2flambda*2f${functionName}))`;
85
85
  if (event.InvokeComplete.ErrorCode === 'Unhandled') {
86
- throw new Error(`Lambda function ${functionName} failed with an unhandled error. See ${logs} to see the logs of this invocation.`);
86
+ throw new Error(`Lambda function ${functionName} failed with an unhandled error: ${event.InvokeComplete.ErrorDetails} See ${logs} to see the logs of this invocation.`);
87
87
  }
88
88
  throw new Error(`Lambda function ${functionName} failed with error code ${event.InvokeComplete.ErrorCode}: ${event.InvokeComplete.ErrorDetails}. See ${logs} to see the logs of this invocation.`);
89
89
  }
@@ -105,7 +105,9 @@ type Prettify<T> = {
105
105
  export type WebhookOption = Prettify<null | ({
106
106
  url: string;
107
107
  secret: string | null;
108
- } & Partial<ToOptions<[typeof BrowserSafeApis.options.webhookCustomDataOption]>>)>;
108
+ } & Partial<ToOptions<{
109
+ customData: typeof BrowserSafeApis.options.webhookCustomDataOption;
110
+ }>>)>;
109
111
  export type SerializedInputProps = {
110
112
  type: 'bucket-url';
111
113
  hash: string;
@@ -146,6 +148,8 @@ export type LambdaStartPayload = {
146
148
  overwrite: boolean;
147
149
  audioBitrate: string | null;
148
150
  videoBitrate: string | null;
151
+ encodingMaxRate: string | null;
152
+ encodingBufferSize: string | null;
149
153
  webhook: WebhookOption;
150
154
  forceHeight: number | null;
151
155
  forceWidth: number | null;
@@ -200,6 +204,8 @@ export type LambdaPayloads = {
200
204
  overwrite: boolean;
201
205
  audioBitrate: string | null;
202
206
  videoBitrate: string | null;
207
+ encodingMaxRate: string | null;
208
+ encodingBufferSize: string | null;
203
209
  webhook: WebhookOption;
204
210
  forceHeight: number | null;
205
211
  forceWidth: number | null;
@@ -242,6 +248,8 @@ export type LambdaPayloads = {
242
248
  muted: boolean;
243
249
  audioBitrate: string | null;
244
250
  videoBitrate: string | null;
251
+ encodingBufferSize: string | null;
252
+ encodingMaxRate: string | null;
245
253
  launchFunctionConfig: {
246
254
  version: string;
247
255
  };
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import https from 'https';
4
2
  import http from 'node:http';
5
3
  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": "4.0.77",
3
+ "version": "4.0.79",
4
4
  "description": "Distributed renderer for Remotion based on AWS Lambda",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -26,10 +26,10 @@
26
26
  "aws-policies": "^1.0.1",
27
27
  "mime-types": "2.1.34",
28
28
  "zod": "3.22.3",
29
- "@remotion/bundler": "4.0.77",
30
- "@remotion/renderer": "4.0.77",
31
- "@remotion/cli": "4.0.77",
32
- "remotion": "4.0.77"
29
+ "@remotion/bundler": "4.0.79",
30
+ "@remotion/renderer": "4.0.79",
31
+ "@remotion/cli": "4.0.79",
32
+ "remotion": "4.0.79"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@jonny/eslint-config": "3.0.276",
@@ -43,11 +43,11 @@
43
43
  "ts-node": "^10.8.0",
44
44
  "vitest": "0.31.1",
45
45
  "zip-lib": "^0.7.2",
46
- "@remotion/bundler": "4.0.77",
47
- "@remotion/compositor-linux-arm64-gnu": "4.0.77"
46
+ "@remotion/bundler": "4.0.79",
47
+ "@remotion/compositor-linux-arm64-gnu": "4.0.79"
48
48
  },
49
49
  "peerDependencies": {
50
- "@remotion/bundler": "4.0.77"
50
+ "@remotion/bundler": "4.0.79"
51
51
  },
52
52
  "publishConfig": {
53
53
  "access": "public"
Binary file