@remotion/lambda 4.0.0-oops.3 → 4.0.0-preload.13

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.
@@ -43,14 +43,14 @@ const makeLayerPublic = async () => {
43
43
  const { Version, LayerArn } = await (0, aws_clients_1.getLambdaClient)(region).send(new client_lambda_1.PublishLayerVersionCommand({
44
44
  Content: {
45
45
  S3Bucket: 'remotionlambda-binaries-' + region,
46
- S3Key: `remotion-layer-${layer}-v4-${architecture}.zip`,
46
+ S3Key: `remotion-layer-${layer}-v5-${architecture}.zip`,
47
47
  },
48
48
  LayerName: layerName,
49
49
  LicenseInfo: layer === 'chromium'
50
- ? 'Compiled from Chromium source. Read Chromium License: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/LICENSE'
50
+ ? 'Chromium 101, compiled from source. Read Chromium License: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/LICENSE'
51
51
  : layer === 'ffmpeg'
52
52
  ? 'Compiled from FFMPEG source. Read FFMPEG license: https://ffmpeg.org/legal.html'
53
- : 'Contains UNIX .so files and Noto Sans font. Read Noto Sans License: https://fonts.google.com/noto/specimen/Noto+Sans/about',
53
+ : 'Contains Amazon Linux .so files and Noto Sans font. Read Noto Sans License: https://fonts.google.com/noto/specimen/Noto+Sans/about',
54
54
  CompatibleRuntimes: runtimes,
55
55
  Description: constants_1.CURRENT_VERSION,
56
56
  }));
@@ -1,13 +1,10 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.cleanItems = void 0;
7
4
  const client_s3_1 = require("@aws-sdk/client-s3");
8
- const p_limit_1 = __importDefault(require("p-limit"));
9
5
  const aws_clients_1 = require("../shared/aws-clients");
10
- const limit = (0, p_limit_1.default)(10);
6
+ const p_limit_1 = require("../shared/p-limit");
7
+ const limit = (0, p_limit_1.pLimit)(10);
11
8
  const cleanItems = async ({ bucket, onAfterItemDeleted, onBeforeItemDeleted, region, list, }) => {
12
9
  return Promise.all(list.map((object) => limit(async () => {
13
10
  onBeforeItemDeleted({
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.uploadDir = exports.getDirFiles = void 0;
7
7
  const client_s3_1 = require("@aws-sdk/client-s3");
8
8
  const lib_storage_1 = require("@aws-sdk/lib-storage");
9
- const bundler_1 = require("@remotion/bundler");
10
9
  const fs_1 = require("fs");
10
+ const mime_types_1 = __importDefault(require("mime-types"));
11
11
  const path_1 = __importDefault(require("path"));
12
12
  const aws_clients_1 = require("../shared/aws-clients");
13
13
  const getDirFiles = (entry) => {
@@ -40,7 +40,7 @@ const uploadDir = async ({ bucket, region, dir, onProgress, folder, privacy, })
40
40
  const uploads = files.map(async (filePath) => {
41
41
  const Key = `${folder}/${path_1.default.relative(dir, filePath.name)}`;
42
42
  const Body = (0, fs_1.createReadStream)(filePath.name);
43
- const ContentType = bundler_1.BundlerInternals.mimeTypes.lookup(Key) || 'application/octet-stream';
43
+ const ContentType = mime_types_1.default.lookup(Key) || 'application/octet-stream';
44
44
  const ACL = privacy === 'private' ? 'private' : 'public-read';
45
45
  if (filePath.size > 5 * 1024 * 1024) {
46
46
  const paralellUploads3 = new lib_storage_1.Upload({
@@ -20,6 +20,7 @@ const waitForLaunched = () => {
20
20
  });
21
21
  };
22
22
  const getBrowserInstance = async (shouldDumpIo, chromiumOptions) => {
23
+ var _a;
23
24
  if (launching) {
24
25
  await waitForLaunched();
25
26
  if (!_browserInstance) {
@@ -33,8 +34,9 @@ const getBrowserInstance = async (shouldDumpIo, chromiumOptions) => {
33
34
  launching = true;
34
35
  const execPath = await (0, get_chromium_executable_path_1.executablePath)();
35
36
  const actualChromiumOptions = {
36
- gl: 'swiftshader',
37
37
  ...chromiumOptions,
38
+ // Override the `null` value, which might come from CLI with swANGLE
39
+ gl: (_a = chromiumOptions.gl) !== null && _a !== void 0 ? _a : 'swangle',
38
40
  };
39
41
  _browserInstance = await (0, renderer_1.openBrowser)('chrome', {
40
42
  browserExecutable: execPath,
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.lambdaReadFile = exports.lambdaWriteFile = exports.lambdaLs = void 0;
4
7
  const client_s3_1 = require("@aws-sdk/client-s3");
8
+ const mime_types_1 = __importDefault(require("mime-types"));
5
9
  const aws_clients_1 = require("../../shared/aws-clients");
6
10
  const lambdaLs = async ({ bucketName, prefix, region, expectedBucketOwner, continuationToken, }) => {
7
11
  var _a, _b, _c;
@@ -49,6 +53,7 @@ const lambdaWriteFile = async ({ bucketName, key, body, region, privacy, expecte
49
53
  Body: body,
50
54
  ACL: privacy === 'private' ? 'private' : 'public-read',
51
55
  ExpectedBucketOwner: expectedBucketOwner !== null && expectedBucketOwner !== void 0 ? expectedBucketOwner : undefined,
56
+ ContentType: mime_types_1.default.lookup(key) || 'application/octet-stream',
52
57
  }));
53
58
  };
54
59
  exports.lambdaWriteFile = lambdaWriteFile;
@@ -101,6 +101,11 @@ const renderHandler = async (params, options, logs) => {
101
101
  proResProfile: params.proResProfile,
102
102
  onDownload: (src) => {
103
103
  console.log('Downloading', src);
104
+ return ({ percent }) => {
105
+ if (remotion_1.Internals.Logging.isEqualOrBelowLogLevel(params.logLevel, 'verbose')) {
106
+ console.log(`Download progress of ${src}: ${percent}`);
107
+ }
108
+ };
104
109
  },
105
110
  overwrite: false,
106
111
  chromiumOptions: params.chromiumOptions,
@@ -210,7 +210,7 @@ export declare type RenderMetadata = {
210
210
  renderId: string;
211
211
  outName: OutNameInput | undefined;
212
212
  };
213
- export declare type LambdaVersions = '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';
213
+ export declare type LambdaVersions = '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';
214
214
  export declare const CURRENT_VERSION: LambdaVersions;
215
215
  export declare type PostRenderData = {
216
216
  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-05-16';
87
+ exports.CURRENT_VERSION = '2022-05-19';
88
88
  exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = 'L-B99A9384';
89
89
  exports.LAMBDA_BURST_LIMIT_QUOTA = 'L-548AE339';
@@ -7,141 +7,141 @@ exports.hostedLayers = {
7
7
  'ap-northeast-1': [
8
8
  {
9
9
  layerArn: 'arn:aws:lambda:ap-northeast-1:678892195805:layer:remotion-binaries-remotion-arm64',
10
- version: 3,
10
+ version: 4,
11
11
  },
12
12
  {
13
13
  layerArn: 'arn:aws:lambda:ap-northeast-1:678892195805:layer:remotion-binaries-ffmpeg-arm64',
14
- version: 3,
14
+ version: 4,
15
15
  },
16
16
  {
17
17
  layerArn: 'arn:aws:lambda:ap-northeast-1:678892195805:layer:remotion-binaries-chromium-arm64',
18
- version: 3,
18
+ version: 4,
19
19
  },
20
20
  ],
21
21
  'ap-south-1': [
22
22
  {
23
23
  layerArn: 'arn:aws:lambda:ap-south-1:678892195805:layer:remotion-binaries-remotion-arm64',
24
- version: 3,
24
+ version: 4,
25
25
  },
26
26
  {
27
27
  layerArn: 'arn:aws:lambda:ap-south-1:678892195805:layer:remotion-binaries-ffmpeg-arm64',
28
- version: 3,
28
+ version: 4,
29
29
  },
30
30
  {
31
31
  layerArn: 'arn:aws:lambda:ap-south-1:678892195805:layer:remotion-binaries-chromium-arm64',
32
- version: 3,
32
+ version: 4,
33
33
  },
34
34
  ],
35
35
  'ap-southeast-1': [
36
36
  {
37
37
  layerArn: 'arn:aws:lambda:ap-southeast-1:678892195805:layer:remotion-binaries-remotion-arm64',
38
- version: 3,
38
+ version: 4,
39
39
  },
40
40
  {
41
41
  layerArn: 'arn:aws:lambda:ap-southeast-1:678892195805:layer:remotion-binaries-ffmpeg-arm64',
42
- version: 3,
42
+ version: 4,
43
43
  },
44
44
  {
45
45
  layerArn: 'arn:aws:lambda:ap-southeast-1:678892195805:layer:remotion-binaries-chromium-arm64',
46
- version: 3,
46
+ version: 4,
47
47
  },
48
48
  ],
49
49
  'ap-southeast-2': [
50
50
  {
51
51
  layerArn: 'arn:aws:lambda:ap-southeast-2:678892195805:layer:remotion-binaries-remotion-arm64',
52
- version: 3,
52
+ version: 4,
53
53
  },
54
54
  {
55
55
  layerArn: 'arn:aws:lambda:ap-southeast-2:678892195805:layer:remotion-binaries-ffmpeg-arm64',
56
- version: 3,
56
+ version: 4,
57
57
  },
58
58
  {
59
59
  layerArn: 'arn:aws:lambda:ap-southeast-2:678892195805:layer:remotion-binaries-chromium-arm64',
60
- version: 3,
60
+ version: 4,
61
61
  },
62
62
  ],
63
63
  'eu-central-1': [
64
64
  {
65
65
  layerArn: 'arn:aws:lambda:eu-central-1:678892195805:layer:remotion-binaries-remotion-arm64',
66
- version: 3,
66
+ version: 4,
67
67
  },
68
68
  {
69
69
  layerArn: 'arn:aws:lambda:eu-central-1:678892195805:layer:remotion-binaries-ffmpeg-arm64',
70
- version: 3,
70
+ version: 4,
71
71
  },
72
72
  {
73
73
  layerArn: 'arn:aws:lambda:eu-central-1:678892195805:layer:remotion-binaries-chromium-arm64',
74
- version: 3,
74
+ version: 4,
75
75
  },
76
76
  ],
77
77
  'eu-west-1': [
78
78
  {
79
79
  layerArn: 'arn:aws:lambda:eu-west-1:678892195805:layer:remotion-binaries-remotion-arm64',
80
- version: 3,
80
+ version: 4,
81
81
  },
82
82
  {
83
83
  layerArn: 'arn:aws:lambda:eu-west-1:678892195805:layer:remotion-binaries-ffmpeg-arm64',
84
- version: 3,
84
+ version: 4,
85
85
  },
86
86
  {
87
87
  layerArn: 'arn:aws:lambda:eu-west-1:678892195805:layer:remotion-binaries-chromium-arm64',
88
- version: 3,
88
+ version: 4,
89
89
  },
90
90
  ],
91
91
  'eu-west-2': [
92
92
  {
93
93
  layerArn: 'arn:aws:lambda:eu-west-2:678892195805:layer:remotion-binaries-remotion-arm64',
94
- version: 3,
94
+ version: 4,
95
95
  },
96
96
  {
97
97
  layerArn: 'arn:aws:lambda:eu-west-2:678892195805:layer:remotion-binaries-ffmpeg-arm64',
98
- version: 3,
98
+ version: 4,
99
99
  },
100
100
  {
101
101
  layerArn: 'arn:aws:lambda:eu-west-2:678892195805:layer:remotion-binaries-chromium-arm64',
102
- version: 3,
102
+ version: 4,
103
103
  },
104
104
  ],
105
105
  'us-east-1': [
106
106
  {
107
107
  layerArn: 'arn:aws:lambda:us-east-1:678892195805:layer:remotion-binaries-remotion-arm64',
108
- version: 7,
108
+ version: 8,
109
109
  },
110
110
  {
111
111
  layerArn: 'arn:aws:lambda:us-east-1:678892195805:layer:remotion-binaries-ffmpeg-arm64',
112
- version: 7,
112
+ version: 8,
113
113
  },
114
114
  {
115
115
  layerArn: 'arn:aws:lambda:us-east-1:678892195805:layer:remotion-binaries-chromium-arm64',
116
- version: 7,
116
+ version: 8,
117
117
  },
118
118
  ],
119
119
  'us-east-2': [
120
120
  {
121
121
  layerArn: 'arn:aws:lambda:us-east-2:678892195805:layer:remotion-binaries-remotion-arm64',
122
- version: 3,
122
+ version: 4,
123
123
  },
124
124
  {
125
125
  layerArn: 'arn:aws:lambda:us-east-2:678892195805:layer:remotion-binaries-ffmpeg-arm64',
126
- version: 3,
126
+ version: 4,
127
127
  },
128
128
  {
129
129
  layerArn: 'arn:aws:lambda:us-east-2:678892195805:layer:remotion-binaries-chromium-arm64',
130
- version: 3,
130
+ version: 4,
131
131
  },
132
132
  ],
133
133
  'us-west-2': [
134
134
  {
135
135
  layerArn: 'arn:aws:lambda:us-west-2:678892195805:layer:remotion-binaries-remotion-arm64',
136
- version: 3,
136
+ version: 4,
137
137
  },
138
138
  {
139
139
  layerArn: 'arn:aws:lambda:us-west-2:678892195805:layer:remotion-binaries-ffmpeg-arm64',
140
- version: 3,
140
+ version: 4,
141
141
  },
142
142
  {
143
143
  layerArn: 'arn:aws:lambda:us-west-2:678892195805:layer:remotion-binaries-chromium-arm64',
144
- version: 3,
144
+ version: 4,
145
145
  },
146
146
  ],
147
147
  },
@@ -149,141 +149,141 @@ exports.hostedLayers = {
149
149
  'ap-northeast-1': [
150
150
  {
151
151
  layerArn: 'arn:aws:lambda:ap-northeast-1:678892195805:layer:remotion-binaries-remotion-x86_64',
152
- version: 3,
152
+ version: 4,
153
153
  },
154
154
  {
155
155
  layerArn: 'arn:aws:lambda:ap-northeast-1:678892195805:layer:remotion-binaries-ffmpeg-x86_64',
156
- version: 3,
156
+ version: 4,
157
157
  },
158
158
  {
159
159
  layerArn: 'arn:aws:lambda:ap-northeast-1:678892195805:layer:remotion-binaries-chromium-x86_64',
160
- version: 3,
160
+ version: 4,
161
161
  },
162
162
  ],
163
163
  'ap-south-1': [
164
164
  {
165
165
  layerArn: 'arn:aws:lambda:ap-south-1:678892195805:layer:remotion-binaries-remotion-x86_64',
166
- version: 3,
166
+ version: 4,
167
167
  },
168
168
  {
169
169
  layerArn: 'arn:aws:lambda:ap-south-1:678892195805:layer:remotion-binaries-ffmpeg-x86_64',
170
- version: 3,
170
+ version: 4,
171
171
  },
172
172
  {
173
173
  layerArn: 'arn:aws:lambda:ap-south-1:678892195805:layer:remotion-binaries-chromium-x86_64',
174
- version: 3,
174
+ version: 4,
175
175
  },
176
176
  ],
177
177
  'ap-southeast-1': [
178
178
  {
179
179
  layerArn: 'arn:aws:lambda:ap-southeast-1:678892195805:layer:remotion-binaries-remotion-x86_64',
180
- version: 3,
180
+ version: 4,
181
181
  },
182
182
  {
183
183
  layerArn: 'arn:aws:lambda:ap-southeast-1:678892195805:layer:remotion-binaries-ffmpeg-x86_64',
184
- version: 3,
184
+ version: 4,
185
185
  },
186
186
  {
187
187
  layerArn: 'arn:aws:lambda:ap-southeast-1:678892195805:layer:remotion-binaries-chromium-x86_64',
188
- version: 3,
188
+ version: 4,
189
189
  },
190
190
  ],
191
191
  'ap-southeast-2': [
192
192
  {
193
193
  layerArn: 'arn:aws:lambda:ap-southeast-2:678892195805:layer:remotion-binaries-remotion-x86_64',
194
- version: 3,
194
+ version: 4,
195
195
  },
196
196
  {
197
197
  layerArn: 'arn:aws:lambda:ap-southeast-2:678892195805:layer:remotion-binaries-ffmpeg-x86_64',
198
- version: 3,
198
+ version: 4,
199
199
  },
200
200
  {
201
201
  layerArn: 'arn:aws:lambda:ap-southeast-2:678892195805:layer:remotion-binaries-chromium-x86_64',
202
- version: 3,
202
+ version: 4,
203
203
  },
204
204
  ],
205
205
  'eu-central-1': [
206
206
  {
207
207
  layerArn: 'arn:aws:lambda:eu-central-1:678892195805:layer:remotion-binaries-remotion-x86_64',
208
- version: 3,
208
+ version: 4,
209
209
  },
210
210
  {
211
211
  layerArn: 'arn:aws:lambda:eu-central-1:678892195805:layer:remotion-binaries-ffmpeg-x86_64',
212
- version: 3,
212
+ version: 4,
213
213
  },
214
214
  {
215
215
  layerArn: 'arn:aws:lambda:eu-central-1:678892195805:layer:remotion-binaries-chromium-x86_64',
216
- version: 3,
216
+ version: 4,
217
217
  },
218
218
  ],
219
219
  'eu-west-1': [
220
220
  {
221
221
  layerArn: 'arn:aws:lambda:eu-west-1:678892195805:layer:remotion-binaries-remotion-x86_64',
222
- version: 3,
222
+ version: 4,
223
223
  },
224
224
  {
225
225
  layerArn: 'arn:aws:lambda:eu-west-1:678892195805:layer:remotion-binaries-ffmpeg-x86_64',
226
- version: 3,
226
+ version: 4,
227
227
  },
228
228
  {
229
229
  layerArn: 'arn:aws:lambda:eu-west-1:678892195805:layer:remotion-binaries-chromium-x86_64',
230
- version: 3,
230
+ version: 4,
231
231
  },
232
232
  ],
233
233
  'eu-west-2': [
234
234
  {
235
235
  layerArn: 'arn:aws:lambda:eu-west-2:678892195805:layer:remotion-binaries-remotion-x86_64',
236
- version: 3,
236
+ version: 4,
237
237
  },
238
238
  {
239
239
  layerArn: 'arn:aws:lambda:eu-west-2:678892195805:layer:remotion-binaries-ffmpeg-x86_64',
240
- version: 3,
240
+ version: 4,
241
241
  },
242
242
  {
243
243
  layerArn: 'arn:aws:lambda:eu-west-2:678892195805:layer:remotion-binaries-chromium-x86_64',
244
- version: 3,
244
+ version: 4,
245
245
  },
246
246
  ],
247
247
  'us-east-1': [
248
248
  {
249
249
  layerArn: 'arn:aws:lambda:us-east-1:678892195805:layer:remotion-binaries-remotion-x86_64',
250
- version: 7,
250
+ version: 8,
251
251
  },
252
252
  {
253
253
  layerArn: 'arn:aws:lambda:us-east-1:678892195805:layer:remotion-binaries-ffmpeg-x86_64',
254
- version: 7,
254
+ version: 8,
255
255
  },
256
256
  {
257
257
  layerArn: 'arn:aws:lambda:us-east-1:678892195805:layer:remotion-binaries-chromium-x86_64',
258
- version: 7,
258
+ version: 8,
259
259
  },
260
260
  ],
261
261
  'us-east-2': [
262
262
  {
263
263
  layerArn: 'arn:aws:lambda:us-east-2:678892195805:layer:remotion-binaries-remotion-x86_64',
264
- version: 3,
264
+ version: 4,
265
265
  },
266
266
  {
267
267
  layerArn: 'arn:aws:lambda:us-east-2:678892195805:layer:remotion-binaries-ffmpeg-x86_64',
268
- version: 3,
268
+ version: 4,
269
269
  },
270
270
  {
271
271
  layerArn: 'arn:aws:lambda:us-east-2:678892195805:layer:remotion-binaries-chromium-x86_64',
272
- version: 3,
272
+ version: 4,
273
273
  },
274
274
  ],
275
275
  'us-west-2': [
276
276
  {
277
277
  layerArn: 'arn:aws:lambda:us-west-2:678892195805:layer:remotion-binaries-remotion-x86_64',
278
- version: 3,
278
+ version: 4,
279
279
  },
280
280
  {
281
281
  layerArn: 'arn:aws:lambda:us-west-2:678892195805:layer:remotion-binaries-ffmpeg-x86_64',
282
- version: 3,
282
+ version: 4,
283
283
  },
284
284
  {
285
285
  layerArn: 'arn:aws:lambda:us-west-2:678892195805:layer:remotion-binaries-chromium-x86_64',
286
- version: 3,
286
+ version: 4,
287
287
  },
288
288
  ],
289
289
  },
@@ -0,0 +1 @@
1
+ export declare const pLimit: (concurrency: number) => <Arguments extends unknown[], ReturnType_1>(fn: (..._arguments: Arguments) => ReturnType_1 | PromiseLike<ReturnType_1>, ...args: Arguments) => Promise<ReturnType_1>;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pLimit = void 0;
4
+ const pLimit = (concurrency) => {
5
+ const queue = [];
6
+ let activeCount = 0;
7
+ const next = () => {
8
+ var _a;
9
+ activeCount--;
10
+ if (queue.length > 0) {
11
+ (_a = queue.shift()) === null || _a === void 0 ? void 0 : _a();
12
+ }
13
+ };
14
+ const run = async (fn, resolve, ...args) => {
15
+ activeCount++;
16
+ // eslint-disable-next-line require-await
17
+ const result = (async () => fn(...args))();
18
+ resolve(result);
19
+ try {
20
+ await result;
21
+ }
22
+ catch (_a) { }
23
+ next();
24
+ };
25
+ const enqueue = (fn, resolve, ...args) => {
26
+ queue.push(() => run(fn, resolve, ...args));
27
+ (async () => {
28
+ var _a;
29
+ // This function needs to wait until the next microtask before comparing
30
+ // `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
31
+ // when the run function is dequeued and called. The comparison in the if-statement
32
+ // needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
33
+ await Promise.resolve();
34
+ if (activeCount < concurrency && queue.length > 0) {
35
+ (_a = queue.shift()) === null || _a === void 0 ? void 0 : _a();
36
+ }
37
+ })();
38
+ };
39
+ const generator = (fn, ...args) => new Promise((resolve) => {
40
+ enqueue(fn, resolve, ...args);
41
+ });
42
+ Object.defineProperties(generator, {
43
+ activeCount: {
44
+ get: () => activeCount,
45
+ },
46
+ pendingCount: {
47
+ get: () => queue.length,
48
+ },
49
+ clearQueue: {
50
+ value: () => {
51
+ queue.length = 0;
52
+ },
53
+ },
54
+ });
55
+ return generator;
56
+ };
57
+ exports.pLimit = pLimit;
@@ -22,7 +22,7 @@ const validateFramesPerLambda = (framesPerLambda) => {
22
22
  throw new TypeError(`'framesPerLambda' needs to be an integer, passed ${framesPerLambda}`);
23
23
  }
24
24
  if (framesPerLambda < constants_1.MINIMUM_FRAMES_PER_LAMBDA) {
25
- throw new TypeError('The framesPerLambda needs to be at least 4.');
25
+ throw new TypeError(`The framesPerLambda needs to be at least 4, but is ${framesPerLambda}`);
26
26
  }
27
27
  };
28
28
  exports.validateFramesPerLambda = validateFramesPerLambda;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "4.0.0-oops.3+31c506229",
3
+ "version": "4.0.0-preload.13+f7b159495",
4
4
  "description": "Distributed renderer for Remotion based on AWS Lambda",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -31,14 +31,14 @@
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-oops.3+31c506229",
35
- "@remotion/cli": "4.0.0-oops.3+31c506229",
36
- "@remotion/renderer": "4.0.0-oops.3+31c506229",
34
+ "@remotion/bundler": "4.0.0-preload.13+f7b159495",
35
+ "@remotion/cli": "4.0.0-preload.13+f7b159495",
36
+ "@remotion/renderer": "4.0.0-preload.13+f7b159495",
37
37
  "aws-policies": "^1.0.1",
38
38
  "dotenv": "^10.0.0",
39
+ "mime-types": "2.1.34",
39
40
  "minimist": "1.2.6",
40
- "p-limit": "^3.1.0",
41
- "remotion": "4.0.0-oops.3+31c506229"
41
+ "remotion": "4.0.0-preload.13+f7b159495"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": ">=16.8.0",
@@ -47,6 +47,7 @@
47
47
  "devDependencies": {
48
48
  "@jonny/eslint-config": "3.0.259",
49
49
  "@types/jest": "^27.0.2",
50
+ "@types/mime-types": "2.1.1",
50
51
  "@types/minimist": "1.2.2",
51
52
  "@types/node": "^14.14.14",
52
53
  "@types/prompt": "^1.1.0",
@@ -63,5 +64,5 @@
63
64
  "publishConfig": {
64
65
  "access": "public"
65
66
  },
66
- "gitHead": "31c506229ccf43f67dee263b0edce90ebbb2e22e"
67
+ "gitHead": "f7b1594951e881444050f2f9d4af8d442bbec942"
67
68
  }
Binary file