@remotion/renderer 4.0.536 → 4.0.538

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 (292) hide show
  1. package/dist/aac-priming.d.ts +2 -1
  2. package/dist/assets/apply-tone-frequency.d.ts +2 -1
  3. package/dist/assets/apply-tone-frequency.js +8 -1
  4. package/dist/assets/calculate-asset-positions.js +2 -0
  5. package/dist/assets/convert-assets-to-file-urls.d.ts +2 -1
  6. package/dist/assets/download-and-map-assets-to-file.d.ts +3 -2
  7. package/dist/assets/get-audio-channels.d.ts +3 -2
  8. package/dist/assets/inline-audio-mixing.d.ts +2 -1
  9. package/dist/assets/types.d.ts +2 -1
  10. package/dist/browser/Browser.d.ts +5 -5
  11. package/dist/browser/Browser.js +74 -65
  12. package/dist/browser/BrowserFetcher.d.ts +7 -5
  13. package/dist/browser/BrowserPage.d.ts +4 -4
  14. package/dist/browser/BrowserPage.js +222 -226
  15. package/dist/browser/BrowserRunner.d.ts +2 -1
  16. package/dist/browser/Connection.js +109 -96
  17. package/dist/browser/ConsoleMessage.d.ts +1 -1
  18. package/dist/browser/ConsoleMessage.js +16 -9
  19. package/dist/browser/DOMWorld.d.ts +1 -1
  20. package/dist/browser/DOMWorld.js +91 -77
  21. package/dist/browser/Errors.js +4 -2
  22. package/dist/browser/EventEmitter.js +1 -2
  23. package/dist/browser/ExecutionContext.js +120 -117
  24. package/dist/browser/FrameManager.js +244 -249
  25. package/dist/browser/HTTPRequest.js +22 -11
  26. package/dist/browser/HTTPResponse.js +16 -3
  27. package/dist/browser/JSHandle.js +30 -17
  28. package/dist/browser/LifecycleWatcher.js +128 -122
  29. package/dist/browser/NetworkEventManager.js +40 -31
  30. package/dist/browser/NetworkManager.js +203 -210
  31. package/dist/browser/NodeWebSocketTransport.js +0 -3
  32. package/dist/browser/Target.d.ts +1 -1
  33. package/dist/browser/Target.js +39 -32
  34. package/dist/browser/TaskQueue.js +18 -5
  35. package/dist/browser/TimeoutSettings.js +25 -12
  36. package/dist/browser/browser-download-progress-bar.d.ts +2 -1
  37. package/dist/browser/get-chrome-download-url.d.ts +3 -2
  38. package/dist/browser/handle-failed-resource.d.ts +2 -1
  39. package/dist/call-ffmpeg.d.ts +7 -6
  40. package/dist/can-concat-seamlessly.d.ts +4 -2
  41. package/dist/can-use-parallel-encoding.d.ts +2 -1
  42. package/dist/check-version-requirements.d.ts +2 -1
  43. package/dist/client.d.ts +302 -280
  44. package/dist/client.js +2 -2
  45. package/dist/codec-supports-media.d.ts +4 -3
  46. package/dist/codec.d.ts +1 -1
  47. package/dist/collect-assets.d.ts +1 -1
  48. package/dist/combine-audio.d.ts +4 -2
  49. package/dist/combine-chunks.d.ts +2 -1
  50. package/dist/combine-video-streams.d.ts +4 -2
  51. package/dist/compositor/compositor.d.ts +4 -3
  52. package/dist/compositor/get-executable-path.d.ts +4 -4
  53. package/dist/compress-audio.d.ts +4 -2
  54. package/dist/create-audio.d.ts +4 -2
  55. package/dist/create-silent-audio.d.ts +2 -1
  56. package/dist/crf.d.ts +6 -4
  57. package/dist/cycle-browser-tabs.d.ts +2 -1
  58. package/dist/ensure-browser.d.ts +1 -52
  59. package/dist/error-handling/handle-javascript-exception.d.ts +1 -1
  60. package/dist/error-handling/handle-javascript-exception.js +0 -5
  61. package/dist/error-handling/symbolicateable-error.d.ts +1 -1
  62. package/dist/error-handling/symbolicateable-error.js +0 -4
  63. package/dist/error-handling.js +1 -1
  64. package/dist/esm/client.mjs +306 -238
  65. package/dist/esm/index.mjs +108 -88
  66. package/dist/extract-audio.d.ts +3 -2
  67. package/dist/ffmpeg-args.d.ts +12 -6
  68. package/dist/finalize-fast-start.d.ts +2 -1
  69. package/dist/get-browser-instance.d.ts +6 -4
  70. package/dist/get-codec-name.d.ts +6 -3
  71. package/dist/get-compositions.d.ts +2 -1
  72. package/dist/get-concurrency.d.ts +1 -1
  73. package/dist/get-concurrency.js +1 -1
  74. package/dist/get-duration-from-frame-range.d.ts +1 -1
  75. package/dist/get-extension-from-codec.d.ts +2 -1
  76. package/dist/get-frame-padded-index.d.ts +2 -1
  77. package/dist/get-local-browser-executable.d.ts +4 -2
  78. package/dist/get-port.d.ts +1 -1
  79. package/dist/get-prores-profile-name.d.ts +3 -1
  80. package/dist/get-silent-parts.d.ts +5 -4
  81. package/dist/get-video-metadata.d.ts +4 -3
  82. package/dist/get-video-threads-flag.d.ts +2 -1
  83. package/dist/goto-page-or-throw.d.ts +1 -1
  84. package/dist/guess-extension-for-media.d.ts +2 -1
  85. package/dist/image-format.d.ts +6 -5
  86. package/dist/index.d.ts +213 -440
  87. package/dist/index.js +18 -18
  88. package/dist/is-audio-codec.d.ts +2 -1
  89. package/dist/log-level.d.ts +2 -2
  90. package/dist/logger.d.ts +6 -6
  91. package/dist/make-page.d.ts +5 -3
  92. package/dist/memory/from-macos-sysctl.d.ts +2 -1
  93. package/dist/memory/from-proc-meminfo.d.ts +2 -1
  94. package/dist/memory/get-available-memory.d.ts +2 -1
  95. package/dist/merge-inline-audio-tracks.d.ts +2 -1
  96. package/dist/mux-video-and-audio.d.ts +5 -3
  97. package/dist/offthread-video-server.d.ts +2 -1
  98. package/dist/offthread-video-server.js +6 -4
  99. package/dist/open-browser.d.ts +2 -2
  100. package/dist/options/allow-html-in-canvas.js +1 -2
  101. package/dist/options/api-key.d.ts +1 -1
  102. package/dist/options/api-key.js +1 -3
  103. package/dist/options/ask-ai.js +1 -1
  104. package/dist/options/audio-bitrate.js +1 -9
  105. package/dist/options/audio-codec.d.ts +23 -20
  106. package/dist/options/beep-on-finish.js +1 -1
  107. package/dist/options/benchmark-concurrencies.js +1 -2
  108. package/dist/options/binaries-directory.d.ts +1 -1
  109. package/dist/options/binaries-directory.js +1 -9
  110. package/dist/options/browser-executable.d.ts +1 -1
  111. package/dist/options/browser-executable.js +1 -1
  112. package/dist/options/browser.js +1 -2
  113. package/dist/options/bundle-cache.js +1 -2
  114. package/dist/options/canvas-tabs.js +1 -1
  115. package/dist/options/chrome-mode.d.ts +4 -4
  116. package/dist/options/chrome-mode.js +1 -6
  117. package/dist/options/color-space.d.ts +9 -5
  118. package/dist/options/color-space.js +1 -8
  119. package/dist/options/concurrency.d.ts +1 -1
  120. package/dist/options/concurrency.js +1 -5
  121. package/dist/options/config.js +1 -1
  122. package/dist/options/crf.js +1 -1
  123. package/dist/options/cross-site-isolation.js +1 -2
  124. package/dist/options/dark-mode.js +1 -2
  125. package/dist/options/default-coding-agent.d.ts +2 -2
  126. package/dist/options/default-coding-agent.js +1 -2
  127. package/dist/options/default-editor.d.ts +4 -4
  128. package/dist/options/default-editor.js +1 -3
  129. package/dist/options/default-premount-in-seconds.js +1 -1
  130. package/dist/options/delete-after.d.ts +1 -1
  131. package/dist/options/delete-after.js +1 -11
  132. package/dist/options/disable-shared-memory-capture.js +1 -3
  133. package/dist/options/disable-web-security.d.ts +1 -1
  134. package/dist/options/disable-web-security.js +1 -1
  135. package/dist/options/disallow-parallel-encoding.js +1 -1
  136. package/dist/options/enable-cancellation.js +1 -2
  137. package/dist/options/enable-lambda-insights.js +1 -2
  138. package/dist/options/enable-multiprocess-on-linux.js +1 -13
  139. package/dist/options/encoding-buffer-size.d.ts +4 -2
  140. package/dist/options/encoding-buffer-size.js +1 -3
  141. package/dist/options/encoding-max-rate.d.ts +1 -1
  142. package/dist/options/encoding-max-rate.js +1 -3
  143. package/dist/options/enforce-audio.js +1 -15
  144. package/dist/options/env-file.js +1 -3
  145. package/dist/options/every-nth-frame.d.ts +1 -1
  146. package/dist/options/every-nth-frame.js +1 -6
  147. package/dist/options/experimental-keep-audio-context-alive.js +1 -3
  148. package/dist/options/folder-expiry.d.ts +1 -1
  149. package/dist/options/folder-expiry.js +1 -4
  150. package/dist/options/for-seamless-aac-concatenation.js +1 -3
  151. package/dist/options/force-new-studio.js +1 -1
  152. package/dist/options/frames.d.ts +1 -1
  153. package/dist/options/frames.js +1 -4
  154. package/dist/options/gl.d.ts +6 -6
  155. package/dist/options/gl.js +3 -28
  156. package/dist/options/gop-size.js +1 -3
  157. package/dist/options/hardware-acceleration.d.ts +3 -3
  158. package/dist/options/headless.js +1 -1
  159. package/dist/options/ignore-certificate-errors.d.ts +1 -1
  160. package/dist/options/ignore-certificate-errors.js +1 -1
  161. package/dist/options/image-sequence-pattern.js +1 -5
  162. package/dist/options/image-sequence.js +1 -1
  163. package/dist/options/index.d.ts +91 -72
  164. package/dist/options/index.js +2 -0
  165. package/dist/options/interactivity.js +1 -1
  166. package/dist/options/ipv4.js +1 -1
  167. package/dist/options/is-production.d.ts +1 -1
  168. package/dist/options/is-production.js +1 -4
  169. package/dist/options/jpeg-quality.d.ts +1 -1
  170. package/dist/options/jpeg-quality.js +1 -4
  171. package/dist/options/keyboard-shortcuts.js +1 -1
  172. package/dist/options/latency-hint.d.ts +1 -1
  173. package/dist/options/latency-hint.js +1 -10
  174. package/dist/options/license-key.d.ts +1 -1
  175. package/dist/options/license-key.js +1 -2
  176. package/dist/options/log-level.d.ts +4 -3
  177. package/dist/options/log-level.js +1 -16
  178. package/dist/options/metadata.js +2 -7
  179. package/dist/options/mute.js +1 -1
  180. package/dist/options/no-open.js +1 -1
  181. package/dist/options/number-of-gif-loops.d.ts +1 -1
  182. package/dist/options/number-of-gif-loops.js +1 -13
  183. package/dist/options/number-of-shared-audio-tags.js +1 -1
  184. package/dist/options/offthreadvideo-cache-size.d.ts +1 -1
  185. package/dist/options/offthreadvideo-cache-size.js +1 -11
  186. package/dist/options/offthreadvideo-threads.d.ts +1 -1
  187. package/dist/options/offthreadvideo-threads.js +1 -2
  188. package/dist/options/on-browser-download.d.ts +1 -1
  189. package/dist/options/on-browser-download.js +1 -2
  190. package/dist/options/options-map.d.ts +180 -180
  191. package/dist/options/out-dir.d.ts +1 -1
  192. package/dist/options/out-dir.js +1 -4
  193. package/dist/options/override-duration.js +1 -1
  194. package/dist/options/override-fps.js +1 -1
  195. package/dist/options/override-height.js +1 -1
  196. package/dist/options/override-width.js +1 -1
  197. package/dist/options/overwrite.js +1 -5
  198. package/dist/options/package-manager.d.ts +1 -1
  199. package/dist/options/package-manager.js +1 -12
  200. package/dist/options/pixel-format.d.ts +6 -5
  201. package/dist/options/pixel-format.js +1 -2
  202. package/dist/options/port.js +1 -1
  203. package/dist/options/prefer-lossless.d.ts +1 -1
  204. package/dist/options/prefer-lossless.js +1 -4
  205. package/dist/options/{experimental-tracks.d.ts → preserve-pitch-on-playback.d.ts} +3 -3
  206. package/dist/options/preserve-pitch-on-playback.js +36 -0
  207. package/dist/options/preview-sample-rate.js +1 -3
  208. package/dist/options/props.js +1 -5
  209. package/dist/options/prores-profile.d.ts +2 -2
  210. package/dist/options/prores-profile.js +1 -5
  211. package/dist/options/public-dir.d.ts +1 -1
  212. package/dist/options/public-dir.js +1 -2
  213. package/dist/options/public-license-key.d.ts +1 -1
  214. package/dist/options/public-license-key.js +1 -3
  215. package/dist/options/public-path.d.ts +1 -1
  216. package/dist/options/public-path.js +1 -5
  217. package/dist/options/repro.d.ts +3 -1
  218. package/dist/options/repro.js +1 -1
  219. package/dist/options/rspack.js +1 -1
  220. package/dist/options/runs.js +1 -3
  221. package/dist/options/sample-rate.d.ts +2 -2
  222. package/dist/options/sample-rate.js +1 -2
  223. package/dist/options/scale.js +1 -5
  224. package/dist/options/sequence-activity-limit.js +1 -4
  225. package/dist/options/show-layer-frame-numbers.js +1 -3
  226. package/dist/options/show-premounting.js +1 -2
  227. package/dist/options/skip-skills.js +1 -1
  228. package/dist/options/still-frame.d.ts +1 -1
  229. package/dist/options/still-frame.js +1 -3
  230. package/dist/options/still-image-format.d.ts +3 -2
  231. package/dist/options/still-image-format.js +1 -2
  232. package/dist/options/timeout.d.ts +1 -1
  233. package/dist/options/timeout.js +1 -4
  234. package/dist/options/user-agent.d.ts +1 -1
  235. package/dist/options/user-agent.js +1 -1
  236. package/dist/options/version-flag.js +1 -1
  237. package/dist/options/video-bitrate.js +1 -7
  238. package/dist/options/video-cache-size.d.ts +1 -1
  239. package/dist/options/video-cache-size.js +1 -7
  240. package/dist/options/video-codec.d.ts +9 -7
  241. package/dist/options/video-codec.js +1 -1
  242. package/dist/options/video-image-format.d.ts +6 -5
  243. package/dist/options/video-image-format.js +1 -6
  244. package/dist/options/webhook-custom-data.d.ts +1 -1
  245. package/dist/options/webhook-custom-data.js +1 -1
  246. package/dist/options/webpack-poll.js +1 -1
  247. package/dist/options/x264-preset.d.ts +8 -7
  248. package/dist/options/x264-preset.js +1 -23
  249. package/dist/p-limit.d.ts +1 -1
  250. package/dist/pixel-format.d.ts +4 -3
  251. package/dist/pool.js +0 -2
  252. package/dist/port-config.d.ts +6 -5
  253. package/dist/prespawn-ffmpeg.d.ts +1 -1
  254. package/dist/print-useful-error-message.d.ts +2 -1
  255. package/dist/probe-encoder.d.ts +8 -5
  256. package/dist/probe-shared-memory-capture.d.ts +4 -2
  257. package/dist/prores-profile.d.ts +4 -2
  258. package/dist/puppeteer-evaluate.d.ts +2 -2
  259. package/dist/puppeteer-screenshot.d.ts +4 -3
  260. package/dist/pure.d.ts +12 -15
  261. package/dist/remotion-shared-memory.d.ts +1 -1
  262. package/dist/remotion-shared-memory.js +199 -187
  263. package/dist/render-frame-and-retry-target-close.d.ts +10 -10
  264. package/dist/render-frame-with-option-to-reject.d.ts +7 -5
  265. package/dist/render-frame-with-option-to-reject.js +1 -5
  266. package/dist/render-frame.d.ts +8 -6
  267. package/dist/render-frames.d.ts +1 -40
  268. package/dist/render-has-audio.d.ts +3 -2
  269. package/dist/replace-browser.d.ts +2 -1
  270. package/dist/repro.d.ts +1 -1
  271. package/dist/screenshot-task.d.ts +4 -3
  272. package/dist/seek-to-frame.d.ts +3 -2
  273. package/dist/select-composition.d.ts +1 -20
  274. package/dist/serve-handler/index.d.ts +1 -1
  275. package/dist/serve-handler/range-parser.d.ts +2 -2
  276. package/dist/serve-static.d.ts +2 -1
  277. package/dist/serve-static.js +4 -4
  278. package/dist/set-props-and-env.js +2 -6
  279. package/dist/stringify-ffmpeg-filter.d.ts +2 -1
  280. package/dist/stringify-ffmpeg-filter.js +20 -2
  281. package/dist/take-frame.d.ts +1 -1
  282. package/dist/test-gpu.d.ts +4 -2
  283. package/dist/validate-even-dimensions-with-codec.d.ts +4 -2
  284. package/dist/validate-ffmpeg-override.d.ts +1 -1
  285. package/dist/validate-number-of-gif-loops.d.ts +2 -1
  286. package/dist/validate-output-filename.d.ts +4 -2
  287. package/package.json +16 -16
  288. package/dist/options/experimental-sequence-activity-limit.d.ts +0 -19
  289. package/dist/options/experimental-sequence-activity-limit.js +0 -40
  290. package/dist/options/experimental-sequence-activity.d.ts +0 -19
  291. package/dist/options/experimental-sequence-activity.js +0 -38
  292. package/dist/options/experimental-tracks.js +0 -43
@@ -17246,6 +17246,17 @@ var tmpDir = (str) => {
17246
17246
  import fs15, { writeSync } from "node:fs";
17247
17247
  import path15 from "node:path";
17248
17248
 
17249
+ // src/assets/calculate-atempo.ts
17250
+ var calculateATempo = (playbackRate) => {
17251
+ if (playbackRate === 1) {
17252
+ return null;
17253
+ }
17254
+ if (playbackRate >= 0.5 && playbackRate <= 2) {
17255
+ return `atempo=${playbackRate.toFixed(5)}`;
17256
+ }
17257
+ return `${calculateATempo(Math.sqrt(playbackRate))},${calculateATempo(Math.sqrt(playbackRate))}`;
17258
+ };
17259
+
17249
17260
  // src/assets/apply-tone-frequency.ts
17250
17261
  var applyToneFrequencyUsingFfmpeg = async ({
17251
17262
  input,
@@ -17257,7 +17268,11 @@ var applyToneFrequencyUsingFfmpeg = async ({
17257
17268
  cancelSignal,
17258
17269
  sampleRate
17259
17270
  }) => {
17260
- const filter = `asetrate=${sampleRate}*${toneFrequency},aresample=${sampleRate},atempo=1/${toneFrequency}`;
17271
+ const filter = [
17272
+ `asetrate=${sampleRate}*${toneFrequency}`,
17273
+ `aresample=${sampleRate}`,
17274
+ calculateATempo(1 / toneFrequency)
17275
+ ].filter((part) => part !== null).join(",");
17261
17276
  const args = [
17262
17277
  "-hide_banner",
17263
17278
  "-i",
@@ -17683,69 +17698,6 @@ var makeRange = (from, to) => {
17683
17698
  });
17684
17699
  };
17685
17700
 
17686
- // src/port-config.ts
17687
- import os9 from "os";
17688
- var cached = null;
17689
- var getPortConfig = (preferIpv4) => {
17690
- if (cached) {
17691
- return cached;
17692
- }
17693
- const networkInterfaces = os9.networkInterfaces();
17694
- const flattened = flattenNetworkInterfaces(networkInterfaces);
17695
- const host = getHostToBind(flattened, preferIpv4);
17696
- const hostsToTry = getHostsToTry(flattened);
17697
- const response = { host, hostsToTry };
17698
- cached = response;
17699
- return response;
17700
- };
17701
- var getHostToBind = (flattened, preferIpv4) => {
17702
- if (preferIpv4 || !isIpV6Supported(flattened)) {
17703
- return "0.0.0.0";
17704
- }
17705
- return "::";
17706
- };
17707
- var getHostsToTry = (flattened) => {
17708
- return [
17709
- hasIPv6LoopbackAddress(flattened) ? "::1" : null,
17710
- hasIpv4LoopbackAddress(flattened) ? "127.0.0.1" : null,
17711
- isIpV6Supported(flattened) ? "::" : null,
17712
- "0.0.0.0"
17713
- ].filter(truthy);
17714
- };
17715
- var flattenNetworkInterfaces = (networkInterfaces) => {
17716
- const result = [];
17717
- for (const iface in networkInterfaces) {
17718
- for (const configuration of networkInterfaces[iface]) {
17719
- result.push(configuration);
17720
- }
17721
- }
17722
- return result;
17723
- };
17724
- var isIpV6Supported = (flattened) => {
17725
- for (const configuration of flattened) {
17726
- if (configuration.family === "IPv6" && !configuration.internal) {
17727
- return true;
17728
- }
17729
- }
17730
- return false;
17731
- };
17732
- var hasIPv6LoopbackAddress = (flattened) => {
17733
- for (const configuration of flattened) {
17734
- if (configuration.family === "IPv6" && configuration.internal && configuration.address === "::1") {
17735
- return true;
17736
- }
17737
- }
17738
- return false;
17739
- };
17740
- var hasIpv4LoopbackAddress = (flattened) => {
17741
- for (const configuration of flattened) {
17742
- if (configuration.family === "IPv4" && configuration.internal && configuration.address === "127.0.0.1") {
17743
- return true;
17744
- }
17745
- }
17746
- return false;
17747
- };
17748
-
17749
17701
  // src/serve-handler/index.ts
17750
17702
  import { createReadStream, promises as promises3 } from "node:fs";
17751
17703
  import path19 from "node:path";
@@ -18032,7 +17984,7 @@ var serveStatic = async (path, options2) => {
18032
17984
  });
18033
17985
  let selectedPort = null;
18034
17986
  const maxTries = 10;
18035
- const portConfig = getPortConfig(options2.forceIPv4);
17987
+ const host = "127.0.0.1";
18036
17988
  for (let i = 0;i < maxTries; i++) {
18037
17989
  let unlock = () => {};
18038
17990
  try {
@@ -18041,10 +17993,10 @@ var serveStatic = async (path, options2) => {
18041
17993
  desiredPort: options2?.port ?? undefined,
18042
17994
  from: 3000,
18043
17995
  to: 3100,
18044
- hostsToTry: portConfig.hostsToTry
17996
+ hostsToTry: [host]
18045
17997
  }).then(({ port, unlockPort }) => {
18046
17998
  unlock = unlockPort;
18047
- server.listen({ port, host: portConfig.host });
17999
+ server.listen({ port, host });
18048
18000
  server.on("listening", () => {
18049
18001
  resolve(port);
18050
18002
  return unlock();
@@ -19180,7 +19132,7 @@ var resolveConcurrency = (userPreference) => {
19180
19132
  const min = 1;
19181
19133
  let rounded;
19182
19134
  if (typeof userPreference === "string") {
19183
- const percentage = parseInt(userPreference.slice(0, -1), 10);
19135
+ const percentage = parseFloat(userPreference.slice(0, -1));
19184
19136
  rounded = Math.floor(percentage / 100 * maxCpus);
19185
19137
  } else {
19186
19138
  rounded = Math.floor(userPreference);
@@ -19544,6 +19496,69 @@ var validateSelectedPixelFormatAndCodecCombination = (pixelFormat, codec) => {
19544
19496
  }
19545
19497
  };
19546
19498
 
19499
+ // src/port-config.ts
19500
+ import os9 from "os";
19501
+ var cached = null;
19502
+ var getPortConfig = (preferIpv4) => {
19503
+ if (cached) {
19504
+ return cached;
19505
+ }
19506
+ const networkInterfaces = os9.networkInterfaces();
19507
+ const flattened = flattenNetworkInterfaces(networkInterfaces);
19508
+ const host = getHostToBind(flattened, preferIpv4);
19509
+ const hostsToTry = getHostsToTry(flattened);
19510
+ const response = { host, hostsToTry };
19511
+ cached = response;
19512
+ return response;
19513
+ };
19514
+ var getHostToBind = (flattened, preferIpv4) => {
19515
+ if (preferIpv4 || !isIpV6Supported(flattened)) {
19516
+ return "0.0.0.0";
19517
+ }
19518
+ return "::";
19519
+ };
19520
+ var getHostsToTry = (flattened) => {
19521
+ return [
19522
+ hasIPv6LoopbackAddress(flattened) ? "::1" : null,
19523
+ hasIpv4LoopbackAddress(flattened) ? "127.0.0.1" : null,
19524
+ isIpV6Supported(flattened) ? "::" : null,
19525
+ "0.0.0.0"
19526
+ ].filter(truthy);
19527
+ };
19528
+ var flattenNetworkInterfaces = (networkInterfaces) => {
19529
+ const result = [];
19530
+ for (const iface in networkInterfaces) {
19531
+ for (const configuration of networkInterfaces[iface]) {
19532
+ result.push(configuration);
19533
+ }
19534
+ }
19535
+ return result;
19536
+ };
19537
+ var isIpV6Supported = (flattened) => {
19538
+ for (const configuration of flattened) {
19539
+ if (configuration.family === "IPv6" && !configuration.internal) {
19540
+ return true;
19541
+ }
19542
+ }
19543
+ return false;
19544
+ };
19545
+ var hasIPv6LoopbackAddress = (flattened) => {
19546
+ for (const configuration of flattened) {
19547
+ if (configuration.family === "IPv6" && configuration.internal && configuration.address === "::1") {
19548
+ return true;
19549
+ }
19550
+ }
19551
+ return false;
19552
+ };
19553
+ var hasIpv4LoopbackAddress = (flattened) => {
19554
+ for (const configuration of flattened) {
19555
+ if (configuration.family === "IPv4" && configuration.internal && configuration.address === "127.0.0.1") {
19556
+ return true;
19557
+ }
19558
+ }
19559
+ return false;
19560
+ };
19561
+
19547
19562
  // src/probe-shared-memory-capture.ts
19548
19563
  import fs16 from "node:fs";
19549
19564
  import os10 from "node:os";
@@ -22302,6 +22317,7 @@ var renderFrameWithOptionToReject = async ({
22302
22317
  if (previousFrame !== undefined) {
22303
22318
  return Promise.reject(new Error(`An artifact with output "${artifact.filename}" was already registered at frame ${previousFrame}, but now registered again at frame ${artifact.frame}. Artifacts must have unique names. https://remotion.dev/docs/artifacts`));
22304
22319
  }
22320
+ assetIndex.firstArtifactFrameByFilename.set(artifact.filename, artifact.frame);
22305
22321
  onArtifact?.(artifact);
22306
22322
  }
22307
22323
  const compressedAssets = audioAndVideoAssets.map((asset) => {
@@ -22325,11 +22341,6 @@ var renderFrameWithOptionToReject = async ({
22325
22341
  assetIndex.firstAssetBySrc.set(asset.src, asset);
22326
22342
  }
22327
22343
  }
22328
- for (const artifact of artifactAssets) {
22329
- if (!assetIndex.firstArtifactFrameByFilename.has(artifact.filename)) {
22330
- assetIndex.firstArtifactFrameByFilename.set(artifact.filename, artifact.frame);
22331
- }
22332
- }
22333
22344
  for (const renderAsset of compressedAssets) {
22334
22345
  downloadAndMapAssetsToFileUrl({
22335
22346
  renderAsset,
@@ -23582,7 +23593,8 @@ var calculateAssetPositions = (frames, sourceFrames = frames.map((_, index) => i
23582
23593
  playbackRate: asset.playbackRate,
23583
23594
  toneFrequency: asset.toneFrequency,
23584
23595
  audioStartFrame: asset.audioStartFrame,
23585
- audioStreamIndex: asset.audioStreamIndex
23596
+ audioStreamIndex: asset.audioStreamIndex,
23597
+ preservePitch: asset.preservePitch ?? true
23586
23598
  };
23587
23599
  assets.push(openAsset);
23588
23600
  openAssets.set(asset.id, openAsset);
@@ -24009,17 +24021,6 @@ var mergeInlineAudioTracks = async ({
24009
24021
  return currentTracks[0] ?? null;
24010
24022
  };
24011
24023
 
24012
- // src/assets/calculate-atempo.ts
24013
- var calculateATempo = (playbackRate) => {
24014
- if (playbackRate === 1) {
24015
- return null;
24016
- }
24017
- if (playbackRate >= 0.5 && playbackRate <= 2) {
24018
- return `atempo=${playbackRate.toFixed(5)}`;
24019
- }
24020
- return `${calculateATempo(Math.sqrt(playbackRate))},${calculateATempo(Math.sqrt(playbackRate))}`;
24021
- };
24022
-
24023
24024
  // src/assets/round-volume-to-avoid-stack-overflow.ts
24024
24025
  var MAX_FFMPEG_STACK_DEPTH = 98;
24025
24026
  var roundVolumeToAvoidStackOverflow = (volume) => {
@@ -24151,6 +24152,19 @@ var stringifyTrim = (trim) => {
24151
24152
  }
24152
24153
  return asString;
24153
24154
  };
24155
+ var calculateSpeedChangeFilter = ({
24156
+ playbackRate,
24157
+ preservePitch,
24158
+ sampleRate
24159
+ }) => {
24160
+ if (playbackRate === 1) {
24161
+ return null;
24162
+ }
24163
+ if (preservePitch) {
24164
+ return calculateATempo(playbackRate);
24165
+ }
24166
+ return `asetrate=${sampleRate}*${playbackRate},aresample=${sampleRate}`;
24167
+ };
24154
24168
  var trimAndSetTempo = ({
24155
24169
  assetDuration,
24156
24170
  asset,
@@ -24158,7 +24172,8 @@ var trimAndSetTempo = ({
24158
24172
  trimRightOffset,
24159
24173
  fps,
24160
24174
  indent,
24161
- logLevel
24175
+ logLevel,
24176
+ sampleRate
24162
24177
  }) => {
24163
24178
  const { trimLeft, maxTrim } = getActualTrimLeft({
24164
24179
  trimLeft: asset.trimLeft,
@@ -24182,7 +24197,11 @@ var trimAndSetTempo = ({
24182
24197
  }
24183
24198
  return {
24184
24199
  filter: [
24185
- calculateATempo(asset.playbackRate),
24200
+ calculateSpeedChangeFilter({
24201
+ playbackRate: asset.playbackRate,
24202
+ preservePitch: asset.preservePitch,
24203
+ sampleRate
24204
+ }),
24186
24205
  `atrim=${stringifyTrim(trimLeft)}:${stringifyTrim(trimRightOrAssetDuration)}`
24187
24206
  ],
24188
24207
  actualTrimLeft: trimLeft,
@@ -24237,7 +24256,8 @@ var stringifyFfmpegFilter = ({
24237
24256
  asset,
24238
24257
  fps,
24239
24258
  indent,
24240
- logLevel
24259
+ logLevel,
24260
+ sampleRate
24241
24261
  });
24242
24262
  const volumeFilter = ffmpegVolumeExpression({
24243
24263
  volume,
@@ -1,6 +1,7 @@
1
+ import type { LogLevel } from './log-level';
1
2
  export declare const extractAudio: (options: {
2
3
  videoSource: string;
3
4
  audioOutput: string;
4
- logLevel?: "error" | "info" | "trace" | "verbose" | "warn" | undefined;
5
- binariesDirectory?: string | null | undefined;
5
+ logLevel?: LogLevel;
6
+ binariesDirectory?: string | null;
6
7
  }) => Promise<void>;
@@ -1,18 +1,24 @@
1
+ import type { HardwareAccelerationOption } from './client';
2
+ import type { Codec } from './codec';
3
+ import type { LogLevel } from './log-level';
4
+ import { type ColorSpace } from './options/color-space';
5
+ import type { X264Preset } from './options/x264-preset';
6
+ import type { PixelFormat } from './pixel-format';
1
7
  export declare const generateFfmpegArgs: ({ hasPreencoded, proResProfileName, pixelFormat, x264Preset, gopSize, codec, crf, videoBitrate, encodingMaxRate, encodingBufferSize, colorSpace, hardwareAcceleration, indent, logLevel, cpuCount, lambdaMemoryInBytes, }: {
2
8
  hasPreencoded: boolean;
3
9
  proResProfileName: string | null;
4
- pixelFormat: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le";
5
- x264Preset: "fast" | "faster" | "medium" | "placebo" | "slow" | "slower" | "superfast" | "ultrafast" | "veryfast" | "veryslow" | null;
10
+ pixelFormat: PixelFormat;
11
+ x264Preset: X264Preset | null;
6
12
  gopSize: number | null;
7
13
  crf: unknown;
8
- codec: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav";
14
+ codec: Codec;
9
15
  videoBitrate: string | null;
10
16
  encodingMaxRate: string | null;
11
17
  encodingBufferSize: string | null;
12
- colorSpace: "bt2020-ncl" | "bt601" | "bt709" | "default" | null;
13
- hardwareAcceleration: "disable" | "if-possible" | "required";
18
+ colorSpace: ColorSpace | null;
19
+ hardwareAcceleration: HardwareAccelerationOption;
14
20
  indent: boolean;
15
- logLevel: "error" | "info" | "trace" | "verbose" | "warn";
21
+ logLevel: LogLevel;
16
22
  cpuCount: number;
17
23
  lambdaMemoryInBytes: number | null;
18
24
  }) => string[][];
@@ -1,4 +1,5 @@
1
1
  import type { FastStartMuxer } from './get-fast-start-muxer';
2
+ import type { LogLevel } from './log-level';
2
3
  import type { CancelSignal } from './make-cancel-signal';
3
4
  export declare const finalizeFastStart: ({ input, output, muxer, force, indent, logLevel, binariesDirectory, cancelSignal, }: {
4
5
  input: string;
@@ -6,7 +7,7 @@ export declare const finalizeFastStart: ({ input, output, muxer, force, indent,
6
7
  muxer: FastStartMuxer;
7
8
  force: boolean;
8
9
  indent: boolean;
9
- logLevel: "error" | "info" | "trace" | "verbose" | "warn";
10
+ logLevel: LogLevel;
10
11
  binariesDirectory: string | null;
11
12
  cancelSignal: CancelSignal | null;
12
13
  }) => Promise<void>;
@@ -2,19 +2,21 @@ import type { BrowserExecutable } from './browser-executable';
2
2
  import type { BrowserLog } from './browser-log';
3
3
  import type { HeadlessBrowser } from './browser/Browser';
4
4
  import type { OnLog, Page } from './browser/BrowserPage';
5
+ import type { LogLevel } from './log-level';
5
6
  import type { ChromiumOptions } from './open-browser';
7
+ import type { ChromeMode } from './options/chrome-mode';
6
8
  import type { OnBrowserDownload } from './options/on-browser-download';
7
9
  export declare const getPageAndCleanupFn: ({ passedInInstance, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent, logLevel, onBrowserDownload, chromeMode, pageIndex, onBrowserLog, onLog, }: {
8
10
  passedInInstance: HeadlessBrowser | undefined;
9
- browserExecutable: BrowserExecutable;
11
+ browserExecutable: BrowserExecutable | null;
10
12
  chromiumOptions: ChromiumOptions;
11
13
  indent: boolean;
12
14
  forceDeviceScaleFactor: number | undefined;
13
- logLevel: "error" | "info" | "trace" | "verbose" | "warn";
15
+ logLevel: LogLevel;
14
16
  onBrowserDownload: OnBrowserDownload;
15
- chromeMode: "chrome-for-testing" | "headless-shell";
17
+ chromeMode: ChromeMode;
16
18
  pageIndex: number;
17
- onBrowserLog: ((log: BrowserLog) => void) | null;
19
+ onBrowserLog: null | ((log: BrowserLog) => void);
18
20
  onLog: OnLog;
19
21
  }) => Promise<{
20
22
  cleanupPage: () => Promise<void>;
@@ -1,4 +1,7 @@
1
1
  import type { OnLog } from './browser/BrowserPage';
2
+ import type { Codec } from './codec';
3
+ import type { LogLevel } from './log-level';
4
+ import type { HardwareAccelerationOption } from './options/hardware-acceleration';
2
5
  export type CodecSettings = {
3
6
  encoderName: string;
4
7
  hardwareAccelerated: boolean;
@@ -9,12 +12,12 @@ export declare const hasSpecifiedUnsupportedHardwareQualifySettings: ({ encoding
9
12
  crf: unknown;
10
13
  }) => "crf" | "encodingBufferSize" | "encodingMaxRate" | null;
11
14
  export declare const getCodecName: ({ codec, encodingMaxRate, encodingBufferSize, crf, hardwareAcceleration, logLevel, indent, onLog, }: {
12
- codec: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav";
13
- hardwareAcceleration: "disable" | "if-possible" | "required";
15
+ codec: Codec;
16
+ hardwareAcceleration: HardwareAccelerationOption;
14
17
  encodingMaxRate: string | null;
15
18
  encodingBufferSize: string | null;
16
19
  crf: unknown;
17
- logLevel: "error" | "info" | "trace" | "verbose" | "warn";
20
+ logLevel: LogLevel;
18
21
  indent: boolean;
19
22
  onLog: OnLog | null;
20
23
  }) => CodecSettings | null;
@@ -38,7 +38,8 @@ export type GetCompositionsOptions = RequiredInputPropsInV5 & SharedGetCompositi
38
38
  serveUrl: string;
39
39
  };
40
40
  type V4GetCompositionsArguments = [options: GetCompositionsOptions] | [serveUrlOrWebpackUrl: string, config?: V4LegacyGetCompositionsOptions];
41
+ type GetCompositionsArguments = typeof NoReactInternals.ENABLE_V5_BREAKING_CHANGES extends true ? [options: GetCompositionsOptions] : V4GetCompositionsArguments;
41
42
  export declare const convertGetCompositionsArgumentsToOptions: (args: V4GetCompositionsArguments, enableV5BreakingChanges: boolean) => GetCompositionsOptions;
42
43
  export declare const internalGetCompositions: (args_0: InternalGetCompositionsOptions) => Promise<VideoConfig[]>;
43
- export declare const getCompositions: (...args: V4GetCompositionsArguments) => Promise<VideoConfig[]>;
44
+ export declare const getCompositions: (...args: GetCompositionsArguments) => Promise<VideoConfig[]>;
44
45
  export {};
@@ -1 +1 @@
1
- export declare const resolveConcurrency: (userPreference: string | number | null) => number;
1
+ export declare const resolveConcurrency: (userPreference: number | string | null) => number;
@@ -10,7 +10,7 @@ const resolveConcurrency = (userPreference) => {
10
10
  const min = 1;
11
11
  let rounded;
12
12
  if (typeof userPreference === 'string') {
13
- const percentage = parseInt(userPreference.slice(0, -1), 10);
13
+ const percentage = parseFloat(userPreference.slice(0, -1));
14
14
  rounded = Math.floor((percentage / 100) * maxCpus);
15
15
  }
16
16
  else {
@@ -1,2 +1,2 @@
1
1
  import type { ResolvedFrameRange } from './frame-range';
2
- export declare const getFramesToRender: (frameRange: ResolvedFrameRange[] | ResolvedFrameRange, everyNthFrame: number) => number[];
2
+ export declare const getFramesToRender: (frameRange: ResolvedFrameRange | ResolvedFrameRange[], everyNthFrame: number) => number[];
@@ -1,5 +1,6 @@
1
1
  import type { Codec } from './codec';
2
2
  import type { FileExtension } from './file-extensions';
3
- export declare const getFileExtensionFromCodec: <T extends "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav">(codec: T, audioCodec: "aac" | "mp3" | "opus" | "pcm-16" | null) => FileExtension;
3
+ import type { AudioCodec } from './options/audio-codec';
4
+ export declare const getFileExtensionFromCodec: <T extends Codec>(codec: T, audioCodec: AudioCodec | null) => FileExtension;
4
5
  export declare const makeFileExtensionMap: () => Record<string, ("aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav")[]>;
5
6
  export declare const defaultCodecsForFileExtension: Record<FileExtension, Codec>;
@@ -1,3 +1,4 @@
1
+ import type { VideoImageFormat } from './image-format';
1
2
  export type CountType = 'from-zero' | 'actual-frames';
2
3
  export declare const getFrameOutputFileNameFromPattern: ({ pattern, frame, ext, }: {
3
4
  pattern: string;
@@ -7,7 +8,7 @@ export declare const getFrameOutputFileNameFromPattern: ({ pattern, frame, ext,
7
8
  export declare const getFrameOutputFileName: ({ index, frame, imageFormat, countType, lastFrame, totalFrames, imageSequencePattern, }: {
8
9
  index: number;
9
10
  frame: number;
10
- imageFormat: "jpeg" | "none" | "png";
11
+ imageFormat: VideoImageFormat;
11
12
  countType: CountType;
12
13
  lastFrame: number;
13
14
  totalFrames: number;
@@ -1,7 +1,9 @@
1
1
  import type { BrowserExecutable } from './browser-executable';
2
+ import type { LogLevel } from './log-level';
3
+ import type { ChromeMode } from './options/chrome-mode';
2
4
  export declare const getLocalBrowserExecutable: ({ preferredBrowserExecutable, logLevel, indent, chromeMode, }: {
3
5
  preferredBrowserExecutable: BrowserExecutable;
4
- logLevel: "error" | "info" | "trace" | "verbose" | "warn";
6
+ logLevel: LogLevel;
5
7
  indent: boolean;
6
- chromeMode: "chrome-for-testing" | "headless-shell";
8
+ chromeMode: ChromeMode;
7
9
  }) => string;
@@ -8,7 +8,7 @@ export declare const getDesiredPort: ({ desiredPort, from, hostsToTry, to, onPor
8
8
  from: number;
9
9
  to: number;
10
10
  hostsToTry: string[];
11
- onPortUnavailable?: ((port: number) => Promise<"continue" | "stop">) | undefined;
11
+ onPortUnavailable?: (port: number) => Promise<'continue' | 'stop'>;
12
12
  }) => Promise<{
13
13
  port: number;
14
14
  unlockPort: () => void;
@@ -1 +1,3 @@
1
- export declare const getProResProfileName: (codec: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav", proResProfile: "4444" | "4444-xq" | "hq" | "light" | "proxy" | "standard" | undefined) => string | null;
1
+ import type { _InternalTypes } from 'remotion';
2
+ import type { Codec } from './codec';
3
+ export declare const getProResProfileName: (codec: Codec, proResProfile: _InternalTypes['ProResProfile'] | undefined) => string | null;
@@ -1,9 +1,10 @@
1
1
  import type { GetSilentPartsResponse, SilentPart } from './compositor/payloads';
2
+ import type { LogLevel } from './log-level';
2
3
  export type { SilentPart };
3
4
  export declare const getSilentParts: ({ src, noiseThresholdInDecibels: passedNoiseThresholdInDecibels, minDurationInSeconds: passedMinDuration, logLevel, binariesDirectory, }: {
4
5
  src: string;
5
- minDurationInSeconds?: number | undefined;
6
- logLevel?: "error" | "info" | "trace" | "verbose" | "warn" | undefined;
7
- noiseThresholdInDecibels?: number | undefined;
8
- binariesDirectory?: string | null | undefined;
6
+ minDurationInSeconds?: number;
7
+ logLevel?: LogLevel;
8
+ noiseThresholdInDecibels?: number;
9
+ binariesDirectory?: string | null;
9
10
  }) => Promise<GetSilentPartsResponse>;
@@ -1,9 +1,10 @@
1
1
  import type { VideoMetadata } from './compositor/payloads';
2
+ import type { LogLevel } from './log-level';
2
3
  export { VideoMetadata } from './compositor/payloads';
3
4
  /**
4
5
  * @deprecated Use Mediabunny instead: https://www.remotion.dev/docs/mediabunny/metadata
5
6
  */
6
7
  export declare const getVideoMetadata: (videoSource: string, options?: {
7
- logLevel?: "error" | "info" | "trace" | "verbose" | "warn" | undefined;
8
- binariesDirectory?: string | null | undefined;
9
- } | undefined) => Promise<VideoMetadata>;
8
+ logLevel?: LogLevel;
9
+ binariesDirectory?: string | null;
10
+ }) => Promise<VideoMetadata>;
@@ -1 +1,2 @@
1
- export declare const getIdealVideoThreadsFlag: (logLevel: "error" | "info" | "trace" | "verbose" | "warn") => number;
1
+ import type { LogLevel } from './log-level';
2
+ export declare const getIdealVideoThreadsFlag: (logLevel: LogLevel) => number;
@@ -1,3 +1,3 @@
1
1
  import type { Page } from './browser/BrowserPage';
2
2
  import type { HTTPResponse } from './browser/HTTPResponse';
3
- export declare const gotoPageOrThrow: (page: Page, urlToVisit: string, actualTimeout: number) => Promise<[null, Error] | [HTTPResponse, null]>;
3
+ export declare const gotoPageOrThrow: (page: Page, urlToVisit: string, actualTimeout: number) => Promise<[HTTPResponse, null] | [null, Error]>;
@@ -1,8 +1,9 @@
1
+ import type { LogLevel } from './log-level';
1
2
  import type { CancelSignal } from './make-cancel-signal';
2
3
  export declare const guessExtensionForVideo: ({ src, indent, logLevel, binariesDirectory, cancelSignal, }: {
3
4
  src: string;
4
5
  indent: boolean;
5
- logLevel: "error" | "info" | "trace" | "verbose" | "warn";
6
+ logLevel: LogLevel;
6
7
  binariesDirectory: string | null;
7
8
  cancelSignal: CancelSignal | undefined;
8
9
  }) => Promise<"mp3" | "mp4" | "wav" | "webm">;
@@ -1,5 +1,6 @@
1
- export declare const validVideoImageFormats: readonly ["png", "jpeg", "none"];
2
- export declare const validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
1
+ import type { PixelFormat } from './pixel-format';
2
+ export declare const validVideoImageFormats: readonly ['png', 'jpeg', 'none'];
3
+ export declare const validStillImageFormats: readonly ['png', 'jpeg', 'pdf', 'webp'];
3
4
  export type VideoImageFormat = (typeof validVideoImageFormats)[number];
4
5
  export type StillImageFormat = (typeof validStillImageFormats)[number];
5
6
  /**
@@ -8,6 +9,6 @@ export type StillImageFormat = (typeof validStillImageFormats)[number];
8
9
  export type ImageFormat = 'This type is deprecated, use VideoImageFormat or StillImageFormat instead';
9
10
  export declare const DEFAULT_VIDEO_IMAGE_FORMAT: VideoImageFormat;
10
11
  export declare const DEFAULT_STILL_IMAGE_FORMAT: StillImageFormat;
11
- export declare const validateVideoImageFormat: (videoImageFormat: "jpeg" | "none" | "png") => void;
12
- export declare const validateSelectedPixelFormatAndImageFormatCombination: (pixelFormat: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le" | undefined, videoImageFormat: "jpeg" | "none" | "png") => "none" | "valid";
13
- export declare const validateStillImageFormat: (imageFormat: "jpeg" | "pdf" | "png" | "webp") => void;
12
+ export declare const validateVideoImageFormat: (videoImageFormat: VideoImageFormat) => void;
13
+ export declare const validateSelectedPixelFormatAndImageFormatCombination: (pixelFormat: PixelFormat | undefined, videoImageFormat: VideoImageFormat) => 'none' | 'valid';
14
+ export declare const validateStillImageFormat: (imageFormat: StillImageFormat) => void;