@remotion/lambda 4.0.188 → 4.0.189

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.
@@ -5,6 +5,7 @@ const client_1 = require("@remotion/serverless/client");
5
5
  const version_1 = require("remotion/version");
6
6
  const aws_implementation_1 = require("../functions/aws-implementation");
7
7
  const client_2 = require("@remotion/serverless/client");
8
+ const no_react_1 = require("remotion/no-react");
8
9
  const validate_download_behavior_1 = require("../shared/validate-download-behavior");
9
10
  const validate_frames_per_lambda_1 = require("../shared/validate-frames-per-lambda");
10
11
  const validate_lambda_codec_1 = require("../shared/validate-lambda-codec");
@@ -57,7 +58,7 @@ const makeLambdaRenderMediaPayload = async ({ rendererFunctionName, frameRange,
57
58
  downloadBehavior,
58
59
  muted,
59
60
  version: version_1.VERSION,
60
- overwrite: overwrite !== null && overwrite !== void 0 ? overwrite : false,
61
+ overwrite: overwrite !== null && overwrite !== void 0 ? overwrite : no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES,
61
62
  audioBitrate: audioBitrate !== null && audioBitrate !== void 0 ? audioBitrate : null,
62
63
  videoBitrate: videoBitrate !== null && videoBitrate !== void 0 ? videoBitrate : null,
63
64
  encodingBufferSize: encodingBufferSize !== null && encodingBufferSize !== void 0 ? encodingBufferSize : null,
@@ -222,6 +222,7 @@ const innerLaunchHandler = async ({ functionName, params, options, overallProgre
222
222
  downloadBehavior: params.downloadBehavior,
223
223
  audioBitrate: params.audioBitrate,
224
224
  muted: params.muted,
225
+ functionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
225
226
  };
226
227
  const { key, renderBucketName, customCredentials } = (0, client_1.getExpectedOutName)(renderMetadata, params.bucketName, typeof params.outName === 'string' || typeof params.outName === 'undefined'
227
228
  ? null
@@ -265,6 +265,7 @@ const rendererHandler = async ({ onStream, options, params, providerSpecifics, r
265
265
  }
266
266
  const logs = [];
267
267
  const leakDetection = (0, why_is_node_running_1.enableNodeIntrospection)(ENABLE_SLOW_LEAK_DETECTION);
268
+ let shouldKeepBrowserOpen = true;
268
269
  try {
269
270
  await renderHandler({
270
271
  params,
@@ -285,6 +286,9 @@ const rendererHandler = async ({ onStream, options, params, providerSpecifics, r
285
286
  // If this error is encountered, we can just retry as it
286
287
  // is a very rare error to occur
287
288
  const isRetryableError = (0, is_flaky_error_1.isFlakyError)(err);
289
+ if (isRetryableError) {
290
+ shouldKeepBrowserOpen = false;
291
+ }
288
292
  const shouldNotRetry = err.name === 'CancelledError';
289
293
  const shouldRetry = isRetryableError && params.retriesLeft > 0 && !shouldNotRetry;
290
294
  renderer_1.RenderInternals.Log.error({ indent: false, logLevel: params.logLevel }, `Error occurred (will retry = ${String(shouldRetry)})`);
@@ -312,7 +316,14 @@ const rendererHandler = async ({ onStream, options, params, providerSpecifics, r
312
316
  throw err;
313
317
  }
314
318
  finally {
315
- (0, serverless_1.forgetBrowserEventLoop)(params.logLevel);
319
+ if (shouldKeepBrowserOpen) {
320
+ (0, serverless_1.forgetBrowserEventLoop)(params.logLevel);
321
+ }
322
+ else {
323
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel: params.logLevel }, 'Lambda did not succeed with flaky error, not keeping browser open.');
324
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel: params.logLevel }, 'Quitting Lambda forcefully now to force not keeping the Lambda warm.');
325
+ process.exit(0);
326
+ }
316
327
  if (ENABLE_SLOW_LEAK_DETECTION) {
317
328
  (0, leak_detection_1.startLeakDetection)(leakDetection, requestContext.awsRequestId);
318
329
  }
@@ -125,6 +125,7 @@ const innerStillHandler = async ({ params: lambdaParams, expectedBucketOwner, re
125
125
  numberOfGifLoops: null,
126
126
  downloadBehavior: lambdaParams.downloadBehavior,
127
127
  audioBitrate: null,
128
+ functionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
128
129
  };
129
130
  const still = (0, overall_render_progress_1.makeInitialOverallRenderProgress)(timeoutInMilliseconds);
130
131
  still.renderMetadata = renderMetadata;
package/dist/index.d.ts CHANGED
@@ -34,7 +34,7 @@ import type { RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput } from './api/
34
34
  import { renderVideoOnLambda } from './api/render-media-on-lambda';
35
35
  import type { RenderStillOnLambdaInput, RenderStillOnLambdaOutput } from './api/render-still-on-lambda';
36
36
  import { validateWebhookSignature } from './api/validate-webhook-signature';
37
- import { LambdaInternals } from './internals';
37
+ import { LambdaInternals, _InternalAwsProvider, _InternalOverallRenderProgress } from './internals';
38
38
  import type { AwsRegion } from './regions';
39
39
  import type { RenderProgress } from './shared/constants';
40
40
  import type { WebhookPayload } from './shared/invoke-webhook';
@@ -56,3 +56,4 @@ declare const presignUrl: <CheckIfObjectExists extends boolean = false>({ region
56
56
  declare const getSites: ({ region, forceBucketName, }: GetSitesInput) => Promise<GetSitesOutput>;
57
57
  export { LambdaInternals, deleteFunction, deleteRender, deleteSite, deployFunction, deploySite, downloadMedia, estimatePrice, getAwsClient, getCompositionsOnLambda, getFunctionInfo, getFunctions, getOrCreateBucket, getRegions, getRenderProgress, getRolePolicy, getSites, getUserPolicy, presignUrl, renderMediaOnLambda, renderStillOnLambda, renderVideoOnLambda, simulatePermissions, validateWebhookSignature, };
58
58
  export type { AwsRegion, CustomCredentials, DeleteFunctionInput, DeleteRenderInput, DeleteSiteInput, DeleteSiteOutput, DeployFunctionInput, DeployFunctionOutput, DeploySiteInput, DeploySiteOutput, DownloadMediaInput, DownloadMediaOutput, EnhancedErrorInfo, EstimatePriceInput, FunctionInfo, GetAwsClientInput, GetAwsClientOutput, GetCompositionsOnLambdaInput, GetCompositionsOnLambdaOutput, GetFunctionInfoInput, GetFunctionsInput, GetOrCreateBucketInput, GetOrCreateBucketOutput, GetRenderProgressInput, GetSitesInput, GetSitesOutput, LambdaErrorInfo, RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput, RenderProgress, RenderStillOnLambdaInput, RenderStillOnLambdaOutput, SimulatePermissionsInput, SimulatePermissionsOutput, WebhookPayload, };
59
+ export { _InternalAwsProvider, _InternalOverallRenderProgress };
@@ -90,3 +90,5 @@ export declare const LambdaInternals: {
90
90
  };
91
91
  }>;
92
92
  };
93
+ export { AwsProvider as _InternalAwsProvider } from './functions/aws-implementation';
94
+ export { OverallRenderProgress as _InternalOverallRenderProgress } from './functions/helpers/overall-render-progress';
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.188",
6
+ "version": "4.0.189",
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.583.0",
23
23
  "mime-types": "2.1.34",
24
24
  "zod": "3.22.3",
25
- "@remotion/cli": "4.0.188",
26
- "@remotion/bundler": "4.0.188",
27
- "@remotion/streaming": "4.0.188",
28
- "@remotion/renderer": "4.0.188",
29
- "@remotion/studio-server": "4.0.188",
30
- "remotion": "4.0.188",
31
- "@remotion/serverless": "4.0.188"
25
+ "@remotion/bundler": "4.0.189",
26
+ "@remotion/cli": "4.0.189",
27
+ "@remotion/renderer": "4.0.189",
28
+ "@remotion/studio-server": "4.0.189",
29
+ "@remotion/streaming": "4.0.189",
30
+ "@remotion/serverless": "4.0.189",
31
+ "remotion": "4.0.189"
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.188",
41
- "@remotion/compositor-linux-arm64-gnu": "4.0.188"
40
+ "@remotion/bundler": "4.0.189",
41
+ "@remotion/compositor-linux-arm64-gnu": "4.0.189"
42
42
  },
43
43
  "peerDependencies": {
44
- "@remotion/bundler": "4.0.188"
44
+ "@remotion/bundler": "4.0.189"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
Binary file