@remotion/lambda 4.0.217 → 4.0.219

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.
@@ -1,6 +1,6 @@
1
1
  import type { LogLevel } from '@remotion/renderer';
2
2
  import type { CustomCredentials } from '@remotion/serverless/client';
3
- import type { AwsProvider } from '../functions/aws-implementation';
3
+ import { type AwsProvider } from '../functions/aws-implementation';
4
4
  import type { AwsRegion } from '../regions';
5
5
  import type { RenderProgress } from '../shared/constants';
6
6
  export type GetRenderProgressInput = {
@@ -11,6 +11,7 @@ export type GetRenderProgressInput = {
11
11
  logLevel?: LogLevel;
12
12
  s3OutputProvider?: CustomCredentials<AwsProvider>;
13
13
  forcePathStyle?: boolean;
14
+ skipLambdaInvocation?: boolean;
14
15
  };
15
16
  /**
16
17
  * @description Gets the current status of a render originally triggered via renderMediaOnLambda().
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRenderProgress = void 0;
4
4
  const client_1 = require("@remotion/serverless/client");
5
+ const aws_implementation_1 = require("../functions/aws-implementation");
6
+ const get_progress_1 = require("../functions/helpers/get-progress");
7
+ const parse_function_name_1 = require("../functions/helpers/parse-function-name");
5
8
  const call_lambda_1 = require("../shared/call-lambda");
6
9
  const make_lambda_payload_1 = require("./make-lambda-payload");
7
10
  /**
@@ -15,6 +18,28 @@ const make_lambda_payload_1 = require("./make-lambda-payload");
15
18
  * @returns {Promise<RenderProgress>} See documentation for this function to see all properties on the return object.
16
19
  */
17
20
  const getRenderProgress = async (input) => {
21
+ var _a, _b;
22
+ if (input.skipLambdaInvocation) {
23
+ const parsed = (0, parse_function_name_1.parseFunctionName)(input.functionName);
24
+ if (!parsed) {
25
+ throw new Error([
26
+ `The function name ${input.functionName} does not adhere to the function name convention (https://www.remotion.dev/docs/lambda/naming-convention).`,
27
+ 'Cannot determine memory and disk size from the function name.',
28
+ 'You must call getRenderProgress with `skipLambdaInvocation` set to false.',
29
+ ].join('\n'));
30
+ }
31
+ return (0, get_progress_1.getProgress)({
32
+ bucketName: input.bucketName,
33
+ renderId: input.renderId,
34
+ region: input.region,
35
+ forcePathStyle: (_a = input.forcePathStyle) !== null && _a !== void 0 ? _a : false,
36
+ customCredentials: (_b = input.s3OutputProvider) !== null && _b !== void 0 ? _b : null,
37
+ expectedBucketOwner: null,
38
+ providerSpecifics: aws_implementation_1.awsImplementation,
39
+ memorySizeInMb: parsed.memorySizeInMb,
40
+ timeoutInMilliseconds: parsed.timeoutInSeconds * 1000,
41
+ });
42
+ }
18
43
  const result = await (0, call_lambda_1.callLambda)({
19
44
  functionName: input.functionName,
20
45
  type: client_1.ServerlessRoutines.status,
@@ -13,6 +13,7 @@ const no_react_1 = require("remotion/no-react");
13
13
  const download_media_1 = require("../../../api/download-media");
14
14
  const get_render_progress_1 = require("../../../api/get-render-progress");
15
15
  const render_media_on_lambda_1 = require("../../../api/render-media-on-lambda");
16
+ const parse_function_name_1 = require("../../../functions/helpers/parse-function-name");
16
17
  const constants_1 = require("../../../shared/constants");
17
18
  const sleep_1 = require("../../../shared/sleep");
18
19
  const validate_frames_per_lambda_1 = require("../../../shared/validate-frames-per-lambda");
@@ -286,12 +287,14 @@ const renderCommand = async (args, remotionRoot, logLevel, implementation) => {
286
287
  fallback: `Render folder: ${res.folderInS3Console}`,
287
288
  }));
288
289
  }
290
+ const adheresToFunctionNameConvention = (0, parse_function_name_1.parseFunctionName)(functionName);
289
291
  const status = await (0, get_render_progress_1.getRenderProgress)({
290
292
  functionName,
291
293
  bucketName: res.bucketName,
292
294
  renderId: res.renderId,
293
295
  region: (0, get_aws_region_1.getAwsRegion)(),
294
296
  logLevel,
297
+ skipLambdaInvocation: Boolean(adheresToFunctionNameConvention),
295
298
  });
296
299
  progressBar.update((0, progress_1.makeProgressString)({
297
300
  downloadInfo: null,
@@ -2,7 +2,7 @@ import type { CloudProvider, ProviderSpecifics } from '@remotion/serverless';
2
2
  import type { OverallRenderProgress } from './overall-render-progress';
3
3
  export declare const getOverallProgressS3: <Provider extends CloudProvider>({ renderId, bucketName, expectedBucketOwner, region, providerSpecifics, forcePathStyle, }: {
4
4
  renderId: string;
5
- expectedBucketOwner: string;
5
+ expectedBucketOwner: string | null;
6
6
  bucketName: string;
7
7
  region: Provider["region"];
8
8
  providerSpecifics: ProviderSpecifics<Provider>;
@@ -4,7 +4,7 @@ import type { GenericRenderProgress } from '../../shared/constants';
4
4
  export declare const getProgress: <Provider extends CloudProvider>({ bucketName, renderId, expectedBucketOwner, region, memorySizeInMb, timeoutInMilliseconds, customCredentials, providerSpecifics, forcePathStyle, }: {
5
5
  bucketName: string;
6
6
  renderId: string;
7
- expectedBucketOwner: string;
7
+ expectedBucketOwner: string | null;
8
8
  region: Provider["region"];
9
9
  memorySizeInMb: number;
10
10
  timeoutInMilliseconds: number;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getProgress = void 0;
4
- const renderer_1 = require("@remotion/renderer");
4
+ const pure_1 = require("@remotion/renderer/pure");
5
5
  const client_1 = require("@remotion/serverless/client");
6
6
  const no_react_1 = require("remotion/no-react");
7
7
  const constants_1 = require("../../shared/constants");
@@ -14,7 +14,7 @@ const inspect_errors_1 = require("./inspect-errors");
14
14
  const make_timeout_error_1 = require("./make-timeout-error");
15
15
  const render_has_audio_video_1 = require("./render-has-audio-video");
16
16
  const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region, memorySizeInMb, timeoutInMilliseconds, customCredentials, providerSpecifics, forcePathStyle, }) => {
17
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
17
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
18
18
  const overallProgress = await (0, get_overall_progress_s3_1.getOverallProgressS3)({
19
19
  renderId,
20
20
  bucketName,
@@ -27,10 +27,11 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
27
27
  if (!overallProgress.renderMetadata) {
28
28
  throw new Error('No render metadata found even though render is finished');
29
29
  }
30
+ if (overallProgress.renderMetadata.type === 'still') {
31
+ throw new Error("You don't need to call getRenderProgress() on a still render. Once you have obtained the `renderId`, the render is already done! 😉");
32
+ }
30
33
  const outData = (0, client_1.getExpectedOutName)(overallProgress.renderMetadata, bucketName, customCredentials);
31
- const totalFrameCount = overallProgress.renderMetadata.type === 'still'
32
- ? 1
33
- : renderer_1.RenderInternals.getFramesToRender(overallProgress.renderMetadata.frameRange, overallProgress.renderMetadata.everyNthFrame).length;
34
+ const totalFrameCount = pure_1.NoReactAPIs.getFramesToRender(overallProgress.renderMetadata.frameRange, overallProgress.renderMetadata.everyNthFrame).length;
34
35
  return {
35
36
  framesRendered: totalFrameCount,
36
37
  bucket: bucketName,
@@ -85,53 +86,97 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
85
86
  const errorExplanations = (0, inspect_errors_1.inspectErrors)({
86
87
  errors: overallProgress.errors,
87
88
  });
88
- if (renderMetadata && renderMetadata.type === 'still') {
89
- throw new Error("You don't need to call getRenderProgress() on a still render. Once you have obtained the `renderId`, the render is already done! 😉");
89
+ const { hasAudio, hasVideo } = renderMetadata
90
+ ? (0, render_has_audio_video_1.lambdaRenderHasAudioVideo)(renderMetadata)
91
+ : { hasAudio: false, hasVideo: false };
92
+ const chunkCount = (_b = overallProgress.chunks.length) !== null && _b !== void 0 ? _b : 0;
93
+ const cleanup = {
94
+ doneIn: null,
95
+ minFilesToDelete: 0,
96
+ filesDeleted: 0,
97
+ };
98
+ if (renderMetadata === null) {
99
+ return {
100
+ framesRendered: (_c = overallProgress.framesRendered) !== null && _c !== void 0 ? _c : 0,
101
+ chunks: chunkCount,
102
+ done: false,
103
+ encodingStatus: {
104
+ framesEncoded: overallProgress.framesEncoded,
105
+ combinedFrames: overallProgress.combinedFrames,
106
+ timeToCombine: overallProgress.timeToCombine,
107
+ },
108
+ timeToRenderFrames: overallProgress.timeToRenderFrames,
109
+ costs: (0, format_costs_info_1.formatCostsInfo)(0),
110
+ renderId,
111
+ renderMetadata,
112
+ bucket: bucketName,
113
+ outputFile: null,
114
+ timeToFinish: null,
115
+ errors: errorExplanations,
116
+ fatalErrorEncountered: errorExplanations.some((f) => f.isFatal && !f.willRetry),
117
+ currentTime: Date.now(),
118
+ renderSize: 0,
119
+ lambdasInvoked: (_d = overallProgress.lambdasInvoked) !== null && _d !== void 0 ? _d : 0,
120
+ cleanup,
121
+ timeToFinishChunks: null,
122
+ overallProgress: (0, get_overall_progress_1.getOverallProgress)({
123
+ encoding: 0,
124
+ invoking: 0,
125
+ frames: 0,
126
+ gotComposition: overallProgress.compositionValidated,
127
+ visitedServeUrl: overallProgress.serveUrlOpened,
128
+ invokedLambda: overallProgress.lambdasInvoked,
129
+ combining: 0,
130
+ }),
131
+ retriesInfo: (_e = overallProgress.retries) !== null && _e !== void 0 ? _e : [],
132
+ outKey: null,
133
+ outBucket: null,
134
+ mostExpensiveFrameRanges: null,
135
+ timeToEncode: overallProgress.timeToEncode,
136
+ outputSizeInBytes: null,
137
+ estimatedBillingDurationInMilliseconds: null,
138
+ combinedFrames: (_f = overallProgress.combinedFrames) !== null && _f !== void 0 ? _f : 0,
139
+ timeToCombine: (_g = overallProgress.timeToCombine) !== null && _g !== void 0 ? _g : null,
140
+ timeoutTimestamp: overallProgress.timeoutTimestamp,
141
+ type: 'success',
142
+ compositionValidated: overallProgress.compositionValidated,
143
+ functionLaunched: overallProgress.functionLaunched,
144
+ serveUrlOpened: overallProgress.serveUrlOpened,
145
+ artifacts: overallProgress.receivedArtifact,
146
+ };
90
147
  }
91
148
  const priceFromBucket = (0, calculate_price_from_bucket_1.estimatePriceFromBucket)({
92
149
  renderMetadata,
93
150
  memorySizeInMb,
94
- lambdasInvoked: (_b = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.estimatedRenderLambdaInvokations) !== null && _b !== void 0 ? _b : 0,
151
+ lambdasInvoked: (_h = renderMetadata.estimatedRenderLambdaInvokations) !== null && _h !== void 0 ? _h : 0,
95
152
  // We cannot determine the ephemeral storage size, so we
96
153
  // overestimate the price, but will only have a miniscule effect (~0.2%)
97
154
  diskSizeInMb: constants_1.MAX_EPHEMERAL_STORAGE_IN_MB,
98
- timings: (_c = overallProgress.timings) !== null && _c !== void 0 ? _c : [],
155
+ timings: (_j = overallProgress.timings) !== null && _j !== void 0 ? _j : [],
99
156
  providerSpecifics,
100
157
  });
101
- const { hasAudio, hasVideo } = renderMetadata
102
- ? (0, render_has_audio_video_1.lambdaRenderHasAudioVideo)(renderMetadata)
103
- : { hasAudio: false, hasVideo: false };
104
- const cleanup = {
105
- doneIn: null,
106
- minFilesToDelete: 0,
107
- filesDeleted: 0,
108
- };
109
158
  const chunkMultiplier = [hasAudio, hasVideo].filter(client_1.truthy).length;
110
- const allChunks = ((_d = overallProgress.chunks) !== null && _d !== void 0 ? _d : []).length / chunkMultiplier ===
111
- ((_e = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.totalChunks) !== null && _e !== void 0 ? _e : Infinity);
112
- const frameCount = renderMetadata
113
- ? renderer_1.RenderInternals.getFramesToRender(renderMetadata.frameRange, renderMetadata.everyNthFrame).length
114
- : null;
115
- const chunkCount = (_f = overallProgress.chunks.length) !== null && _f !== void 0 ? _f : 0;
116
- const missingChunks = renderMetadata
117
- ? new Array(renderMetadata.totalChunks)
118
- .fill(true)
119
- .map((_, i) => i)
120
- .filter((index) => {
121
- var _a;
122
- return (typeof ((_a = overallProgress.chunks) !== null && _a !== void 0 ? _a : []).find((c) => c === index) ===
123
- 'undefined');
124
- })
125
- : null;
159
+ if (renderMetadata.type === 'still') {
160
+ throw new Error("You don't need to call getRenderProgress() on a still render. Once you have obtained the `renderId`, the render is already done! 😉");
161
+ }
162
+ const allChunks = ((_k = overallProgress.chunks) !== null && _k !== void 0 ? _k : []).length / chunkMultiplier ===
163
+ ((_l = renderMetadata.totalChunks) !== null && _l !== void 0 ? _l : Infinity);
164
+ const frameCount = pure_1.NoReactAPIs.getFramesToRender(renderMetadata.frameRange, renderMetadata.everyNthFrame).length;
165
+ const missingChunks = new Array(renderMetadata.totalChunks)
166
+ .fill(true)
167
+ .map((_, i) => i)
168
+ .filter((index) => {
169
+ var _a;
170
+ return (typeof ((_a = overallProgress.chunks) !== null && _a !== void 0 ? _a : []).find((c) => c === index) ===
171
+ 'undefined');
172
+ });
126
173
  // We add a 20 second buffer for it, since AWS timeshifts can be quite a lot. Once it's 20sec over the limit, we consider it timed out
127
174
  // 1. If we have missing chunks, we consider it timed out
128
- const isBeyondTimeoutAndMissingChunks = renderMetadata &&
129
- Date.now() > renderMetadata.startedDate + timeoutInMilliseconds + 20000 &&
175
+ const isBeyondTimeoutAndMissingChunks = Date.now() > renderMetadata.startedDate + timeoutInMilliseconds + 20000 &&
130
176
  missingChunks &&
131
177
  missingChunks.length > 0;
132
178
  // 2. If we have no missing chunks, but the encoding is not done, even after the additional `merge` function has been spawned, we consider it timed out
133
- const isBeyondTimeoutAndHasStitchTimeout = renderMetadata &&
134
- Date.now() > renderMetadata.startedDate + timeoutInMilliseconds * 2 + 20000;
179
+ const isBeyondTimeoutAndHasStitchTimeout = Date.now() > renderMetadata.startedDate + timeoutInMilliseconds * 2 + 20000;
135
180
  const allErrors = [
136
181
  isBeyondTimeoutAndMissingChunks || isBeyondTimeoutAndHasStitchTimeout
137
182
  ? (0, make_timeout_error_1.makeTimeoutError)({
@@ -145,7 +190,7 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
145
190
  ...errorExplanations,
146
191
  ].filter(no_react_1.NoReactInternals.truthy);
147
192
  return {
148
- framesRendered: (_g = overallProgress.framesRendered) !== null && _g !== void 0 ? _g : 0,
193
+ framesRendered: (_m = overallProgress.framesRendered) !== null && _m !== void 0 ? _m : 0,
149
194
  chunks: chunkCount,
150
195
  done: false,
151
196
  encodingStatus: {
@@ -166,7 +211,7 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
166
211
  fatalErrorEncountered: allErrors.some((f) => f.isFatal && !f.willRetry),
167
212
  currentTime: Date.now(),
168
213
  renderSize: 0,
169
- lambdasInvoked: (_h = overallProgress.lambdasInvoked) !== null && _h !== void 0 ? _h : 0,
214
+ lambdasInvoked: (_o = overallProgress.lambdasInvoked) !== null && _o !== void 0 ? _o : 0,
170
215
  cleanup,
171
216
  timeToFinishChunks: allChunks && overallProgress
172
217
  ? (0, calculate_chunk_times_1.calculateChunkTimes)({
@@ -175,20 +220,18 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
175
220
  })
176
221
  : null,
177
222
  overallProgress: (0, get_overall_progress_1.getOverallProgress)({
178
- encoding: renderMetadata && frameCount
179
- ? ((_j = overallProgress.framesEncoded) !== null && _j !== void 0 ? _j : 0) / frameCount
180
- : 0,
181
- invoking: renderMetadata
182
- ? ((_k = overallProgress.lambdasInvoked) !== null && _k !== void 0 ? _k : 0) /
183
- renderMetadata.estimatedRenderLambdaInvokations
223
+ encoding: frameCount
224
+ ? ((_p = overallProgress.framesEncoded) !== null && _p !== void 0 ? _p : 0) / frameCount
184
225
  : 0,
185
- frames: ((_l = overallProgress.framesRendered) !== null && _l !== void 0 ? _l : 0) / (frameCount !== null && frameCount !== void 0 ? frameCount : 1),
226
+ invoking: ((_q = overallProgress.lambdasInvoked) !== null && _q !== void 0 ? _q : 0) /
227
+ renderMetadata.estimatedRenderLambdaInvokations,
228
+ frames: ((_r = overallProgress.framesRendered) !== null && _r !== void 0 ? _r : 0) / (frameCount !== null && frameCount !== void 0 ? frameCount : 1),
186
229
  gotComposition: overallProgress.compositionValidated,
187
230
  visitedServeUrl: overallProgress.serveUrlOpened,
188
231
  invokedLambda: overallProgress.lambdasInvoked,
189
232
  combining: overallProgress.combinedFrames / (frameCount !== null && frameCount !== void 0 ? frameCount : 1),
190
233
  }),
191
- retriesInfo: (_m = overallProgress.retries) !== null && _m !== void 0 ? _m : [],
234
+ retriesInfo: (_s = overallProgress.retries) !== null && _s !== void 0 ? _s : [],
192
235
  outKey: null,
193
236
  outBucket: null,
194
237
  mostExpensiveFrameRanges: null,
@@ -197,8 +240,8 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
197
240
  estimatedBillingDurationInMilliseconds: priceFromBucket
198
241
  ? priceFromBucket.estimatedBillingDurationInMilliseconds
199
242
  : null,
200
- combinedFrames: (_o = overallProgress.combinedFrames) !== null && _o !== void 0 ? _o : 0,
201
- timeToCombine: (_p = overallProgress.timeToCombine) !== null && _p !== void 0 ? _p : null,
243
+ combinedFrames: (_t = overallProgress.combinedFrames) !== null && _t !== void 0 ? _t : 0,
244
+ timeToCombine: (_u = overallProgress.timeToCombine) !== null && _u !== void 0 ? _u : null,
202
245
  timeoutTimestamp: overallProgress.timeoutTimestamp,
203
246
  type: 'success',
204
247
  compositionValidated: overallProgress.compositionValidated,
@@ -1,4 +1,4 @@
1
- import { type EnhancedErrorInfo, type LambdaErrorInfo } from '@remotion/serverless';
1
+ import type { EnhancedErrorInfo, LambdaErrorInfo } from '@remotion/serverless';
2
2
  export declare const inspectErrors: ({ errors, }: {
3
3
  errors: LambdaErrorInfo[];
4
4
  }) => EnhancedErrorInfo[];
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.inspectErrors = void 0;
4
- const serverless_1 = require("@remotion/serverless");
4
+ const client_1 = require("@remotion/serverless/client");
5
5
  const docs_url_1 = require("../../shared/docs-url");
6
6
  const FAILED_TO_LAUNCH_TOKEN = 'Failed to launch browser.';
7
7
  const getExplanation = (stack) => {
@@ -16,13 +16,13 @@ const getExplanation = (stack) => {
16
16
  if (stack.includes('TooManyRequestsException')) {
17
17
  return `AWS returned an "TooManyRequestsException" error message which could mean you reached the concurrency limit of AWS Lambda. You can increase the limit - read this troubleshooting page: ${docs_url_1.DOCS_URL}/docs/lambda/troubleshooting/rate-limit`;
18
18
  }
19
- if ((0, serverless_1.errorIsOutOfSpaceError)(stack)) {
19
+ if ((0, client_1.errorIsOutOfSpaceError)(stack)) {
20
20
  return `Your lambda function reached the storage limit. Reduce the amount of space needed per lambda function or increase the storage limit: ${docs_url_1.DOCS_URL}/docs/lambda/disk-size.`;
21
21
  }
22
- if ((0, serverless_1.isErrInsufficientResourcesErr)(stack)) {
22
+ if ((0, client_1.isErrInsufficientResourcesErr)(stack)) {
23
23
  return 'The lambda ran out of memory. Deploy a new function with more memory.';
24
24
  }
25
- if ((0, serverless_1.isBrowserCrashedError)(stack)) {
25
+ if ((0, client_1.isBrowserCrashedError)(stack)) {
26
26
  return 'The browser crashed while rendering the video. Deploy a new function with memory to give the browser more resources.';
27
27
  }
28
28
  return null;
@@ -0,0 +1,8 @@
1
+ type ReturnType = {
2
+ version: string;
3
+ memorySizeInMb: number;
4
+ diskSizeInMb: number;
5
+ timeoutInSeconds: number;
6
+ };
7
+ export declare const parseFunctionName: (functionName: string) => ReturnType | null;
8
+ export {};
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseFunctionName = void 0;
4
+ const defaults_1 = require("../../defaults");
5
+ const parseFunctionName = (functionName) => {
6
+ const match = functionName.match(new RegExp(defaults_1.RENDER_FN_PREFIX + '(.*)-mem(\\d+)mb-disk(\\d+)mb-(\\d+)sec$'));
7
+ if (!match) {
8
+ return null;
9
+ }
10
+ return {
11
+ version: match[1],
12
+ memorySizeInMb: parseInt(match[2], 10),
13
+ diskSizeInMb: parseInt(match[3], 10),
14
+ timeoutInSeconds: parseInt(match[4], 10),
15
+ };
16
+ };
17
+ exports.parseFunctionName = parseFunctionName;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.lambdaRenderHasAudioVideo = void 0;
4
- const renderer_1 = require("@remotion/renderer");
4
+ const pure_1 = require("@remotion/renderer/pure");
5
5
  const lambdaRenderHasAudioVideo = (renderMetadata) => {
6
6
  if (renderMetadata.type === 'still') {
7
7
  throw new Error('Cannot merge stills');
8
8
  }
9
- const support = renderer_1.RenderInternals.codecSupportsMedia(renderMetadata.codec);
9
+ const support = pure_1.NoReactAPIs.codecSupportsMedia(renderMetadata.codec);
10
10
  const hasVideo = renderMetadata
11
- ? !renderer_1.RenderInternals.isAudioCodec(renderMetadata.codec)
11
+ ? !pure_1.NoReactAPIs.isAudioCodec(renderMetadata.codec)
12
12
  : false;
13
13
  const hasAudio = renderMetadata
14
14
  ? !renderMetadata.muted && support.audio
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.rendererHandler = void 0;
7
7
  const renderer_1 = require("@remotion/renderer");
8
+ const pure_1 = require("@remotion/renderer/pure");
8
9
  const serverless_1 = require("@remotion/serverless");
9
10
  const client_1 = require("@remotion/serverless/client");
10
11
  const node_fs_1 = __importDefault(require("node:fs"));
@@ -98,7 +99,7 @@ const renderHandler = async ({ params, options, logs, onStream, providerSpecific
98
99
  }
99
100
  const audioOutputLocation = willRenderAudioEval === 'no'
100
101
  ? null
101
- : renderer_1.RenderInternals.isAudioCodec(params.codec)
102
+ : pure_1.NoReactAPIs.isAudioCodec(params.codec)
102
103
  ? null
103
104
  : audioExtension
104
105
  ? node_path_1.default.join(outdir, `${chunk}.${audioExtension}`)
@@ -238,7 +239,7 @@ const renderHandler = async ({ params, options, logs, onStream, providerSpecific
238
239
  if (videoOutputLocation) {
239
240
  const videoChunkTimer = (0, timer_1.timer)('Sending main chunk', params.logLevel);
240
241
  await onStream({
241
- type: renderer_1.RenderInternals.isAudioCodec(params.codec)
242
+ type: pure_1.NoReactAPIs.isAudioCodec(params.codec)
242
243
  ? 'audio-chunk-rendered'
243
244
  : 'video-chunk-rendered',
244
245
  payload: node_fs_1.default.readFileSync(videoOutputLocation),
@@ -4,6 +4,6 @@ export declare const lambdaReadFileImplementation: ({ bucketName, key, region, e
4
4
  bucketName: string;
5
5
  key: string;
6
6
  region: AwsRegion;
7
- expectedBucketOwner: string;
7
+ expectedBucketOwner: string | null;
8
8
  forcePathStyle: boolean;
9
9
  }) => Promise<Readable>;
@@ -11,7 +11,7 @@ const lambdaReadFileImplementation = async ({ bucketName, key, region, expectedB
11
11
  }).send(new client_s3_1.GetObjectCommand({
12
12
  Bucket: bucketName,
13
13
  Key: key,
14
- ExpectedBucketOwner: expectedBucketOwner,
14
+ ExpectedBucketOwner: expectedBucketOwner !== null && expectedBucketOwner !== void 0 ? expectedBucketOwner : undefined,
15
15
  }));
16
16
  return Body;
17
17
  };
@@ -33,10 +33,12 @@ const pathOfCredentialsFile = () => {
33
33
  };
34
34
  const isLikelyToHaveAwsProfile = () => {
35
35
  const credentialsFile = pathOfCredentialsFile();
36
- if (!(0, fs_1.existsSync)(credentialsFile)) {
36
+ try {
37
+ const content = (0, fs_1.readFileSync)(credentialsFile, 'utf-8');
38
+ return content.includes('[default]');
39
+ }
40
+ catch (err) {
37
41
  return false;
38
42
  }
39
- const content = (0, fs_1.readFileSync)(credentialsFile, 'utf-8');
40
- return content.includes('[default]');
41
43
  };
42
44
  exports.isLikelyToHaveAwsProfile = isLikelyToHaveAwsProfile;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/lambda"
4
4
  },
5
5
  "name": "@remotion/lambda",
6
- "version": "4.0.217",
6
+ "version": "4.0.219",
7
7
  "description": "Render Remotion videos on AWS Lambda",
8
8
  "main": "dist/index.js",
9
9
  "sideEffects": false,
@@ -22,13 +22,13 @@
22
22
  "@aws-sdk/s3-request-presigner": "3.645.0",
23
23
  "mime-types": "2.1.34",
24
24
  "zod": "3.22.3",
25
- "@remotion/bundler": "4.0.217",
26
- "@remotion/renderer": "4.0.217",
27
- "remotion": "4.0.217",
28
- "@remotion/serverless": "4.0.217",
29
- "@remotion/cli": "4.0.217",
30
- "@remotion/streaming": "4.0.217",
31
- "@remotion/studio-server": "4.0.217"
25
+ "@remotion/bundler": "4.0.219",
26
+ "@remotion/studio-server": "4.0.219",
27
+ "@remotion/streaming": "4.0.219",
28
+ "@remotion/cli": "4.0.219",
29
+ "@remotion/renderer": "4.0.219",
30
+ "@remotion/serverless": "4.0.219",
31
+ "remotion": "4.0.219"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/mime-types": "2.1.1",
@@ -37,11 +37,11 @@
37
37
  "pureimage": "0.4.13",
38
38
  "vitest": "0.31.1",
39
39
  "zip-lib": "^0.7.2",
40
- "@remotion/bundler": "4.0.217",
41
- "@remotion/compositor-linux-arm64-gnu": "4.0.217"
40
+ "@remotion/bundler": "4.0.219",
41
+ "@remotion/compositor-linux-arm64-gnu": "4.0.219"
42
42
  },
43
43
  "peerDependencies": {
44
- "@remotion/bundler": "4.0.217"
44
+ "@remotion/bundler": "4.0.219"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
Binary file