@remotion/lambda 3.2.0 → 3.2.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.
@@ -29,6 +29,7 @@ export declare type RenderMediaOnLambdaInput = {
29
29
  numberOfGifLoops?: number | null;
30
30
  concurrencyPerLambda?: number;
31
31
  downloadBehavior?: DownloadBehavior | null;
32
+ muted?: boolean;
32
33
  };
33
34
  export declare type RenderMediaOnLambdaOutput = {
34
35
  renderId: string;
@@ -52,8 +53,8 @@ export declare type RenderMediaOnLambdaOutput = {
52
53
  * @param params.logLevel Level of logging that Lambda function should perform. Default "info".
53
54
  * @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
54
55
  */
55
- export declare const renderMediaOnLambda: ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, logLevel, frameRange, outName, timeoutInMilliseconds, chromiumOptions, scale, numberOfGifLoops, everyNthFrame, concurrencyPerLambda, downloadBehavior, }: RenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
56
+ export declare const renderMediaOnLambda: ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, logLevel, frameRange, outName, timeoutInMilliseconds, chromiumOptions, scale, numberOfGifLoops, everyNthFrame, concurrencyPerLambda, downloadBehavior, muted, }: RenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
56
57
  /**
57
58
  * @deprecated Renamed to renderMediaOnLambda()
58
59
  */
59
- export declare const renderVideoOnLambda: ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, logLevel, frameRange, outName, timeoutInMilliseconds, chromiumOptions, scale, numberOfGifLoops, everyNthFrame, concurrencyPerLambda, downloadBehavior, }: RenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
60
+ export declare const renderVideoOnLambda: ({ functionName, serveUrl, inputProps, codec, imageFormat, crf, envVariables, pixelFormat, proResProfile, quality, region, maxRetries, composition, framesPerLambda, privacy, logLevel, frameRange, outName, timeoutInMilliseconds, chromiumOptions, scale, numberOfGifLoops, everyNthFrame, concurrencyPerLambda, downloadBehavior, muted, }: RenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
@@ -26,7 +26,7 @@ const validate_serveurl_1 = require("../shared/validate-serveurl");
26
26
  * @param params.logLevel Level of logging that Lambda function should perform. Default "info".
27
27
  * @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
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, numberOfGifLoops, everyNthFrame, concurrencyPerLambda, downloadBehavior, }) => {
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, numberOfGifLoops, everyNthFrame, concurrencyPerLambda, downloadBehavior, muted, }) => {
30
30
  var _a;
31
31
  const actualCodec = (0, validate_lambda_codec_1.validateLambdaCodec)(codec);
32
32
  (0, validate_serveurl_1.validateServeUrl)(serveUrl);
@@ -61,6 +61,7 @@ const renderMediaOnLambda = async ({ functionName, serveUrl, inputProps, codec,
61
61
  numberOfGifLoops: numberOfGifLoops !== null && numberOfGifLoops !== void 0 ? numberOfGifLoops : 0,
62
62
  concurrencyPerLambda: concurrencyPerLambda !== null && concurrencyPerLambda !== void 0 ? concurrencyPerLambda : 1,
63
63
  downloadBehavior: downloadBehavior !== null && downloadBehavior !== void 0 ? downloadBehavior : { type: 'play-in-browser' },
64
+ muted: muted !== null && muted !== void 0 ? muted : false,
64
65
  },
65
66
  region,
66
67
  });
@@ -38,7 +38,7 @@ const renderCommand = async (args) => {
38
38
  (0, quit_1.quit)(1);
39
39
  }
40
40
  const outName = (_a = args[2]) !== null && _a !== void 0 ? _a : null;
41
- const { chromiumOptions, codec, crf, envVariables, frameRange, imageFormat, inputProps, logLevel, pixelFormat, proResProfile, puppeteerTimeout, quality, scale, everyNthFrame, numberOfGifLoops, } = await cli_1.CliInternals.getCliOptions({
41
+ const { chromiumOptions, codec, crf, envVariables, frameRange, imageFormat, inputProps, logLevel, pixelFormat, proResProfile, puppeteerTimeout, quality, scale, everyNthFrame, numberOfGifLoops, muted, } = await cli_1.CliInternals.getCliOptions({
42
42
  type: 'series',
43
43
  isLambda: true,
44
44
  });
@@ -75,6 +75,7 @@ const renderCommand = async (args) => {
75
75
  numberOfGifLoops,
76
76
  everyNthFrame,
77
77
  concurrencyPerLambda: args_1.parsedLambdaCli['concurrency-per-lambda'],
78
+ muted,
78
79
  });
79
80
  const totalSteps = outName ? 5 : 4;
80
81
  const progressBar = cli_1.CliInternals.createOverwriteableCliOutput(cli_1.CliInternals.quietFlagProvided());
@@ -148,6 +148,7 @@ const innerLaunchHandler = async (params, options) => {
148
148
  scale: params.scale,
149
149
  everyNthFrame: params.everyNthFrame,
150
150
  concurrencyPerLambda: params.concurrencyPerLambda,
151
+ muted: params.muted,
151
152
  };
152
153
  return payload;
153
154
  });
@@ -18,7 +18,7 @@ const get_folder_size_1 = require("./helpers/get-folder-size");
18
18
  const io_1 = require("./helpers/io");
19
19
  const write_lambda_error_1 = require("./helpers/write-lambda-error");
20
20
  const renderHandler = async (params, options, logs) => {
21
- var _a, _b;
21
+ var _a;
22
22
  if (params.type !== constants_1.LambdaRoutines.renderer) {
23
23
  throw new Error('Params must be renderer');
24
24
  }
@@ -41,81 +41,87 @@ const renderHandler = async (params, options, logs) => {
41
41
  const outputLocation = path_1.default.join(outdir, `localchunk-${String(params.chunk).padStart(8, '0')}.${renderer_1.RenderInternals.getFileExtensionFromCodec(params.codec, 'chunk')}`);
42
42
  const chunkCodec = params.codec === 'gif' ? 'h264-mkv' : params.codec;
43
43
  const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
44
- await (0, renderer_1.renderMedia)({
45
- composition: {
46
- id: params.composition,
47
- durationInFrames: params.durationInFrames,
48
- fps: params.fps,
49
- height: params.height,
50
- width: params.width,
51
- },
52
- imageFormat: params.imageFormat,
53
- inputProps: params.inputProps,
54
- frameRange: params.frameRange,
55
- onProgress: ({ renderedFrames, encodedFrames, stitchStage }) => {
56
- if (renderedFrames % 10 === 0 &&
57
- renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose')) {
58
- console.log(`Rendered ${renderedFrames} frames, encoded ${encodedFrames} frames, stage = ${stitchStage}`);
59
- }
60
- const allFrames = renderer_1.RenderInternals.getFramesToRender(params.frameRange, params.everyNthFrame);
61
- if (renderedFrames === allFrames.length) {
62
- console.log('Rendered all frames!');
63
- }
64
- chunkTimingData.timings[renderedFrames] = Date.now() - start;
65
- },
66
- parallelism: params.concurrencyPerLambda,
67
- onStart: () => {
68
- (0, io_1.lambdaWriteFile)({
69
- privacy: 'private',
70
- bucketName: params.bucketName,
71
- body: JSON.stringify({
72
- filesCleaned: clean_tmpdir_1.deletedFilesSize,
73
- filesInTmp: fs_1.default.readdirSync('/tmp'),
74
- isWarm: options.isWarm,
75
- deletedFiles: clean_tmpdir_1.deletedFiles,
76
- tmpSize: (0, get_folder_size_1.getFolderSizeRecursively)('/tmp'),
77
- tmpDirFiles: (0, get_files_in_folder_1.getFolderFiles)('/tmp'),
78
- }),
79
- key: (0, constants_1.lambdaInitializedKey)({
80
- renderId: params.renderId,
81
- chunk: params.chunk,
82
- attempt: params.attempt,
83
- }),
84
- region: (0, get_current_region_1.getCurrentRegionInFunction)(),
85
- expectedBucketOwner: options.expectedBucketOwner,
86
- downloadBehavior: null,
87
- });
88
- },
89
- puppeteerInstance: browserInstance,
90
- serveUrl: params.serveUrl,
91
- quality: params.quality,
92
- envVariables: params.envVariables,
93
- dumpBrowserLogs: renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose'),
94
- verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose'),
95
- onBrowserLog: (log) => {
96
- logs.push(log);
97
- },
98
- outputLocation,
99
- codec: chunkCodec,
100
- crf: (_b = params.crf) !== null && _b !== void 0 ? _b : undefined,
101
- ffmpegExecutable: process.env.NODE_ENV === 'test' ? null : '/opt/bin/ffmpeg',
102
- pixelFormat: params.pixelFormat,
103
- proResProfile: params.proResProfile,
104
- onDownload: (src) => {
105
- console.log('Downloading', src);
106
- return () => undefined;
107
- },
108
- overwrite: false,
109
- chromiumOptions: params.chromiumOptions,
110
- scale: params.scale,
111
- timeoutInMilliseconds: params.timeoutInMilliseconds,
112
- port: null,
113
- everyNthFrame: params.everyNthFrame,
114
- numberOfGifLoops: null,
115
- downloadMap,
44
+ await new Promise((resolve, reject) => {
45
+ var _a;
46
+ (0, renderer_1.renderMedia)({
47
+ composition: {
48
+ id: params.composition,
49
+ durationInFrames: params.durationInFrames,
50
+ fps: params.fps,
51
+ height: params.height,
52
+ width: params.width,
53
+ },
54
+ imageFormat: params.imageFormat,
55
+ inputProps: params.inputProps,
56
+ frameRange: params.frameRange,
57
+ onProgress: ({ renderedFrames, encodedFrames, stitchStage }) => {
58
+ if (renderedFrames % 10 === 0 &&
59
+ renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose')) {
60
+ console.log(`Rendered ${renderedFrames} frames, encoded ${encodedFrames} frames, stage = ${stitchStage}`);
61
+ }
62
+ const allFrames = renderer_1.RenderInternals.getFramesToRender(params.frameRange, params.everyNthFrame);
63
+ if (renderedFrames === allFrames.length) {
64
+ console.log('Rendered all frames!');
65
+ }
66
+ chunkTimingData.timings[renderedFrames] = Date.now() - start;
67
+ },
68
+ parallelism: params.concurrencyPerLambda,
69
+ onStart: () => {
70
+ (0, io_1.lambdaWriteFile)({
71
+ privacy: 'private',
72
+ bucketName: params.bucketName,
73
+ body: JSON.stringify({
74
+ filesCleaned: clean_tmpdir_1.deletedFilesSize,
75
+ filesInTmp: fs_1.default.readdirSync('/tmp'),
76
+ isWarm: options.isWarm,
77
+ deletedFiles: clean_tmpdir_1.deletedFiles,
78
+ tmpSize: (0, get_folder_size_1.getFolderSizeRecursively)('/tmp'),
79
+ tmpDirFiles: (0, get_files_in_folder_1.getFolderFiles)('/tmp'),
80
+ }),
81
+ key: (0, constants_1.lambdaInitializedKey)({
82
+ renderId: params.renderId,
83
+ chunk: params.chunk,
84
+ attempt: params.attempt,
85
+ }),
86
+ region: (0, get_current_region_1.getCurrentRegionInFunction)(),
87
+ expectedBucketOwner: options.expectedBucketOwner,
88
+ downloadBehavior: null,
89
+ }).catch((err) => reject(err));
90
+ },
91
+ puppeteerInstance: browserInstance,
92
+ serveUrl: params.serveUrl,
93
+ quality: params.quality,
94
+ envVariables: params.envVariables,
95
+ dumpBrowserLogs: renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose'),
96
+ verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose'),
97
+ onBrowserLog: (log) => {
98
+ logs.push(log);
99
+ },
100
+ outputLocation,
101
+ codec: chunkCodec,
102
+ crf: (_a = params.crf) !== null && _a !== void 0 ? _a : undefined,
103
+ ffmpegExecutable: process.env.NODE_ENV === 'test' ? null : '/opt/bin/ffmpeg',
104
+ pixelFormat: params.pixelFormat,
105
+ proResProfile: params.proResProfile,
106
+ onDownload: (src) => {
107
+ console.log('Downloading', src);
108
+ return () => undefined;
109
+ },
110
+ overwrite: false,
111
+ chromiumOptions: params.chromiumOptions,
112
+ scale: params.scale,
113
+ timeoutInMilliseconds: params.timeoutInMilliseconds,
114
+ port: null,
115
+ everyNthFrame: params.everyNthFrame,
116
+ numberOfGifLoops: null,
117
+ downloadMap,
118
+ muted: params.muted,
119
+ enforceAudioTrack: true,
120
+ })
121
+ .then(() => resolve())
122
+ .catch((err) => reject(err));
116
123
  });
117
124
  const endRendered = Date.now();
118
- console.log('Adding silent audio, chunk', params.chunk);
119
125
  const condensedTimingData = {
120
126
  ...chunkTimingData,
121
127
  timings: Object.values(chunkTimingData.timings),
@@ -43,6 +43,7 @@ const startHandler = async (params) => {
43
43
  everyNthFrame: params.everyNthFrame,
44
44
  concurrencyPerLambda: params.concurrencyPerLambda,
45
45
  downloadBehavior: params.downloadBehavior,
46
+ muted: params.muted,
46
47
  };
47
48
  await (0, aws_clients_1.getLambdaClient)((0, get_current_region_1.getCurrentRegionInFunction)()).send(new client_lambda_1.InvokeCommand({
48
49
  FunctionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
@@ -113,6 +113,7 @@ export declare type LambdaPayloads = {
113
113
  numberOfGifLoops: number | null;
114
114
  concurrencyPerLambda: number;
115
115
  downloadBehavior: DownloadBehavior;
116
+ muted: boolean;
116
117
  };
117
118
  launch: {
118
119
  type: LambdaRoutines.launch;
@@ -141,6 +142,7 @@ export declare type LambdaPayloads = {
141
142
  numberOfGifLoops: number | null;
142
143
  concurrencyPerLambda: number;
143
144
  downloadBehavior: DownloadBehavior;
145
+ muted: boolean;
144
146
  };
145
147
  status: {
146
148
  type: LambdaRoutines.status;
@@ -176,6 +178,7 @@ export declare type LambdaPayloads = {
176
178
  chromiumOptions: ChromiumOptions;
177
179
  scale: number;
178
180
  everyNthFrame: number;
181
+ muted: boolean;
179
182
  };
180
183
  still: {
181
184
  type: LambdaRoutines.still;
@@ -224,7 +227,7 @@ export declare type RenderMetadata = {
224
227
  renderId: string;
225
228
  outName: OutNameInput | undefined;
226
229
  };
227
- export declare type LambdaVersions = '2022-08-08' | '2022-08-04' | '2022-08-02' | '2022-08-01' | '2022-07-28' | '2022-07-27' | '2022-07-25' | '2022-07-23' | '2022-07-20' | '2022-07-18' | '2022-07-15' | '2022-07-14' | '2022-07-12' | '2022-07-10' | '2022-07-09' | '2022-07-08' | '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';
230
+ export declare type LambdaVersions = '2022-08-13' | '2022-08-11' | '2022-08-10' | '2022-08-04' | '2022-08-02' | '2022-08-01' | '2022-07-28' | '2022-07-27' | '2022-07-25' | '2022-07-23' | '2022-07-20' | '2022-07-18' | '2022-07-15' | '2022-07-14' | '2022-07-12' | '2022-07-10' | '2022-07-09' | '2022-07-08' | '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';
228
231
  export declare const CURRENT_VERSION: LambdaVersions;
229
232
  export declare type PostRenderData = {
230
233
  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-08-08';
87
+ exports.CURRENT_VERSION = '2022-08-13';
88
88
  exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = 'L-B99A9384';
89
89
  exports.LAMBDA_BURST_LIMIT_QUOTA = 'L-548AE339';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "3.2.0",
3
+ "version": "3.2.3",
4
4
  "description": "Distributed renderer for Remotion based on AWS Lambda",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -32,12 +32,12 @@
32
32
  "@aws-sdk/client-service-quotas": "3.58.0",
33
33
  "@aws-sdk/lib-storage": "3.58.0",
34
34
  "@aws-sdk/s3-request-presigner": "3.58.0",
35
- "@remotion/bundler": "3.2.0",
36
- "@remotion/cli": "3.2.0",
37
- "@remotion/renderer": "3.2.0",
35
+ "@remotion/bundler": "3.2.3",
36
+ "@remotion/cli": "3.2.3",
37
+ "@remotion/renderer": "3.2.3",
38
38
  "aws-policies": "^1.0.1",
39
39
  "mime-types": "2.1.34",
40
- "remotion": "3.2.0"
40
+ "remotion": "3.2.3"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "react": ">=16.8.0",
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "47b188161a9e922a247eaa998e72d37af9137707"
65
+ "gitHead": "15773a2e48ee8a9dbcfd898520cb914396c21eb1"
66
66
  }
Binary file