@remotion/lambda 4.0.514 → 4.0.515

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.
@@ -25,7 +25,7 @@ const quit_1 = require("../../helpers/quit");
25
25
  const log_1 = require("../../log");
26
26
  const progress_1 = require("./progress");
27
27
  exports.RENDER_COMMAND = 'render';
28
- const { x264Option, audioBitrateOption, offthreadVideoCacheSizeInBytesOption, offthreadVideoThreadsOption, scaleOption, crfOption, gopSizeOption, jpegQualityOption, videoBitrateOption, mutedOption, colorSpaceOption, deleteAfterOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, numberOfGifLoopsOption, encodingMaxRateOption, encodingBufferSizeOption, delayRenderTimeoutInMillisecondsOption, overwriteOption, binariesDirectoryOption, preferLosslessOption, metadataOption, mediaCacheSizeInBytesOption, darkModeOption, pixelFormatOption, browserExecutableOption, everyNthFrameOption, proResProfileOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, audioCodecOption, videoCodecOption, overrideHeightOption, overrideWidthOption, overrideFpsOption, overrideDurationOption, sampleRateOption, } = client_1.BrowserSafeApis.options;
28
+ const { x264Option, audioBitrateOption, offthreadVideoCacheSizeInBytesOption, offthreadVideoThreadsOption, scaleOption, crfOption, gopSizeOption, jpegQualityOption, videoBitrateOption, mutedOption, colorSpaceOption, deleteAfterOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, numberOfGifLoopsOption, encodingMaxRateOption, encodingBufferSizeOption, delayRenderTimeoutInMillisecondsOption, overwriteOption, binariesDirectoryOption, preferLosslessOption, metadataOption, mediaCacheSizeInBytesOption, darkModeOption, pixelFormatOption, browserExecutableOption, everyNthFrameOption, proResProfileOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, audioCodecOption, videoCodecOption, overrideHeightOption, overrideWidthOption, overrideFpsOption, overrideDurationOption, sampleRateOption, enableCancellationOption, } = client_1.BrowserSafeApis.options;
29
29
  const renderCommand = async ({ args, remotionRoot, logLevel, providerSpecifics, }) => {
30
30
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
31
31
  const serveUrl = args[0];
@@ -47,6 +47,9 @@ const renderCommand = async ({ args, remotionRoot, logLevel, providerSpecifics,
47
47
  throw new Error('Comma-separated frame selections are only supported by the local `remotion render` command. Pass one frame range to render a video on Lambda.');
48
48
  }
49
49
  const singleFrameRange = frameRange;
50
+ const enableCancellation = enableCancellationOption.getValue({
51
+ commandLine: cli_1.CliInternals.parsedCli,
52
+ }).value;
50
53
  const height = overrideHeightOption.getValue({
51
54
  commandLine: cli_1.CliInternals.parsedCli,
52
55
  }).value;
@@ -267,6 +270,7 @@ const renderCommand = async ({ args, remotionRoot, logLevel, providerSpecifics,
267
270
  const concurrencyPerLambda = (_g = args_1.parsedLambdaCli['concurrency-per-lambda']) !== null && _g !== void 0 ? _g : 1;
268
271
  const webhookCustomData = (0, get_webhook_custom_data_1.getWebhookCustomData)(logLevel);
269
272
  const res = await lambda_client_1.LambdaClientInternals.internalRenderMediaOnLambdaRaw({
273
+ enableCancellation,
270
274
  functionName,
271
275
  serveUrl,
272
276
  inputProps,
@@ -330,6 +334,32 @@ const renderCommand = async ({ args, remotionRoot, logLevel, providerSpecifics,
330
334
  isProduction: (_p = args_1.parsedLambdaCli[client_1.BrowserSafeApis.options.isProductionOption.cliFlag]) !== null && _p !== void 0 ? _p : true,
331
335
  sampleRate,
332
336
  });
337
+ const unregisterCtrlCHandler = cli_1.CliInternals.registerCtrlCHandler(async () => {
338
+ var _a;
339
+ if (!enableCancellation) {
340
+ log_1.Log.info({ indent: false, logLevel }, 'Stopped waiting. The Lambda render is still running.');
341
+ log_1.Log.info({ indent: false, logLevel }, 'Use --enable-cancellation to allow Ctrl+C to cancel it.');
342
+ return 130;
343
+ }
344
+ log_1.Log.info({ indent: false, logLevel }, 'Cancelling Lambda render...');
345
+ try {
346
+ await lambda_client_1.LambdaClientInternals.internalCancelRenderOnLambda({
347
+ bucketName: res.bucketName,
348
+ region,
349
+ renderId: res.renderId,
350
+ forcePathStyle: (_a = args_1.parsedLambdaCli['force-path-style']) !== null && _a !== void 0 ? _a : false,
351
+ requestHandler: null,
352
+ providerSpecifics,
353
+ });
354
+ }
355
+ catch (err) {
356
+ log_1.Log.error({ indent: false, logLevel }, `Could not cancel the Lambda render: ${err instanceof Error ? err.message : String(err)}`);
357
+ log_1.Log.info({ indent: false, logLevel }, 'The Lambda render may still be running.');
358
+ return 1;
359
+ }
360
+ log_1.Log.info({ indent: false, logLevel }, 'Cancellation signal sent.');
361
+ return 130;
362
+ });
333
363
  const progressBar = cli_1.CliInternals.createOverwriteableCliOutput({
334
364
  quiet: cli_1.CliInternals.quietFlagProvided(),
335
365
  cancelSignal: null,
@@ -339,6 +369,9 @@ const renderCommand = async ({ args, remotionRoot, logLevel, providerSpecifics,
339
369
  logLevel,
340
370
  });
341
371
  log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray(`Bucket: ${cli_1.CliInternals.makeHyperlink({ text: res.bucketName, fallback: res.bucketName, url: lambda_client_1.LambdaClientInternals.getS3BucketUrl({ region: (0, get_aws_region_1.getAwsRegion)(), bucketName: res.bucketName }) })}`));
372
+ if (enableCancellation) {
373
+ log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('Press Ctrl+C to cancel the render.'));
374
+ }
342
375
  log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray(`Function: ${cli_1.CliInternals.makeHyperlink({ text: functionName, fallback: functionName, url: lambda_client_1.LambdaClientInternals.getLambdaFunctionUrl({ region: (0, get_aws_region_1.getAwsRegion)(), functionName }) })}`));
343
376
  log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray(`Render ID: ${cli_1.CliInternals.makeHyperlink({ text: res.renderId, fallback: res.renderId, url: res.folderInS3Console })}`));
344
377
  log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray(`progress.json: ${cli_1.CliInternals.makeHyperlink({
@@ -407,6 +440,7 @@ const renderCommand = async ({ args, remotionRoot, logLevel, providerSpecifics,
407
440
  overall: newStatus,
408
441
  }), false);
409
442
  if (newStatus.done) {
443
+ unregisterCtrlCHandler();
410
444
  let downloadOrNothing;
411
445
  if (downloadName) {
412
446
  const downloadStart = Date.now();
@@ -479,6 +513,7 @@ const renderCommand = async ({ args, remotionRoot, logLevel, providerSpecifics,
479
513
  (0, quit_1.quit)(0);
480
514
  }
481
515
  if (newStatus.fatalErrorEncountered) {
516
+ unregisterCtrlCHandler();
482
517
  log_1.Log.error({ indent: false, logLevel }, '\n');
483
518
  const uniqueErrors = [];
484
519
  for (const err of newStatus.errors) {
@@ -8604,7 +8604,7 @@ var require_package = __commonJS((exports, module) => {
8604
8604
  url: "https://github.com/remotion-dev/remotion/tree/main/packages/lambda"
8605
8605
  },
8606
8606
  name: "@remotion/lambda",
8607
- version: "4.0.514",
8607
+ version: "4.0.515",
8608
8608
  description: "Render Remotion videos on AWS Lambda",
8609
8609
  main: "dist/index.js",
8610
8610
  scripts: {
@@ -12014,7 +12014,8 @@ var {
12014
12014
  overrideWidthOption,
12015
12015
  overrideFpsOption,
12016
12016
  overrideDurationOption,
12017
- sampleRateOption
12017
+ sampleRateOption,
12018
+ enableCancellationOption
12018
12019
  } = BrowserSafeApis3.options;
12019
12020
  var renderCommand = async ({
12020
12021
  args,
@@ -12040,6 +12041,9 @@ var renderCommand = async ({
12040
12041
  throw new Error("Comma-separated frame selections are only supported by the local `remotion render` command. Pass one frame range to render a video on Lambda.");
12041
12042
  }
12042
12043
  const singleFrameRange = frameRange;
12044
+ const enableCancellation = enableCancellationOption.getValue({
12045
+ commandLine: CliInternals14.parsedCli
12046
+ }).value;
12043
12047
  const height = overrideHeightOption.getValue({
12044
12048
  commandLine: CliInternals14.parsedCli
12045
12049
  }).value;
@@ -12263,6 +12267,7 @@ var renderCommand = async ({
12263
12267
  const concurrencyPerLambda = parsedLambdaCli["concurrency-per-lambda"] ?? 1;
12264
12268
  const webhookCustomData = getWebhookCustomData(logLevel);
12265
12269
  const res = await LambdaClientInternals25.internalRenderMediaOnLambdaRaw({
12270
+ enableCancellation,
12266
12271
  functionName,
12267
12272
  serveUrl,
12268
12273
  inputProps,
@@ -12324,6 +12329,30 @@ var renderCommand = async ({
12324
12329
  isProduction: parsedLambdaCli[BrowserSafeApis3.options.isProductionOption.cliFlag] ?? true,
12325
12330
  sampleRate
12326
12331
  });
12332
+ const unregisterCtrlCHandler = CliInternals14.registerCtrlCHandler(async () => {
12333
+ if (!enableCancellation) {
12334
+ Log.info({ indent: false, logLevel }, "Stopped waiting. The Lambda render is still running.");
12335
+ Log.info({ indent: false, logLevel }, "Use --enable-cancellation to allow Ctrl+C to cancel it.");
12336
+ return 130;
12337
+ }
12338
+ Log.info({ indent: false, logLevel }, "Cancelling Lambda render...");
12339
+ try {
12340
+ await LambdaClientInternals25.internalCancelRenderOnLambda({
12341
+ bucketName: res.bucketName,
12342
+ region,
12343
+ renderId: res.renderId,
12344
+ forcePathStyle: parsedLambdaCli["force-path-style"] ?? false,
12345
+ requestHandler: null,
12346
+ providerSpecifics
12347
+ });
12348
+ } catch (err) {
12349
+ Log.error({ indent: false, logLevel }, `Could not cancel the Lambda render: ${err instanceof Error ? err.message : String(err)}`);
12350
+ Log.info({ indent: false, logLevel }, "The Lambda render may still be running.");
12351
+ return 1;
12352
+ }
12353
+ Log.info({ indent: false, logLevel }, "Cancellation signal sent.");
12354
+ return 130;
12355
+ });
12327
12356
  const progressBar = CliInternals14.createOverwriteableCliOutput({
12328
12357
  quiet: CliInternals14.quietFlagProvided(),
12329
12358
  cancelSignal: null,
@@ -12332,6 +12361,9 @@ var renderCommand = async ({
12332
12361
  logLevel
12333
12362
  });
12334
12363
  Log.info({ indent: false, logLevel }, CliInternals14.chalk.gray(`Bucket: ${CliInternals14.makeHyperlink({ text: res.bucketName, fallback: res.bucketName, url: LambdaClientInternals25.getS3BucketUrl({ region: getAwsRegion(), bucketName: res.bucketName }) })}`));
12364
+ if (enableCancellation) {
12365
+ Log.info({ indent: false, logLevel }, CliInternals14.chalk.gray("Press Ctrl+C to cancel the render."));
12366
+ }
12335
12367
  Log.info({ indent: false, logLevel }, CliInternals14.chalk.gray(`Function: ${CliInternals14.makeHyperlink({ text: functionName, fallback: functionName, url: LambdaClientInternals25.getLambdaFunctionUrl({ region: getAwsRegion(), functionName }) })}`));
12336
12368
  Log.info({ indent: false, logLevel }, CliInternals14.chalk.gray(`Render ID: ${CliInternals14.makeHyperlink({ text: res.renderId, fallback: res.renderId, url: res.folderInS3Console })}`));
12337
12369
  Log.info({ indent: false, logLevel }, CliInternals14.chalk.gray(`progress.json: ${CliInternals14.makeHyperlink({
@@ -12399,6 +12431,7 @@ var renderCommand = async ({
12399
12431
  overall: newStatus
12400
12432
  }), false);
12401
12433
  if (newStatus.done) {
12434
+ unregisterCtrlCHandler();
12402
12435
  let downloadOrNothing;
12403
12436
  if (downloadName) {
12404
12437
  const downloadStart = Date.now();
@@ -12463,6 +12496,7 @@ var renderCommand = async ({
12463
12496
  quit(0);
12464
12497
  }
12465
12498
  if (newStatus.fatalErrorEncountered) {
12499
+ unregisterCtrlCHandler();
12466
12500
  Log.error({ indent: false, logLevel }, `
12467
12501
  `);
12468
12502
  const uniqueErrors = [];
@@ -3,12 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.serverAwsImplementation = void 0;
4
4
  const lambda_client_1 = require("@remotion/lambda-client");
5
5
  const serverless_1 = require("@remotion/serverless");
6
+ const no_react_1 = require("remotion/no-react");
6
7
  const clean_tmpdir_1 = require("./helpers/clean-tmpdir");
7
8
  const get_current_region_1 = require("./helpers/get-current-region");
8
9
  const get_folder_files_1 = require("./helpers/get-folder-files");
9
10
  const make_aws_artifact_1 = require("./helpers/make-aws-artifact");
10
11
  const timer_1 = require("./helpers/timer");
11
12
  exports.serverAwsImplementation = {
13
+ defaultX264Preset: no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES
14
+ ? 'veryfast'
15
+ : null,
12
16
  forgetBrowserEventLoop: serverless_1.forgetBrowserEventLoopImplementation,
13
17
  getBrowserInstance: serverless_1.getBrowserInstanceImplementation,
14
18
  timer: timer_1.timer,
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.514",
6
+ "version": "4.0.515",
7
7
  "description": "Render Remotion videos on AWS Lambda",
8
8
  "main": "dist/index.js",
9
9
  "scripts": {
@@ -28,22 +28,22 @@
28
28
  "@aws-sdk/client-cloudwatch-logs": "3.986.0",
29
29
  "@aws-sdk/client-service-quotas": "3.986.0",
30
30
  "@aws-sdk/lib-storage": "3.986.0",
31
- "@remotion/bundler": "4.0.514",
32
- "@remotion/cli": "4.0.514",
33
- "@remotion/lambda-client": "4.0.514",
34
- "@remotion/renderer": "4.0.514",
35
- "@remotion/serverless": "4.0.514",
36
- "@remotion/streaming": "4.0.514",
31
+ "@remotion/bundler": "4.0.515",
32
+ "@remotion/cli": "4.0.515",
33
+ "@remotion/lambda-client": "4.0.515",
34
+ "@remotion/renderer": "4.0.515",
35
+ "@remotion/serverless": "4.0.515",
36
+ "@remotion/streaming": "4.0.515",
37
37
  "@smithy/abort-controller": "4.0.1",
38
- "remotion": "4.0.514",
38
+ "remotion": "4.0.515",
39
39
  "zod": "4.4.3"
40
40
  },
41
41
  "devDependencies": {
42
- "@remotion/bundler": "4.0.514",
42
+ "@remotion/bundler": "4.0.515",
43
43
  "@types/express": "5.0.1",
44
44
  "express": "4.21.0",
45
- "@remotion/compositor-linux-arm64-gnu": "4.0.514",
46
- "@remotion/eslint-config-internal": "4.0.514",
45
+ "@remotion/compositor-linux-arm64-gnu": "4.0.515",
46
+ "@remotion/eslint-config-internal": "4.0.515",
47
47
  "mime-types": "2.1.34",
48
48
  "@types/mime-types": "2.1.1",
49
49
  "@types/minimist": "1.2.2",
@@ -54,7 +54,7 @@
54
54
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
55
55
  },
56
56
  "peerDependencies": {
57
- "@remotion/bundler": "4.0.514"
57
+ "@remotion/bundler": "4.0.515"
58
58
  },
59
59
  "publishConfig": {
60
60
  "access": "public"
Binary file