@remotion/renderer 4.0.539 → 4.0.540

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.
Files changed (157) hide show
  1. package/dist/assets/download-and-map-assets-to-file.js +16 -3
  2. package/dist/assets/download-file.js +9 -2
  3. package/dist/assets/download-map.d.ts +1 -1
  4. package/dist/assets/read-file.d.ts +1 -1
  5. package/dist/assets/read-file.js +6 -5
  6. package/dist/browser/BrowserFetcher.js +4 -1
  7. package/dist/browser/BrowserPage.js +27 -8
  8. package/dist/browser/NetworkManager.js +6 -1
  9. package/dist/browser/devtools-commands.d.ts +6 -1
  10. package/dist/browser/get-chrome-download-url.d.ts +1 -1
  11. package/dist/browser/get-chrome-download-url.js +4 -1
  12. package/dist/check-version-requirements.js +6 -6
  13. package/dist/client.d.ts +459 -238
  14. package/dist/esm/client.mjs +349 -310
  15. package/dist/esm/index.mjs +306 -261
  16. package/dist/get-compositions.js +6 -3
  17. package/dist/index.d.ts +113 -41
  18. package/dist/index.js +4 -2
  19. package/dist/make-page.d.ts +3 -1
  20. package/dist/make-page.js +2 -1
  21. package/dist/options/allow-html-in-canvas.d.ts +1 -1
  22. package/dist/options/api-key.d.ts +1 -1
  23. package/dist/options/ask-ai.d.ts +1 -1
  24. package/dist/options/ask-ai.js +1 -1
  25. package/dist/options/audio-bitrate.d.ts +1 -1
  26. package/dist/options/beep-on-finish.d.ts +1 -1
  27. package/dist/options/benchmark-concurrencies.d.ts +1 -1
  28. package/dist/options/binaries-directory.d.ts +1 -1
  29. package/dist/options/browser-executable.d.ts +1 -1
  30. package/dist/options/browser-executable.js +1 -1
  31. package/dist/options/browser.d.ts +1 -1
  32. package/dist/options/bundle-cache.d.ts +1 -1
  33. package/dist/options/canvas-tabs.d.ts +1 -1
  34. package/dist/options/chrome-mode.d.ts +1 -1
  35. package/dist/options/color-space.d.ts +1 -1
  36. package/dist/options/concurrency.d.ts +1 -1
  37. package/dist/options/config.d.ts +1 -1
  38. package/dist/options/crf.d.ts +1 -1
  39. package/dist/options/crf.js +1 -1
  40. package/dist/options/cross-site-isolation.d.ts +1 -1
  41. package/dist/options/cross-site-isolation.js +2 -2
  42. package/dist/options/dark-mode.d.ts +1 -1
  43. package/dist/options/default-coding-agent.d.ts +1 -1
  44. package/dist/options/default-editor.d.ts +1 -1
  45. package/dist/options/default-premount-in-seconds.d.ts +1 -1
  46. package/dist/options/delete-after.d.ts +1 -1
  47. package/dist/options/disable-git-source.d.ts +2 -2
  48. package/dist/options/disable-shared-memory-capture.d.ts +1 -1
  49. package/dist/options/disable-web-security.d.ts +1 -1
  50. package/dist/options/disallow-parallel-encoding.d.ts +1 -1
  51. package/dist/options/enable-cancellation.d.ts +1 -1
  52. package/dist/options/enable-lambda-insights.d.ts +1 -1
  53. package/dist/options/enable-lambda-insights.js +2 -2
  54. package/dist/options/enable-multiprocess-on-linux.d.ts +1 -1
  55. package/dist/options/enable-multiprocess-on-linux.js +2 -2
  56. package/dist/options/encoding-buffer-size.d.ts +1 -1
  57. package/dist/options/encoding-max-rate.d.ts +1 -1
  58. package/dist/options/enforce-audio.d.ts +1 -1
  59. package/dist/options/env-file.d.ts +1 -1
  60. package/dist/options/every-nth-frame.d.ts +1 -1
  61. package/dist/options/experimental-keep-audio-context-alive.d.ts +1 -1
  62. package/dist/options/folder-expiry.d.ts +1 -1
  63. package/dist/options/folder-expiry.js +1 -1
  64. package/dist/options/for-seamless-aac-concatenation.d.ts +1 -1
  65. package/dist/options/force-new-studio.d.ts +1 -1
  66. package/dist/options/frames.d.ts +1 -1
  67. package/dist/options/gl.d.ts +1 -1
  68. package/dist/options/gop-size.d.ts +1 -1
  69. package/dist/options/headless.d.ts +1 -1
  70. package/dist/options/ignore-certificate-errors.d.ts +1 -1
  71. package/dist/options/image-sequence-pattern.d.ts +1 -1
  72. package/dist/options/image-sequence.d.ts +1 -1
  73. package/dist/options/index.d.ts +119 -102
  74. package/dist/options/index.js +2 -0
  75. package/dist/options/interactivity.d.ts +1 -1
  76. package/dist/options/ipv4.d.ts +1 -1
  77. package/dist/options/is-production.d.ts +1 -1
  78. package/dist/options/jpeg-quality.d.ts +1 -1
  79. package/dist/options/keyboard-shortcuts.d.ts +1 -1
  80. package/dist/options/latency-hint.d.ts +1 -1
  81. package/dist/options/license-key.d.ts +1 -1
  82. package/dist/options/log-level.d.ts +1 -1
  83. package/dist/options/metadata.d.ts +1 -1
  84. package/dist/options/mute.d.ts +1 -1
  85. package/dist/options/no-open.d.ts +1 -1
  86. package/dist/options/number-of-gif-loops.d.ts +1 -1
  87. package/dist/options/number-of-shared-audio-tags.d.ts +1 -1
  88. package/dist/options/offthreadvideo-cache-size.d.ts +1 -1
  89. package/dist/options/offthreadvideo-threads.d.ts +1 -1
  90. package/dist/options/on-browser-download.d.ts +1 -1
  91. package/dist/options/options-map.d.ts +340 -136
  92. package/dist/options/options-map.js +13 -0
  93. package/dist/options/out-dir.d.ts +1 -1
  94. package/dist/options/override-duration.d.ts +1 -1
  95. package/dist/options/override-fps.d.ts +1 -1
  96. package/dist/options/override-height.d.ts +1 -1
  97. package/dist/options/override-width.d.ts +1 -1
  98. package/dist/options/overwrite.d.ts +1 -1
  99. package/dist/options/package-manager.d.ts +1 -1
  100. package/dist/options/pixel-format.d.ts +1 -1
  101. package/dist/options/port.d.ts +1 -1
  102. package/dist/options/prefer-lossless.d.ts +1 -1
  103. package/dist/options/preferred-effect-backend.d.ts +18 -0
  104. package/dist/options/preferred-effect-backend.js +28 -0
  105. package/dist/options/preserve-pitch-on-playback.d.ts +1 -1
  106. package/dist/options/preview-sample-rate.d.ts +1 -1
  107. package/dist/options/props.d.ts +1 -1
  108. package/dist/options/prores-profile.d.ts +1 -1
  109. package/dist/options/public-dir.d.ts +1 -1
  110. package/dist/options/public-license-key.d.ts +1 -1
  111. package/dist/options/public-path.d.ts +1 -1
  112. package/dist/options/repro.d.ts +1 -1
  113. package/dist/options/rspack.d.ts +1 -1
  114. package/dist/options/runs.d.ts +1 -1
  115. package/dist/options/sample-rate.d.ts +1 -1
  116. package/dist/options/scale.d.ts +1 -1
  117. package/dist/options/sequence-activity-limit.d.ts +1 -1
  118. package/dist/options/show-layer-frame-numbers.d.ts +1 -1
  119. package/dist/options/show-premounting.d.ts +1 -1
  120. package/dist/options/skip-skills.d.ts +1 -1
  121. package/dist/options/still-frame.d.ts +1 -1
  122. package/dist/options/still-image-format.d.ts +1 -1
  123. package/dist/options/throw-if-site-exists.d.ts +2 -2
  124. package/dist/options/timeout.d.ts +1 -1
  125. package/dist/options/user-agent.d.ts +1 -1
  126. package/dist/options/version-flag.d.ts +1 -1
  127. package/dist/options/video-bitrate.d.ts +1 -1
  128. package/dist/options/video-cache-size.d.ts +1 -1
  129. package/dist/options/video-codec.d.ts +1 -1
  130. package/dist/options/video-image-format.d.ts +1 -1
  131. package/dist/options/webhook-custom-data.d.ts +1 -1
  132. package/dist/options/webpack-poll.d.ts +1 -1
  133. package/dist/options/x264-preset.d.ts +1 -1
  134. package/dist/render-frames.js +6 -3
  135. package/dist/render-media.d.ts +1 -1
  136. package/dist/render-media.js +4 -2
  137. package/dist/render-still.js +6 -2
  138. package/dist/select-composition.js +6 -3
  139. package/dist/set-props-and-env.d.ts +2 -0
  140. package/dist/set-props-and-env.js +8 -3
  141. package/dist/stringify-ffmpeg-filter.js +6 -2
  142. package/dist/symbolicate-stacktrace.js +1 -1
  143. package/dist/validate-selected-frames.d.ts +4 -4
  144. package/dist/validate-selected-frames.js +2 -31
  145. package/package.json +15 -15
  146. package/dist/options/experimental-client-side-rendering.d.ts +0 -16
  147. package/dist/options/experimental-client-side-rendering.js +0 -30
  148. package/dist/options/experimental-sequence-activity-limit.d.ts +0 -19
  149. package/dist/options/experimental-sequence-activity-limit.js +0 -40
  150. package/dist/options/experimental-sequence-activity.d.ts +0 -19
  151. package/dist/options/experimental-sequence-activity.js +0 -38
  152. package/dist/options/experimental-tracks.d.ts +0 -19
  153. package/dist/options/experimental-tracks.js +0 -43
  154. package/dist/prestitcher-memory-usage.d.ts +0 -13
  155. package/dist/prestitcher-memory-usage.js +0 -33
  156. package/dist/render-partitions.d.ts +0 -7
  157. package/dist/render-partitions.js +0 -50
@@ -1130,14 +1130,15 @@ var getClient = (url) => {
1130
1130
  }
1131
1131
  throw new Error(`Can only download URLs starting with http:// or https://, got "${url}"`);
1132
1132
  };
1133
- var readFileWithoutRedirect = (url) => {
1133
+ var readFileWithoutRedirect = (url, signal) => {
1134
1134
  return new Promise((resolve, reject) => {
1135
1135
  const client = getClient(url);
1136
1136
  const req = client(url, typeof Bun === "undefined" ? {
1137
1137
  headers: {
1138
1138
  "user-agent": "Mozilla/5.0 (@remotion/renderer - https://remotion.dev)"
1139
- }
1140
- } : {}, (res) => {
1139
+ },
1140
+ signal: signal ?? undefined
1141
+ } : { signal: signal ?? undefined }, (res) => {
1141
1142
  resolve({ request: req, response: res });
1142
1143
  });
1143
1144
  req.on("error", (err) => {
@@ -1146,11 +1147,11 @@ var readFileWithoutRedirect = (url) => {
1146
1147
  });
1147
1148
  });
1148
1149
  };
1149
- var readFile = async (url, redirectsSoFar = 0) => {
1150
+ var readFile = async (url, signal, redirectsSoFar = 0) => {
1150
1151
  if (redirectsSoFar > 10) {
1151
1152
  throw new Error(`Too many redirects while downloading ${url}`);
1152
1153
  }
1153
- const { request, response } = await readFileWithoutRedirect(url);
1154
+ const { request, response } = await readFileWithoutRedirect(url, signal);
1154
1155
  if (redirectStatusCodes.includes(response.statusCode)) {
1155
1156
  if (!response.headers.location) {
1156
1157
  throw new Error(`Received a status code ${response.statusCode} but no "Location" header while calling ${response.headers.location}`);
@@ -1158,7 +1159,7 @@ var readFile = async (url, redirectsSoFar = 0) => {
1158
1159
  const redirectUrl = new URL(response.headers.location, url).toString();
1159
1160
  request.destroy();
1160
1161
  response.destroy();
1161
- return readFile(redirectUrl, redirectsSoFar + 1);
1162
+ return readFile(redirectUrl, signal, redirectsSoFar + 1);
1162
1163
  }
1163
1164
  if (response.statusCode >= 400) {
1164
1165
  const body = await tryToObtainBody(response);
@@ -1240,23 +1241,27 @@ var downloadFileWithoutRetries = ({
1240
1241
  return;
1241
1242
  }
1242
1243
  rejectAndFlag(new Error(`Tried to download file ${url}, ${noDataSentToken} 20 seconds`));
1244
+ closeConnection();
1243
1245
  }, 20000);
1244
1246
  };
1245
1247
  refreshTimeout();
1246
1248
  let finishEventSent = false;
1247
- let closeConnection = () => {
1248
- return;
1249
- };
1249
+ const requestController = new AbortController;
1250
+ let closeConnection = () => requestController.abort();
1250
1251
  const onAbort = () => {
1251
1252
  rejectAndFlag(new Error(CANCELLED_ERROR));
1252
1253
  closeConnection();
1253
1254
  };
1254
1255
  abortSignal.addEventListener("abort", onAbort);
1255
- readFile(url).then(({ response, request }) => {
1256
+ readFile(url, requestController.signal).then(({ response, request }) => {
1256
1257
  closeConnection = () => {
1257
1258
  request.destroy();
1258
1259
  response.destroy();
1259
1260
  };
1261
+ if (rejected) {
1262
+ closeConnection();
1263
+ return;
1264
+ }
1260
1265
  if (abortSignal.aborted) {
1261
1266
  onAbort();
1262
1267
  return;
@@ -2595,7 +2600,10 @@ class NetworkManager extends EventEmitter {
2595
2600
  this.#client.on("Network.responseReceivedExtraInfo", this.#onResponseReceivedExtraInfo.bind(this));
2596
2601
  }
2597
2602
  async initialize() {
2598
- await this.#client.send("Network.enable");
2603
+ await this.#client.send("Network.enable", {
2604
+ maxTotalBufferSize: 0,
2605
+ maxResourceBufferSize: 0
2606
+ });
2599
2607
  }
2600
2608
  #onRequestWillBeSent(event) {
2601
2609
  this.#onRequest(event, undefined);
@@ -3490,6 +3498,19 @@ class Page extends EventEmitter {
3490
3498
  client.on("Runtime.consoleAPICalled", (event) => {
3491
3499
  return this.#onConsoleAPI(event);
3492
3500
  });
3501
+ client.on("Runtime.exceptionThrown", (event) => {
3502
+ const { exception, text, stackTrace, url, lineNumber, columnNumber } = event.exceptionDetails;
3503
+ const description = exception ? exception.description ?? String(exception.unserializableValue ?? exception.value) : null;
3504
+ this.onBrowserLog?.({
3505
+ type: "error",
3506
+ text: description === null ? text : `${text} ${description}`,
3507
+ stackTrace: stackTrace?.callFrames.length ? stackTrace.callFrames.map((frame) => ({
3508
+ url: frame.url,
3509
+ lineNumber: frame.lineNumber,
3510
+ columnNumber: frame.columnNumber
3511
+ })) : [{ url, lineNumber, columnNumber }]
3512
+ });
3513
+ });
3493
3514
  client.on("Runtime.bindingCalled", (event) => {
3494
3515
  return this.#onBindingCalled(event);
3495
3516
  });
@@ -3576,7 +3597,7 @@ class Page extends EventEmitter {
3576
3597
  this.emit("error", new Error("Page crashed!"));
3577
3598
  }
3578
3599
  #onLogEntryAdded(event) {
3579
- const { level, text, args, source, url, lineNumber } = event.entry;
3600
+ const { level, text, args, source, url, lineNumber, stackTrace } = event.entry;
3580
3601
  if (args) {
3581
3602
  args.map((arg) => {
3582
3603
  return releaseObject(this.#client, arg);
@@ -3588,16 +3609,15 @@ class Page extends EventEmitter {
3588
3609
  type: level,
3589
3610
  text,
3590
3611
  args: [],
3591
- stackTraceLocations: [{ url, lineNumber }],
3612
+ stackTraceLocations: stackTrace?.callFrames.length ? stackTrace.callFrames.map((frame) => ({
3613
+ url: frame.url,
3614
+ lineNumber: frame.lineNumber,
3615
+ columnNumber: frame.columnNumber
3616
+ })) : [{ url, lineNumber }],
3592
3617
  previewString,
3593
3618
  logLevel: logLevelFromRemotionLog ?? logLevelFromEvent,
3594
3619
  tag
3595
3620
  });
3596
- this.onBrowserLog?.({
3597
- stackTrace: message.stackTrace(),
3598
- text: message.text,
3599
- type: message.type
3600
- });
3601
3621
  this.#onConsole(message);
3602
3622
  }
3603
3623
  }
@@ -4778,8 +4798,106 @@ var canUseParallelEncoding = (codec) => {
4778
4798
  };
4779
4799
 
4780
4800
  // src/check-version-requirements.ts
4781
- import os2 from "node:os";
4801
+ import os3 from "node:os";
4782
4802
  import { NoReactInternals as NoReactInternals3 } from "remotion/no-react";
4803
+
4804
+ // src/browser/get-chrome-download-url.ts
4805
+ import * as fs5 from "node:fs";
4806
+ import * as os2 from "node:os";
4807
+ var TESTED_VERSION = "158.0.8127.2";
4808
+ var isAmazonLinux2023 = () => {
4809
+ if (os2.platform() !== "linux") {
4810
+ return false;
4811
+ }
4812
+ try {
4813
+ const osRelease = fs5.readFileSync("/etc/os-release", "utf-8");
4814
+ return osRelease.includes("Amazon Linux") && osRelease.includes('VERSION="2023"');
4815
+ } catch {
4816
+ return false;
4817
+ }
4818
+ };
4819
+ var MINIMUM_GLIBC_FOR_REMOTION_MEDIA = [2, 35];
4820
+ var getGlibcVersion = () => {
4821
+ if (process.platform !== "linux") {
4822
+ return null;
4823
+ }
4824
+ const { report } = process;
4825
+ if (!report) {
4826
+ return null;
4827
+ }
4828
+ const rep = report.getReport();
4829
+ if (typeof rep === "string") {
4830
+ return null;
4831
+ }
4832
+ const { glibcVersionRuntime } = rep.header;
4833
+ if (!glibcVersionRuntime) {
4834
+ return null;
4835
+ }
4836
+ const split = glibcVersionRuntime.split(".");
4837
+ if (split.length !== 2) {
4838
+ return null;
4839
+ }
4840
+ return [Number(split[0]), Number(split[1])];
4841
+ };
4842
+ var isGlibcVersionAtLeast = (required) => {
4843
+ const version = getGlibcVersion();
4844
+ if (version === null) {
4845
+ return false;
4846
+ }
4847
+ const [major, minor] = version;
4848
+ const [reqMajor, reqMinor] = required;
4849
+ if (major > reqMajor) {
4850
+ return true;
4851
+ }
4852
+ if (major === reqMajor && minor >= reqMinor) {
4853
+ return true;
4854
+ }
4855
+ return false;
4856
+ };
4857
+ var canUseRemotionMediaBinaries = () => {
4858
+ if (process.platform !== "linux") {
4859
+ return false;
4860
+ }
4861
+ return isGlibcVersionAtLeast(MINIMUM_GLIBC_FOR_REMOTION_MEDIA);
4862
+ };
4863
+ function getChromeDownloadUrl({
4864
+ platform,
4865
+ version,
4866
+ chromeMode
4867
+ }) {
4868
+ if (platform === "linux-arm64" && version && /^\d+$/.test(version)) {
4869
+ const archive = chromeMode === "chrome-for-testing" ? "chromium-linux-arm64" : "chromium-headless-shell-linux-arm64";
4870
+ return `https://playwright.azureedge.net/builds/chromium/${version}/${archive}.zip`;
4871
+ }
4872
+ if (chromeMode === "headless-shell" && version === null) {
4873
+ if (platform === "mac-arm64") {
4874
+ return `https://remotion.media/chromium-headless-shell-mac-arm64-${TESTED_VERSION}.zip?clear`;
4875
+ }
4876
+ if (platform === "win64") {
4877
+ return `https://remotion.media/chromium-headless-shell-win-x64-${TESTED_VERSION}.zip?clear`;
4878
+ }
4879
+ if (platform === "linux64" || platform === "linux-arm64") {
4880
+ const architecture = platform === "linux64" ? "x64" : "arm64";
4881
+ if (isAmazonLinux2023()) {
4882
+ return `https://remotion.media/chromium-headless-shell-amazon-linux-${architecture}-${TESTED_VERSION}.zip?clear`;
4883
+ }
4884
+ if (canUseRemotionMediaBinaries()) {
4885
+ return `https://remotion.media/chromium-headless-shell-linux-${architecture}-${TESTED_VERSION}.zip?clear`;
4886
+ }
4887
+ }
4888
+ }
4889
+ const archive = chromeMode === "headless-shell" ? "chrome-headless-shell" : "chrome";
4890
+ return `https://storage.googleapis.com/chrome-for-testing-public/${version ?? TESTED_VERSION}/${platform}/${archive}-${platform}.zip`;
4891
+ }
4892
+ var logDownloadUrl = ({
4893
+ url,
4894
+ logLevel,
4895
+ indent
4896
+ }) => {
4897
+ Log.info({ indent, logLevel }, `Downloading from: ${url}`);
4898
+ };
4899
+
4900
+ // src/check-version-requirements.ts
4783
4901
  var getRequiredLibCVersion = () => {
4784
4902
  if (process.platform !== "linux") {
4785
4903
  return null;
@@ -4787,10 +4905,10 @@ var getRequiredLibCVersion = () => {
4787
4905
  if (isMusl({ indent: false, logLevel: "warn" })) {
4788
4906
  return null;
4789
4907
  }
4790
- if (process.arch === "arm64") {
4791
- return [2, 26];
4908
+ if (process.arch === "arm64" && isAmazonLinux2023()) {
4909
+ return [2, 34];
4792
4910
  }
4793
- return [2, 31];
4911
+ return [2, 35];
4794
4912
  };
4795
4913
  var required = getRequiredLibCVersion();
4796
4914
  var gLibCErrorMessage = (libCString) => {
@@ -4807,7 +4925,7 @@ var gLibCErrorMessage = (libCString) => {
4807
4925
  if (Number(split[0]) > required[0]) {
4808
4926
  return null;
4809
4927
  }
4810
- return `Rendering videos requires glibc ${required.join(".")} on your or higher on your OS. Your system has glibc ${libCString}.`;
4928
+ return `Rendering videos requires glibc ${required.join(".")} or higher on your OS. Your system has glibc ${libCString}.`;
4811
4929
  };
4812
4930
  var checkLibCRequirement = (logLevel, indent) => {
4813
4931
  if (process.platform === "win32" || process.platform === "darwin") {
@@ -4848,7 +4966,7 @@ var checkMacOSVersion = (logLevel, indent) => {
4848
4966
  if (process.platform !== "darwin") {
4849
4967
  return;
4850
4968
  }
4851
- const majorVersion = Number(os2.release().split(".")[0]);
4969
+ const majorVersion = Number(os3.release().split(".")[0]);
4852
4970
  if (Number.isNaN(majorVersion) || majorVersion >= MIN_DARWIN_VERSION) {
4853
4971
  return;
4854
4972
  }
@@ -4922,7 +5040,7 @@ var formatStackFrameLocationLine = (frame) => {
4922
5040
  };
4923
5041
 
4924
5042
  // src/symbolicate-stacktrace.ts
4925
- import { readFileSync } from "fs";
5043
+ import { readFileSync as readFileSync2 } from "fs";
4926
5044
  import path6 from "path";
4927
5045
  import { SourceMapConsumer } from "source-map";
4928
5046
  function extractSourceMapUrl(fileContents) {
@@ -4968,14 +5086,14 @@ var getSourceMap = (filePath, fileContents, type) => {
4968
5086
  }
4969
5087
  if (type === "local") {
4970
5088
  const newFilePath = path6.join(path6.dirname(filePath), sm);
4971
- return Promise.resolve(new SourceMapConsumer(readFileSync(newFilePath, "utf8")));
5089
+ return Promise.resolve(new SourceMapConsumer(readFileSync2(newFilePath, "utf8")));
4972
5090
  }
4973
5091
  const index = filePath.lastIndexOf("/");
4974
5092
  const url = filePath.substring(0, index + 1) + sm;
4975
5093
  return getSourceMapFromRemoteUrl(url);
4976
5094
  };
4977
5095
  var fetchUrl = async (url) => {
4978
- const { request, response } = await readFile(url);
5096
+ const { request, response } = await readFile(url, null);
4979
5097
  return new Promise((resolve, reject) => {
4980
5098
  let downloaded = "";
4981
5099
  response.on("data", (d) => {
@@ -5051,7 +5169,7 @@ var getSourceMapFromRemoteFile = async (fileName) => {
5051
5169
  return getSourceMap(fileName, fileContents, "remote");
5052
5170
  };
5053
5171
  var getSourceMapFromLocalFile = (fileName) => {
5054
- const fileContents = readFileSync(fileName, "utf8");
5172
+ const fileContents = readFileSync2(fileName, "utf8");
5055
5173
  return getSourceMap(fileName, fileContents, "local");
5056
5174
  };
5057
5175
 
@@ -5465,7 +5583,7 @@ var validateFrameRange = (frameRange) => {
5465
5583
  };
5466
5584
 
5467
5585
  // src/get-compositions.ts
5468
- import { NoReactInternals as NoReactInternals11 } from "remotion/no-react";
5586
+ import { NoReactInternals as NoReactInternals12 } from "remotion/no-react";
5469
5587
 
5470
5588
  // src/to-megabytes.ts
5471
5589
  function toMegabytes(bytes) {
@@ -5553,8 +5671,8 @@ import { promisify as promisify2 } from "node:util";
5553
5671
 
5554
5672
  // src/browser/browser-download-lock.ts
5555
5673
  import { randomUUID } from "node:crypto";
5556
- import * as fs5 from "node:fs";
5557
- import os3 from "node:os";
5674
+ import * as fs6 from "node:fs";
5675
+ import os4 from "node:os";
5558
5676
  var RETRY_INTERVAL_IN_MS = 100;
5559
5677
  var STALE_LOCK_IN_MS = 30000;
5560
5678
  var HEARTBEAT_INTERVAL_IN_MS = 5000;
@@ -5568,7 +5686,7 @@ var isErrorWithCode = (error, code) => {
5568
5686
  };
5569
5687
  var readLock = async (lockPath) => {
5570
5688
  try {
5571
- const parsed = JSON.parse(await fs5.promises.readFile(lockPath, "utf8"));
5689
+ const parsed = JSON.parse(await fs6.promises.readFile(lockPath, "utf8"));
5572
5690
  if (typeof parsed.hostname !== "string" || typeof parsed.pid !== "number" || typeof parsed.token !== "string") {
5573
5691
  return null;
5574
5692
  }
@@ -5588,7 +5706,7 @@ var isProcessRunning = (pid) => {
5588
5706
  var removeStaleLock = async (lockPath) => {
5589
5707
  let stats;
5590
5708
  try {
5591
- stats = await fs5.promises.stat(lockPath);
5709
+ stats = await fs6.promises.stat(lockPath);
5592
5710
  } catch (error) {
5593
5711
  if (isErrorWithCode(error, "ENOENT")) {
5594
5712
  return;
@@ -5596,7 +5714,7 @@ var removeStaleLock = async (lockPath) => {
5596
5714
  throw error;
5597
5715
  }
5598
5716
  const lock = await readLock(lockPath);
5599
- if (lock?.hostname === os3.hostname()) {
5717
+ if (lock?.hostname === os4.hostname()) {
5600
5718
  if (isProcessRunning(lock.pid)) {
5601
5719
  return;
5602
5720
  }
@@ -5604,7 +5722,7 @@ var removeStaleLock = async (lockPath) => {
5604
5722
  return;
5605
5723
  }
5606
5724
  try {
5607
- await fs5.promises.unlink(lockPath);
5725
+ await fs6.promises.unlink(lockPath);
5608
5726
  } catch (error) {
5609
5727
  if (!isErrorWithCode(error, "ENOENT")) {
5610
5728
  throw error;
@@ -5616,7 +5734,7 @@ var acquireBrowserDownloadLock = async (lockPath) => {
5616
5734
  const token = randomUUID();
5617
5735
  let lockFile;
5618
5736
  try {
5619
- lockFile = await fs5.promises.open(lockPath, "wx");
5737
+ lockFile = await fs6.promises.open(lockPath, "wx");
5620
5738
  } catch (error) {
5621
5739
  if (!isErrorWithCode(error, "EEXIST")) {
5622
5740
  throw error;
@@ -5627,13 +5745,13 @@ var acquireBrowserDownloadLock = async (lockPath) => {
5627
5745
  }
5628
5746
  try {
5629
5747
  await lockFile.writeFile(JSON.stringify({
5630
- hostname: os3.hostname(),
5748
+ hostname: os4.hostname(),
5631
5749
  pid: process.pid,
5632
5750
  token
5633
5751
  }));
5634
5752
  } catch (error) {
5635
5753
  await lockFile.close();
5636
- await fs5.promises.rm(lockPath, { force: true });
5754
+ await fs6.promises.rm(lockPath, { force: true });
5637
5755
  throw error;
5638
5756
  }
5639
5757
  const heartbeat = setInterval(async () => {
@@ -5643,7 +5761,7 @@ var acquireBrowserDownloadLock = async (lockPath) => {
5643
5761
  }
5644
5762
  const now = new Date;
5645
5763
  try {
5646
- await fs5.promises.utimes(lockPath, now, now);
5764
+ await fs6.promises.utimes(lockPath, now, now);
5647
5765
  } catch {}
5648
5766
  }, HEARTBEAT_INTERVAL_IN_MS);
5649
5767
  heartbeat.unref();
@@ -5652,7 +5770,7 @@ var acquireBrowserDownloadLock = async (lockPath) => {
5652
5770
  const currentLock = await readLock(lockPath);
5653
5771
  await lockFile.close();
5654
5772
  if (currentLock?.token === token) {
5655
- await fs5.promises.rm(lockPath, { force: true });
5773
+ await fs6.promises.rm(lockPath, { force: true });
5656
5774
  }
5657
5775
  };
5658
5776
  }
@@ -5667,7 +5785,7 @@ import { pipeline } from "node:stream/promises";
5667
5785
  import { promisify } from "node:util";
5668
5786
 
5669
5787
  // vendor/yauzl-patched/index.js
5670
- var fs6 = __require("fs");
5788
+ var fs7 = __require("fs");
5671
5789
  var zlib = __require("zlib");
5672
5790
  var fd_slicer = require_fd_slicer();
5673
5791
  var crc32 = require_buffer_crc32();
@@ -5696,12 +5814,12 @@ function open(path, options2, callback) {
5696
5814
  options2.strictFileNames = false;
5697
5815
  if (callback == null)
5698
5816
  callback = defaultCallback;
5699
- fs6.open(path, "r", function(err, fd) {
5817
+ fs7.open(path, "r", function(err, fd) {
5700
5818
  if (err)
5701
5819
  return callback(err);
5702
5820
  fromFd(fd, options2, function(err, zipfile) {
5703
5821
  if (err)
5704
- fs6.close(fd, defaultCallback);
5822
+ fs7.close(fd, defaultCallback);
5705
5823
  callback(err, zipfile);
5706
5824
  });
5707
5825
  });
@@ -5725,7 +5843,7 @@ function fromFd(fd, options2, callback) {
5725
5843
  options2.strictFileNames = false;
5726
5844
  if (callback == null)
5727
5845
  callback = defaultCallback;
5728
- fs6.fstat(fd, function(err, stats) {
5846
+ fs7.fstat(fd, function(err, stats) {
5729
5847
  if (err)
5730
5848
  return callback(err);
5731
5849
  var reader = fd_slicer.createFromFd(fd, { autoClose: true });
@@ -6551,99 +6669,6 @@ var extractZipArchive = async (archivePath, dir) => {
6551
6669
  });
6552
6670
  };
6553
6671
 
6554
- // src/browser/get-chrome-download-url.ts
6555
- import * as fs7 from "node:fs";
6556
- import * as os4 from "node:os";
6557
- var TESTED_VERSION = "157.0.8080.0";
6558
- var isAmazonLinux2023 = () => {
6559
- if (os4.platform() !== "linux") {
6560
- return false;
6561
- }
6562
- try {
6563
- const osRelease = fs7.readFileSync("/etc/os-release", "utf-8");
6564
- return osRelease.includes("Amazon Linux") && osRelease.includes('VERSION="2023"');
6565
- } catch {
6566
- return false;
6567
- }
6568
- };
6569
- var MINIMUM_GLIBC_FOR_REMOTION_MEDIA = [2, 35];
6570
- var getGlibcVersion = () => {
6571
- if (process.platform !== "linux") {
6572
- return null;
6573
- }
6574
- const { report } = process;
6575
- if (!report) {
6576
- return null;
6577
- }
6578
- const rep = report.getReport();
6579
- if (typeof rep === "string") {
6580
- return null;
6581
- }
6582
- const { glibcVersionRuntime } = rep.header;
6583
- if (!glibcVersionRuntime) {
6584
- return null;
6585
- }
6586
- const split = glibcVersionRuntime.split(".");
6587
- if (split.length !== 2) {
6588
- return null;
6589
- }
6590
- return [Number(split[0]), Number(split[1])];
6591
- };
6592
- var isGlibcVersionAtLeast = (required) => {
6593
- const version = getGlibcVersion();
6594
- if (version === null) {
6595
- return false;
6596
- }
6597
- const [major, minor] = version;
6598
- const [reqMajor, reqMinor] = required;
6599
- if (major > reqMajor) {
6600
- return true;
6601
- }
6602
- if (major === reqMajor && minor >= reqMinor) {
6603
- return true;
6604
- }
6605
- return false;
6606
- };
6607
- var canUseRemotionMediaBinaries = () => {
6608
- if (process.platform !== "linux") {
6609
- return false;
6610
- }
6611
- return isGlibcVersionAtLeast(MINIMUM_GLIBC_FOR_REMOTION_MEDIA);
6612
- };
6613
- function getChromeDownloadUrl({
6614
- platform,
6615
- version,
6616
- chromeMode
6617
- }) {
6618
- if (platform === "linux-arm64" && version && /^\d+$/.test(version)) {
6619
- const archive = chromeMode === "chrome-for-testing" ? "chromium-linux-arm64" : "chromium-headless-shell-linux-arm64";
6620
- return `https://playwright.azureedge.net/builds/chromium/${version}/${archive}.zip`;
6621
- }
6622
- if (chromeMode === "headless-shell" && version === null) {
6623
- if (platform === "mac-arm64") {
6624
- return `https://remotion.media/chromium-headless-shell-mac-arm64-${TESTED_VERSION}.zip?clear`;
6625
- }
6626
- if (platform === "linux64" || platform === "linux-arm64") {
6627
- const architecture = platform === "linux64" ? "x64" : "arm64";
6628
- if (isAmazonLinux2023()) {
6629
- return `https://remotion.media/chromium-headless-shell-amazon-linux-${architecture}-${TESTED_VERSION}.zip?clear`;
6630
- }
6631
- if (canUseRemotionMediaBinaries()) {
6632
- return `https://remotion.media/chromium-headless-shell-linux-${architecture}-${TESTED_VERSION}.zip?clear`;
6633
- }
6634
- }
6635
- }
6636
- const archive = chromeMode === "headless-shell" ? "chrome-headless-shell" : "chrome";
6637
- return `https://storage.googleapis.com/chrome-for-testing-public/${version ?? TESTED_VERSION}/${platform}/${archive}-${platform}.zip`;
6638
- }
6639
- var logDownloadUrl = ({
6640
- url,
6641
- logLevel,
6642
- indent
6643
- }) => {
6644
- Log.info({ indent, logLevel }, `Downloading from: ${url}`);
6645
- };
6646
-
6647
6672
  // src/browser/get-download-destination.ts
6648
6673
  import fs8 from "node:fs";
6649
6674
  import path8 from "node:path";
@@ -6745,7 +6770,7 @@ var downloadBrowser = async ({
6745
6770
  }) => {
6746
6771
  const platform = getPlatform();
6747
6772
  const downloadURL = getChromeDownloadUrl({ platform, version, chromeMode });
6748
- const fileName = downloadURL.split("/").pop();
6773
+ const fileName = downloadURL.split("/").pop()?.split("?")[0];
6749
6774
  if (!fileName) {
6750
6775
  throw new Error(`A malformed download URL was found: ${downloadURL}.`);
6751
6776
  }
@@ -16468,8 +16493,12 @@ var waitForAssetToBeDownloaded = ({
16468
16493
  if (!downloadMap.listeners[src][downloadDir]) {
16469
16494
  downloadMap.listeners[src][downloadDir] = [];
16470
16495
  }
16471
- return new Promise((resolve) => {
16472
- downloadMap.listeners[src][downloadDir].push(() => {
16496
+ return new Promise((resolve, reject) => {
16497
+ downloadMap.listeners[src][downloadDir].push((err) => {
16498
+ if (err) {
16499
+ reject(err);
16500
+ return;
16501
+ }
16473
16502
  const srcMap = downloadMap.hasBeenDownloadedMap[src];
16474
16503
  if (!srcMap?.[downloadDir]) {
16475
16504
  throw new Error("Expected file for " + src + "to be available in " + downloadDir);
@@ -16498,7 +16527,7 @@ var notifyAssetIsDownloaded = ({
16498
16527
  downloadMap.hasBeenDownloadedMap[src] = {};
16499
16528
  }
16500
16529
  downloadMap.hasBeenDownloadedMap[src][downloadDir] = to;
16501
- downloadMap.listeners[src][downloadDir].forEach((fn) => fn());
16530
+ downloadMap.listeners[src][downloadDir].forEach((fn) => fn(null));
16502
16531
  };
16503
16532
  var validateMimeType = (mimeType, src) => {
16504
16533
  if (!mimeType.includes("/")) {
@@ -16612,6 +16641,12 @@ var downloadAsset = async ({
16612
16641
  indent,
16613
16642
  logLevel,
16614
16643
  abortSignal: downloadMap.cleanupController.signal
16644
+ }).catch((err) => {
16645
+ delete downloadMap.isDownloadingMap[src]?.[downloadDir];
16646
+ const listeners = downloadMap.listeners[src]?.[downloadDir] ?? [];
16647
+ delete downloadMap.listeners[src]?.[downloadDir];
16648
+ listeners.forEach((fn) => fn(err));
16649
+ throw err;
16615
16650
  });
16616
16651
  notifyAssetIsDownloaded({ src, downloadMap, downloadDir, to });
16617
16652
  if (shouldAnalyzeAudioImmediately) {
@@ -18544,6 +18579,7 @@ var seekToFrame = async ({
18544
18579
  };
18545
18580
 
18546
18581
  // src/set-props-and-env.ts
18582
+ import { NoReactInternals as NoReactInternals11 } from "remotion/no-react";
18547
18583
  import { VERSION as VERSION3 } from "remotion/version";
18548
18584
 
18549
18585
  // src/goto-page-or-throw.ts
@@ -18598,19 +18634,23 @@ var innerSetPropsAndEnv = async ({
18598
18634
  onServeUrlVisited,
18599
18635
  isMainTab,
18600
18636
  mediaCacheSizeInBytes,
18637
+ preferredEffectBackend,
18601
18638
  initialMemoryAvailable,
18602
18639
  darkMode,
18603
18640
  sampleRate
18604
18641
  }) => {
18642
+ NoReactInternals11.validatePreferredEffectBackend(preferredEffectBackend);
18605
18643
  validatePuppeteerTimeout(timeoutInMilliseconds);
18606
18644
  const actualTimeout = timeoutInMilliseconds ?? DEFAULT_TIMEOUT;
18607
18645
  page.setDefaultTimeout(actualTimeout);
18608
18646
  page.setDefaultNavigationTimeout(actualTimeout);
18609
18647
  const urlToVisit = normalizeServeUrl(serveUrl);
18610
- await page.evaluateOnNewDocument((timeout, mainTab, cacheSizeInBytes, initMemoryAvailable, sRate) => {
18648
+ await page.evaluateOnNewDocument((timeout, mainTab, cacheSizeInBytes, effectBackend, disableWebGpuEffects, initMemoryAvailable, sRate) => {
18611
18649
  window.remotion_puppeteerTimeout = timeout;
18612
18650
  window.remotion_isMainTab = mainTab;
18613
18651
  window.remotion_mediaCacheSizeInBytes = cacheSizeInBytes;
18652
+ window.remotion_preferredEffectBackend = effectBackend;
18653
+ window.remotion_disableWebGpuEffects = disableWebGpuEffects;
18614
18654
  window.remotion_initialMemoryAvailable = initMemoryAvailable;
18615
18655
  window.remotion_sampleRate = sRate;
18616
18656
  if (window.process === undefined) {
@@ -18620,7 +18660,7 @@ var innerSetPropsAndEnv = async ({
18620
18660
  window.process.env = {};
18621
18661
  }
18622
18662
  window.process.env.NODE_ENV = "production";
18623
- }, actualTimeout, isMainTab, mediaCacheSizeInBytes, initialMemoryAvailable, sampleRate);
18663
+ }, actualTimeout, isMainTab, mediaCacheSizeInBytes, preferredEffectBackend, Boolean(process.env.AWS_LAMBDA_FUNCTION_NAME), initialMemoryAvailable, sampleRate);
18624
18664
  await page.evaluateOnNewDocument('window.remotion_broadcastChannel = new BroadcastChannel("remotion-video-frame-extraction")');
18625
18665
  if (envVariables) {
18626
18666
  await page.evaluateOnNewDocument((input) => {
@@ -18676,6 +18716,7 @@ var innerSetPropsAndEnv = async ({
18676
18716
  onServeUrlVisited,
18677
18717
  isMainTab,
18678
18718
  mediaCacheSizeInBytes,
18719
+ preferredEffectBackend,
18679
18720
  initialMemoryAvailable,
18680
18721
  darkMode,
18681
18722
  sampleRate
@@ -18955,6 +18996,7 @@ var innerGetCompositions = async ({
18955
18996
  indent,
18956
18997
  logLevel,
18957
18998
  mediaCacheSizeInBytes,
18999
+ preferredEffectBackend,
18958
19000
  darkMode
18959
19001
  }) => {
18960
19002
  validatePuppeteerTimeout(timeoutInMilliseconds);
@@ -18976,6 +19018,7 @@ var innerGetCompositions = async ({
18976
19018
  },
18977
19019
  isMainTab: true,
18978
19020
  mediaCacheSizeInBytes,
19021
+ preferredEffectBackend,
18979
19022
  initialMemoryAvailable: getAvailableMemory(logLevel),
18980
19023
  darkMode,
18981
19024
  sampleRate: 48000
@@ -19028,8 +19071,8 @@ var innerGetCompositions = async ({
19028
19071
  height,
19029
19072
  fps,
19030
19073
  durationInFrames,
19031
- props: NoReactInternals11.deserializeJSONWithSpecialTypes(r.serializedResolvedPropsWithCustomSchema),
19032
- defaultProps: NoReactInternals11.deserializeJSONWithSpecialTypes(r.serializedDefaultPropsWithCustomSchema),
19074
+ props: NoReactInternals12.deserializeJSONWithSpecialTypes(r.serializedResolvedPropsWithCustomSchema),
19075
+ defaultProps: NoReactInternals12.deserializeJSONWithSpecialTypes(r.serializedDefaultPropsWithCustomSchema),
19033
19076
  defaultCodec,
19034
19077
  defaultOutName,
19035
19078
  defaultVideoImageFormat,
@@ -19058,6 +19101,7 @@ var internalGetCompositionsRaw = async ({
19058
19101
  chromeMode,
19059
19102
  offthreadVideoThreads,
19060
19103
  mediaCacheSizeInBytes,
19104
+ preferredEffectBackend,
19061
19105
  onLog
19062
19106
  }) => {
19063
19107
  const { page, cleanupPage } = await getPageAndCleanupFn({
@@ -19116,6 +19160,7 @@ var internalGetCompositionsRaw = async ({
19116
19160
  chromeMode,
19117
19161
  offthreadVideoThreads,
19118
19162
  mediaCacheSizeInBytes,
19163
+ preferredEffectBackend,
19119
19164
  darkMode: chromiumOptions.darkMode ?? false
19120
19165
  });
19121
19166
  }).then((comp) => {
@@ -19131,7 +19176,7 @@ var internalGetCompositionsRaw = async ({
19131
19176
  };
19132
19177
  var internalGetCompositions = wrapWithErrorHandling(internalGetCompositionsRaw);
19133
19178
  var getCompositions = (...args) => {
19134
- const options2 = convertGetCompositionsArgumentsToOptions(args, NoReactInternals11.ENABLE_V5_BREAKING_CHANGES);
19179
+ const options2 = convertGetCompositionsArgumentsToOptions(args, NoReactInternals12.ENABLE_V5_BREAKING_CHANGES);
19135
19180
  if (typeof options2?.serveUrl !== "string" || !options2.serveUrl) {
19136
19181
  throw new Error("No serve URL or webpack bundle directory was passed to getCompositions().");
19137
19182
  }
@@ -19151,6 +19196,7 @@ var getCompositions = (...args) => {
19151
19196
  chromeMode,
19152
19197
  offthreadVideoThreads,
19153
19198
  mediaCacheSizeInBytes,
19199
+ preferredEffectBackend,
19154
19200
  serveUrl
19155
19201
  } = options2;
19156
19202
  const indent = false;
@@ -19159,7 +19205,7 @@ var getCompositions = (...args) => {
19159
19205
  browserExecutable: browserExecutable ?? null,
19160
19206
  chromiumOptions: chromiumOptions ?? {},
19161
19207
  envVariables: envVariables ?? {},
19162
- serializedInputPropsWithCustomSchema: NoReactInternals11.serializeJSONWithSpecialTypes({
19208
+ serializedInputPropsWithCustomSchema: NoReactInternals12.serializeJSONWithSpecialTypes({
19163
19209
  data: inputProps ?? {},
19164
19210
  indent: undefined,
19165
19211
  staticBase: null
@@ -19182,6 +19228,7 @@ var getCompositions = (...args) => {
19182
19228
  chromeMode: chromeMode ?? "headless-shell",
19183
19229
  offthreadVideoThreads: offthreadVideoThreads ?? null,
19184
19230
  mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
19231
+ preferredEffectBackend: preferredEffectBackend ?? "auto",
19185
19232
  onLog: defaultOnLog
19186
19233
  });
19187
19234
  };
@@ -19494,6 +19541,41 @@ var validateJpegQuality = (q) => {
19494
19541
  }
19495
19542
  };
19496
19543
 
19544
+ // src/make-cancel-signal.ts
19545
+ var makeCancelSignal = () => {
19546
+ const callbacks = [];
19547
+ let cancelled = false;
19548
+ return {
19549
+ cancelSignal: (callback) => {
19550
+ callbacks.push(callback);
19551
+ if (cancelled) {
19552
+ callback();
19553
+ }
19554
+ },
19555
+ cancel: () => {
19556
+ if (cancelled) {
19557
+ return;
19558
+ }
19559
+ callbacks.forEach((cb) => {
19560
+ cb();
19561
+ });
19562
+ cancelled = true;
19563
+ }
19564
+ };
19565
+ };
19566
+ var cancelErrorMessages = {
19567
+ renderMedia: "renderMedia() got cancelled",
19568
+ renderFrames: "renderFrames() got cancelled",
19569
+ renderStill: "renderStill() got cancelled",
19570
+ stitchFramesToVideo: "stitchFramesToVideo() got cancelled"
19571
+ };
19572
+ var isUserCancelledRender = (err) => {
19573
+ if (typeof err === "object" && err !== null && "message" in err && typeof err.message === "string") {
19574
+ return err.message.includes(cancelErrorMessages.renderMedia) || err.message.includes(cancelErrorMessages.renderFrames) || err.message.includes(cancelErrorMessages.renderStill) || err.message.includes(cancelErrorMessages.stitchFramesToVideo);
19575
+ }
19576
+ return false;
19577
+ };
19578
+
19497
19579
  // src/perf.ts
19498
19580
  var perf = {
19499
19581
  capture: [],
@@ -19800,11 +19882,11 @@ var getCodecName = ({
19800
19882
  };
19801
19883
 
19802
19884
  // src/options/color-space.tsx
19803
- import { NoReactInternals as NoReactInternals12 } from "remotion/no-react";
19885
+ import { NoReactInternals as NoReactInternals13 } from "remotion/no-react";
19804
19886
  var validV4ColorSpaces = ["default", "bt601", "bt709", "bt2020-ncl"];
19805
19887
  var validV5ColorSpaces = ["bt601", "bt709", "bt2020-ncl"];
19806
- var validColorSpaces = NoReactInternals12.ENABLE_V5_BREAKING_CHANGES ? validV5ColorSpaces : validV4ColorSpaces;
19807
- var DEFAULT_COLOR_SPACE = NoReactInternals12.ENABLE_V5_BREAKING_CHANGES ? "bt709" : "default";
19888
+ var validColorSpaces = NoReactInternals13.ENABLE_V5_BREAKING_CHANGES ? validV5ColorSpaces : validV4ColorSpaces;
19889
+ var DEFAULT_COLOR_SPACE = NoReactInternals13.ENABLE_V5_BREAKING_CHANGES ? "bt709" : "default";
19808
19890
 
19809
19891
  // src/options/gop-size.tsx
19810
19892
  var validateGopSize = (value) => {
@@ -20398,10 +20480,10 @@ var createRemotionSharedMemoryFfmpegBridge = ({
20398
20480
  };
20399
20481
 
20400
20482
  // src/validate.ts
20401
- import { NoReactInternals as NoReactInternals13 } from "remotion/no-react";
20402
- var validateFps = NoReactInternals13.validateFps;
20403
- var validateDimension = NoReactInternals13.validateDimension;
20404
- var validateDurationInFrames = NoReactInternals13.validateDurationInFrames;
20483
+ import { NoReactInternals as NoReactInternals14 } from "remotion/no-react";
20484
+ var validateFps = NoReactInternals14.validateFps;
20485
+ var validateDimension = NoReactInternals14.validateDimension;
20486
+ var validateDurationInFrames = NoReactInternals14.validateDurationInFrames;
20405
20487
 
20406
20488
  // src/validate-even-dimensions-with-codec.ts
20407
20489
  var validateEvenDimensionsWithCodec = ({
@@ -21101,7 +21183,7 @@ var probeSharedMemoryCapture = async ({
21101
21183
  // src/render-frames.ts
21102
21184
  import fs18 from "node:fs";
21103
21185
  import path24 from "node:path";
21104
- import { NoReactInternals as NoReactInternals16 } from "remotion/no-react";
21186
+ import { NoReactInternals as NoReactInternals18 } from "remotion/no-react";
21105
21187
 
21106
21188
  // src/cycle-browser-tabs.ts
21107
21189
  var cycleBrowserTabs = ({
@@ -21676,41 +21758,6 @@ var getFilePadLength = ({
21676
21758
  throw new Error("Unknown file type");
21677
21759
  };
21678
21760
 
21679
- // src/make-cancel-signal.ts
21680
- var makeCancelSignal = () => {
21681
- const callbacks = [];
21682
- let cancelled = false;
21683
- return {
21684
- cancelSignal: (callback) => {
21685
- callbacks.push(callback);
21686
- if (cancelled) {
21687
- callback();
21688
- }
21689
- },
21690
- cancel: () => {
21691
- if (cancelled) {
21692
- return;
21693
- }
21694
- callbacks.forEach((cb) => {
21695
- cb();
21696
- });
21697
- cancelled = true;
21698
- }
21699
- };
21700
- };
21701
- var cancelErrorMessages = {
21702
- renderMedia: "renderMedia() got cancelled",
21703
- renderFrames: "renderFrames() got cancelled",
21704
- renderStill: "renderStill() got cancelled",
21705
- stitchFramesToVideo: "stitchFramesToVideo() got cancelled"
21706
- };
21707
- var isUserCancelledRender = (err) => {
21708
- if (typeof err === "object" && err !== null && "message" in err && typeof err.message === "string") {
21709
- return err.message.includes(cancelErrorMessages.renderMedia) || err.message.includes(cancelErrorMessages.renderFrames) || err.message.includes(cancelErrorMessages.renderStill) || err.message.includes(cancelErrorMessages.stitchFramesToVideo);
21710
- }
21711
- return false;
21712
- };
21713
-
21714
21761
  // src/make-page.ts
21715
21762
  var makePage = async ({
21716
21763
  context,
@@ -21733,6 +21780,7 @@ var makePage = async ({
21733
21780
  pageIndex,
21734
21781
  isMainTab,
21735
21782
  mediaCacheSizeInBytes,
21783
+ preferredEffectBackend,
21736
21784
  onLog,
21737
21785
  darkMode,
21738
21786
  sampleRate
@@ -21762,6 +21810,7 @@ var makePage = async ({
21762
21810
  },
21763
21811
  isMainTab,
21764
21812
  mediaCacheSizeInBytes,
21813
+ preferredEffectBackend,
21765
21814
  initialMemoryAvailable: getAvailableMemory(logLevel),
21766
21815
  darkMode,
21767
21816
  sampleRate
@@ -21857,10 +21906,10 @@ class Pool {
21857
21906
  }
21858
21907
 
21859
21908
  // src/render-frame-and-retry-target-close.ts
21860
- import { NoReactInternals as NoReactInternals15 } from "remotion/no-react";
21909
+ import { NoReactInternals as NoReactInternals16 } from "remotion/no-react";
21861
21910
 
21862
21911
  // src/is-delay-render-error-with-retry.ts
21863
- import { NoReactInternals as NoReactInternals14 } from "remotion/no-react";
21912
+ import { NoReactInternals as NoReactInternals15 } from "remotion/no-react";
21864
21913
  var getRetriesLeftFromError = (error) => {
21865
21914
  if (!error) {
21866
21915
  throw new Error("Expected stack");
@@ -21869,15 +21918,15 @@ var getRetriesLeftFromError = (error) => {
21869
21918
  if (!stack) {
21870
21919
  throw new Error("Expected stack: " + JSON.stringify(error));
21871
21920
  }
21872
- const beforeIndex = stack.indexOf(NoReactInternals14.DELAY_RENDER_ATTEMPT_TOKEN);
21921
+ const beforeIndex = stack.indexOf(NoReactInternals15.DELAY_RENDER_ATTEMPT_TOKEN);
21873
21922
  if (beforeIndex === -1) {
21874
21923
  throw new Error("Expected to find attempt token in stack");
21875
21924
  }
21876
- const afterIndex = stack.indexOf(NoReactInternals14.DELAY_RENDER_RETRY_TOKEN);
21925
+ const afterIndex = stack.indexOf(NoReactInternals15.DELAY_RENDER_RETRY_TOKEN);
21877
21926
  if (afterIndex === -1) {
21878
21927
  throw new Error("Expected to find retry token in stack");
21879
21928
  }
21880
- const inbetween = stack.substring(beforeIndex + NoReactInternals14.DELAY_RENDER_ATTEMPT_TOKEN.length, afterIndex);
21929
+ const inbetween = stack.substring(beforeIndex + NoReactInternals15.DELAY_RENDER_ATTEMPT_TOKEN.length, afterIndex);
21881
21930
  const parsed = Number(inbetween);
21882
21931
  if (Number.isNaN(parsed)) {
21883
21932
  throw new Error(`Expected to find a number in the stack ${stack}`);
@@ -22551,7 +22600,7 @@ var renderFrameAndRetryTargetClose = async ({
22551
22600
  currentPool.release(freePage);
22552
22601
  } catch (err) {
22553
22602
  const isTargetClosedError = isTargetClosedErr(err);
22554
- const shouldRetryError = err.stack?.includes(NoReactInternals15.DELAY_RENDER_RETRY_TOKEN);
22603
+ const shouldRetryError = err.stack?.includes(NoReactInternals16.DELAY_RENDER_RETRY_TOKEN);
22555
22604
  const flakyNetworkError = isFlakyNetworkError(err);
22556
22605
  if (isUserCancelledRender(err) && !shouldRetryError) {
22557
22606
  throw err;
@@ -22740,39 +22789,10 @@ var validateScale = (scale) => {
22740
22789
  };
22741
22790
 
22742
22791
  // src/validate-selected-frames.ts
22743
- var validateSelectedFrames = ({
22744
- frames,
22745
- durationInFrames
22746
- }) => {
22747
- if (!Array.isArray(frames)) {
22748
- throw new TypeError("The `frames` option must be an array of frame numbers.");
22749
- }
22750
- if (frames.length === 0) {
22751
- throw new TypeError("The `frames` option must contain at least one frame.");
22752
- }
22753
- for (const frame of frames) {
22754
- if (typeof frame !== "number") {
22755
- throw new TypeError(`The \`frames\` option must contain only numbers, but got ${typeof frame}.`);
22756
- }
22757
- if (!Number.isFinite(frame)) {
22758
- throw new TypeError(`The \`frames\` option must contain only finite numbers, but got ${frame}.`);
22759
- }
22760
- if (!Number.isInteger(frame)) {
22761
- throw new TypeError(`The \`frames\` option must contain only integers, but got ${frame}.`);
22762
- }
22763
- if (frame < 0) {
22764
- throw new TypeError(`The \`frames\` option must contain only non-negative numbers, but got ${frame}.`);
22765
- }
22766
- if (durationInFrames !== null && frame >= durationInFrames) {
22767
- throw new RangeError(`Frame ${frame} is out of range, must be between 0 and ${durationInFrames - 1}.`);
22768
- }
22769
- }
22770
- const uniqueFrames = new Set(frames);
22771
- if (uniqueFrames.size !== frames.length) {
22772
- throw new TypeError("The `frames` option must not contain duplicate frames.");
22773
- }
22774
- return [...frames].sort((a, b) => a - b);
22775
- };
22792
+ import { NoReactInternals as NoReactInternals17 } from "remotion/no-react";
22793
+ var {
22794
+ validateSelectedFrames
22795
+ } = NoReactInternals17;
22776
22796
 
22777
22797
  // src/render-frames.ts
22778
22798
  var MAX_RETRIES_PER_FRAME = 1;
@@ -22817,6 +22837,7 @@ var innerRenderFrames = async ({
22817
22837
  binariesDirectory,
22818
22838
  imageSequencePattern,
22819
22839
  mediaCacheSizeInBytes,
22840
+ preferredEffectBackend,
22820
22841
  onLog,
22821
22842
  darkMode,
22822
22843
  sampleRate
@@ -22875,6 +22896,7 @@ var innerRenderFrames = async ({
22875
22896
  pageIndex,
22876
22897
  isMainTab: pageIndex === 0,
22877
22898
  mediaCacheSizeInBytes,
22899
+ preferredEffectBackend,
22878
22900
  onLog,
22879
22901
  darkMode,
22880
22902
  sampleRate
@@ -23026,6 +23048,7 @@ var internalRenderFramesRaw = ({
23026
23048
  offthreadVideoThreads,
23027
23049
  imageSequencePattern,
23028
23050
  mediaCacheSizeInBytes,
23051
+ preferredEffectBackend,
23029
23052
  onLog,
23030
23053
  sampleRate
23031
23054
  }) => {
@@ -23137,6 +23160,7 @@ var internalRenderFramesRaw = ({
23137
23160
  offthreadVideoThreads,
23138
23161
  imageSequencePattern,
23139
23162
  mediaCacheSizeInBytes,
23163
+ preferredEffectBackend,
23140
23164
  onLog,
23141
23165
  darkMode: chromiumOptions.darkMode ?? false,
23142
23166
  sampleRate
@@ -23214,6 +23238,7 @@ var renderFrames = (options2) => {
23214
23238
  offthreadVideoThreads,
23215
23239
  imageSequencePattern,
23216
23240
  mediaCacheSizeInBytes,
23241
+ preferredEffectBackend,
23217
23242
  sampleRate
23218
23243
  } = options2;
23219
23244
  if (!composition) {
@@ -23252,12 +23277,12 @@ var renderFrames = (options2) => {
23252
23277
  indent,
23253
23278
  jpegQuality: jpegQuality ?? DEFAULT_JPEG_QUALITY,
23254
23279
  onDownload: onDownload ?? null,
23255
- serializedInputPropsWithCustomSchema: NoReactInternals16.serializeJSONWithSpecialTypes({
23280
+ serializedInputPropsWithCustomSchema: NoReactInternals18.serializeJSONWithSpecialTypes({
23256
23281
  indent: undefined,
23257
23282
  staticBase: null,
23258
23283
  data: inputProps ?? {}
23259
23284
  }).serializedString,
23260
- serializedResolvedPropsWithCustomSchema: NoReactInternals16.serializeJSONWithSpecialTypes({
23285
+ serializedResolvedPropsWithCustomSchema: NoReactInternals18.serializeJSONWithSpecialTypes({
23261
23286
  indent: undefined,
23262
23287
  staticBase: null,
23263
23288
  data: composition.props
@@ -23288,6 +23313,7 @@ var renderFrames = (options2) => {
23288
23313
  offthreadVideoThreads: offthreadVideoThreads ?? null,
23289
23314
  imageSequencePattern: imageSequencePattern ?? null,
23290
23315
  mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
23316
+ preferredEffectBackend: preferredEffectBackend ?? "auto",
23291
23317
  onLog: defaultOnLog,
23292
23318
  sampleRate: sampleRate ?? composition.defaultSampleRate ?? 48000
23293
23319
  });
@@ -23298,7 +23324,7 @@ import fs20 from "node:fs";
23298
23324
  import os11 from "node:os";
23299
23325
  import path31 from "node:path";
23300
23326
  import { LicensingInternals } from "@remotion/licensing";
23301
- import { NoReactInternals as NoReactInternals20 } from "remotion/no-react";
23327
+ import { NoReactInternals as NoReactInternals22 } from "remotion/no-react";
23302
23328
 
23303
23329
  // src/codec-supports-media.ts
23304
23330
  var support = {
@@ -23421,7 +23447,7 @@ var validateSelectedCodecAndPresetCombination = ({
23421
23447
  var DEFAULT_OVERWRITE = true;
23422
23448
 
23423
23449
  // src/prores-profile.ts
23424
- import { NoReactInternals as NoReactInternals17 } from "remotion/no-react";
23450
+ import { NoReactInternals as NoReactInternals19 } from "remotion/no-react";
23425
23451
  var validateSelectedCodecAndProResCombination = ({
23426
23452
  codec,
23427
23453
  proResProfile
@@ -23429,15 +23455,15 @@ var validateSelectedCodecAndProResCombination = ({
23429
23455
  if (typeof proResProfile !== "undefined" && codec !== "prores") {
23430
23456
  throw new TypeError(`You have set a ProRes profile but the codec is "${codec}". Set the codec to "prores" or remove the ProRes profile.`);
23431
23457
  }
23432
- if (proResProfile !== undefined && !NoReactInternals17.proResProfileOptions.includes(proResProfile)) {
23433
- throw new TypeError(`The ProRes profile "${proResProfile}" is not valid. Valid options are ${NoReactInternals17.proResProfileOptions.map((p) => `"${p}"`).join(", ")}`);
23458
+ if (proResProfile !== undefined && !NoReactInternals19.proResProfileOptions.includes(proResProfile)) {
23459
+ throw new TypeError(`The ProRes profile "${proResProfile}" is not valid. Valid options are ${NoReactInternals19.proResProfileOptions.map((p) => `"${p}"`).join(", ")}`);
23434
23460
  }
23435
23461
  };
23436
23462
 
23437
23463
  // src/stitch-frames-to-video.ts
23438
23464
  import { cpSync as cpSync2, promises as promises5, rmSync as rmSync4 } from "node:fs";
23439
23465
  import path30 from "node:path";
23440
- import { NoReactInternals as NoReactInternals18 } from "remotion/no-react";
23466
+ import { NoReactInternals as NoReactInternals20 } from "remotion/no-react";
23441
23467
 
23442
23468
  // src/aac-priming.ts
23443
23469
  var LIBFDK_AAC_LC_ENCODER_DELAY_IN_SAMPLES = 2048;
@@ -24229,6 +24255,8 @@ var stringifyFfmpegFilter = ({
24229
24255
  const startInVideoSeconds = startInVideo / fps;
24230
24256
  const assetTrimLeftOffset = startInVideo === 0 ? trimLeftOffset : 0;
24231
24257
  const startInChunkSeconds = startInVideo === 0 ? 0 : startInVideoSeconds - trimLeftOffset;
24258
+ const capturedFrameCount = Math.round((chunkLengthInSeconds + trimLeftOffset - trimRightOffset) * fps);
24259
+ const assetTrimRightOffset = startInVideo + asset.duration >= capturedFrameCount ? trimRightOffset : 0;
24232
24260
  const { trimLeft, maxTrim } = getActualTrimLeft({
24233
24261
  trimLeft: asset.trimLeft,
24234
24262
  fps,
@@ -24251,7 +24279,7 @@ var stringifyFfmpegFilter = ({
24251
24279
  } = trimAndSetTempo({
24252
24280
  assetDuration,
24253
24281
  trimLeftOffset: assetTrimLeftOffset,
24254
- trimRightOffset,
24282
+ trimRightOffset: assetTrimRightOffset,
24255
24283
  asset,
24256
24284
  fps,
24257
24285
  indent,
@@ -24273,7 +24301,7 @@ var stringifyFfmpegFilter = ({
24273
24301
  toneFrequency && toneFrequency !== 1 ? `asetrate=${sampleRate}*${toneFrequency},aresample=${sampleRate},atempo=1/${toneFrequency}` : null
24274
24302
  ].filter(truthy).join(",") + `[a0]`,
24275
24303
  pad_end: padAtEnd > 0.0000001 ? "apad=pad_len=" + Math.round(padAtEnd * sampleRate) : null,
24276
- pad_start: padStart === 0 ? null : `adelay=${new Array(channels + 1).fill((padStart * 1000).toFixed(0)).join("|")}`,
24304
+ pad_start: padStart === 0 ? null : `adelay=${new Array(channels + 1).fill(`${Math.round(padStart * sampleRate)}S`).join("|")}`,
24277
24305
  actualTrimLeft
24278
24306
  };
24279
24307
  };
@@ -24811,7 +24839,7 @@ var innerStitchFramesToVideo = async ({
24811
24839
  const outputExtension = (getExtensionOfFilename(outputLocation) ?? getFileExtensionFromCodec(codec, resolvedAudioCodec)).toLowerCase();
24812
24840
  if (codec === "aac" && (outputExtension === "mpg" || outputExtension === "mpeg")) {
24813
24841
  const message = "AAC output with .mpg or .mpeg extensions is not supported. Use .aac for raw ADTS AAC or .m4a for an MPEG-4 audio container.";
24814
- if (NoReactInternals18.ENABLE_V5_BREAKING_CHANGES) {
24842
+ if (NoReactInternals20.ENABLE_V5_BREAKING_CHANGES) {
24815
24843
  throw new Error(message);
24816
24844
  }
24817
24845
  Log.warn({ indent, logLevel }, `${message} Falling back to raw ADTS AAC while keeping the requested filename. This will throw an error in Remotion 5.0.`);
@@ -25251,7 +25279,7 @@ var validateNumberOfGifLoops = (numberOfGifLoops, codec) => {
25251
25279
  };
25252
25280
 
25253
25281
  // src/validate-output-filename.ts
25254
- import { NoReactInternals as NoReactInternals19 } from "remotion/no-react";
25282
+ import { NoReactInternals as NoReactInternals21 } from "remotion/no-react";
25255
25283
  var validateOutputFilename = ({
25256
25284
  codec,
25257
25285
  audioCodecSetting,
@@ -25263,7 +25291,7 @@ var validateOutputFilename = ({
25263
25291
  throw new TypeError(`The codec "${codec}" is not supported. Supported codecs are: ${Object.keys(defaultFileExtensionMap).join(", ")}`);
25264
25292
  }
25265
25293
  const normalizedExtension = extension === null ? null : extension.toLowerCase();
25266
- if (NoReactInternals19.ENABLE_V5_BREAKING_CHANGES && codec === "aac" && (normalizedExtension === "mpg" || normalizedExtension === "mpeg")) {
25294
+ if (NoReactInternals21.ENABLE_V5_BREAKING_CHANGES && codec === "aac" && (normalizedExtension === "mpg" || normalizedExtension === "mpeg")) {
25267
25295
  throw new Error("AAC output with .mpg or .mpeg extensions is not supported. Use .aac for raw ADTS AAC or .m4a for an MPEG-4 audio container.");
25268
25296
  }
25269
25297
  const map = defaultFileExtensionMap[codec];
@@ -25351,6 +25379,7 @@ var internalRenderMediaRaw = async ({
25351
25379
  chromeMode,
25352
25380
  offthreadVideoThreads,
25353
25381
  mediaCacheSizeInBytes,
25382
+ preferredEffectBackend,
25354
25383
  onLog,
25355
25384
  licenseKey,
25356
25385
  isProduction,
@@ -25750,6 +25779,7 @@ var internalRenderMediaRaw = async ({
25750
25779
  chromeMode,
25751
25780
  imageSequencePattern: null,
25752
25781
  mediaCacheSizeInBytes,
25782
+ preferredEffectBackend,
25753
25783
  onLog,
25754
25784
  sampleRate
25755
25785
  });
@@ -25957,6 +25987,7 @@ var renderMedia = ({
25957
25987
  offthreadVideoThreads,
25958
25988
  compositionStart,
25959
25989
  mediaCacheSizeInBytes,
25990
+ preferredEffectBackend,
25960
25991
  isProduction,
25961
25992
  sampleRate,
25962
25993
  ...apiKeyOrLicenseKey
@@ -25968,8 +25999,8 @@ var renderMedia = ({
25968
25999
  }
25969
26000
  const licenseKey = "licenseKey" in apiKeyOrLicenseKey && typeof apiKeyOrLicenseKey.licenseKey === "string" ? apiKeyOrLicenseKey.licenseKey : null;
25970
26001
  const apiKey = "apiKey" in apiKeyOrLicenseKey && typeof apiKeyOrLicenseKey.apiKey === "string" ? apiKeyOrLicenseKey.apiKey : null;
25971
- const effectiveLicenseKey = (NoReactInternals20.ENABLE_V5_BREAKING_CHANGES ? licenseKey : licenseKey ?? apiKey) ?? null;
25972
- if (NoReactInternals20.ENABLE_V5_BREAKING_CHANGES && effectiveLicenseKey === null) {
26002
+ const effectiveLicenseKey = (NoReactInternals22.ENABLE_V5_BREAKING_CHANGES ? licenseKey : licenseKey ?? apiKey) ?? null;
26003
+ if (NoReactInternals22.ENABLE_V5_BREAKING_CHANGES && effectiveLicenseKey === null) {
25973
26004
  Log.warn({ indent, logLevel }, 'Pass "licenseKey" to renderMedia(). If you qualify for the Free License (https://remotion.dev/license), pass "free-license" instead.');
25974
26005
  }
25975
26006
  return internalRenderMedia({
@@ -25994,7 +26025,7 @@ var renderMedia = ({
25994
26025
  ffmpegOverride: ffmpegOverride ?? undefined,
25995
26026
  frameRange: frameRange ?? null,
25996
26027
  imageFormat: imageFormat ?? null,
25997
- serializedInputPropsWithCustomSchema: NoReactInternals20.serializeJSONWithSpecialTypes({
26028
+ serializedInputPropsWithCustomSchema: NoReactInternals22.serializeJSONWithSpecialTypes({
25998
26029
  indent: undefined,
25999
26030
  staticBase: null,
26000
26031
  data: inputProps ?? {}
@@ -26029,7 +26060,7 @@ var renderMedia = ({
26029
26060
  return;
26030
26061
  },
26031
26062
  server: undefined,
26032
- serializedResolvedPropsWithCustomSchema: NoReactInternals20.serializeJSONWithSpecialTypes({
26063
+ serializedResolvedPropsWithCustomSchema: NoReactInternals22.serializeJSONWithSpecialTypes({
26033
26064
  indent: undefined,
26034
26065
  staticBase: null,
26035
26066
  data: composition.props ?? {}
@@ -26052,6 +26083,7 @@ var renderMedia = ({
26052
26083
  hardwareAcceleration: hardwareAcceleration ?? "disable",
26053
26084
  chromeMode: chromeMode ?? "headless-shell",
26054
26085
  mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
26086
+ preferredEffectBackend: preferredEffectBackend ?? "auto",
26055
26087
  licenseKey: effectiveLicenseKey,
26056
26088
  onLog: defaultOnLog,
26057
26089
  isProduction: isProduction ?? null,
@@ -26063,7 +26095,7 @@ var renderMedia = ({
26063
26095
  import fs21, { statSync as statSync2 } from "node:fs";
26064
26096
  import path32 from "node:path";
26065
26097
  import { LicensingInternals as LicensingInternals2 } from "@remotion/licensing";
26066
- import { NoReactInternals as NoReactInternals21 } from "remotion/no-react";
26098
+ import { NoReactInternals as NoReactInternals23 } from "remotion/no-react";
26067
26099
  var innerRenderStill = async ({
26068
26100
  composition,
26069
26101
  imageFormat = DEFAULT_STILL_IMAGE_FORMAT,
@@ -26091,6 +26123,7 @@ var innerRenderStill = async ({
26091
26123
  onArtifact,
26092
26124
  chromeMode,
26093
26125
  mediaCacheSizeInBytes,
26126
+ preferredEffectBackend,
26094
26127
  onLog
26095
26128
  }) => {
26096
26129
  validateDimension(composition.height, "height", "in the `config` object passed to `renderStill()`");
@@ -26101,7 +26134,7 @@ var innerRenderStill = async ({
26101
26134
  allowFloats: false
26102
26135
  });
26103
26136
  validateStillImageFormat(imageFormat);
26104
- NoReactInternals21.validateFrame({
26137
+ NoReactInternals23.validateFrame({
26105
26138
  frame,
26106
26139
  durationInFrames: composition.durationInFrames,
26107
26140
  allowFloats: false
@@ -26159,8 +26192,10 @@ var innerRenderStill = async ({
26159
26192
  onError: errorCallback,
26160
26193
  frame: null
26161
26194
  });
26195
+ page.on("error", errorCallback);
26162
26196
  const cleanup = async () => {
26163
26197
  cleanUpJSException();
26198
+ page.off("error", errorCallback);
26164
26199
  if (puppeteerInstance) {
26165
26200
  await page.close();
26166
26201
  } else {
@@ -26190,6 +26225,7 @@ var innerRenderStill = async ({
26190
26225
  },
26191
26226
  isMainTab: true,
26192
26227
  mediaCacheSizeInBytes,
26228
+ preferredEffectBackend,
26193
26229
  initialMemoryAvailable: getAvailableMemory(logLevel),
26194
26230
  darkMode: chromiumOptions.darkMode ?? false,
26195
26231
  sampleRate: 48000
@@ -26374,6 +26410,7 @@ var renderStill = (options2) => {
26374
26410
  chromeMode,
26375
26411
  offthreadVideoThreads,
26376
26412
  mediaCacheSizeInBytes,
26413
+ preferredEffectBackend,
26377
26414
  isProduction,
26378
26415
  ...apiKeyOrLicenseKey
26379
26416
  } = options2;
@@ -26387,8 +26424,8 @@ var renderStill = (options2) => {
26387
26424
  }
26388
26425
  const licenseKey = "licenseKey" in apiKeyOrLicenseKey && typeof apiKeyOrLicenseKey.licenseKey === "string" ? apiKeyOrLicenseKey.licenseKey : null;
26389
26426
  const apiKey = "apiKey" in apiKeyOrLicenseKey && typeof apiKeyOrLicenseKey.apiKey === "string" ? apiKeyOrLicenseKey.apiKey : null;
26390
- const effectiveLicenseKey = (NoReactInternals21.ENABLE_V5_BREAKING_CHANGES ? licenseKey : licenseKey ?? apiKey) ?? null;
26391
- if (NoReactInternals21.ENABLE_V5_BREAKING_CHANGES && effectiveLicenseKey === null) {
26427
+ const effectiveLicenseKey = (NoReactInternals23.ENABLE_V5_BREAKING_CHANGES ? licenseKey : licenseKey ?? apiKey) ?? null;
26428
+ if (NoReactInternals23.ENABLE_V5_BREAKING_CHANGES && effectiveLicenseKey === null) {
26392
26429
  Log.warn({ indent, logLevel }, 'Pass "licenseKey" to renderStill(). If you qualify for the Free License (https://remotion.dev/license), pass "free-license" instead.');
26393
26430
  }
26394
26431
  return internalRenderStill({
@@ -26400,7 +26437,7 @@ var renderStill = (options2) => {
26400
26437
  frame: frame ?? 0,
26401
26438
  imageFormat: imageFormat ?? DEFAULT_STILL_IMAGE_FORMAT,
26402
26439
  indent,
26403
- serializedInputPropsWithCustomSchema: NoReactInternals21.serializeJSONWithSpecialTypes({
26440
+ serializedInputPropsWithCustomSchema: NoReactInternals23.serializeJSONWithSpecialTypes({
26404
26441
  staticBase: null,
26405
26442
  indent: undefined,
26406
26443
  data: inputProps ?? {}
@@ -26417,7 +26454,7 @@ var renderStill = (options2) => {
26417
26454
  serveUrl,
26418
26455
  timeoutInMilliseconds: timeoutInMilliseconds ?? DEFAULT_TIMEOUT,
26419
26456
  logLevel,
26420
- serializedResolvedPropsWithCustomSchema: NoReactInternals21.serializeJSONWithSpecialTypes({
26457
+ serializedResolvedPropsWithCustomSchema: NoReactInternals23.serializeJSONWithSpecialTypes({
26421
26458
  indent: undefined,
26422
26459
  staticBase: null,
26423
26460
  data: composition.props ?? {}
@@ -26433,6 +26470,7 @@ var renderStill = (options2) => {
26433
26470
  chromeMode: chromeMode ?? "headless-shell",
26434
26471
  offthreadVideoThreads: offthreadVideoThreads ?? null,
26435
26472
  mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
26473
+ preferredEffectBackend: preferredEffectBackend ?? "auto",
26436
26474
  licenseKey: effectiveLicenseKey,
26437
26475
  onLog: defaultOnLog,
26438
26476
  isProduction: isProduction ?? null
@@ -26440,7 +26478,7 @@ var renderStill = (options2) => {
26440
26478
  };
26441
26479
 
26442
26480
  // src/select-composition.ts
26443
- import { NoReactInternals as NoReactInternals22 } from "remotion/no-react";
26481
+ import { NoReactInternals as NoReactInternals24 } from "remotion/no-react";
26444
26482
  var innerSelectComposition = async ({
26445
26483
  page,
26446
26484
  serializedInputPropsWithCustomSchema,
@@ -26453,6 +26491,7 @@ var innerSelectComposition = async ({
26453
26491
  logLevel,
26454
26492
  onServeUrlVisited,
26455
26493
  mediaCacheSizeInBytes,
26494
+ preferredEffectBackend,
26456
26495
  chromiumOptions
26457
26496
  }) => {
26458
26497
  validatePuppeteerTimeout(timeoutInMilliseconds);
@@ -26472,6 +26511,7 @@ var innerSelectComposition = async ({
26472
26511
  onServeUrlVisited,
26473
26512
  isMainTab: true,
26474
26513
  mediaCacheSizeInBytes,
26514
+ preferredEffectBackend,
26475
26515
  initialMemoryAvailable: getAvailableMemory(logLevel),
26476
26516
  darkMode: chromiumOptions.darkMode ?? false,
26477
26517
  sampleRate: 48000
@@ -26534,8 +26574,8 @@ var innerSelectComposition = async ({
26534
26574
  height,
26535
26575
  fps,
26536
26576
  durationInFrames,
26537
- props: NoReactInternals22.deserializeJSONWithSpecialTypes(res.serializedResolvedPropsWithCustomSchema),
26538
- defaultProps: NoReactInternals22.deserializeJSONWithSpecialTypes(res.serializedDefaultPropsWithCustomSchema),
26577
+ props: NoReactInternals24.deserializeJSONWithSpecialTypes(res.serializedResolvedPropsWithCustomSchema),
26578
+ defaultProps: NoReactInternals24.deserializeJSONWithSpecialTypes(res.serializedDefaultPropsWithCustomSchema),
26539
26579
  defaultCodec,
26540
26580
  defaultOutName,
26541
26581
  defaultVideoImageFormat,
@@ -26567,7 +26607,8 @@ var internalSelectCompositionRaw = async (options2) => {
26567
26607
  onBrowserDownload,
26568
26608
  onServeUrlVisited,
26569
26609
  chromeMode,
26570
- mediaCacheSizeInBytes
26610
+ mediaCacheSizeInBytes,
26611
+ preferredEffectBackend
26571
26612
  } = options2;
26572
26613
  const [{ page, cleanupPage }, serverUsed] = await Promise.all([
26573
26614
  getPageAndCleanupFn({
@@ -26631,7 +26672,8 @@ var internalSelectCompositionRaw = async (options2) => {
26631
26672
  onBrowserDownload,
26632
26673
  onServeUrlVisited,
26633
26674
  chromeMode,
26634
- mediaCacheSizeInBytes
26675
+ mediaCacheSizeInBytes,
26676
+ preferredEffectBackend
26635
26677
  }).then((data) => {
26636
26678
  return resolve(data);
26637
26679
  }).catch((err) => {
@@ -26665,7 +26707,8 @@ var selectComposition = async (options2) => {
26665
26707
  onBrowserDownload,
26666
26708
  chromeMode,
26667
26709
  offthreadVideoThreads,
26668
- mediaCacheSizeInBytes
26710
+ mediaCacheSizeInBytes,
26711
+ preferredEffectBackend
26669
26712
  } = options2;
26670
26713
  const indent = false;
26671
26714
  const logLevel = passedLogLevel ?? (verbose ? "verbose" : "info");
@@ -26675,7 +26718,7 @@ var selectComposition = async (options2) => {
26675
26718
  browserExecutable: browserExecutable ?? null,
26676
26719
  chromiumOptions: chromiumOptions ?? {},
26677
26720
  envVariables: envVariables ?? {},
26678
- serializedInputPropsWithCustomSchema: NoReactInternals22.serializeJSONWithSpecialTypes({
26721
+ serializedInputPropsWithCustomSchema: NoReactInternals24.serializeJSONWithSpecialTypes({
26679
26722
  indent: undefined,
26680
26723
  staticBase: null,
26681
26724
  data: inputProps ?? {}
@@ -26699,7 +26742,8 @@ var selectComposition = async (options2) => {
26699
26742
  },
26700
26743
  chromeMode: chromeMode ?? "headless-shell",
26701
26744
  offthreadVideoThreads: offthreadVideoThreads ?? null,
26702
- mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null
26745
+ mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
26746
+ preferredEffectBackend: preferredEffectBackend ?? "auto"
26703
26747
  });
26704
26748
  return data.metadata;
26705
26749
  };
@@ -27153,9 +27197,9 @@ var getAudibleParts = ({
27153
27197
  };
27154
27198
  // src/get-video-metadata.ts
27155
27199
  import { resolve as resolve2 } from "node:path";
27156
- import { NoReactInternals as NoReactInternals23 } from "remotion/no-react";
27200
+ import { NoReactInternals as NoReactInternals25 } from "remotion/no-react";
27157
27201
  var getVideoMetadata = async (videoSource, options2) => {
27158
- if (NoReactInternals23.ENABLE_V5_BREAKING_CHANGES) {
27202
+ if (NoReactInternals25.ENABLE_V5_BREAKING_CHANGES) {
27159
27203
  throw new Error("getVideoMetadata() has been removed in Remotion 5. Use Mediabunny instead: https://www.remotion.dev/docs/mediabunny/metadata");
27160
27204
  }
27161
27205
  const compositor = startLongRunningCompositor({
@@ -27194,6 +27238,7 @@ var customEditorLineNumberPlaceholder = "%LINE_NUMBER%";
27194
27238
  var customEditorColumnNumberPlaceholder = "%COLUMN_NUMBER%";
27195
27239
  // src/index.ts
27196
27240
  var RenderInternals = {
27241
+ isUserCancelledRender,
27197
27242
  resolveConcurrency,
27198
27243
  serveStatic,
27199
27244
  validateEvenDimensionsWithCodec,