@remotion/renderer 4.0.534 → 4.0.535

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 (225) hide show
  1. package/dist/browser/BrowserPage.js +4 -0
  2. package/dist/client.d.ts +315 -0
  3. package/dist/combine-chunks.d.ts +2 -1
  4. package/dist/combine-chunks.js +81 -52
  5. package/dist/combine-video-streams.js +3 -0
  6. package/dist/compositor/get-executable-path.js +30 -15
  7. package/dist/ensure-browser.d.ts +3 -0
  8. package/dist/esm/client.mjs +1076 -846
  9. package/dist/esm/index.mjs +394 -351
  10. package/dist/esm/pure.mjs +3 -1
  11. package/dist/get-video-threads-flag.js +5 -1
  12. package/dist/index.d.ts +47 -1
  13. package/dist/mux-video-and-audio.js +3 -0
  14. package/dist/options/allow-html-in-canvas.d.ts +1 -0
  15. package/dist/options/allow-html-in-canvas.js +1 -0
  16. package/dist/options/api-key.d.ts +1 -0
  17. package/dist/options/api-key.js +1 -0
  18. package/dist/options/ask-ai.d.ts +1 -0
  19. package/dist/options/ask-ai.js +1 -0
  20. package/dist/options/audio-bitrate.d.ts +1 -0
  21. package/dist/options/audio-bitrate.js +1 -0
  22. package/dist/options/audio-codec.d.ts +1 -0
  23. package/dist/options/audio-codec.js +1 -0
  24. package/dist/options/beep-on-finish.d.ts +1 -0
  25. package/dist/options/beep-on-finish.js +1 -0
  26. package/dist/options/benchmark-concurrencies.d.ts +1 -0
  27. package/dist/options/benchmark-concurrencies.js +1 -0
  28. package/dist/options/binaries-directory.d.ts +1 -0
  29. package/dist/options/binaries-directory.js +1 -0
  30. package/dist/options/browser-executable.d.ts +1 -0
  31. package/dist/options/browser-executable.js +1 -0
  32. package/dist/options/browser.d.ts +1 -0
  33. package/dist/options/browser.js +1 -0
  34. package/dist/options/bundle-cache.d.ts +1 -0
  35. package/dist/options/bundle-cache.js +1 -0
  36. package/dist/options/canvas-tabs.d.ts +1 -0
  37. package/dist/options/canvas-tabs.js +1 -0
  38. package/dist/options/chrome-mode.d.ts +1 -0
  39. package/dist/options/chrome-mode.js +1 -0
  40. package/dist/options/color-space.d.ts +1 -0
  41. package/dist/options/color-space.js +1 -0
  42. package/dist/options/concurrency.d.ts +1 -0
  43. package/dist/options/concurrency.js +1 -0
  44. package/dist/options/config.d.ts +1 -0
  45. package/dist/options/config.js +1 -0
  46. package/dist/options/crf.d.ts +1 -0
  47. package/dist/options/crf.js +1 -0
  48. package/dist/options/cross-site-isolation.d.ts +1 -0
  49. package/dist/options/cross-site-isolation.js +1 -0
  50. package/dist/options/dark-mode.d.ts +1 -0
  51. package/dist/options/dark-mode.js +1 -0
  52. package/dist/options/default-coding-agent.d.ts +1 -0
  53. package/dist/options/default-coding-agent.js +1 -0
  54. package/dist/options/default-editor.d.ts +1 -0
  55. package/dist/options/default-editor.js +1 -0
  56. package/dist/options/default-premount-in-seconds.d.ts +19 -0
  57. package/dist/options/default-premount-in-seconds.js +36 -0
  58. package/dist/options/delete-after.d.ts +1 -0
  59. package/dist/options/delete-after.js +1 -0
  60. package/dist/options/disable-git-source.d.ts +1 -0
  61. package/dist/options/disable-git-source.js +1 -0
  62. package/dist/options/disable-shared-memory-capture.d.ts +1 -0
  63. package/dist/options/disable-shared-memory-capture.js +1 -0
  64. package/dist/options/disable-web-security.d.ts +1 -0
  65. package/dist/options/disable-web-security.js +1 -0
  66. package/dist/options/disallow-parallel-encoding.d.ts +1 -0
  67. package/dist/options/disallow-parallel-encoding.js +1 -0
  68. package/dist/options/enable-cancellation.d.ts +1 -0
  69. package/dist/options/enable-cancellation.js +1 -0
  70. package/dist/options/enable-lambda-insights.d.ts +1 -0
  71. package/dist/options/enable-lambda-insights.js +1 -0
  72. package/dist/options/enable-multiprocess-on-linux.d.ts +1 -0
  73. package/dist/options/enable-multiprocess-on-linux.js +1 -0
  74. package/dist/options/encoding-buffer-size.d.ts +1 -0
  75. package/dist/options/encoding-buffer-size.js +1 -0
  76. package/dist/options/encoding-max-rate.d.ts +1 -0
  77. package/dist/options/encoding-max-rate.js +1 -0
  78. package/dist/options/enforce-audio.d.ts +1 -0
  79. package/dist/options/enforce-audio.js +1 -0
  80. package/dist/options/env-file.d.ts +1 -0
  81. package/dist/options/env-file.js +1 -0
  82. package/dist/options/every-nth-frame.d.ts +1 -0
  83. package/dist/options/every-nth-frame.js +1 -0
  84. package/dist/options/experimental-keep-audio-context-alive.d.ts +1 -0
  85. package/dist/options/experimental-keep-audio-context-alive.js +1 -0
  86. package/dist/options/experimental-sequence-activity-limit.d.ts +19 -0
  87. package/dist/options/experimental-sequence-activity-limit.js +40 -0
  88. package/dist/options/experimental-sequence-activity.d.ts +19 -0
  89. package/dist/options/experimental-sequence-activity.js +38 -0
  90. package/dist/options/experimental-tracks.d.ts +1 -0
  91. package/dist/options/experimental-tracks.js +1 -0
  92. package/dist/options/folder-expiry.d.ts +1 -0
  93. package/dist/options/folder-expiry.js +1 -0
  94. package/dist/options/for-seamless-aac-concatenation.d.ts +1 -0
  95. package/dist/options/for-seamless-aac-concatenation.js +1 -0
  96. package/dist/options/force-new-studio.d.ts +1 -0
  97. package/dist/options/force-new-studio.js +1 -0
  98. package/dist/options/frames.d.ts +1 -0
  99. package/dist/options/frames.js +1 -0
  100. package/dist/options/gl.d.ts +1 -0
  101. package/dist/options/gl.js +1 -0
  102. package/dist/options/gop-size.d.ts +1 -0
  103. package/dist/options/gop-size.js +1 -0
  104. package/dist/options/hardware-acceleration.d.ts +1 -0
  105. package/dist/options/hardware-acceleration.js +1 -0
  106. package/dist/options/headless.d.ts +1 -0
  107. package/dist/options/headless.js +1 -0
  108. package/dist/options/ignore-certificate-errors.d.ts +1 -0
  109. package/dist/options/ignore-certificate-errors.js +1 -0
  110. package/dist/options/image-sequence-pattern.d.ts +1 -0
  111. package/dist/options/image-sequence-pattern.js +1 -0
  112. package/dist/options/image-sequence.d.ts +1 -0
  113. package/dist/options/image-sequence.js +1 -0
  114. package/dist/options/index.d.ts +175 -0
  115. package/dist/options/index.js +8 -0
  116. package/dist/options/interactivity.d.ts +1 -0
  117. package/dist/options/interactivity.js +1 -0
  118. package/dist/options/ipv4.d.ts +1 -0
  119. package/dist/options/ipv4.js +1 -0
  120. package/dist/options/is-production.d.ts +1 -0
  121. package/dist/options/is-production.js +1 -0
  122. package/dist/options/jpeg-quality.d.ts +1 -0
  123. package/dist/options/jpeg-quality.js +1 -0
  124. package/dist/options/keyboard-shortcuts.d.ts +1 -0
  125. package/dist/options/keyboard-shortcuts.js +1 -0
  126. package/dist/options/latency-hint.d.ts +1 -0
  127. package/dist/options/latency-hint.js +1 -0
  128. package/dist/options/license-key.d.ts +1 -0
  129. package/dist/options/license-key.js +1 -0
  130. package/dist/options/log-level.d.ts +1 -0
  131. package/dist/options/log-level.js +1 -0
  132. package/dist/options/metadata.d.ts +1 -0
  133. package/dist/options/metadata.js +1 -0
  134. package/dist/options/mute.d.ts +1 -0
  135. package/dist/options/mute.js +1 -0
  136. package/dist/options/no-open.d.ts +1 -0
  137. package/dist/options/no-open.js +1 -0
  138. package/dist/options/number-of-gif-loops.d.ts +1 -0
  139. package/dist/options/number-of-gif-loops.js +1 -0
  140. package/dist/options/number-of-shared-audio-tags.d.ts +1 -0
  141. package/dist/options/number-of-shared-audio-tags.js +1 -0
  142. package/dist/options/offthreadvideo-cache-size.d.ts +1 -0
  143. package/dist/options/offthreadvideo-cache-size.js +1 -0
  144. package/dist/options/offthreadvideo-threads.d.ts +1 -0
  145. package/dist/options/offthreadvideo-threads.js +1 -0
  146. package/dist/options/on-browser-download.d.ts +1 -0
  147. package/dist/options/on-browser-download.js +1 -0
  148. package/dist/options/option.d.ts +1 -0
  149. package/dist/options/options-map.d.ts +140 -0
  150. package/dist/options/out-dir.d.ts +1 -0
  151. package/dist/options/out-dir.js +1 -0
  152. package/dist/options/override-duration.d.ts +1 -0
  153. package/dist/options/override-duration.js +1 -0
  154. package/dist/options/override-fps.d.ts +1 -0
  155. package/dist/options/override-fps.js +1 -0
  156. package/dist/options/override-height.d.ts +1 -0
  157. package/dist/options/override-height.js +1 -0
  158. package/dist/options/override-width.d.ts +1 -0
  159. package/dist/options/override-width.js +1 -0
  160. package/dist/options/overwrite.d.ts +1 -0
  161. package/dist/options/overwrite.js +1 -0
  162. package/dist/options/package-manager.d.ts +1 -0
  163. package/dist/options/package-manager.js +1 -0
  164. package/dist/options/pixel-format.d.ts +1 -0
  165. package/dist/options/pixel-format.js +1 -0
  166. package/dist/options/port.d.ts +1 -0
  167. package/dist/options/port.js +1 -0
  168. package/dist/options/prefer-lossless.d.ts +1 -0
  169. package/dist/options/prefer-lossless.js +1 -0
  170. package/dist/options/preview-sample-rate.d.ts +1 -0
  171. package/dist/options/preview-sample-rate.js +1 -0
  172. package/dist/options/props.d.ts +1 -0
  173. package/dist/options/props.js +1 -0
  174. package/dist/options/prores-profile.d.ts +1 -0
  175. package/dist/options/prores-profile.js +1 -0
  176. package/dist/options/public-dir.d.ts +1 -0
  177. package/dist/options/public-dir.js +1 -0
  178. package/dist/options/public-license-key.d.ts +1 -0
  179. package/dist/options/public-license-key.js +1 -0
  180. package/dist/options/public-path.d.ts +1 -0
  181. package/dist/options/public-path.js +1 -0
  182. package/dist/options/repro.d.ts +1 -0
  183. package/dist/options/repro.js +1 -0
  184. package/dist/options/rspack.d.ts +1 -0
  185. package/dist/options/rspack.js +1 -0
  186. package/dist/options/runs.d.ts +1 -0
  187. package/dist/options/runs.js +1 -0
  188. package/dist/options/sample-rate.d.ts +1 -0
  189. package/dist/options/sample-rate.js +1 -0
  190. package/dist/options/scale.d.ts +1 -0
  191. package/dist/options/scale.js +1 -0
  192. package/dist/options/separate-audio.d.ts +1 -0
  193. package/dist/options/separate-audio.js +2 -1
  194. package/dist/options/show-premounting.d.ts +19 -0
  195. package/dist/options/show-premounting.js +33 -0
  196. package/dist/options/skip-skills.d.ts +1 -0
  197. package/dist/options/skip-skills.js +1 -0
  198. package/dist/options/still-frame.d.ts +1 -0
  199. package/dist/options/still-frame.js +1 -0
  200. package/dist/options/still-image-format.d.ts +1 -0
  201. package/dist/options/still-image-format.js +1 -0
  202. package/dist/options/throw-if-site-exists.d.ts +1 -0
  203. package/dist/options/throw-if-site-exists.js +1 -0
  204. package/dist/options/timeout.d.ts +1 -0
  205. package/dist/options/timeout.js +1 -0
  206. package/dist/options/user-agent.d.ts +1 -0
  207. package/dist/options/user-agent.js +1 -0
  208. package/dist/options/version-flag.d.ts +1 -0
  209. package/dist/options/version-flag.js +1 -0
  210. package/dist/options/video-bitrate.d.ts +1 -0
  211. package/dist/options/video-bitrate.js +1 -0
  212. package/dist/options/video-cache-size.d.ts +1 -0
  213. package/dist/options/video-cache-size.js +1 -0
  214. package/dist/options/video-codec.d.ts +1 -0
  215. package/dist/options/video-codec.js +1 -0
  216. package/dist/options/video-image-format.d.ts +1 -0
  217. package/dist/options/video-image-format.js +1 -0
  218. package/dist/options/webhook-custom-data.d.ts +1 -0
  219. package/dist/options/webhook-custom-data.js +1 -0
  220. package/dist/options/webpack-poll.d.ts +1 -0
  221. package/dist/options/webpack-poll.js +1 -0
  222. package/dist/options/x264-preset.d.ts +1 -0
  223. package/dist/options/x264-preset.js +1 -0
  224. package/dist/prespawn-ffmpeg.js +10 -5
  225. package/package.json +13 -13
@@ -1,19 +1,23 @@
1
1
  import { createRequire } from "node:module";
2
2
  var __defProp = Object.defineProperty;
3
3
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
4
+ var __returnValue = (v) => v;
5
+ function __exportSetter(name, newValue) {
6
+ this[name] = __returnValue.bind(null, newValue);
7
+ }
4
8
  var __export = (target, all) => {
5
9
  for (var name in all)
6
10
  __defProp(target, name, {
7
11
  get: all[name],
8
12
  enumerable: true,
9
13
  configurable: true,
10
- set: (newValue) => all[name] = () => newValue
14
+ set: __exportSetter.bind(all, name)
11
15
  });
12
16
  };
13
17
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
18
 
15
19
  // vendor/yauzl-patched/pend.js
16
- var require_pend = __commonJS((exports, module) => {
20
+ var require_pend = __commonJS(function(exports, module) {
17
21
  module.exports = Pend;
18
22
  function Pend() {
19
23
  this.pending = 0;
@@ -67,23 +71,23 @@ var require_pend = __commonJS((exports, module) => {
67
71
  });
68
72
 
69
73
  // vendor/yauzl-patched/fd-slicer.js
70
- var require_fd_slicer = __commonJS((exports) => {
71
- var fs6 = __require("fs");
74
+ var require_fd_slicer = __commonJS(function(exports) {
75
+ var fs = __require("fs");
72
76
  var util = __require("util");
73
77
  var stream = __require("stream");
74
78
  var Readable = stream.Readable;
75
79
  var Writable = stream.Writable;
76
80
  var PassThrough = stream.PassThrough;
77
81
  var Pend = require_pend();
78
- var EventEmitter2 = __require("events").EventEmitter;
82
+ var EventEmitter = __require("events").EventEmitter;
79
83
  exports.createFromBuffer = createFromBuffer;
80
84
  exports.createFromFd = createFromFd;
81
85
  exports.BufferSlicer = BufferSlicer;
82
86
  exports.FdSlicer = FdSlicer;
83
- util.inherits(FdSlicer, EventEmitter2);
87
+ util.inherits(FdSlicer, EventEmitter);
84
88
  function FdSlicer(fd, options2) {
85
89
  options2 = options2 || {};
86
- EventEmitter2.call(this);
90
+ EventEmitter.call(this);
87
91
  this.fd = fd;
88
92
  this.pend = new Pend;
89
93
  this.pend.max = 1;
@@ -93,18 +97,18 @@ var require_fd_slicer = __commonJS((exports) => {
93
97
  FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
94
98
  var self = this;
95
99
  self.pend.go(function(cb) {
96
- fs6.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer2) {
100
+ fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {
97
101
  cb();
98
- callback(err, bytesRead, buffer2);
102
+ callback(err, bytesRead, buffer);
99
103
  });
100
104
  });
101
105
  };
102
106
  FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
103
107
  var self = this;
104
108
  self.pend.go(function(cb) {
105
- fs6.write(self.fd, buffer, offset, length, position, function(err, written, buffer2) {
109
+ fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer) {
106
110
  cb();
107
- callback(err, written, buffer2);
111
+ callback(err, written, buffer);
108
112
  });
109
113
  });
110
114
  };
@@ -125,7 +129,7 @@ var require_fd_slicer = __commonJS((exports) => {
125
129
  if (self.refCount < 0)
126
130
  throw new Error("invalid unref");
127
131
  if (self.autoClose) {
128
- fs6.close(self.fd, onCloseDone);
132
+ fs.close(self.fd, onCloseDone);
129
133
  }
130
134
  function onCloseDone(err) {
131
135
  if (err) {
@@ -164,7 +168,7 @@ var require_fd_slicer = __commonJS((exports) => {
164
168
  if (self._destroyed)
165
169
  return cb();
166
170
  var buffer = Buffer.allocUnsafe(toRead);
167
- fs6.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
171
+ fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
168
172
  if (self._destroyed)
169
173
  return cb();
170
174
  if (err) {
@@ -221,11 +225,11 @@ var require_fd_slicer = __commonJS((exports) => {
221
225
  self.context.pend.go(function(cb) {
222
226
  if (self._destroyed)
223
227
  return cb();
224
- fs6.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err2, bytes) {
225
- if (err2) {
228
+ fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) {
229
+ if (err) {
226
230
  self.destroy();
227
231
  cb();
228
- callback(err2);
232
+ callback(err);
229
233
  } else {
230
234
  self.bytesWritten += bytes;
231
235
  self.pos += bytes;
@@ -243,9 +247,9 @@ var require_fd_slicer = __commonJS((exports) => {
243
247
  }
244
248
  cb(err);
245
249
  };
246
- util.inherits(BufferSlicer, EventEmitter2);
250
+ util.inherits(BufferSlicer, EventEmitter);
247
251
  function BufferSlicer(buffer, options2) {
248
- EventEmitter2.call(this);
252
+ EventEmitter.call(this);
249
253
  options2 = options2 || {};
250
254
  this.refCount = 0;
251
255
  this.buffer = buffer;
@@ -356,7 +360,7 @@ var require_fd_slicer = __commonJS((exports) => {
356
360
  });
357
361
 
358
362
  // vendor/yauzl-patched/buffer-crc32.js
359
- var require_buffer_crc32 = __commonJS((exports, module) => {
363
+ var require_buffer_crc32 = __commonJS(function(exports, module) {
360
364
  var Buffer2 = __require("buffer").Buffer;
361
365
  var CRC_TABLE = [
362
366
  0,
@@ -660,6 +664,14 @@ var require_buffer_crc32 = __commonJS((exports, module) => {
660
664
  module.exports = crc32;
661
665
  });
662
666
 
667
+ // src/perf.ts
668
+ var exports_perf = {};
669
+ __export(exports_perf, {
670
+ getPerf: () => getPerf,
671
+ startPerfMeasure: () => startPerfMeasure,
672
+ stopPerfMeasure: () => stopPerfMeasure
673
+ });
674
+
663
675
  // src/index.ts
664
676
  import execa2 from "execa";
665
677
 
@@ -2320,7 +2332,7 @@ class ExecutionContext {
2320
2332
  returnByValue,
2321
2333
  awaitPromise: true,
2322
2334
  userGesture: true
2323
- }).catch(rewriteError2);
2335
+ }).catch(rewriteError);
2324
2336
  if (_details) {
2325
2337
  throw new Error("Evaluation failed: " + getExceptionMessage(_details));
2326
2338
  }
@@ -2364,7 +2376,7 @@ class ExecutionContext {
2364
2376
  }
2365
2377
  const {
2366
2378
  value: { exceptionDetails, result: remoteObject }
2367
- } = await callFunctionOnPromise.catch(rewriteError2);
2379
+ } = await callFunctionOnPromise.catch(rewriteError);
2368
2380
  if (exceptionDetails) {
2369
2381
  throw new Error("Evaluation failed: " + getExceptionMessage(exceptionDetails));
2370
2382
  }
@@ -2405,7 +2417,7 @@ class ExecutionContext {
2405
2417
  }
2406
2418
  return { value: arg };
2407
2419
  }
2408
- function rewriteError2(error) {
2420
+ function rewriteError(error) {
2409
2421
  if (error.message.includes("Object reference chain is too long")) {
2410
2422
  return { value: { result: { type: "undefined" } }, size: 1 };
2411
2423
  }
@@ -3503,6 +3515,9 @@ class Page extends EventEmitter {
3503
3515
  type: log.type
3504
3516
  });
3505
3517
  if (url?.endsWith(NoReactInternals2.bundleName) && lineNumber && this.sourceMapGetter()) {
3518
+ if (!isEqualOrBelowLogLevel(logLevel, log.logLevel)) {
3519
+ return;
3520
+ }
3506
3521
  const origPosition = this.sourceMapGetter()?.originalPositionFor({
3507
3522
  column: columnNumber ?? 0,
3508
3523
  line: lineNumber
@@ -3797,11 +3812,11 @@ var resolveSetprivPathOnLinux = () => {
3797
3812
  return null;
3798
3813
  }
3799
3814
  try {
3800
- const path4 = execSync2("command -v setpriv 2>/dev/null", {
3815
+ const path = execSync2("command -v setpriv 2>/dev/null", {
3801
3816
  encoding: "utf8",
3802
3817
  stdio: ["ignore", "pipe", "ignore"]
3803
3818
  }).trim();
3804
- cachedSetprivPath = path4 ? path4 : null;
3819
+ cachedSetprivPath = path ? path : null;
3805
3820
  } catch {
3806
3821
  cachedSetprivPath = null;
3807
3822
  }
@@ -3855,8 +3870,8 @@ class NodeWebSocketTransport {
3855
3870
  websocket;
3856
3871
  onmessage;
3857
3872
  onclose;
3858
- constructor(ws2) {
3859
- this.websocket = ws2;
3873
+ constructor(ws) {
3874
+ this.websocket = ws;
3860
3875
  this.websocket.addEventListener("message", (event) => {
3861
3876
  if (this.onmessage) {
3862
3877
  this.onmessage.call(null, event.data);
@@ -3887,8 +3902,8 @@ class NodeWebSocketTransport {
3887
3902
 
3888
3903
  // src/browser/parse-browser-log-message.ts
3889
3904
  var parseBrowserLogMessage = (input) => {
3890
- const format2 = /^\[([0-9]{4})\/([0-9]{6})\.([0-9]{6}):([A-Z]+):(.*?)(?:\(([0-9]+)\)|:([0-9]+))\](.*)/;
3891
- const match = input.match(format2);
3905
+ const format = /^\[([0-9]{4})\/([0-9]{6})\.([0-9]{6}):([A-Z]+):(.*?)(?:\(([0-9]+)\)|:([0-9]+))\](.*)/;
3906
+ const match = input.match(format);
3892
3907
  if (!match) {
3893
3908
  return null;
3894
3909
  }
@@ -4550,28 +4565,39 @@ import execa from "execa";
4550
4565
 
4551
4566
  // src/compositor/get-executable-path.ts
4552
4567
  import path4 from "path";
4553
- var warned = false;
4568
+ var cachedIsMusl = null;
4554
4569
  function isMusl({
4555
4570
  indent,
4556
4571
  logLevel
4557
4572
  }) {
4573
+ if (cachedIsMusl !== null) {
4574
+ return cachedIsMusl;
4575
+ }
4558
4576
  if (!process.report && typeof Bun !== "undefined") {
4559
- if (!warned) {
4560
- Log.warn({ indent, logLevel }, "Bun limitation: Could not determine if your Linux is using musl or glibc. Assuming glibc.");
4561
- }
4562
- warned = true;
4563
- return false;
4577
+ Log.warn({ indent, logLevel }, "Bun limitation: Could not determine if your Linux is using musl or glibc. Assuming glibc.");
4578
+ cachedIsMusl = false;
4579
+ return cachedIsMusl;
4564
4580
  }
4565
- const report = process.report?.getReport();
4566
- if (report && typeof report === "string") {
4567
- if (!warned) {
4581
+ const processReport = process.report;
4582
+ const excludeNetwork = processReport && "excludeNetwork" in processReport ? processReport.excludeNetwork : null;
4583
+ try {
4584
+ if (processReport && "excludeNetwork" in processReport) {
4585
+ processReport.excludeNetwork = true;
4586
+ }
4587
+ const report = processReport?.getReport();
4588
+ if (report && typeof report === "string") {
4568
4589
  Log.warn({ indent, logLevel }, "Bun limitation: Could not determine if your Windows is using musl or glibc. Assuming glibc.");
4590
+ cachedIsMusl = false;
4591
+ return cachedIsMusl;
4592
+ }
4593
+ const { glibcVersionRuntime } = report.header;
4594
+ cachedIsMusl = !glibcVersionRuntime;
4595
+ return cachedIsMusl;
4596
+ } finally {
4597
+ if (processReport && "excludeNetwork" in processReport) {
4598
+ processReport.excludeNetwork = excludeNetwork;
4569
4599
  }
4570
- warned = true;
4571
- return false;
4572
4600
  }
4573
- const { glibcVersionRuntime } = report.header;
4574
- return !glibcVersionRuntime;
4575
4601
  }
4576
4602
  var getExecutablePath = ({
4577
4603
  indent,
@@ -4676,10 +4702,10 @@ var hasPermissions = (p) => {
4676
4702
  const canExecute = isOwner && ownerHasExecutePermission || isGroup && groupHasExecutePermission;
4677
4703
  return canExecute;
4678
4704
  };
4679
- var makeFileExecutableIfItIsNot = (path5) => {
4680
- const hasPermissionsResult = hasPermissions(path5);
4705
+ var makeFileExecutableIfItIsNot = (path) => {
4706
+ const hasPermissionsResult = hasPermissions(path);
4681
4707
  if (!hasPermissionsResult) {
4682
- chmodSync(path5, 493);
4708
+ chmodSync(path, 493);
4683
4709
  }
4684
4710
  };
4685
4711
 
@@ -5652,7 +5678,7 @@ var Transform = __require("stream").Transform;
5652
5678
  var PassThrough = __require("stream").PassThrough;
5653
5679
  var Writable = __require("stream").Writable;
5654
5680
  var $open = open;
5655
- function open(path7, options2, callback) {
5681
+ function open(path, options2, callback) {
5656
5682
  if (typeof options2 === "function") {
5657
5683
  callback = options2;
5658
5684
  options2 = null;
@@ -5671,13 +5697,13 @@ function open(path7, options2, callback) {
5671
5697
  options2.strictFileNames = false;
5672
5698
  if (callback == null)
5673
5699
  callback = defaultCallback;
5674
- fs6.open(path7, "r", function(err, fd) {
5700
+ fs6.open(path, "r", function(err, fd) {
5675
5701
  if (err)
5676
5702
  return callback(err);
5677
- fromFd(fd, options2, function(err2, zipfile) {
5678
- if (err2)
5703
+ fromFd(fd, options2, function(err, zipfile) {
5704
+ if (err)
5679
5705
  fs6.close(fd, defaultCallback);
5680
- callback(err2, zipfile);
5706
+ callback(err, zipfile);
5681
5707
  });
5682
5708
  });
5683
5709
  }
@@ -5759,9 +5785,9 @@ function fromRandomAccessReader(reader, totalSize, options2, callback) {
5759
5785
  var zip64EocdlBuffer = buffer.subarray(i - zip64EocdlSize, i - zip64EocdlSize + zip64EocdlSize);
5760
5786
  var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8);
5761
5787
  var zip64EocdrBuffer = newBuffer(56);
5762
- return readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err2) {
5763
- if (err2)
5764
- return callback(err2);
5788
+ return readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err) {
5789
+ if (err)
5790
+ return callback(err);
5765
5791
  if (zip64EocdrBuffer.readUInt32LE(0) !== 101075792) {
5766
5792
  return callback(new Error("invalid zip64 end of central directory record signature"));
5767
5793
  }
@@ -5873,9 +5899,9 @@ ZipFile.prototype._readEntry = function() {
5873
5899
  return emitErrorAndAutoClose(self, new Error("strong encryption is not supported"));
5874
5900
  self.readEntryCursor += 46;
5875
5901
  buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength);
5876
- readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err2) {
5877
- if (err2)
5878
- return emitErrorAndAutoClose(self, err2);
5902
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {
5903
+ if (err)
5904
+ return emitErrorAndAutoClose(self, err);
5879
5905
  if (self.emittedError)
5880
5906
  return;
5881
5907
  entry.fileNameRaw = buffer.subarray(0, entry.fileNameLength);
@@ -5884,8 +5910,8 @@ ZipFile.prototype._readEntry = function() {
5884
5910
  entry.fileCommentRaw = buffer.subarray(fileCommentStart, fileCommentStart + entry.fileCommentLength);
5885
5911
  try {
5886
5912
  entry.extraFields = parseExtraFields(entry.extraFieldRaw);
5887
- } catch (err3) {
5888
- return emitErrorAndAutoClose(self, err3);
5913
+ } catch (err) {
5914
+ return emitErrorAndAutoClose(self, err);
5889
5915
  }
5890
5916
  if (self.decodeStrings) {
5891
5917
  var isUtf8 = (entry.generalPurposeBitFlag & 2048) !== 0;
@@ -6109,10 +6135,10 @@ ZipFile.prototype.readLocalFileHeader = function(entry, options2, callback) {
6109
6135
  localFileHeader.extraFieldLength = extraFieldLength;
6110
6136
  buffer = newBuffer(fileNameLength + extraFieldLength);
6111
6137
  self.reader.ref();
6112
- readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader + 30, function(err2) {
6138
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader + 30, function(err) {
6113
6139
  try {
6114
- if (err2)
6115
- return callback(err2);
6140
+ if (err)
6141
+ return callback(err);
6116
6142
  localFileHeader.fileName = buffer.subarray(0, fileNameLength);
6117
6143
  localFileHeader.extraField = buffer.subarray(fileNameLength);
6118
6144
  return callback(null, localFileHeader);
@@ -6564,13 +6590,13 @@ var getGlibcVersion = () => {
6564
6590
  }
6565
6591
  return [Number(split[0]), Number(split[1])];
6566
6592
  };
6567
- var isGlibcVersionAtLeast = (required2) => {
6593
+ var isGlibcVersionAtLeast = (required) => {
6568
6594
  const version = getGlibcVersion();
6569
6595
  if (version === null) {
6570
6596
  return false;
6571
6597
  }
6572
6598
  const [major, minor] = version;
6573
- const [reqMajor, reqMinor] = required2;
6599
+ const [reqMajor, reqMinor] = required;
6574
6600
  if (major > reqMajor) {
6575
6601
  return true;
6576
6602
  }
@@ -6586,20 +6612,20 @@ var canUseRemotionMediaBinaries = () => {
6586
6612
  return isGlibcVersionAtLeast(MINIMUM_GLIBC_FOR_REMOTION_MEDIA);
6587
6613
  };
6588
6614
  function getChromeDownloadUrl({
6589
- platform: platform2,
6615
+ platform,
6590
6616
  version,
6591
6617
  chromeMode
6592
6618
  }) {
6593
- if (platform2 === "linux-arm64" && version && /^\d+$/.test(version)) {
6594
- const archive2 = chromeMode === "chrome-for-testing" ? "chromium-linux-arm64" : "chromium-headless-shell-linux-arm64";
6595
- return `https://playwright.azureedge.net/builds/chromium/${version}/${archive2}.zip`;
6619
+ if (platform === "linux-arm64" && version && /^\d+$/.test(version)) {
6620
+ const archive = chromeMode === "chrome-for-testing" ? "chromium-linux-arm64" : "chromium-headless-shell-linux-arm64";
6621
+ return `https://playwright.azureedge.net/builds/chromium/${version}/${archive}.zip`;
6596
6622
  }
6597
6623
  if (chromeMode === "headless-shell" && version === null) {
6598
- if (platform2 === "mac-arm64") {
6624
+ if (platform === "mac-arm64") {
6599
6625
  return `https://remotion.media/chromium-headless-shell-mac-arm64-${TESTED_VERSION}.zip?clear`;
6600
6626
  }
6601
- if (platform2 === "linux64" || platform2 === "linux-arm64") {
6602
- const architecture = platform2 === "linux64" ? "x64" : "arm64";
6627
+ if (platform === "linux64" || platform === "linux-arm64") {
6628
+ const architecture = platform === "linux64" ? "x64" : "arm64";
6603
6629
  if (isAmazonLinux2023()) {
6604
6630
  return `https://remotion.media/chromium-headless-shell-amazon-linux-${architecture}-${TESTED_VERSION}.zip?clear`;
6605
6631
  }
@@ -6609,7 +6635,7 @@ function getChromeDownloadUrl({
6609
6635
  }
6610
6636
  }
6611
6637
  const archive = chromeMode === "headless-shell" ? "chrome-headless-shell" : "chrome";
6612
- return `https://storage.googleapis.com/chrome-for-testing-public/${version ?? TESTED_VERSION}/${platform2}/${archive}-${platform2}.zip`;
6638
+ return `https://storage.googleapis.com/chrome-for-testing-public/${version ?? TESTED_VERSION}/${platform}/${archive}-${platform}.zip`;
6613
6639
  }
6614
6640
  var logDownloadUrl = ({
6615
6641
  url,
@@ -6654,15 +6680,15 @@ var getDownloadsCacheDir = () => {
6654
6680
  var mkdirAsync = fs9.promises.mkdir;
6655
6681
  var unlinkAsync = promisify2(fs9.unlink.bind(fs9));
6656
6682
  function existsAsync(filePath) {
6657
- return new Promise((resolve2) => {
6683
+ return new Promise((resolve) => {
6658
6684
  fs9.access(filePath, (err) => {
6659
- return resolve2(!err);
6685
+ return resolve(!err);
6660
6686
  });
6661
6687
  });
6662
6688
  }
6663
6689
  var getPlatform = () => {
6664
- const platform3 = os5.platform();
6665
- switch (platform3) {
6690
+ const platform = os5.platform();
6691
+ switch (platform) {
6666
6692
  case "darwin":
6667
6693
  return os5.arch() === "arm64" ? "mac-arm64" : "mac-x64";
6668
6694
  case "linux":
@@ -6670,7 +6696,7 @@ var getPlatform = () => {
6670
6696
  case "win32":
6671
6697
  return "win64";
6672
6698
  default:
6673
- throw new Error("Unsupported platform: " + platform3);
6699
+ throw new Error("Unsupported platform: " + platform);
6674
6700
  }
6675
6701
  };
6676
6702
  var getDownloadsFolder = (chromeMode) => {
@@ -6684,13 +6710,13 @@ var getVersionFilePath = (chromeMode) => {
6684
6710
  var getExpectedVersion = ({
6685
6711
  version,
6686
6712
  chromeMode,
6687
- platform: platform3
6713
+ platform
6688
6714
  }) => {
6689
6715
  if (version) {
6690
6716
  return version;
6691
6717
  }
6692
6718
  const downloadUrl = getChromeDownloadUrl({
6693
- platform: platform3,
6719
+ platform,
6694
6720
  version: null,
6695
6721
  chromeMode
6696
6722
  });
@@ -6718,16 +6744,16 @@ var downloadBrowser = async ({
6718
6744
  version,
6719
6745
  chromeMode
6720
6746
  }) => {
6721
- const platform3 = getPlatform();
6722
- const downloadURL = getChromeDownloadUrl({ platform: platform3, version, chromeMode });
6747
+ const platform = getPlatform();
6748
+ const downloadURL = getChromeDownloadUrl({ platform, version, chromeMode });
6723
6749
  const fileName = downloadURL.split("/").pop();
6724
6750
  if (!fileName) {
6725
6751
  throw new Error(`A malformed download URL was found: ${downloadURL}.`);
6726
6752
  }
6727
6753
  const downloadsFolder = getDownloadsFolder(chromeMode);
6728
6754
  const archivePath = path9.join(downloadsFolder, fileName);
6729
- const outputPath = getFolderPath(downloadsFolder, platform3);
6730
- const expectedVersion = getExpectedVersion({ version, chromeMode, platform: platform3 });
6755
+ const outputPath = getFolderPath(downloadsFolder, platform);
6756
+ const expectedVersion = getExpectedVersion({ version, chromeMode, platform });
6731
6757
  if (await existsAsync(outputPath)) {
6732
6758
  const installedVersion = readVersionFile(chromeMode);
6733
6759
  if (installedVersion === expectedVersion) {
@@ -6789,7 +6815,7 @@ var downloadBrowser = async ({
6789
6815
  fs9.renameSync(chromePath, chromeHeadlessShellPath);
6790
6816
  }
6791
6817
  if (fs9.existsSync(chromeLinuxFolder)) {
6792
- const targetFolder = path9.join(outputPath, (chromeMode === "headless-shell" ? "chrome-headless-shell-" : "chrome-") + platform3);
6818
+ const targetFolder = path9.join(outputPath, (chromeMode === "headless-shell" ? "chrome-headless-shell-" : "chrome-") + platform);
6793
6819
  if (chromeLinuxFolder !== targetFolder) {
6794
6820
  fs9.renameSync(chromeLinuxFolder, targetFolder);
6795
6821
  }
@@ -6810,41 +6836,41 @@ var downloadBrowser = async ({
6810
6836
  await releaseLock();
6811
6837
  }
6812
6838
  };
6813
- var getFolderPath = (downloadsFolder, platform3) => {
6814
- return path9.resolve(downloadsFolder, platform3);
6839
+ var getFolderPath = (downloadsFolder, platform) => {
6840
+ return path9.resolve(downloadsFolder, platform);
6815
6841
  };
6816
6842
  var getExecutablePath2 = (chromeMode) => {
6817
6843
  const downloadsFolder = getDownloadsFolder(chromeMode);
6818
- const platform3 = getPlatform();
6819
- const folderPath = getFolderPath(downloadsFolder, platform3);
6844
+ const platform = getPlatform();
6845
+ const folderPath = getFolderPath(downloadsFolder, platform);
6820
6846
  if (chromeMode === "chrome-for-testing") {
6821
- if (platform3 === "mac-arm64" || platform3 === "mac-x64") {
6822
- return path9.join(folderPath, `chrome-${platform3}`, "Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing");
6847
+ if (platform === "mac-arm64" || platform === "mac-x64") {
6848
+ return path9.join(folderPath, `chrome-${platform}`, "Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing");
6823
6849
  }
6824
- if (platform3 === "win64") {
6850
+ if (platform === "win64") {
6825
6851
  return path9.join(folderPath, "chrome-win64", "chrome.exe");
6826
6852
  }
6827
- if (platform3 === "linux64" || platform3 === "linux-arm64") {
6828
- return path9.join(folderPath, `chrome-${platform3}`, "chrome");
6853
+ if (platform === "linux64" || platform === "linux-arm64") {
6854
+ return path9.join(folderPath, `chrome-${platform}`, "chrome");
6829
6855
  }
6830
- throw new Error("unsupported platform" + platform3);
6856
+ throw new Error("unsupported platform" + platform);
6831
6857
  }
6832
6858
  if (chromeMode === "headless-shell") {
6833
- const shellFolder = path9.join(folderPath, `chrome-headless-shell-${platform3}`);
6859
+ const shellFolder = path9.join(folderPath, `chrome-headless-shell-${platform}`);
6834
6860
  const remotionExecutable = path9.join(shellFolder, "headless_shell");
6835
6861
  if (fs9.existsSync(remotionExecutable)) {
6836
6862
  return remotionExecutable;
6837
6863
  }
6838
- return path9.join(shellFolder, platform3 === "win64" ? "chrome-headless-shell.exe" : "chrome-headless-shell");
6864
+ return path9.join(shellFolder, platform === "win64" ? "chrome-headless-shell.exe" : "chrome-headless-shell");
6839
6865
  }
6840
6866
  throw new Error("unsupported chrome mode" + chromeMode);
6841
6867
  };
6842
6868
  var getRevisionInfo = (chromeMode) => {
6843
6869
  const executablePath = getExecutablePath2(chromeMode);
6844
6870
  const downloadsFolder = getDownloadsFolder(chromeMode);
6845
- const platform3 = getPlatform();
6846
- const folderPath = getFolderPath(downloadsFolder, platform3);
6847
- const url = getChromeDownloadUrl({ platform: platform3, version: null, chromeMode });
6871
+ const platform = getPlatform();
6872
+ const folderPath = getFolderPath(downloadsFolder, platform);
6873
+ const url = getChromeDownloadUrl({ platform, version: null, chromeMode });
6848
6874
  const local = fs9.existsSync(folderPath);
6849
6875
  return {
6850
6876
  executablePath,
@@ -7196,18 +7222,18 @@ var getAvailableMemory = (logLevel) => {
7196
7222
  // src/get-video-threads-flag.ts
7197
7223
  var MEMORY_USAGE_PER_THREAD = 400000000;
7198
7224
  var RESERVED_MEMORY = 2000000000;
7225
+ var MAX_VIDEO_THREADS = 16;
7199
7226
  var getIdealVideoThreadsFlag = (logLevel) => {
7200
7227
  const freeMemory = getAvailableMemory(logLevel);
7201
7228
  const cpus = getCpuCount();
7202
7229
  const maxRecommendedBasedOnCpus = cpus * 2 / 3;
7203
7230
  const maxRecommendedBasedOnMemory = (freeMemory - RESERVED_MEMORY) / MEMORY_USAGE_PER_THREAD;
7204
- const maxRecommended = Math.min(maxRecommendedBasedOnCpus, maxRecommendedBasedOnMemory);
7231
+ const maxRecommended = Math.min(maxRecommendedBasedOnCpus, maxRecommendedBasedOnMemory, MAX_VIDEO_THREADS);
7205
7232
  return Math.max(1, Math.round(maxRecommended));
7206
7233
  };
7207
7234
 
7208
7235
  // src/options/gl.tsx
7209
7236
  import { NoReactInternals as NoReactInternals7 } from "remotion/no-react";
7210
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
7211
7237
  var validOpenGlRenderers = [
7212
7238
  "swangle",
7213
7239
  "angle",
@@ -7481,7 +7507,6 @@ var getPageAndCleanupFn = async ({
7481
7507
  };
7482
7508
 
7483
7509
  // src/options/offthreadvideo-threads.tsx
7484
- import { jsx as jsx2, jsxs as jsxs2, Fragment as Fragment2 } from "react/jsx-runtime";
7485
7510
  var DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS = 2;
7486
7511
 
7487
7512
  // src/prepare-server.ts
@@ -16157,11 +16182,11 @@ populateMaps(extensions, {});
16157
16182
  var getExt = (contentType) => {
16158
16183
  return mimeDb[contentType.toLowerCase()]?.extensions?.[0] ?? null;
16159
16184
  };
16160
- function mimeLookup(path11) {
16161
- if (!path11 || typeof path11 !== "string") {
16185
+ function mimeLookup(path) {
16186
+ if (!path || typeof path !== "string") {
16162
16187
  return false;
16163
16188
  }
16164
- const ext = extname("." + path11).toLowerCase().substr(1);
16189
+ const ext = extname("." + path).toLowerCase().substr(1);
16165
16190
  if (!ext) {
16166
16191
  return false;
16167
16192
  }
@@ -16231,17 +16256,17 @@ var pLimit = (concurrency) => {
16231
16256
  queue.shift()?.();
16232
16257
  }
16233
16258
  };
16234
- const run = async (fn, resolve2, ...args) => {
16259
+ const run = async (fn, resolve, ...args) => {
16235
16260
  activeCount++;
16236
16261
  const result = (async () => fn(...args))();
16237
- resolve2(result);
16262
+ resolve(result);
16238
16263
  try {
16239
16264
  await result;
16240
16265
  } catch {}
16241
16266
  next();
16242
16267
  };
16243
- const enqueue = (fn, resolve2, ...args) => {
16244
- queue.push(() => run(fn, resolve2, ...args));
16268
+ const enqueue = (fn, resolve, ...args) => {
16269
+ queue.push(() => run(fn, resolve, ...args));
16245
16270
  (async () => {
16246
16271
  await Promise.resolve();
16247
16272
  if (activeCount < concurrency && queue.length > 0) {
@@ -16249,8 +16274,8 @@ var pLimit = (concurrency) => {
16249
16274
  }
16250
16275
  })();
16251
16276
  };
16252
- const generator = (fn, ...args) => new Promise((resolve2) => {
16253
- enqueue(fn, resolve2, ...args);
16277
+ const generator = (fn, ...args) => new Promise((resolve) => {
16278
+ enqueue(fn, resolve, ...args);
16254
16279
  });
16255
16280
  Object.defineProperties(generator, {
16256
16281
  activeCount: {
@@ -16439,13 +16464,13 @@ var waitForAssetToBeDownloaded = ({
16439
16464
  if (!downloadMap.listeners[src][downloadDir]) {
16440
16465
  downloadMap.listeners[src][downloadDir] = [];
16441
16466
  }
16442
- return new Promise((resolve2) => {
16467
+ return new Promise((resolve) => {
16443
16468
  downloadMap.listeners[src][downloadDir].push(() => {
16444
16469
  const srcMap = downloadMap.hasBeenDownloadedMap[src];
16445
16470
  if (!srcMap?.[downloadDir]) {
16446
16471
  throw new Error("Expected file for " + src + "to be available in " + downloadDir);
16447
16472
  }
16448
- resolve2(srcMap[downloadDir]);
16473
+ resolve(srcMap[downloadDir]);
16449
16474
  });
16450
16475
  });
16451
16476
  };
@@ -16867,13 +16892,13 @@ ${parsed.backtrace}`));
16867
16892
  child.stderr.on("data", (data) => {
16868
16893
  stderrChunks.push(data);
16869
16894
  });
16870
- let resolve2 = null;
16895
+ let resolve = null;
16871
16896
  let reject = null;
16872
16897
  child.on("close", (code, signal) => {
16873
16898
  const waitersToKill = Array.from(waiters.values());
16874
16899
  if (code === 0) {
16875
16900
  runningStatus = { type: "quit-without-error", signal };
16876
- resolve2?.();
16901
+ resolve?.();
16877
16902
  for (const waiter of waitersToKill) {
16878
16903
  waiter.reject(new Error(`Compositor quit${signal ? ` with signal ${signal}` : ""}`));
16879
16904
  }
@@ -16902,7 +16927,7 @@ ${parsed.backtrace}`));
16902
16927
  rej(new Error(`Compositor quit${runningStatus.signal ? ` with signal ${runningStatus.signal}` : ""}: ${runningStatus.error}`));
16903
16928
  return;
16904
16929
  }
16905
- resolve2 = res;
16930
+ resolve = res;
16906
16931
  reject = rej;
16907
16932
  });
16908
16933
  };
@@ -16982,7 +17007,6 @@ ${parsed.backtrace}`));
16982
17007
  };
16983
17008
 
16984
17009
  // src/options/offthreadvideo-cache-size.tsx
16985
- import { jsx as jsx3, jsxs as jsxs3, Fragment as Fragment3 } from "react/jsx-runtime";
16986
17010
  var validateOffthreadVideoCacheSizeInBytes = (option) => {
16987
17011
  if (option === undefined || option === null) {
16988
17012
  return;
@@ -17088,7 +17112,7 @@ var startOffthreadVideoServer = ({
17088
17112
  shouldAnalyzeAudioImmediately: true,
17089
17113
  audioStreamIndex: undefined
17090
17114
  }).then((to) => {
17091
- return new Promise((resolve2, reject) => {
17115
+ return new Promise((resolve, reject) => {
17092
17116
  if (closed) {
17093
17117
  reject(Error(REQUEST_CLOSED_TOKEN));
17094
17118
  return;
@@ -17100,10 +17124,10 @@ var startOffthreadVideoServer = ({
17100
17124
  time,
17101
17125
  transparent,
17102
17126
  tone_mapped: toneMapped
17103
- }).then(resolve2).catch(reject);
17127
+ }).then(resolve).catch(reject);
17104
17128
  });
17105
17129
  }).then((readable) => {
17106
- return new Promise((resolve2, reject) => {
17130
+ return new Promise((resolve, reject) => {
17107
17131
  if (closed) {
17108
17132
  reject(Error(REQUEST_CLOSED_TOKEN));
17109
17133
  return;
@@ -17138,7 +17162,7 @@ var startOffthreadVideoServer = ({
17138
17162
  if (err) {
17139
17163
  reject(err);
17140
17164
  } else {
17141
- resolve2();
17165
+ resolve();
17142
17166
  }
17143
17167
  });
17144
17168
  });
@@ -17519,9 +17543,9 @@ var createLock = ({ timeout }) => {
17519
17543
  }
17520
17544
  };
17521
17545
  const waitForAllToBeDone = () => {
17522
- const success = new Promise((resolve2) => {
17546
+ const success = new Promise((resolve) => {
17523
17547
  waiters.push(() => {
17524
- resolve2();
17548
+ resolve();
17525
17549
  });
17526
17550
  });
17527
17551
  resolveWaiters();
@@ -17531,9 +17555,9 @@ var createLock = ({ timeout }) => {
17531
17555
  if (timeout === null) {
17532
17556
  return success;
17533
17557
  }
17534
- const timeoutFn = new Promise((resolve2) => {
17558
+ const timeoutFn = new Promise((resolve) => {
17535
17559
  setTimeout(() => {
17536
- return resolve2();
17560
+ return resolve();
17537
17561
  }, timeout);
17538
17562
  });
17539
17563
  return Promise.race([success, timeoutFn]);
@@ -17550,15 +17574,15 @@ var isPortAvailableOnHost = ({
17550
17574
  portToTry,
17551
17575
  host
17552
17576
  }) => {
17553
- return new Promise((resolve2) => {
17577
+ return new Promise((resolve) => {
17554
17578
  const server = net.createServer();
17555
17579
  server.unref();
17556
17580
  server.on("error", () => {
17557
- resolve2("unavailable");
17581
+ resolve("unavailable");
17558
17582
  });
17559
17583
  server.listen({ port: portToTry, host }, () => {
17560
17584
  server.close(() => {
17561
- resolve2("available");
17585
+ resolve("available");
17562
17586
  });
17563
17587
  });
17564
17588
  });
@@ -17957,7 +17981,7 @@ var serveHandler = async (request, response, config) => {
17957
17981
  };
17958
17982
 
17959
17983
  // src/serve-static.ts
17960
- var serveStatic = async (path20, options2) => {
17984
+ var serveStatic = async (path, options2) => {
17961
17985
  const {
17962
17986
  listener: offthreadRequest,
17963
17987
  close: closeCompositor,
@@ -17975,13 +17999,13 @@ var serveStatic = async (path20, options2) => {
17975
17999
  if (request.url?.startsWith("/proxy")) {
17976
18000
  return offthreadRequest(request, response);
17977
18001
  }
17978
- if (path20 === null) {
18002
+ if (path === null) {
17979
18003
  response.writeHead(404);
17980
18004
  response.end("Server only supports /proxy");
17981
18005
  return;
17982
18006
  }
17983
18007
  serveHandler(request, response, {
17984
- public: path20
18008
+ public: path
17985
18009
  }).catch(() => {
17986
18010
  if (!response.headersSent) {
17987
18011
  response.writeHead(500);
@@ -18007,7 +18031,7 @@ var serveStatic = async (path20, options2) => {
18007
18031
  for (let i = 0;i < maxTries; i++) {
18008
18032
  let unlock = () => {};
18009
18033
  try {
18010
- selectedPort = await new Promise((resolve2, reject) => {
18034
+ selectedPort = await new Promise((resolve, reject) => {
18011
18035
  getDesiredPort({
18012
18036
  desiredPort: options2?.port ?? undefined,
18013
18037
  from: 3000,
@@ -18017,7 +18041,7 @@ var serveStatic = async (path20, options2) => {
18017
18041
  unlock = unlockPort;
18018
18042
  server.listen({ port, host: portConfig.host });
18019
18043
  server.on("listening", () => {
18020
- resolve2(port);
18044
+ resolve(port);
18021
18045
  return unlock();
18022
18046
  });
18023
18047
  server.on("error", (err) => {
@@ -18035,27 +18059,27 @@ var serveStatic = async (path20, options2) => {
18035
18059
  };
18036
18060
  const close = async () => {
18037
18061
  await Promise.all([
18038
- new Promise((resolve2, reject) => {
18062
+ new Promise((resolve, reject) => {
18039
18063
  closeCompositor().catch((err) => {
18040
18064
  if (err.message.includes("Compositor quit")) {
18041
- resolve2();
18065
+ resolve();
18042
18066
  return;
18043
18067
  }
18044
18068
  reject(err);
18045
18069
  }).finally(() => {
18046
- resolve2();
18070
+ resolve();
18047
18071
  });
18048
18072
  }),
18049
- new Promise((resolve2, reject) => {
18073
+ new Promise((resolve, reject) => {
18050
18074
  destroyConnections();
18051
18075
  server.close((err) => {
18052
18076
  if (err) {
18053
18077
  if (err.code === "ERR_SERVER_NOT_RUNNING") {
18054
- return resolve2();
18078
+ return resolve();
18055
18079
  }
18056
18080
  reject(err);
18057
18081
  } else {
18058
- resolve2();
18082
+ resolve();
18059
18083
  }
18060
18084
  });
18061
18085
  })
@@ -18396,7 +18420,7 @@ var waitForReady = ({
18396
18420
  });
18397
18421
  });
18398
18422
  };
18399
- const waitForReadyProm = new Promise((resolve2, reject) => {
18423
+ const waitForReadyProm = new Promise((resolve, reject) => {
18400
18424
  const waitTask = page.mainFrame()._mainWorld.waitForFunction({
18401
18425
  browser: page.browser,
18402
18426
  timeout: timeoutInMilliseconds + 3000,
@@ -18412,7 +18436,7 @@ var waitForReady = ({
18412
18436
  return retrieveCancelledErrorAndReject();
18413
18437
  }
18414
18438
  if (token === readyToken) {
18415
- return resolve2(a);
18439
+ return resolve(a);
18416
18440
  }
18417
18441
  reject(new Error("Unexpected token " + token));
18418
18442
  }).catch((err) => {
@@ -18611,9 +18635,9 @@ var innerSetPropsAndEnv = async ({
18611
18635
  };
18612
18636
  }, serializedInputPropsWithCustomSchema, initialFrame, proxyPort, audioEnabled, videoEnabled, logLevel);
18613
18637
  const retry = async () => {
18614
- await new Promise((resolve2) => {
18638
+ await new Promise((resolve) => {
18615
18639
  setTimeout(() => {
18616
- resolve2();
18640
+ resolve();
18617
18641
  }, 2000);
18618
18642
  });
18619
18643
  return innerSetPropsAndEnv({
@@ -19030,7 +19054,7 @@ var internalGetCompositionsRaw = async ({
19030
19054
  onLog
19031
19055
  });
19032
19056
  const cleanup = [cleanupPage];
19033
- return new Promise((resolve2, reject) => {
19057
+ return new Promise((resolve, reject) => {
19034
19058
  const onError = (err) => reject(err);
19035
19059
  cleanup.push(handleJavascriptException({
19036
19060
  page,
@@ -19075,7 +19099,7 @@ var internalGetCompositionsRaw = async ({
19075
19099
  darkMode: chromiumOptions.darkMode ?? false
19076
19100
  });
19077
19101
  }).then((comp) => {
19078
- return resolve2(comp);
19102
+ return resolve(comp);
19079
19103
  }).catch((err) => {
19080
19104
  reject(err);
19081
19105
  }).finally(() => {
@@ -19183,18 +19207,18 @@ var getFileExtensionFromCodec = (codec, audioCodec) => {
19183
19207
  if (!validCodecs.includes(codec)) {
19184
19208
  throw new Error(`Codec must be one of the following: ${validCodecs.join(", ")}, but got ${codec}`);
19185
19209
  }
19186
- const map2 = defaultFileExtensionMap[codec];
19210
+ const map = defaultFileExtensionMap[codec];
19187
19211
  if (audioCodec === null) {
19188
- return map2.default;
19212
+ return map.default;
19189
19213
  }
19190
19214
  const typedAudioCodec = audioCodec;
19191
- if (!(typedAudioCodec in map2.forAudioCodec)) {
19215
+ if (!(typedAudioCodec in map.forAudioCodec)) {
19192
19216
  throw new Error(`Audio codec ${typedAudioCodec} is not supported for codec ${codec}`);
19193
19217
  }
19194
- return map2.forAudioCodec[audioCodec].default;
19218
+ return map.forAudioCodec[audioCodec].default;
19195
19219
  };
19196
19220
  var makeFileExtensionMap = () => {
19197
- const map2 = {};
19221
+ const map = {};
19198
19222
  Object.keys(defaultFileExtensionMap).forEach((_codec) => {
19199
19223
  const codec = _codec;
19200
19224
  const fileExtMap = defaultFileExtensionMap[codec];
@@ -19205,15 +19229,15 @@ var makeFileExtensionMap = () => {
19205
19229
  ...possibleExtensionsForAudioCodec.flat(1)
19206
19230
  ];
19207
19231
  for (const extension of allPossibleExtensions) {
19208
- if (!map2[extension]) {
19209
- map2[extension] = [];
19232
+ if (!map[extension]) {
19233
+ map[extension] = [];
19210
19234
  }
19211
- if (!map2[extension].includes(codec)) {
19212
- map2[extension].push(codec);
19235
+ if (!map[extension].includes(codec)) {
19236
+ map[extension].push(codec);
19213
19237
  }
19214
19238
  }
19215
19239
  });
19216
- return map2;
19240
+ return map;
19217
19241
  };
19218
19242
  var defaultCodecsForFileExtension = {
19219
19243
  "3gp": "aac",
@@ -19237,21 +19261,21 @@ var defaultCodecsForFileExtension = {
19237
19261
  // src/path-normalize.ts
19238
19262
  var SLASH = 47;
19239
19263
  var DOT = 46;
19240
- var assertPath = (path21) => {
19241
- const t = typeof path21;
19264
+ var assertPath = (path) => {
19265
+ const t = typeof path;
19242
19266
  if (t !== "string") {
19243
19267
  throw new TypeError(`Expected a string, got a ${t}`);
19244
19268
  }
19245
19269
  };
19246
- var posixNormalize = (path21, allowAboveRoot) => {
19270
+ var posixNormalize = (path, allowAboveRoot) => {
19247
19271
  let res = "";
19248
19272
  let lastSegmentLength = 0;
19249
19273
  let lastSlash = -1;
19250
19274
  let dots = 0;
19251
19275
  let code;
19252
- for (let i = 0;i <= path21.length; ++i) {
19253
- if (i < path21.length) {
19254
- code = path21.charCodeAt(i);
19276
+ for (let i = 0;i <= path.length; ++i) {
19277
+ if (i < path.length) {
19278
+ code = path.charCodeAt(i);
19255
19279
  } else if (code === SLASH) {
19256
19280
  break;
19257
19281
  } else {
@@ -19292,9 +19316,9 @@ var posixNormalize = (path21, allowAboveRoot) => {
19292
19316
  }
19293
19317
  } else {
19294
19318
  if (res.length > 0) {
19295
- res += "/" + path21.slice(lastSlash + 1, i);
19319
+ res += "/" + path.slice(lastSlash + 1, i);
19296
19320
  } else {
19297
- res = path21.slice(lastSlash + 1, i);
19321
+ res = path.slice(lastSlash + 1, i);
19298
19322
  }
19299
19323
  lastSegmentLength = i - lastSlash - 1;
19300
19324
  }
@@ -19317,24 +19341,24 @@ var decode = (s) => {
19317
19341
  };
19318
19342
  var pathNormalize = (p) => {
19319
19343
  assertPath(p);
19320
- let path21 = p;
19321
- if (path21.length === 0) {
19344
+ let path = p;
19345
+ if (path.length === 0) {
19322
19346
  return ".";
19323
19347
  }
19324
- const isAbsolute2 = path21.charCodeAt(0) === SLASH;
19325
- const trailingSeparator = path21.charCodeAt(path21.length - 1) === SLASH;
19326
- path21 = decode(path21);
19327
- path21 = posixNormalize(path21, !isAbsolute2);
19328
- if (path21.length === 0 && !isAbsolute2) {
19329
- path21 = ".";
19348
+ const isAbsolute = path.charCodeAt(0) === SLASH;
19349
+ const trailingSeparator = path.charCodeAt(path.length - 1) === SLASH;
19350
+ path = decode(path);
19351
+ path = posixNormalize(path, !isAbsolute);
19352
+ if (path.length === 0 && !isAbsolute) {
19353
+ path = ".";
19330
19354
  }
19331
- if (path21.length > 0 && trailingSeparator) {
19332
- path21 += "/";
19355
+ if (path.length > 0 && trailingSeparator) {
19356
+ path += "/";
19333
19357
  }
19334
- if (isAbsolute2) {
19335
- return "/" + path21;
19358
+ if (isAbsolute) {
19359
+ return "/" + path;
19336
19360
  }
19337
- return path21;
19361
+ return path;
19338
19362
  };
19339
19363
 
19340
19364
  // src/get-extension-of-filename.ts
@@ -19451,12 +19475,6 @@ var validateJpegQuality = (q) => {
19451
19475
  };
19452
19476
 
19453
19477
  // src/perf.ts
19454
- var exports_perf = {};
19455
- __export(exports_perf, {
19456
- stopPerfMeasure: () => stopPerfMeasure,
19457
- startPerfMeasure: () => startPerfMeasure,
19458
- getPerf: () => getPerf
19459
- });
19460
19478
  var perf = {
19461
19479
  capture: [],
19462
19480
  "extract-frame": [],
@@ -19503,7 +19521,7 @@ var validPixelFormatsForCodec = (codec) => {
19503
19521
  if (codec === "vp8" || codec === "vp9") {
19504
19522
  return validPixelFormats;
19505
19523
  }
19506
- return validPixelFormats.filter((format2) => format2 !== "yuva420p");
19524
+ return validPixelFormats.filter((format) => format !== "yuva420p");
19507
19525
  };
19508
19526
  var validateSelectedPixelFormatAndCodecCombination = (pixelFormat, codec) => {
19509
19527
  if (typeof pixelFormat === "undefined") {
@@ -19763,14 +19781,12 @@ var getCodecName = ({
19763
19781
 
19764
19782
  // src/options/color-space.tsx
19765
19783
  import { NoReactInternals as NoReactInternals12 } from "remotion/no-react";
19766
- import { jsx as jsx4, jsxs as jsxs4, Fragment as Fragment4 } from "react/jsx-runtime";
19767
19784
  var validV4ColorSpaces = ["default", "bt601", "bt709", "bt2020-ncl"];
19768
19785
  var validV5ColorSpaces = ["bt601", "bt709", "bt2020-ncl"];
19769
19786
  var validColorSpaces = NoReactInternals12.ENABLE_V5_BREAKING_CHANGES ? validV5ColorSpaces : validV4ColorSpaces;
19770
19787
  var DEFAULT_COLOR_SPACE = NoReactInternals12.ENABLE_V5_BREAKING_CHANGES ? "bt709" : "default";
19771
19788
 
19772
19789
  // src/options/gop-size.tsx
19773
- import { jsx as jsx5, jsxs as jsxs5, Fragment as Fragment5 } from "react/jsx-runtime";
19774
19790
  var validateGopSize = (value) => {
19775
19791
  if (value === null) {
19776
19792
  return;
@@ -20035,7 +20051,7 @@ var writeWithBackpressure = ({
20035
20051
  if (writable.write(data)) {
20036
20052
  return Promise.resolve();
20037
20053
  }
20038
- return new Promise((resolve2, reject) => {
20054
+ return new Promise((resolve, reject) => {
20039
20055
  const cleanup = () => {
20040
20056
  writable.off("close", onClose);
20041
20057
  writable.off("drain", onDrain);
@@ -20047,7 +20063,7 @@ var writeWithBackpressure = ({
20047
20063
  };
20048
20064
  const onDrain = () => {
20049
20065
  cleanup();
20050
- resolve2();
20066
+ resolve();
20051
20067
  };
20052
20068
  const onError = (error) => {
20053
20069
  cleanup();
@@ -20169,7 +20185,7 @@ var createRemotionSharedMemoryFfmpegBridge = ({
20169
20185
  return;
20170
20186
  }
20171
20187
  if (pool.pendingCount > 0) {
20172
- await new Promise((resolve2) => pool.drainWaiters.push(resolve2));
20188
+ await new Promise((resolve) => pool.drainWaiters.push(resolve));
20173
20189
  }
20174
20190
  if (fatalError || finishing || controlEnded) {
20175
20191
  return;
@@ -20193,8 +20209,8 @@ var createRemotionSharedMemoryFfmpegBridge = ({
20193
20209
  };
20194
20210
  const createRegisteredPool = (frame) => {
20195
20211
  let resolveRegistration;
20196
- const registration = new Promise((resolve2) => {
20197
- resolveRegistration = resolve2;
20212
+ const registration = new Promise((resolve) => {
20213
+ resolveRegistration = resolve;
20198
20214
  });
20199
20215
  const pool = {
20200
20216
  poolId: frame.poolId,
@@ -20295,8 +20311,8 @@ var createRemotionSharedMemoryFfmpegBridge = ({
20295
20311
  }
20296
20312
  let resolveAck;
20297
20313
  let rejectAck;
20298
- const ack = new Promise((resolve2, reject) => {
20299
- resolveAck = resolve2;
20314
+ const ack = new Promise((resolve, reject) => {
20315
+ resolveAck = resolve;
20300
20316
  rejectAck = reject;
20301
20317
  });
20302
20318
  ack.catch(() => {
@@ -20339,12 +20355,12 @@ var createRemotionSharedMemoryFfmpegBridge = ({
20339
20355
  if (fatalError) {
20340
20356
  throw fatalError;
20341
20357
  }
20342
- await new Promise((resolve2, reject) => {
20358
+ await new Promise((resolve, reject) => {
20343
20359
  control.end((error) => {
20344
20360
  if (error) {
20345
20361
  reject(error);
20346
20362
  } else {
20347
- resolve2();
20363
+ resolve();
20348
20364
  }
20349
20365
  });
20350
20366
  });
@@ -20417,9 +20433,9 @@ var probeRemotionSharedMemoryFfmpegSupport = ({
20417
20433
  logLevel
20418
20434
  }) => {
20419
20435
  const key = binariesDirectory ?? "<bundled>";
20420
- const cached2 = remotionSharedMemorySupport.get(key);
20421
- if (cached2) {
20422
- return cached2;
20436
+ const cached = remotionSharedMemorySupport.get(key);
20437
+ if (cached) {
20438
+ return cached;
20423
20439
  }
20424
20440
  const result = (async () => {
20425
20441
  try {
@@ -20526,8 +20542,8 @@ var prespawnFfmpeg = (options2) => {
20526
20542
  ["-f", "remotionshm"],
20527
20543
  ["-video_size", `${options2.width}x${options2.height}`],
20528
20544
  ["-framerate", fpsAsFraction(options2.fps)],
20529
- ["-control_fd", "3"],
20530
- ["-ack_fd", "4"],
20545
+ ["-control_fd", "0"],
20546
+ ["-ack_fd", "1"],
20531
20547
  options2.remotionSharedMemoryPoolDirectory === null ? null : ["-pool_dir", options2.remotionSharedMemoryPoolDirectory],
20532
20548
  ["-i", "remotion"]
20533
20549
  ] : [
@@ -20561,11 +20577,14 @@ var prespawnFfmpeg = (options2) => {
20561
20577
  logLevel: options2.logLevel,
20562
20578
  binariesDirectory: options2.binariesDirectory,
20563
20579
  cancelSignal: options2.signal,
20564
- options: options2.inputMode === "remotion-shared-memory" ? { stdio: ["ignore", "pipe", "pipe", "pipe", "pipe"] } : undefined
20580
+ options: options2.inputMode === "remotion-shared-memory" ? {
20581
+ stdio: "pipe",
20582
+ buffer: false
20583
+ } : undefined
20565
20584
  });
20566
20585
  const remotionSharedMemory = options2.inputMode === "remotion-shared-memory" ? createRemotionSharedMemoryFfmpegBridge({
20567
- control: task.stdio[3],
20568
- acknowledgements: task.stdio[4]
20586
+ control: task.stdin,
20587
+ acknowledgements: task.stdout
20569
20588
  }) : null;
20570
20589
  let ffmpegOutput = "";
20571
20590
  task.stderr?.on("data", (data) => {
@@ -20739,7 +20758,7 @@ class RemotionSharedMemoryCapture {
20739
20758
  if (pool.forgotten) {
20740
20759
  throw new Error("The page owning this shared-memory pool was closed.");
20741
20760
  }
20742
- await new Promise((resolve2) => pool.waiters.push(resolve2));
20761
+ await new Promise((resolve) => pool.waiters.push(resolve));
20743
20762
  }
20744
20763
  const slot = pool.availableSlots.shift();
20745
20764
  if (slot === undefined) {
@@ -20829,7 +20848,7 @@ class RemotionSharedMemoryCapture {
20829
20848
  cleanupError = error;
20830
20849
  }
20831
20850
  if (pool.ownedSlots.size > 0) {
20832
- await new Promise((resolve2) => pool.drainWaiters.push(resolve2));
20851
+ await new Promise((resolve) => pool.drainWaiters.push(resolve));
20833
20852
  }
20834
20853
  try {
20835
20854
  await setScreenshotBackground(page, false);
@@ -20878,8 +20897,8 @@ class RemotionSharedMemoryCapture {
20878
20897
  let retired = false;
20879
20898
  let retirement = null;
20880
20899
  let notifyRetirement;
20881
- const retirementSignal = new Promise((resolve2) => {
20882
- notifyRetirement = resolve2;
20900
+ const retirementSignal = new Promise((resolve) => {
20901
+ notifyRetirement = resolve;
20883
20902
  });
20884
20903
  const retirementListeners = new Set;
20885
20904
  const poolLifetime = {
@@ -20993,9 +21012,9 @@ var probeSharedMemoryCapture = async ({
20993
21012
  binariesDirectory,
20994
21013
  backend: getPreferredRemotionSharedMemoryBackend()
20995
21014
  });
20996
- const cached2 = probes.get(key);
20997
- if (cached2) {
20998
- return cached2;
21015
+ const cached = probes.get(key);
21016
+ if (cached) {
21017
+ return cached;
20999
21018
  }
21000
21019
  const probe = (async () => {
21001
21020
  const support = await probeRemotionSharedMemoryFfmpegSupport({
@@ -21126,7 +21145,7 @@ var DEFAULT = null;
21126
21145
  var cliFlag = "separate-audio-to";
21127
21146
  var separateAudioOption = {
21128
21147
  cliFlag,
21129
- description: () => `If set, the audio will not be included in the main output but rendered as a separate file at the location you pass. If the render contains no audio, a silent audio file is produced even when enforceAudioTrack is false. The muted option still takes precedence. It is recommended to use an absolute path. If a relative path is passed, it is relative to the Remotion Root.`,
21148
+ description: () => `If set, the audio will not be included in the main output but rendered as a separate file at the location you pass. If the render contains no audio, a silent audio file is produced even when enforceAudioTrack is false. Audio-only renders, muted renders and codecs without audio support cannot use this option. For local renders, use an absolute path; relative paths are resolved against the Remotion Root. On Lambda, pass an output name or custom destination as described in renderMediaOnLambda().`,
21130
21149
  docLink: "https://www.remotion.dev/docs/options/separate-audio-to",
21131
21150
  getValue: ({ commandLine }) => {
21132
21151
  if (commandLine[cliFlag]) {
@@ -21141,6 +21160,7 @@ var separateAudioOption = {
21141
21160
  };
21142
21161
  },
21143
21162
  name: "Separate audio to",
21163
+ addedIn: "4.0.123",
21144
21164
  setConfig: () => {
21145
21165
  throw new Error("Not implemented");
21146
21166
  },
@@ -21330,6 +21350,7 @@ var audioCodecOption = {
21330
21350
  description: () => `Set the format of the audio that is embedded in the video. Not all codec and audio codec combinations are supported and certain combinations require a certain file extension and container format. See the table in the docs to see possible combinations.`,
21331
21351
  docLink: "https://www.remotion.dev/docs/options/audio-codec",
21332
21352
  name: "Audio Codec",
21353
+ addedIn: "3.3.41",
21333
21354
  ssrName,
21334
21355
  type: "aac",
21335
21356
  id: cliFlag2
@@ -21799,9 +21820,9 @@ class Pool {
21799
21820
  if (resource !== undefined) {
21800
21821
  return Promise.resolve(resource);
21801
21822
  }
21802
- return new Promise((resolve2) => {
21823
+ return new Promise((resolve) => {
21803
21824
  this.waiters.push((freeResource) => {
21804
- resolve2(freeResource);
21825
+ resolve(freeResource);
21805
21826
  });
21806
21827
  });
21807
21828
  }
@@ -21926,12 +21947,12 @@ import * as assert2 from "node:assert";
21926
21947
  // src/screenshot-task.ts
21927
21948
  import fs17 from "node:fs";
21928
21949
  var screenshotTask = async ({
21929
- format: format2,
21950
+ format,
21930
21951
  height,
21931
21952
  omitBackground,
21932
21953
  page,
21933
21954
  width,
21934
- path: path23,
21955
+ path,
21935
21956
  jpegQuality,
21936
21957
  scale,
21937
21958
  remotionSharedMemory
@@ -21945,7 +21966,7 @@ var screenshotTask = async ({
21945
21966
  const cap = startPerfMeasure("capture");
21946
21967
  try {
21947
21968
  let result;
21948
- if (format2 === "pdf") {
21969
+ if (format === "pdf") {
21949
21970
  const res = await client.send("Page.printToPDF", {
21950
21971
  paperWidth: width / 96,
21951
21972
  paperHeight: height / 96,
@@ -21964,7 +21985,7 @@ var screenshotTask = async ({
21964
21985
  let value;
21965
21986
  try {
21966
21987
  ({ value } = await client.send("Page.captureScreenshot", {
21967
- format: format2,
21988
+ format,
21968
21989
  quality: jpegQuality,
21969
21990
  clip: {
21970
21991
  x: 0,
@@ -21999,11 +22020,11 @@ var screenshotTask = async ({
21999
22020
  if (omitBackground) {
22000
22021
  await setScreenshotBackground(page, false);
22001
22022
  }
22002
- const buffer2 = Buffer.from(result.data, "base64");
22003
- if (path23) {
22004
- await fs17.promises.writeFile(path23, buffer2);
22023
+ const buffer = Buffer.from(result.data, "base64");
22024
+ if (path) {
22025
+ await fs17.promises.writeFile(path, buffer);
22005
22026
  }
22006
- return buffer2;
22027
+ return buffer;
22007
22028
  } catch (err) {
22008
22029
  if (err.message.includes("Unable to capture screenshot")) {
22009
22030
  const errMessage = [
@@ -22205,18 +22226,18 @@ var renderFrameWithOptionToReject = async ({
22205
22226
  if (captureResult.status === "rejected") {
22206
22227
  throw captureResult.reason;
22207
22228
  }
22208
- const buffer2 = captureResult.value;
22229
+ const buffer = captureResult.value;
22209
22230
  if (assetsResult.status === "rejected") {
22210
- if (buffer2 !== null && isRemotionRawFrame(buffer2)) {
22231
+ if (buffer !== null && isRemotionRawFrame(buffer)) {
22211
22232
  try {
22212
- await buffer2.release();
22233
+ await buffer.release();
22213
22234
  } catch {}
22214
22235
  }
22215
22236
  throw assetsResult.reason;
22216
22237
  }
22217
22238
  const collectedAssets = assetsResult.value;
22218
- let frameBufferForArtifacts = Buffer.isBuffer(buffer2) ? buffer2 : null;
22219
- if (buffer2 !== null && isRemotionRawFrame(buffer2) && collectedAssets.some((asset) => asset.type === "artifact" && asset.contentType === "thumbnail")) {
22239
+ let frameBufferForArtifacts = Buffer.isBuffer(buffer) ? buffer : null;
22240
+ if (buffer !== null && isRemotionRawFrame(buffer) && collectedAssets.some((asset) => asset.type === "artifact" && asset.contentType === "thumbnail")) {
22220
22241
  try {
22221
22242
  const thumbnail = await takeFrame({
22222
22243
  freePage: page,
@@ -22236,34 +22257,34 @@ var renderFrameWithOptionToReject = async ({
22236
22257
  frameBufferForArtifacts = thumbnail;
22237
22258
  } catch (error) {
22238
22259
  try {
22239
- await buffer2.release();
22260
+ await buffer.release();
22240
22261
  } catch {}
22241
22262
  throw error;
22242
22263
  }
22243
22264
  }
22244
22265
  cleanupPageListeners();
22245
22266
  if (pageError) {
22246
- if (buffer2 !== null && isRemotionRawFrame(buffer2)) {
22267
+ if (buffer !== null && isRemotionRawFrame(buffer)) {
22247
22268
  try {
22248
- await buffer2.release();
22269
+ await buffer.release();
22249
22270
  } catch {}
22250
22271
  }
22251
22272
  throw pageError;
22252
22273
  }
22253
22274
  if ((onFrameBuffer || onFrame) && !assetsOnly) {
22254
- if (!buffer2) {
22275
+ if (!buffer) {
22255
22276
  throw new Error("unexpected null buffer");
22256
22277
  }
22257
22278
  if (onFrame) {
22258
- await onFrame(buffer2, frame);
22279
+ await onFrame(buffer, frame);
22259
22280
  } else {
22260
- if (isRemotionRawFrame(buffer2)) {
22281
+ if (isRemotionRawFrame(buffer)) {
22261
22282
  try {
22262
- await buffer2.release();
22283
+ await buffer.release();
22263
22284
  } catch {}
22264
22285
  throw new Error("Raw shared-memory frames cannot be passed to renderFrames().");
22265
22286
  }
22266
- await onFrameBuffer?.(buffer2, frame);
22287
+ await onFrameBuffer?.(buffer, frame);
22267
22288
  }
22268
22289
  }
22269
22290
  const audioAndVideoAssets = onlyAudioAndVideoAssets(collectedAssets);
@@ -22374,7 +22395,7 @@ var renderFrame = ({
22374
22395
  trimRightOffset,
22375
22396
  allFramesAndExtraFrames
22376
22397
  }) => {
22377
- return new Promise((resolve2, reject) => {
22398
+ return new Promise((resolve, reject) => {
22378
22399
  renderFrameWithOptionToReject({
22379
22400
  reject,
22380
22401
  width: composition.width,
@@ -22414,7 +22435,7 @@ var renderFrame = ({
22414
22435
  trimRightOffset,
22415
22436
  allFramesAndExtraFrames
22416
22437
  }).then(() => {
22417
- resolve2();
22438
+ resolve();
22418
22439
  }).catch((err) => {
22419
22440
  reject(err);
22420
22441
  });
@@ -22651,9 +22672,9 @@ var handleBrowserCrash = (instance, logLevel, indent) => {
22651
22672
  getBrowser: () => _instance,
22652
22673
  replaceBrowser: async (make, makeNewPages) => {
22653
22674
  if (replacing) {
22654
- const waiter = new Promise((resolve2, reject) => {
22675
+ const waiter = new Promise((resolve, reject) => {
22655
22676
  waiters.push({
22656
- resolve: resolve2,
22677
+ resolve,
22657
22678
  reject
22658
22679
  });
22659
22680
  });
@@ -23015,7 +23036,7 @@ var internalRenderFramesRaw = ({
23015
23036
  const browserInstance = puppeteerInstance ?? makeBrowser();
23016
23037
  const resolvedConcurrency = resolveConcurrency(concurrency);
23017
23038
  const openedPages = [];
23018
- return new Promise((resolve2, reject) => {
23039
+ return new Promise((resolve, reject) => {
23019
23040
  const cleanup = [];
23020
23041
  const onError = (err) => {
23021
23042
  reject(err);
@@ -23107,14 +23128,14 @@ var internalRenderFramesRaw = ({
23107
23128
  })
23108
23129
  ]).then((res) => {
23109
23130
  if (!server || server.compositor.pid === null) {
23110
- return resolve2(res);
23131
+ return resolve(res);
23111
23132
  }
23112
23133
  server.compositor.executeCommand("CloseAllVideos", {}).then(() => {
23113
23134
  Log.verbose({ indent, logLevel, tag: "compositor" }, "Freed memory from compositor");
23114
23135
  }).catch((err) => {
23115
23136
  Log.verbose({ indent, logLevel }, "Could not close compositor", err);
23116
23137
  });
23117
- return resolve2(res);
23138
+ return resolve(res);
23118
23139
  }).catch((err) => reject(err)).finally(() => {
23119
23140
  if (puppeteerInstance) {
23120
23141
  Promise.all(openedPages.map((p) => p.close())).catch((err) => {
@@ -23332,11 +23353,11 @@ var ensureFramesInOrder = (framesToRender) => {
23332
23353
  }
23333
23354
  };
23334
23355
  const waitForRightTimeOfFrameToBeInserted = (frameToBe) => {
23335
- return new Promise((resolve2) => {
23356
+ return new Promise((resolve) => {
23336
23357
  waiters.push({
23337
23358
  id: String(Math.random()),
23338
23359
  forFrame: frameToBe,
23339
- resolve: resolve2
23360
+ resolve
23340
23361
  });
23341
23362
  resolveWaiters();
23342
23363
  });
@@ -23356,7 +23377,6 @@ var ensureFramesInOrder = (framesToRender) => {
23356
23377
  };
23357
23378
 
23358
23379
  // src/options/x264-preset.tsx
23359
- import { jsx as jsx6, jsxs as jsxs6, Fragment as Fragment6 } from "react/jsx-runtime";
23360
23380
  var x264PresetOptions = [
23361
23381
  "ultrafast",
23362
23382
  "superfast",
@@ -23707,8 +23727,8 @@ var makeFfmpegFilterFile = (complexFilter, downloadMap) => {
23707
23727
  return makeFfmpegFilterFileStr(complexFilter.filter, downloadMap);
23708
23728
  };
23709
23729
  var makeFfmpegFilterFileStr = async (complexFilter, downloadMap) => {
23710
- const random2 = Math.random().toString().replace(".", "");
23711
- const filterFile = path25.join(downloadMap.complexFilter, "complex-filter-" + random2 + ".txt");
23730
+ const random = Math.random().toString().replace(".", "");
23731
+ const filterFile = path25.join(downloadMap.complexFilter, "complex-filter-" + random + ".txt");
23712
23732
  if (!existsSync5(downloadMap.complexFilter)) {
23713
23733
  fs19.mkdirSync(downloadMap.complexFilter, { recursive: true });
23714
23734
  }
@@ -24598,6 +24618,8 @@ var muxVideoAndAudio = async ({
24598
24618
  audioOutput ? "copy" : null,
24599
24619
  videoOutput ? "-r" : null,
24600
24620
  videoOutput ? String(fps) : null,
24621
+ videoOutput ? "-video_track_timescale" : null,
24622
+ videoOutput ? "90000" : null,
24601
24623
  numberOfGifLoops === null ? null : "-loop",
24602
24624
  numberOfGifLoops === null ? null : convertNumberOfGifLoopsToFfmpegSyntax(numberOfGifLoops),
24603
24625
  mp4Brand ? "-f" : null,
@@ -24868,13 +24890,13 @@ var innerStitchFramesToVideo = async ({
24868
24890
  cpSync2(audioOnlyFile, outputLocation ?? tempFile);
24869
24891
  onProgress?.(Math.round(assetsInfo.chunkLengthInSeconds * fps));
24870
24892
  deleteDirectory(path30.dirname(audio));
24871
- const file = await new Promise((resolve2, reject) => {
24893
+ const file = await new Promise((resolve, reject) => {
24872
24894
  if (tempFile) {
24873
24895
  promises5.readFile(tempFile).then((f) => {
24874
- return resolve2(f);
24896
+ return resolve(f);
24875
24897
  }).catch((e) => reject(e));
24876
24898
  } else {
24877
- resolve2(null);
24899
+ resolve(null);
24878
24900
  }
24879
24901
  });
24880
24902
  deleteDirectory(assetsInfo.downloadMap.stitchFrames);
@@ -24980,10 +25002,10 @@ var innerStitchFramesToVideo = async ({
24980
25002
  }
24981
25003
  }
24982
25004
  });
24983
- await new Promise((resolve2, reject) => {
25005
+ await new Promise((resolve, reject) => {
24984
25006
  task.once("close", (code, signal) => {
24985
25007
  if (code === 0) {
24986
- resolve2();
25008
+ resolve();
24987
25009
  } else {
24988
25010
  reject(new Error(`FFmpeg quit with code ${code} ${signal ? `(${signal})` : ""} The FFmpeg output was ${ffmpegStderr}`));
24989
25011
  }
@@ -25218,7 +25240,7 @@ var validateOutputFilename = ({
25218
25240
  if (NoReactInternals19.ENABLE_V5_BREAKING_CHANGES && codec === "aac" && (normalizedExtension === "mpg" || normalizedExtension === "mpeg")) {
25219
25241
  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.");
25220
25242
  }
25221
- const map3 = defaultFileExtensionMap[codec];
25243
+ const map = defaultFileExtensionMap[codec];
25222
25244
  const resolvedAudioCodec = resolveAudioCodec({
25223
25245
  codec,
25224
25246
  preferLossless,
@@ -25226,15 +25248,15 @@ var validateOutputFilename = ({
25226
25248
  separateAudioTo
25227
25249
  });
25228
25250
  if (resolvedAudioCodec === null) {
25229
- if (normalizedExtension !== map3.default) {
25230
- throw new TypeError(`When using the ${codec} codec, the output filename must end in .${map3.default}.`);
25251
+ if (normalizedExtension !== map.default) {
25252
+ throw new TypeError(`When using the ${codec} codec, the output filename must end in .${map.default}.`);
25231
25253
  }
25232
25254
  return;
25233
25255
  }
25234
- if (!(resolvedAudioCodec in map3.forAudioCodec)) {
25256
+ if (!(resolvedAudioCodec in map.forAudioCodec)) {
25235
25257
  throw new Error(`Audio codec ${resolvedAudioCodec} is not supported for codec ${codec}`);
25236
25258
  }
25237
- const acceptableExtensions = map3.forAudioCodec[resolvedAudioCodec].possible;
25259
+ const acceptableExtensions = map.forAudioCodec[resolvedAudioCodec].possible;
25238
25260
  if (!acceptableExtensions.includes(normalizedExtension) && !separateAudioTo) {
25239
25261
  throw new TypeError(`When using the ${codec} codec with the ${resolvedAudioCodec} audio codec, the output filename must end in one of the following: ${acceptableExtensions.join(", ")}.`);
25240
25262
  }
@@ -25408,12 +25430,12 @@ var internalRenderMediaRaw = async ({
25408
25430
  }
25409
25431
  const imageFormat = isAudioCodec(codec) ? "none" : provisionalImageFormat ?? compositionWithPossibleUnevenDimensions.defaultVideoImageFormat ?? DEFAULT_VIDEO_IMAGE_FORMAT;
25410
25432
  validateVideoImageFormat(imageFormat);
25411
- const remotionSharedMemorySupport2 = !parallelEncoding || disableSharedMemoryCapture ? null : await probeRemotionSharedMemoryFfmpegSupport({
25433
+ const remotionSharedMemorySupport = !parallelEncoding || disableSharedMemoryCapture ? null : await probeRemotionSharedMemoryFfmpegSupport({
25412
25434
  binariesDirectory,
25413
25435
  indent,
25414
25436
  logLevel
25415
25437
  });
25416
- if (!remotionSharedMemorySupport2?.sharedMemory) {
25438
+ if (!remotionSharedMemorySupport?.sharedMemory) {
25417
25439
  validateSelectedPixelFormatAndImageFormatCombination(pixelFormat, imageFormat);
25418
25440
  }
25419
25441
  const workingDir = fs20.mkdtempSync(path31.join(os11.tmpdir(), "react-motion-render"));
@@ -25435,8 +25457,8 @@ var internalRenderMediaRaw = async ({
25435
25457
  if (disableSharedMemoryCapture) {
25436
25458
  Log.verbose({ indent, logLevel, tag: "renderMedia()" }, "Shared-memory capture is disabled by configuration.");
25437
25459
  }
25438
- const remotionSharedMemoryPoolDirectory = remotionSharedMemorySupport2?.filePools ? fs20.mkdtempSync(path31.join(workingDir, "shm-pools-")) : null;
25439
- const remotionSharedMemory = remotionSharedMemorySupport2?.sharedMemory ? new RemotionSharedMemoryCapture({
25460
+ const remotionSharedMemoryPoolDirectory = remotionSharedMemorySupport?.filePools ? fs20.mkdtempSync(path31.join(workingDir, "shm-pools-")) : null;
25461
+ const remotionSharedMemory = remotionSharedMemorySupport?.sharedMemory ? new RemotionSharedMemoryCapture({
25440
25462
  width: Math.round(actualWidth),
25441
25463
  height: Math.round(actualHeight),
25442
25464
  indent,
@@ -25477,8 +25499,8 @@ var internalRenderMediaRaw = async ({
25477
25499
  validateFps(fps, 'in "renderMedia()"', codec === "gif");
25478
25500
  let preStitcherInputMode = null;
25479
25501
  let notifyPreStitcherStarted;
25480
- const preStitcherStarted = new Promise((resolve2) => {
25481
- notifyPreStitcherStarted = resolve2;
25502
+ const preStitcherStarted = new Promise((resolve) => {
25503
+ notifyPreStitcherStarted = resolve;
25482
25504
  });
25483
25505
  const createPrestitcherIfNecessary = (inputMode) => {
25484
25506
  if (preEncodedFileLocation && !preStitcher) {
@@ -25558,7 +25580,7 @@ var internalRenderMediaRaw = async ({
25558
25580
  minTime = slowestFrames[slowestFrames.length - 1]?.time ?? minTime;
25559
25581
  };
25560
25582
  let cleanupServerFn = () => Promise.resolve(undefined);
25561
- const happyPath = new Promise((resolve2, reject) => {
25583
+ const happyPath = new Promise((resolve, reject) => {
25562
25584
  Promise.resolve().then(() => {
25563
25585
  return makeOrReuseServer(reusedServer, {
25564
25586
  offthreadVideoThreads: offthreadVideoThreads ?? DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS,
@@ -25770,17 +25792,17 @@ var internalRenderMediaRaw = async ({
25770
25792
  onLog,
25771
25793
  sampleRate
25772
25794
  });
25773
- }).then((buffer2) => {
25795
+ }).then((buffer) => {
25774
25796
  Log.verbose({ indent, logLevel }, "Stitching done in", encodedDoneIn + "ms");
25775
25797
  slowestFrames.sort((a, b) => b.time - a.time);
25776
25798
  const result = {
25777
- buffer: buffer2,
25799
+ buffer,
25778
25800
  slowestFrames,
25779
25801
  contentType: mimeLookup("file." + getFileExtensionFromCodec(codec, audioCodec)) || "application/octet-stream"
25780
25802
  };
25781
25803
  const sendTelemetryAndResolve = () => {
25782
25804
  if (licenseKey === null) {
25783
- resolve2(result);
25805
+ resolve(result);
25784
25806
  return;
25785
25807
  }
25786
25808
  LicensingInternals.internalRegisterUsageEvent({
@@ -25796,7 +25818,7 @@ var internalRenderMediaRaw = async ({
25796
25818
  Log.error({ indent, logLevel }, "Failed to send usage event");
25797
25819
  Log.error({ indent: true, logLevel }, err);
25798
25820
  }).finally(() => {
25799
- resolve2(result);
25821
+ resolve(result);
25800
25822
  });
25801
25823
  };
25802
25824
  if (isReproEnabled()) {
@@ -26191,7 +26213,7 @@ var innerRenderStill = async ({
26191
26213
  logLevel,
26192
26214
  attempt: 0
26193
26215
  });
26194
- const [buffer2, collectedAssets] = await Promise.all([
26216
+ const [buffer, collectedAssets] = await Promise.all([
26195
26217
  takeFrame({
26196
26218
  freePage: page,
26197
26219
  height: composition.height,
@@ -26212,7 +26234,7 @@ var innerRenderStill = async ({
26212
26234
  ]);
26213
26235
  const artifactAssets = onlyArtifact({
26214
26236
  assets: collectedAssets,
26215
- frameBuffer: buffer2
26237
+ frameBuffer: buffer
26216
26238
  });
26217
26239
  const previousArtifactAssets = [];
26218
26240
  for (const artifact of artifactAssets) {
@@ -26226,13 +26248,13 @@ var innerRenderStill = async ({
26226
26248
  }
26227
26249
  await cleanup();
26228
26250
  return {
26229
- buffer: output ? null : buffer2,
26251
+ buffer: output ? null : buffer,
26230
26252
  contentType: mimeLookup("file." + imageFormat) || "application/octet-stream"
26231
26253
  };
26232
26254
  };
26233
26255
  var internalRenderStillRaw = (options2) => {
26234
26256
  const cleanup = [];
26235
- const happyPath = new Promise((resolve2, reject) => {
26257
+ const happyPath = new Promise((resolve, reject) => {
26236
26258
  const onError = (err) => reject(err);
26237
26259
  makeOrReuseServer(options2.server, {
26238
26260
  webpackConfigOrServeUrl: options2.serveUrl,
@@ -26259,7 +26281,7 @@ var internalRenderStillRaw = (options2) => {
26259
26281
  });
26260
26282
  }).then((res) => {
26261
26283
  if (options2.licenseKey === null) {
26262
- resolve2(res);
26284
+ resolve(res);
26263
26285
  return;
26264
26286
  }
26265
26287
  LicensingInternals2.internalRegisterUsageEvent({
@@ -26275,7 +26297,7 @@ var internalRenderStillRaw = (options2) => {
26275
26297
  Log.error(options2, "Failed to send usage event");
26276
26298
  Log.error(options2, err);
26277
26299
  }).finally(() => {
26278
- resolve2(res);
26300
+ resolve(res);
26279
26301
  });
26280
26302
  }).catch((err) => reject(err)).finally(() => {
26281
26303
  cleanup.forEach((c) => {
@@ -26556,7 +26578,7 @@ var internalSelectCompositionRaw = async (options2) => {
26556
26578
  })
26557
26579
  ]);
26558
26580
  cleanup.push(() => cleanupPage());
26559
- return new Promise((resolve2, reject) => {
26581
+ return new Promise((resolve, reject) => {
26560
26582
  const onError = (err) => reject(err);
26561
26583
  cleanup.push(handleJavascriptException({
26562
26584
  page,
@@ -26585,7 +26607,7 @@ var internalSelectCompositionRaw = async (options2) => {
26585
26607
  chromeMode,
26586
26608
  mediaCacheSizeInBytes
26587
26609
  }).then((data) => {
26588
- return resolve2(data);
26610
+ return resolve(data);
26589
26611
  }).catch((err) => {
26590
26612
  reject(err);
26591
26613
  }).finally(() => {
@@ -26739,7 +26761,7 @@ var getMaxConcurrency = () => {
26739
26761
  };
26740
26762
  var getMinConcurrency = () => 1;
26741
26763
  // src/combine-chunks.ts
26742
- import { rmSync as rmSync6 } from "node:fs";
26764
+ import { copyFileSync, rmSync as rmSync6 } from "node:fs";
26743
26765
  import { join as join6 } from "node:path";
26744
26766
 
26745
26767
  // src/can-concat-seamlessly.ts
@@ -26793,6 +26815,8 @@ var combineVideoStreams = async ({
26793
26815
  "-an",
26794
26816
  "-c:v",
26795
26817
  encoder,
26818
+ "-video_track_timescale",
26819
+ "90000",
26796
26820
  codec === "h265" ? "-tag:v" : null,
26797
26821
  codec === "h265" ? "hvc1" : null,
26798
26822
  addRemotionMetadata ? `-metadata` : null,
@@ -26858,23 +26882,27 @@ var internalCombineChunks = async ({
26858
26882
  everyNthFrame,
26859
26883
  frameRange,
26860
26884
  compositionDurationInFrames,
26861
- sampleRate
26885
+ sampleRate,
26886
+ separateAudioTo
26862
26887
  }) => {
26863
26888
  validateNumberOfGifLoops(numberOfGifLoops, codec);
26864
- const filelistDir = tmpDir(REMOTION_FILELIST_TOKEN);
26865
26889
  const shouldCreateVideo = !isAudioCodec(codec);
26866
26890
  const resolvedAudioCodec = resolveAudioCodec({
26867
26891
  setting: audioCodec,
26868
26892
  codec,
26869
26893
  preferLossless,
26870
- separateAudioTo: null
26894
+ separateAudioTo
26871
26895
  });
26872
26896
  const shouldCreateAudio = resolvedAudioCodec !== null && audioFiles.length > 0;
26897
+ if (separateAudioTo !== null && (!shouldCreateAudio || !shouldCreateVideo)) {
26898
+ throw new Error("Separate audio requires a video render with audio chunks.");
26899
+ }
26873
26900
  const seamlessVideo = canConcatVideoSeamlessly(codec);
26874
26901
  const realFrameRange = getRealFrameRange(compositionDurationInFrames, frameRange);
26875
26902
  const seamlessAudio = canConcatAudioSeamlessly(resolvedAudioCodec, framesPerChunk);
26876
26903
  const numberOfFrames = getFramesToRender(realFrameRange, everyNthFrame).length;
26877
- const videoOutput = shouldCreateVideo ? join6(filelistDir, `video.${getFileExtensionFromCodec(codec, resolvedAudioCodec)}`) : null;
26904
+ const filelistDir = tmpDir(REMOTION_FILELIST_TOKEN);
26905
+ const videoOutput = shouldCreateVideo ? join6(filelistDir, `video.${getFileExtensionFromCodec(codec, separateAudioTo === null ? resolvedAudioCodec : null)}`) : null;
26878
26906
  const audioOutput = shouldCreateAudio ? join6(filelistDir, `audio.${getExtensionFromAudioCodec(resolvedAudioCodec)}`) : null;
26879
26907
  const chunkDurationInSeconds = framesPerChunk / fps;
26880
26908
  let concatenatedAudio = 0;
@@ -26889,48 +26917,48 @@ var internalCombineChunks = async ({
26889
26917
  });
26890
26918
  };
26891
26919
  Log.verbose({ indent, logLevel }, `Combining chunks, audio = ${shouldCreateAudio === false ? "no" : seamlessAudio ? "seamlessly" : "normally"}, video = ${shouldCreateVideo === false ? "no" : seamlessVideo ? "seamlessly" : "normally"}`);
26892
- await Promise.all([
26893
- shouldCreateAudio && audioOutput ? createCombinedAudio({
26894
- audioBitrate,
26895
- filelistDir,
26896
- files: audioFiles,
26897
- indent,
26898
- logLevel,
26899
- output: audioOutput,
26900
- resolvedAudioCodec,
26901
- seamless: seamlessAudio,
26902
- chunkDurationInSeconds,
26903
- addRemotionMetadata: !shouldCreateVideo,
26904
- binariesDirectory,
26905
- fps,
26906
- cancelSignal,
26907
- onProgress: (frames) => {
26908
- concatenatedAudio = frames;
26909
- updateProgress();
26910
- },
26911
- sampleRate
26912
- }) : null,
26913
- shouldCreateVideo && !seamlessVideo && videoOutput ? combineVideoStreams({
26914
- codec,
26915
- filelistDir,
26916
- fps,
26917
- indent,
26918
- logLevel,
26919
- numberOfGifLoops,
26920
- output: videoOutput,
26921
- files: videoFiles,
26922
- addRemotionMetadata: !shouldCreateAudio,
26923
- binariesDirectory,
26924
- cancelSignal,
26925
- onProgress: (frames) => {
26926
- concatenatedVideo = frames;
26927
- updateProgress();
26928
- }
26929
- }) : null
26930
- ].filter(truthy));
26931
26920
  try {
26921
+ await Promise.all([
26922
+ shouldCreateAudio && audioOutput ? createCombinedAudio({
26923
+ audioBitrate,
26924
+ filelistDir,
26925
+ files: audioFiles,
26926
+ indent,
26927
+ logLevel,
26928
+ output: audioOutput,
26929
+ resolvedAudioCodec,
26930
+ seamless: seamlessAudio,
26931
+ chunkDurationInSeconds,
26932
+ addRemotionMetadata: !shouldCreateVideo,
26933
+ binariesDirectory,
26934
+ fps,
26935
+ cancelSignal,
26936
+ onProgress: (frames) => {
26937
+ concatenatedAudio = frames;
26938
+ updateProgress();
26939
+ },
26940
+ sampleRate
26941
+ }) : null,
26942
+ shouldCreateVideo && !seamlessVideo && videoOutput ? combineVideoStreams({
26943
+ codec,
26944
+ filelistDir,
26945
+ fps,
26946
+ indent,
26947
+ logLevel,
26948
+ numberOfGifLoops,
26949
+ output: videoOutput,
26950
+ files: videoFiles,
26951
+ addRemotionMetadata: !shouldCreateAudio,
26952
+ binariesDirectory,
26953
+ cancelSignal,
26954
+ onProgress: (frames) => {
26955
+ concatenatedVideo = frames;
26956
+ updateProgress();
26957
+ }
26958
+ }) : null
26959
+ ].filter(truthy));
26932
26960
  await muxVideoAndAudio({
26933
- audioOutput,
26961
+ audioOutput: separateAudioTo === null ? audioOutput : null,
26934
26962
  indent,
26935
26963
  logLevel,
26936
26964
  onProgress: (frames) => {
@@ -26947,11 +26975,33 @@ var internalCombineChunks = async ({
26947
26975
  audioCodec: resolvedAudioCodec,
26948
26976
  sampleRate
26949
26977
  });
26978
+ if (separateAudioTo !== null && audioOutput !== null) {
26979
+ const extension = getExtensionOfFilename(separateAudioTo)?.toLowerCase() ?? null;
26980
+ if (getMp4BrandForExtension(extension)) {
26981
+ await muxVideoAndAudio({
26982
+ videoOutput: null,
26983
+ audioOutput,
26984
+ output: separateAudioTo,
26985
+ indent,
26986
+ logLevel,
26987
+ onProgress: () => {
26988
+ return;
26989
+ },
26990
+ binariesDirectory,
26991
+ fps,
26992
+ cancelSignal,
26993
+ metadata: null,
26994
+ numberOfGifLoops: null,
26995
+ audioCodec: resolvedAudioCodec,
26996
+ sampleRate
26997
+ });
26998
+ } else {
26999
+ copyFileSync(audioOutput, separateAudioTo);
27000
+ }
27001
+ }
26950
27002
  onProgress({ totalProgress: 1, frames: numberOfFrames });
26951
- rmSync6(filelistDir, { recursive: true });
26952
- } catch (err) {
26953
- rmSync6(filelistDir, { recursive: true });
26954
- throw err;
27003
+ } finally {
27004
+ rmSync6(filelistDir, { recursive: true, force: true });
26955
27005
  }
26956
27006
  };
26957
27007
  var combineChunks = (options2) => {
@@ -26975,7 +27025,8 @@ var combineChunks = (options2) => {
26975
27025
  everyNthFrame: options2.everyNthFrame ?? 1,
26976
27026
  frameRange: options2.frameRange ?? null,
26977
27027
  compositionDurationInFrames: options2.compositionDurationInFrames,
26978
- sampleRate: options2.sampleRate ?? 48000
27028
+ sampleRate: options2.sampleRate ?? 48000,
27029
+ separateAudioTo: null
26979
27030
  });
26980
27031
  };
26981
27032
  // src/extract-audio.ts
@@ -27095,10 +27146,7 @@ var getVideoMetadata = async (videoSource, options2) => {
27095
27146
  await compositor.waitForDone();
27096
27147
  return JSON.parse(new TextDecoder("utf-8").decode(metadataResponse));
27097
27148
  };
27098
- // src/options/chrome-mode.tsx
27099
- import { jsx as jsx7, jsxs as jsxs7, Fragment as Fragment7 } from "react/jsx-runtime";
27100
27149
  // src/options/default-coding-agent.tsx
27101
- import { jsx as jsx8, jsxs as jsxs8, Fragment as Fragment8 } from "react/jsx-runtime";
27102
27150
  var defaultCodingAgentIds = [
27103
27151
  "codex",
27104
27152
  "cursor",
@@ -27106,7 +27154,6 @@ var defaultCodingAgentIds = [
27106
27154
  "claude-code"
27107
27155
  ];
27108
27156
  // src/options/default-editor.tsx
27109
- import { jsx as jsx9, jsxs as jsxs9, Fragment as Fragment9 } from "react/jsx-runtime";
27110
27157
  var defaultEditorIds = [
27111
27158
  "vscode",
27112
27159
  "cursor",
@@ -27119,10 +27166,6 @@ var defaultEditorIds = [
27119
27166
  var customEditorTargetPathPlaceholder = "%TARGET_PATH%";
27120
27167
  var customEditorLineNumberPlaceholder = "%LINE_NUMBER%";
27121
27168
  var customEditorColumnNumberPlaceholder = "%COLUMN_NUMBER%";
27122
- // src/options/number-of-gif-loops.tsx
27123
- import { jsx as jsx10, jsxs as jsxs10, Fragment as Fragment10 } from "react/jsx-runtime";
27124
- // src/options/on-browser-download.tsx
27125
- import { jsx as jsx11, jsxs as jsxs11, Fragment as Fragment11 } from "react/jsx-runtime";
27126
27169
  // src/index.ts
27127
27170
  var RenderInternals = {
27128
27171
  resolveConcurrency,
@@ -27222,26 +27265,26 @@ var RenderInternals = {
27222
27265
  };
27223
27266
  checkRuntimeVersion("info", false);
27224
27267
  export {
27225
- validateSelectedPixelFormatAndImageFormatCombination,
27226
- validateOutputFilename,
27227
- stitchFramesToVideo,
27228
- selectComposition,
27229
- renderStill,
27230
- renderMedia,
27231
- renderFrames,
27232
- openBrowser,
27233
- makeCancelSignal,
27234
- getVideoMetadata,
27235
- getSilentParts,
27236
- getCompositions,
27237
- extractAudio,
27238
- ensureBrowser,
27239
- defaultEditorIds,
27240
- defaultCodingAgentIds,
27241
- customEditorTargetPathPlaceholder,
27242
- customEditorLineNumberPlaceholder,
27243
- customEditorColumnNumberPlaceholder,
27244
- combineChunks,
27268
+ ErrorWithStackFrame,
27245
27269
  RenderInternals,
27246
- ErrorWithStackFrame
27270
+ combineChunks,
27271
+ customEditorColumnNumberPlaceholder,
27272
+ customEditorLineNumberPlaceholder,
27273
+ customEditorTargetPathPlaceholder,
27274
+ defaultCodingAgentIds,
27275
+ defaultEditorIds,
27276
+ ensureBrowser,
27277
+ extractAudio,
27278
+ getCompositions,
27279
+ getSilentParts,
27280
+ getVideoMetadata,
27281
+ makeCancelSignal,
27282
+ openBrowser,
27283
+ renderFrames,
27284
+ renderMedia,
27285
+ renderStill,
27286
+ selectComposition,
27287
+ stitchFramesToVideo,
27288
+ validateOutputFilename,
27289
+ validateSelectedPixelFormatAndImageFormatCombination
27247
27290
  };