@remotion/renderer 4.0.533 → 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 (285) hide show
  1. package/dist/aac-priming.js +6 -2
  2. package/dist/browser/BrowserFetcher.d.ts +7 -1
  3. package/dist/browser/BrowserFetcher.js +33 -13
  4. package/dist/browser/BrowserPage.js +4 -0
  5. package/dist/browser/Connection.js +5 -17
  6. package/dist/browser/DOMWorld.js +19 -13
  7. package/dist/browser/devtools-commands.d.ts +13 -1
  8. package/dist/browser/devtools-types.d.ts +62 -0
  9. package/dist/browser/get-chrome-download-url.d.ts +1 -1
  10. package/dist/browser/get-chrome-download-url.js +19 -33
  11. package/dist/can-use-parallel-encoding.d.ts +0 -1
  12. package/dist/can-use-parallel-encoding.js +10 -10
  13. package/dist/client.d.ts +402 -4
  14. package/dist/client.js +2 -0
  15. package/dist/combine-chunks.d.ts +2 -1
  16. package/dist/combine-chunks.js +81 -52
  17. package/dist/combine-video-streams.js +3 -0
  18. package/dist/compositor/get-executable-path.js +30 -15
  19. package/dist/cycle-browser-tabs.js +9 -1
  20. package/dist/ensure-browser.d.ts +3 -0
  21. package/dist/ensure-browser.js +30 -6
  22. package/dist/esm/client.mjs +1325 -954
  23. package/dist/esm/index.mjs +4465 -3324
  24. package/dist/esm/pure.mjs +36 -10
  25. package/dist/file-extensions.js +4 -1
  26. package/dist/get-mp4-brand.d.ts +1 -0
  27. package/dist/get-mp4-brand.js +21 -0
  28. package/dist/get-video-threads-flag.js +5 -1
  29. package/dist/image-format.d.ts +1 -0
  30. package/dist/image-format.js +8 -4
  31. package/dist/index.d.ts +58 -2
  32. package/dist/index.js +4 -0
  33. package/dist/memory/from-macos-sysctl.d.ts +1 -0
  34. package/dist/memory/from-macos-sysctl.js +50 -0
  35. package/dist/memory/from-proc-meminfo.d.ts +1 -1
  36. package/dist/memory/from-proc-meminfo.js +7 -4
  37. package/dist/memory/get-available-memory.js +29 -21
  38. package/dist/mux-video-and-audio.js +11 -2
  39. package/dist/next-frame-to-render.d.ts +3 -7
  40. package/dist/next-frame-to-render.js +3 -22
  41. package/dist/open-browser.js +1 -0
  42. package/dist/options/allow-html-in-canvas.d.ts +1 -0
  43. package/dist/options/allow-html-in-canvas.js +2 -1
  44. package/dist/options/api-key.d.ts +1 -0
  45. package/dist/options/api-key.js +2 -1
  46. package/dist/options/ask-ai.d.ts +1 -0
  47. package/dist/options/ask-ai.js +2 -1
  48. package/dist/options/audio-bitrate.d.ts +1 -0
  49. package/dist/options/audio-bitrate.js +2 -1
  50. package/dist/options/audio-codec.d.ts +1 -0
  51. package/dist/options/audio-codec.js +13 -6
  52. package/dist/options/beep-on-finish.d.ts +1 -0
  53. package/dist/options/beep-on-finish.js +2 -1
  54. package/dist/options/benchmark-concurrencies.d.ts +1 -0
  55. package/dist/options/benchmark-concurrencies.js +2 -1
  56. package/dist/options/binaries-directory.d.ts +1 -0
  57. package/dist/options/binaries-directory.js +2 -1
  58. package/dist/options/browser-executable.d.ts +1 -0
  59. package/dist/options/browser-executable.js +2 -1
  60. package/dist/options/browser.d.ts +1 -0
  61. package/dist/options/browser.js +2 -1
  62. package/dist/options/bundle-cache.d.ts +1 -0
  63. package/dist/options/bundle-cache.js +2 -1
  64. package/dist/options/canvas-tabs.d.ts +1 -0
  65. package/dist/options/canvas-tabs.js +2 -1
  66. package/dist/options/chrome-mode.d.ts +1 -0
  67. package/dist/options/chrome-mode.js +2 -1
  68. package/dist/options/color-space.d.ts +1 -0
  69. package/dist/options/color-space.js +2 -1
  70. package/dist/options/concurrency.d.ts +1 -0
  71. package/dist/options/concurrency.js +2 -1
  72. package/dist/options/config.d.ts +1 -0
  73. package/dist/options/config.js +2 -1
  74. package/dist/options/crf.d.ts +1 -0
  75. package/dist/options/crf.js +2 -1
  76. package/dist/options/cross-site-isolation.d.ts +1 -0
  77. package/dist/options/cross-site-isolation.js +2 -1
  78. package/dist/options/dark-mode.d.ts +1 -0
  79. package/dist/options/dark-mode.js +2 -1
  80. package/dist/options/default-coding-agent.d.ts +1 -0
  81. package/dist/options/default-coding-agent.js +2 -1
  82. package/dist/options/default-editor.d.ts +1 -0
  83. package/dist/options/default-editor.js +2 -1
  84. package/dist/options/default-premount-in-seconds.d.ts +19 -0
  85. package/dist/options/default-premount-in-seconds.js +36 -0
  86. package/dist/options/delete-after.d.ts +1 -0
  87. package/dist/options/delete-after.js +2 -1
  88. package/dist/options/disable-git-source.d.ts +1 -0
  89. package/dist/options/disable-git-source.js +2 -1
  90. package/dist/options/disable-shared-memory-capture.d.ts +17 -0
  91. package/dist/options/disable-shared-memory-capture.js +30 -0
  92. package/dist/options/disable-web-security.d.ts +1 -0
  93. package/dist/options/disable-web-security.js +2 -1
  94. package/dist/options/disallow-parallel-encoding.d.ts +1 -0
  95. package/dist/options/disallow-parallel-encoding.js +2 -1
  96. package/dist/options/enable-cancellation.d.ts +1 -0
  97. package/dist/options/enable-cancellation.js +2 -1
  98. package/dist/options/enable-lambda-insights.d.ts +1 -0
  99. package/dist/options/enable-lambda-insights.js +2 -1
  100. package/dist/options/enable-multiprocess-on-linux.d.ts +1 -0
  101. package/dist/options/enable-multiprocess-on-linux.js +2 -1
  102. package/dist/options/encoding-buffer-size.d.ts +1 -0
  103. package/dist/options/encoding-buffer-size.js +2 -1
  104. package/dist/options/encoding-max-rate.d.ts +1 -0
  105. package/dist/options/encoding-max-rate.js +2 -1
  106. package/dist/options/enforce-audio.d.ts +1 -0
  107. package/dist/options/enforce-audio.js +2 -1
  108. package/dist/options/env-file.d.ts +1 -0
  109. package/dist/options/env-file.js +2 -1
  110. package/dist/options/every-nth-frame.d.ts +1 -0
  111. package/dist/options/every-nth-frame.js +2 -1
  112. package/dist/options/experimental-keep-audio-context-alive.d.ts +1 -0
  113. package/dist/options/experimental-keep-audio-context-alive.js +2 -1
  114. package/dist/options/experimental-sequence-activity-limit.d.ts +19 -0
  115. package/dist/options/experimental-sequence-activity-limit.js +40 -0
  116. package/dist/options/experimental-sequence-activity.d.ts +19 -0
  117. package/dist/options/experimental-sequence-activity.js +38 -0
  118. package/dist/options/experimental-tracks.d.ts +19 -0
  119. package/dist/options/experimental-tracks.js +43 -0
  120. package/dist/options/folder-expiry.d.ts +1 -0
  121. package/dist/options/folder-expiry.js +2 -1
  122. package/dist/options/for-seamless-aac-concatenation.d.ts +1 -0
  123. package/dist/options/for-seamless-aac-concatenation.js +2 -1
  124. package/dist/options/force-new-studio.d.ts +1 -0
  125. package/dist/options/force-new-studio.js +2 -1
  126. package/dist/options/frames.d.ts +1 -0
  127. package/dist/options/frames.js +2 -1
  128. package/dist/options/gl.d.ts +1 -0
  129. package/dist/options/gl.js +2 -1
  130. package/dist/options/gop-size.d.ts +1 -0
  131. package/dist/options/gop-size.js +2 -1
  132. package/dist/options/hardware-acceleration.d.ts +1 -0
  133. package/dist/options/hardware-acceleration.js +2 -1
  134. package/dist/options/headless.d.ts +1 -0
  135. package/dist/options/headless.js +2 -1
  136. package/dist/options/ignore-certificate-errors.d.ts +1 -0
  137. package/dist/options/ignore-certificate-errors.js +2 -1
  138. package/dist/options/image-sequence-pattern.d.ts +2 -1
  139. package/dist/options/image-sequence-pattern.js +2 -1
  140. package/dist/options/image-sequence.d.ts +1 -0
  141. package/dist/options/image-sequence.js +2 -1
  142. package/dist/options/index.d.ts +211 -2
  143. package/dist/options/index.js +12 -0
  144. package/dist/options/interactivity.d.ts +1 -0
  145. package/dist/options/interactivity.js +2 -1
  146. package/dist/options/ipv4.d.ts +1 -0
  147. package/dist/options/ipv4.js +2 -1
  148. package/dist/options/is-production.d.ts +1 -0
  149. package/dist/options/is-production.js +2 -1
  150. package/dist/options/jpeg-quality.d.ts +1 -0
  151. package/dist/options/jpeg-quality.js +6 -2
  152. package/dist/options/keyboard-shortcuts.d.ts +1 -0
  153. package/dist/options/keyboard-shortcuts.js +2 -1
  154. package/dist/options/latency-hint.d.ts +1 -0
  155. package/dist/options/latency-hint.js +2 -1
  156. package/dist/options/license-key.d.ts +1 -0
  157. package/dist/options/license-key.js +2 -1
  158. package/dist/options/log-level.d.ts +1 -0
  159. package/dist/options/log-level.js +2 -1
  160. package/dist/options/metadata.d.ts +1 -0
  161. package/dist/options/metadata.js +2 -1
  162. package/dist/options/mute.d.ts +1 -0
  163. package/dist/options/mute.js +2 -1
  164. package/dist/options/no-open.d.ts +1 -0
  165. package/dist/options/no-open.js +2 -1
  166. package/dist/options/number-of-gif-loops.d.ts +1 -0
  167. package/dist/options/number-of-gif-loops.js +2 -1
  168. package/dist/options/number-of-shared-audio-tags.d.ts +1 -0
  169. package/dist/options/number-of-shared-audio-tags.js +2 -1
  170. package/dist/options/offthreadvideo-cache-size.d.ts +1 -0
  171. package/dist/options/offthreadvideo-cache-size.js +2 -1
  172. package/dist/options/offthreadvideo-threads.d.ts +1 -0
  173. package/dist/options/offthreadvideo-threads.js +2 -1
  174. package/dist/options/on-browser-download.d.ts +1 -0
  175. package/dist/options/on-browser-download.js +2 -1
  176. package/dist/options/option.d.ts +1 -0
  177. package/dist/options/options-map.d.ts +189 -1
  178. package/dist/options/options-map.js +4 -0
  179. package/dist/options/out-dir.d.ts +1 -0
  180. package/dist/options/out-dir.js +2 -1
  181. package/dist/options/override-duration.d.ts +1 -0
  182. package/dist/options/override-duration.js +2 -1
  183. package/dist/options/override-fps.d.ts +1 -0
  184. package/dist/options/override-fps.js +2 -1
  185. package/dist/options/override-height.d.ts +1 -0
  186. package/dist/options/override-height.js +2 -1
  187. package/dist/options/override-width.d.ts +1 -0
  188. package/dist/options/override-width.js +2 -1
  189. package/dist/options/overwrite.d.ts +1 -0
  190. package/dist/options/overwrite.js +2 -1
  191. package/dist/options/package-manager.d.ts +1 -0
  192. package/dist/options/package-manager.js +2 -1
  193. package/dist/options/pixel-format.d.ts +1 -0
  194. package/dist/options/pixel-format.js +2 -1
  195. package/dist/options/port.d.ts +1 -0
  196. package/dist/options/port.js +2 -1
  197. package/dist/options/prefer-lossless.d.ts +1 -0
  198. package/dist/options/prefer-lossless.js +2 -1
  199. package/dist/options/preview-sample-rate.d.ts +1 -0
  200. package/dist/options/preview-sample-rate.js +2 -1
  201. package/dist/options/props.d.ts +1 -0
  202. package/dist/options/props.js +2 -1
  203. package/dist/options/prores-profile.d.ts +1 -0
  204. package/dist/options/prores-profile.js +2 -1
  205. package/dist/options/public-dir.d.ts +1 -0
  206. package/dist/options/public-dir.js +2 -1
  207. package/dist/options/public-license-key.d.ts +1 -0
  208. package/dist/options/public-license-key.js +2 -1
  209. package/dist/options/public-path.d.ts +1 -0
  210. package/dist/options/public-path.js +2 -1
  211. package/dist/options/repro.d.ts +1 -0
  212. package/dist/options/repro.js +2 -1
  213. package/dist/options/rspack.d.ts +2 -1
  214. package/dist/options/rspack.js +2 -1
  215. package/dist/options/runs.d.ts +1 -0
  216. package/dist/options/runs.js +2 -1
  217. package/dist/options/sample-rate.d.ts +1 -0
  218. package/dist/options/sample-rate.js +2 -1
  219. package/dist/options/scale.d.ts +1 -0
  220. package/dist/options/scale.js +2 -1
  221. package/dist/options/separate-audio.d.ts +1 -0
  222. package/dist/options/separate-audio.js +3 -2
  223. package/dist/options/show-premounting.d.ts +19 -0
  224. package/dist/options/show-premounting.js +33 -0
  225. package/dist/options/skip-skills.d.ts +1 -0
  226. package/dist/options/skip-skills.js +2 -1
  227. package/dist/options/still-frame.d.ts +1 -0
  228. package/dist/options/still-frame.js +2 -1
  229. package/dist/options/still-image-format.d.ts +1 -0
  230. package/dist/options/still-image-format.js +2 -1
  231. package/dist/options/throw-if-site-exists.d.ts +1 -0
  232. package/dist/options/throw-if-site-exists.js +2 -1
  233. package/dist/options/timeout.d.ts +1 -0
  234. package/dist/options/timeout.js +2 -1
  235. package/dist/options/user-agent.d.ts +1 -0
  236. package/dist/options/user-agent.js +2 -1
  237. package/dist/options/version-flag.d.ts +1 -0
  238. package/dist/options/version-flag.js +2 -1
  239. package/dist/options/video-bitrate.d.ts +1 -0
  240. package/dist/options/video-bitrate.js +2 -1
  241. package/dist/options/video-cache-size.d.ts +1 -0
  242. package/dist/options/video-cache-size.js +2 -1
  243. package/dist/options/video-codec.d.ts +1 -0
  244. package/dist/options/video-codec.js +5 -3
  245. package/dist/options/video-image-format.d.ts +1 -0
  246. package/dist/options/video-image-format.js +7 -2
  247. package/dist/options/webhook-custom-data.d.ts +1 -0
  248. package/dist/options/webhook-custom-data.js +2 -1
  249. package/dist/options/webpack-poll.d.ts +1 -0
  250. package/dist/options/webpack-poll.js +2 -1
  251. package/dist/options/x264-preset.d.ts +1 -0
  252. package/dist/options/x264-preset.js +2 -1
  253. package/dist/prespawn-ffmpeg.d.ts +20 -0
  254. package/dist/prespawn-ffmpeg.js +157 -29
  255. package/dist/probe-shared-memory-capture.d.ts +8 -0
  256. package/dist/probe-shared-memory-capture.js +111 -0
  257. package/dist/puppeteer-screenshot.d.ts +3 -1
  258. package/dist/puppeteer-screenshot.js +1 -0
  259. package/dist/pure.d.ts +1 -1
  260. package/dist/remotion-shared-memory-ffmpeg.d.ts +26 -0
  261. package/dist/remotion-shared-memory-ffmpeg.js +312 -0
  262. package/dist/remotion-shared-memory.d.ts +49 -0
  263. package/dist/remotion-shared-memory.js +359 -0
  264. package/dist/render-frame-and-retry-target-close.d.ts +5 -2
  265. package/dist/render-frame-and-retry-target-close.js +20 -4
  266. package/dist/render-frame-with-option-to-reject.d.ts +4 -1
  267. package/dist/render-frame-with-option-to-reject.js +206 -115
  268. package/dist/render-frame.d.ts +4 -5
  269. package/dist/render-frame.js +3 -1
  270. package/dist/render-frames.d.ts +3 -0
  271. package/dist/render-frames.js +15 -18
  272. package/dist/render-media.d.ts +1 -1
  273. package/dist/render-media.js +131 -46
  274. package/dist/render-still.js +1 -0
  275. package/dist/screenshot-background.d.ts +2 -0
  276. package/dist/screenshot-background.js +20 -0
  277. package/dist/screenshot-task.d.ts +4 -2
  278. package/dist/screenshot-task.js +40 -21
  279. package/dist/seek-to-frame.js +1 -1
  280. package/dist/stitch-frames-to-video.js +71 -10
  281. package/dist/take-frame.d.ts +11 -3
  282. package/dist/take-frame.js +10 -8
  283. package/dist/validate-output-filename.d.ts +1 -1
  284. package/dist/validate-output-filename.js +10 -2
  285. package/package.json +13 -13
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAacPrimingInputArgs = exports.LIBFDK_AAC_LC_ENCODER_DELAY_IN_SAMPLES = void 0;
4
+ const get_mp4_brand_1 = require("./get-mp4-brand");
4
5
  // libfdk_aac (AAC-LC) prepends 2048 samples of encoder delay ("priming") to
5
6
  // its output. The audio is encoded to ADTS first (compressAudio, combineAudio),
6
7
  // and ADTS cannot signal that delay, so stream-copying it into an MP4 or MOV
@@ -10,12 +11,15 @@ exports.getAacPrimingInputArgs = exports.LIBFDK_AAC_LC_ENCODER_DELAY_IN_SAMPLES
10
11
  // edit list that skips the priming, like encoding straight to MP4 does.
11
12
  exports.LIBFDK_AAC_LC_ENCODER_DELAY_IN_SAMPLES = 2048;
12
13
  const getAacPrimingInputArgs = ({ audioCodec, sampleRate, outputExtension, }) => {
14
+ var _a;
13
15
  if (audioCodec !== 'aac') {
14
16
  return [];
15
17
  }
16
18
  // Only containers with edit lists can carry the shift
17
- const extension = outputExtension === null || outputExtension === void 0 ? void 0 : outputExtension.toLowerCase();
18
- if (extension !== 'mp4' && extension !== 'mov') {
19
+ const extension = (_a = outputExtension === null || outputExtension === void 0 ? void 0 : outputExtension.toLowerCase()) !== null && _a !== void 0 ? _a : null;
20
+ if (extension !== 'mp4' &&
21
+ extension !== 'mov' &&
22
+ (0, get_mp4_brand_1.getMp4BrandForExtension)(extension) === null) {
19
23
  return [];
20
24
  }
21
25
  const delayInMicroseconds = Math.round((exports.LIBFDK_AAC_LC_ENCODER_DELAY_IN_SAMPLES / sampleRate) * 1000000);
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { DownloadBrowserProgressFn } from '../options/on-browser-download';
17
- import { TESTED_VERSION } from './get-chrome-download-url';
17
+ import { type Platform, TESTED_VERSION } from './get-chrome-download-url';
18
18
  export { TESTED_VERSION };
19
19
  interface BrowserFetcherRevisionInfo {
20
20
  folderPath: string;
@@ -22,6 +22,12 @@ interface BrowserFetcherRevisionInfo {
22
22
  url: string;
23
23
  local: boolean;
24
24
  }
25
+ export declare const getPlatform: () => Platform;
26
+ export declare const getExpectedVersion: ({ version, chromeMode, platform, }: {
27
+ version: string | null;
28
+ chromeMode: "chrome-for-testing" | "headless-shell";
29
+ platform: Platform;
30
+ }) => string;
25
31
  export declare const readVersionFile: (chromeMode: "chrome-for-testing" | "headless-shell") => string | null;
26
32
  export declare const downloadBrowser: ({ logLevel, indent, onProgress, version, chromeMode, }: {
27
33
  logLevel: "error" | "info" | "trace" | "verbose" | "warn";
@@ -48,7 +48,7 @@ var __importStar = (this && this.__importStar) || (function () {
48
48
  };
49
49
  })();
50
50
  Object.defineProperty(exports, "__esModule", { value: true });
51
- exports.getRevisionInfo = exports.downloadBrowser = exports.readVersionFile = exports.TESTED_VERSION = void 0;
51
+ exports.getRevisionInfo = exports.downloadBrowser = exports.readVersionFile = exports.getExpectedVersion = exports.getPlatform = exports.TESTED_VERSION = void 0;
52
52
  const fs = __importStar(require("node:fs"));
53
53
  const os = __importStar(require("node:os"));
54
54
  const path = __importStar(require("node:path"));
@@ -82,6 +82,7 @@ const getPlatform = () => {
82
82
  throw new Error('Unsupported platform: ' + platform);
83
83
  }
84
84
  };
85
+ exports.getPlatform = getPlatform;
85
86
  const getDownloadsFolder = (chromeMode) => {
86
87
  const destination = chromeMode === 'headless-shell'
87
88
  ? 'chrome-headless-shell'
@@ -92,12 +93,26 @@ const getVersionFilePath = (chromeMode) => {
92
93
  const downloadsFolder = getDownloadsFolder(chromeMode);
93
94
  return path.join(downloadsFolder, 'VERSION');
94
95
  };
95
- const getExpectedVersion = (version, _chromeMode) => {
96
+ const getExpectedVersion = ({ version, chromeMode, platform, }) => {
96
97
  if (version) {
97
98
  return version;
98
99
  }
100
+ // Remotion-patched builds get their own cache marker so an existing stock or
101
+ // older patched download of the same Chromium version is replaced once.
102
+ // Remotion builds include the v3 shared-memory patch; Google's CDN builds
103
+ // are stock Chromium.
104
+ const downloadUrl = (0, get_chrome_download_url_1.getChromeDownloadUrl)({
105
+ platform,
106
+ version: null,
107
+ chromeMode,
108
+ });
109
+ if (chromeMode === 'headless-shell' &&
110
+ downloadUrl.startsWith('https://remotion.media/')) {
111
+ return `${get_chrome_download_url_1.TESTED_VERSION}-remotion-v3`;
112
+ }
99
113
  return get_chrome_download_url_1.TESTED_VERSION;
100
114
  };
115
+ exports.getExpectedVersion = getExpectedVersion;
101
116
  const readVersionFile = (chromeMode) => {
102
117
  const versionFilePath = getVersionFilePath(chromeMode);
103
118
  try {
@@ -113,7 +128,7 @@ const writeVersionFile = (chromeMode, version) => {
113
128
  fs.writeFileSync(versionFilePath, version);
114
129
  };
115
130
  const downloadBrowser = async ({ logLevel, indent, onProgress, version, chromeMode, }) => {
116
- const platform = getPlatform();
131
+ const platform = (0, exports.getPlatform)();
117
132
  const downloadURL = (0, get_chrome_download_url_1.getChromeDownloadUrl)({ platform, version, chromeMode });
118
133
  const fileName = downloadURL.split('/').pop();
119
134
  if (!fileName) {
@@ -122,7 +137,7 @@ const downloadBrowser = async ({ logLevel, indent, onProgress, version, chromeMo
122
137
  const downloadsFolder = getDownloadsFolder(chromeMode);
123
138
  const archivePath = path.join(downloadsFolder, fileName);
124
139
  const outputPath = getFolderPath(downloadsFolder, platform);
125
- const expectedVersion = getExpectedVersion(version, chromeMode);
140
+ const expectedVersion = (0, exports.getExpectedVersion)({ version, chromeMode, platform });
126
141
  if (await existsAsync(outputPath)) {
127
142
  const installedVersion = (0, exports.readVersionFile)(chromeMode);
128
143
  if (installedVersion === expectedVersion) {
@@ -181,12 +196,14 @@ const downloadBrowser = async ({ logLevel, indent, onProgress, version, chromeMo
181
196
  for (const subdir of possibleSubdirs) {
182
197
  const chromeLinuxFolder = path.join(outputPath, subdir);
183
198
  const chromePath = path.join(chromeLinuxFolder, 'chrome');
184
- if (fs.existsSync(chromePath)) {
199
+ if (chromeMode === 'headless-shell' && fs.existsSync(chromePath)) {
185
200
  const chromeHeadlessShellPath = path.join(chromeLinuxFolder, 'chrome-headless-shell');
186
201
  fs.renameSync(chromePath, chromeHeadlessShellPath);
187
202
  }
188
203
  if (fs.existsSync(chromeLinuxFolder)) {
189
- const targetFolder = path.join(outputPath, 'chrome-headless-shell-' + platform);
204
+ const targetFolder = path.join(outputPath, (chromeMode === 'headless-shell'
205
+ ? 'chrome-headless-shell-'
206
+ : 'chrome-') + platform);
190
207
  if (chromeLinuxFolder !== targetFolder) {
191
208
  fs.renameSync(chromeLinuxFolder, targetFolder);
192
209
  }
@@ -216,7 +233,7 @@ const getFolderPath = (downloadsFolder, platform) => {
216
233
  };
217
234
  const getExecutablePath = (chromeMode) => {
218
235
  const downloadsFolder = getDownloadsFolder(chromeMode);
219
- const platform = getPlatform();
236
+ const platform = (0, exports.getPlatform)();
220
237
  const folderPath = getFolderPath(downloadsFolder, platform);
221
238
  if (chromeMode === 'chrome-for-testing') {
222
239
  if (platform === 'mac-arm64' || platform === 'mac-x64') {
@@ -226,23 +243,26 @@ const getExecutablePath = (chromeMode) => {
226
243
  return path.join(folderPath, 'chrome-win64', 'chrome.exe');
227
244
  }
228
245
  if (platform === 'linux64' || platform === 'linux-arm64') {
229
- return path.join(folderPath, 'chrome-linux64', 'chrome');
246
+ return path.join(folderPath, `chrome-${platform}`, 'chrome');
230
247
  }
231
248
  throw new Error('unsupported platform' + platform);
232
249
  }
233
250
  if (chromeMode === 'headless-shell') {
234
- return path.join(folderPath, `chrome-headless-shell-${platform}`, platform === 'win64'
251
+ const shellFolder = path.join(folderPath, `chrome-headless-shell-${platform}`);
252
+ const remotionExecutable = path.join(shellFolder, 'headless_shell');
253
+ if (fs.existsSync(remotionExecutable)) {
254
+ return remotionExecutable;
255
+ }
256
+ return path.join(shellFolder, platform === 'win64'
235
257
  ? 'chrome-headless-shell.exe'
236
- : platform === 'linux-arm64' || (0, get_chrome_download_url_1.isAmazonLinux2023)()
237
- ? 'headless_shell'
238
- : 'chrome-headless-shell');
258
+ : 'chrome-headless-shell');
239
259
  }
240
260
  throw new Error('unsupported chrome mode' + chromeMode);
241
261
  };
242
262
  const getRevisionInfo = (chromeMode) => {
243
263
  const executablePath = getExecutablePath(chromeMode);
244
264
  const downloadsFolder = getDownloadsFolder(chromeMode);
245
- const platform = getPlatform();
265
+ const platform = (0, exports.getPlatform)();
246
266
  const folderPath = getFolderPath(downloadsFolder, platform);
247
267
  const url = (0, get_chrome_download_url_1.getChromeDownloadUrl)({ platform, version: null, chromeMode });
248
268
  const local = fs.existsSync(folderPath);
@@ -18,6 +18,7 @@ exports.Page = void 0;
18
18
  */
19
19
  const no_react_1 = require("remotion/no-react");
20
20
  const format_logs_1 = require("../format-logs");
21
+ const log_level_1 = require("../log-level");
21
22
  const logger_1 = require("../logger");
22
23
  const truthy_1 = require("../truthy");
23
24
  const assert_1 = require("./assert");
@@ -162,6 +163,9 @@ class Page extends EventEmitter_1.EventEmitter {
162
163
  if ((url === null || url === void 0 ? void 0 : url.endsWith(no_react_1.NoReactInternals.bundleName)) &&
163
164
  lineNumber &&
164
165
  this.sourceMapGetter()) {
166
+ if (!(0, log_level_1.isEqualOrBelowLogLevel)(logLevel, log.logLevel)) {
167
+ return;
168
+ }
165
169
  const origPosition = (_b = this.sourceMapGetter()) === null || _b === void 0 ? void 0 : _b.originalPositionFor({
166
170
  column: columnNumber !== null && columnNumber !== void 0 ? columnNumber : 0,
167
171
  line: lineNumber,
@@ -50,14 +50,11 @@ class Connection extends EventEmitter_1.EventEmitter {
50
50
  const params = paramArgs.length ? paramArgs[0] : undefined;
51
51
  const id = this._rawSend({ method, params });
52
52
  return new Promise((resolve, reject) => {
53
- var _a;
54
53
  this.#callbacks.set(id, {
55
54
  resolve,
56
55
  reject,
57
56
  method,
58
- returnSize: true,
59
- stack: (_a = new Error().stack) !== null && _a !== void 0 ? _a : '',
60
- fn: method + JSON.stringify(params),
57
+ params: params !== null && params !== void 0 ? params : null,
61
58
  });
62
59
  });
63
60
  }
@@ -105,11 +102,8 @@ class Connection extends EventEmitter_1.EventEmitter {
105
102
  if (object.error) {
106
103
  callback.reject(createProtocolError(callback.method, object));
107
104
  }
108
- else if (callback.returnSize) {
109
- callback.resolve({ value: object.result, size: message.length });
110
- }
111
105
  else {
112
- callback.resolve(object.result);
106
+ callback.resolve({ value: object.result, size: message.length });
113
107
  }
114
108
  }
115
109
  }
@@ -183,10 +177,9 @@ class CDPSession extends EventEmitter_1.EventEmitter {
183
177
  params,
184
178
  });
185
179
  return new Promise((resolve, reject) => {
186
- var _a;
187
180
  if (this.#callbacks.size > 100) {
188
181
  for (const callback of this.#callbacks.values()) {
189
- logger_1.Log.info({ indent: false, logLevel: 'info' }, callback.fn);
182
+ logger_1.Log.info({ indent: false, logLevel: 'info' }, callback.method + JSON.stringify(callback.params));
190
183
  }
191
184
  throw new Error('Leak detected: Too many callbacks');
192
185
  }
@@ -194,9 +187,7 @@ class CDPSession extends EventEmitter_1.EventEmitter {
194
187
  resolve,
195
188
  reject,
196
189
  method,
197
- returnSize: true,
198
- stack: (_a = new Error().stack) !== null && _a !== void 0 ? _a : '',
199
- fn: method + JSON.stringify(params),
190
+ params: params !== null && params !== void 0 ? params : null,
200
191
  });
201
192
  });
202
193
  }
@@ -207,11 +198,8 @@ class CDPSession extends EventEmitter_1.EventEmitter {
207
198
  if (object.error) {
208
199
  callback.reject(createProtocolError(callback.method, object));
209
200
  }
210
- else if (callback.returnSize) {
211
- callback.resolve({ value: object.result, size });
212
- }
213
201
  else {
214
- callback.resolve(object.result);
202
+ callback.resolve({ value: object.result, size });
215
203
  }
216
204
  }
217
205
  else {
@@ -151,10 +151,8 @@ class WaitTask {
151
151
  const runCount = ++this.#runCount;
152
152
  let success = null;
153
153
  let error = null;
154
- const context = await this.#domWorld.executionContext();
155
- if (this.#terminated || runCount !== this.#runCount) {
156
- return;
157
- }
154
+ const contextPromise = this.#domWorld.executionContext();
155
+ const context = await contextPromise;
158
156
  if (this.#terminated || runCount !== this.#runCount) {
159
157
  return;
160
158
  }
@@ -171,22 +169,30 @@ class WaitTask {
171
169
  return;
172
170
  }
173
171
  // Ignore timeouts in pageScript - we track timeouts ourselves.
174
- // If the frame's execution context has already changed, `frame.evaluate` will
175
- // throw an error - ignore this predicate run altogether.
172
+ // Primitive results need no further CDP evaluation, but must still belong
173
+ // to the current execution context. Object handles are checked in the page.
176
174
  if (!error &&
177
- (await this.#domWorld
178
- .evaluate((s) => {
179
- return !s;
180
- }, success)
181
- .catch(() => {
182
- return true;
183
- }))) {
175
+ (success && !success._remoteObject.objectId
176
+ ? !(0, util_1.valueFromRemoteObject)(success._remoteObject) ||
177
+ !this.#domWorld._hasContext() ||
178
+ this.#domWorld.executionContext() !== contextPromise
179
+ : await this.#domWorld
180
+ .evaluate((s) => {
181
+ return !s;
182
+ }, success)
183
+ .catch(() => {
184
+ return true;
185
+ }))) {
184
186
  if (!success) {
185
187
  throw new Error('Assertion: result handle is not available');
186
188
  }
187
189
  await success.dispose();
188
190
  return;
189
191
  }
192
+ if (this.#terminated || runCount !== this.#runCount) {
193
+ await (success === null || success === void 0 ? void 0 : success.dispose());
194
+ return;
195
+ }
190
196
  if (error) {
191
197
  if (error.message.includes('TypeError: binding is not a function')) {
192
198
  return this.rerun();
@@ -1,4 +1,4 @@
1
- import type { ActivateTargetRequest, AddScriptToEvaluateOnNewDocumentRequest, AddScriptToEvaluateOnNewDocumentResponse, CallFunctionOnRequest, CallFunctionOnResponse, CaptureScreenshotRequest, CaptureScreenshotResponse, CloseTargetRequest, CloseTargetResponse, CreateIsolatedWorldRequest, CreateIsolatedWorldResponse, DetachFromTargetRequest, DevtoolsRemoteObject, EnableRequest, ExceptionDetails, GetFrameTreeResponse, NavigateRequest, NavigateResponse, PrintPDFRequest, PrintPDFResponse, ReleaseObjectRequest, SetAutoAttachRequest, SetDefaultBackgroundColorOverrideRequest, SetDeviceMetricsOverrideRequest, SetLifecycleEventsEnabledRequest } from './devtools-types';
1
+ import type { ActivateTargetRequest, AddScriptToEvaluateOnNewDocumentRequest, AddScriptToEvaluateOnNewDocumentResponse, CallFunctionOnRequest, CallFunctionOnResponse, CaptureScreenshotRequest, CaptureScreenshotResponse, CloseTargetRequest, CloseTargetResponse, CreateIsolatedWorldRequest, CreateIsolatedWorldResponse, DetachFromTargetRequest, DevtoolsRemoteObject, EnableRequest, ExceptionDetails, GetFrameTreeResponse, NavigateRequest, NavigateResponse, PrintPDFRequest, PrintPDFResponse, RemotionCreateFramePoolRequest, RemotionCreateFramePoolResponse, RemotionReleaseFrameRequest, ReleaseObjectRequest, SetAutoAttachRequest, SetDefaultBackgroundColorOverrideRequest, SetDeviceMetricsOverrideRequest, SetLifecycleEventsEnabledRequest } from './devtools-types';
2
2
  export interface Commands {
3
3
  /**
4
4
  * Does nothing.
@@ -216,6 +216,18 @@ export interface Commands {
216
216
  paramsType: [CaptureScreenshotRequest?];
217
217
  returnType: CaptureScreenshotResponse;
218
218
  };
219
+ 'Page.remotionCreateFramePool': {
220
+ paramsType: [RemotionCreateFramePoolRequest];
221
+ returnType: RemotionCreateFramePoolResponse;
222
+ };
223
+ 'Page.remotionReleaseFrame': {
224
+ paramsType: [RemotionReleaseFrameRequest];
225
+ returnType: void;
226
+ };
227
+ 'Page.remotionDestroyFramePool': {
228
+ paramsType: [];
229
+ returnType: void;
230
+ };
219
231
  'Page.printToPDF': {
220
232
  paramsType: [PrintPDFRequest];
221
233
  returnType: PrintPDFResponse;
@@ -589,12 +589,74 @@ export interface CaptureScreenshotRequest {
589
589
  * Optimize image encoding for speed, not for resulting size (defaults to false) EXPERIMENTAL
590
590
  */
591
591
  optimizeForSpeed?: boolean;
592
+ /**
593
+ * Writes the captured pixels into this slot of a Remotion shared-memory
594
+ * frame pool instead of encoding an image. Remotion Chromium only.
595
+ */
596
+ remotionFrameSlot?: number;
597
+ /**
598
+ * Ownership token for the shared-memory slot. Must be supplied together
599
+ * with `remotionFrameSlot`. Remotion Chromium only.
600
+ */
601
+ remotionFrameId?: string;
602
+ /**
603
+ * Skips the temporary viewport resize used by the regular CDP screenshot
604
+ * path. Remotion Chromium only.
605
+ */
606
+ remotionFastViewport?: boolean;
592
607
  }
593
608
  export interface CaptureScreenshotResponse {
594
609
  /**
595
610
  * Base64-encoded image data. (Encoded as a base64 string when passed over JSON)
596
611
  */
597
612
  data: string;
613
+ remotionFrame?: RemotionRawFrame;
614
+ }
615
+ export interface RemotionRawFrame {
616
+ slot: number;
617
+ frameId: string;
618
+ width: number;
619
+ height: number;
620
+ stride: number;
621
+ byteLength: number;
622
+ pixelFormat: 'bgra';
623
+ alphaType: 'opaque' | 'straight';
624
+ colorSpace: 'srgb';
625
+ capturePath: string;
626
+ }
627
+ export type RemotionFramePoolBackend = 'posix-shm' | 'file';
628
+ export interface RemotionCreateFramePoolRequest {
629
+ slotCount: number;
630
+ slotCapacity: number;
631
+ /**
632
+ * Absolute path of a private directory. Chromium creates the pool as a
633
+ * regular file inside it when POSIX shared memory is unavailable, for
634
+ * example on AWS Lambda where `/dev/shm` does not exist. Ignored by
635
+ * Chromium builds that only support POSIX shared memory.
636
+ */
637
+ backingDirectory?: string;
638
+ /**
639
+ * `auto` (default) prefers POSIX shared memory and falls back to
640
+ * `backingDirectory`; `posix-shm` and `file` require that backend.
641
+ */
642
+ preferredBackend?: 'auto' | RemotionFramePoolBackend;
643
+ }
644
+ export interface RemotionCreateFramePoolResponse {
645
+ /**
646
+ * A POSIX shared-memory name such as `/rmshm-123`, or for the `file`
647
+ * backend the absolute path of the created pool file.
648
+ */
649
+ sharedMemoryName: string;
650
+ slotCount: number;
651
+ slotCapacity: number;
652
+ /**
653
+ * Absent in Chromium builds that only support POSIX shared memory.
654
+ */
655
+ backend?: RemotionFramePoolBackend;
656
+ }
657
+ export interface RemotionReleaseFrameRequest {
658
+ slot: number;
659
+ frameId: string;
598
660
  }
599
661
  export interface PrintPDFRequest {
600
662
  /**
@@ -1,5 +1,5 @@
1
1
  import type { ChromeMode } from '../options/chrome-mode';
2
- export declare const TESTED_VERSION = "149.0.7790.0";
2
+ export declare const TESTED_VERSION = "157.0.8080.0";
3
3
  export type Platform = 'linux64' | 'linux-arm64' | 'mac-x64' | 'mac-arm64' | 'win64';
4
4
  export declare const isAmazonLinux2023: () => boolean;
5
5
  export declare const canUseRemotionMediaBinaries: () => boolean;
@@ -38,10 +38,7 @@ exports.getChromeDownloadUrl = getChromeDownloadUrl;
38
38
  const fs = __importStar(require("node:fs"));
39
39
  const os = __importStar(require("node:os"));
40
40
  const logger_1 = require("../logger");
41
- exports.TESTED_VERSION = '149.0.7790.0';
42
- // https://github.com/microsoft/playwright/blame/e76ca6cba40c26bf22c19cf37398d2b9da9ed465/packages/playwright-core/browsers.json
43
- // packages/playwright-core/browsers.json
44
- const PLAYWRIGHT_VERSION = '1421'; // 149.0.7790.0
41
+ exports.TESTED_VERSION = '157.0.8080.0';
45
42
  const isAmazonLinux2023 = () => {
46
43
  if (os.platform() !== 'linux') {
47
44
  return false;
@@ -105,41 +102,30 @@ const canUseRemotionMediaBinaries = () => {
105
102
  };
106
103
  exports.canUseRemotionMediaBinaries = canUseRemotionMediaBinaries;
107
104
  function getChromeDownloadUrl({ platform, version, chromeMode, }) {
108
- if (platform === 'linux-arm64') {
109
- // Amazon Linux 2023 on arm64 needs a special build.
110
- // This binary is compatible with older glibc (no 2.35 requirement).
111
- if ((0, exports.isAmazonLinux2023)() && chromeMode === 'headless-shell' && !version) {
112
- return 'https://remotion.media/chromium-headless-shell-amazon-linux-arm64-149.0.7790.0.zip?clear';
113
- }
114
- if (chromeMode === 'chrome-for-testing') {
115
- return `https://playwright.azureedge.net/builds/chromium/${version !== null && version !== void 0 ? version : PLAYWRIGHT_VERSION}/chromium-linux-arm64.zip`;
116
- }
117
- if (version) {
118
- return `https://playwright.azureedge.net/builds/chromium/${version}/chromium-headless-shell-linux-arm64.zip`;
119
- }
120
- // Regular arm64 binary requires glibc 2.35+
121
- if ((0, exports.canUseRemotionMediaBinaries)()) {
122
- return `https://remotion.media/chromium-headless-shell-linux-arm64-${exports.TESTED_VERSION}.zip?clear`;
123
- }
124
- // Fall back to Playwright for older glibc (non-Amazon Linux systems)
125
- return `https://playwright.azureedge.net/builds/chromium/${PLAYWRIGHT_VERSION}/chromium-headless-shell-linux-arm64.zip`;
105
+ // Preserve explicit Playwright revision overrides on Linux ARM64. Default
106
+ // downloads and Chrome version overrides use Google's CDN on every platform.
107
+ if (platform === 'linux-arm64' && version && /^\d+$/.test(version)) {
108
+ const archive = chromeMode === 'chrome-for-testing'
109
+ ? 'chromium-linux-arm64'
110
+ : 'chromium-headless-shell-linux-arm64';
111
+ return `https://playwright.azureedge.net/builds/chromium/${version}/${archive}.zip`;
126
112
  }
127
- if (chromeMode === 'headless-shell') {
128
- // Amazon Linux 2023 needs a special build.
129
- // This binary is compatible with older glibc (no 2.35 requirement).
130
- if ((0, exports.isAmazonLinux2023)() && platform === 'linux64' && !version) {
131
- return `https://remotion.media/chromium-headless-shell-amazon-linux-x64-149.0.7790.0.zip?clear`;
113
+ if (chromeMode === 'headless-shell' && version === null) {
114
+ if (platform === 'mac-arm64') {
115
+ return `https://remotion.media/chromium-headless-shell-mac-arm64-${exports.TESTED_VERSION}.zip?clear`;
132
116
  }
133
- if (platform === 'linux64' && version === null) {
117
+ if (platform === 'linux64' || platform === 'linux-arm64') {
118
+ const architecture = platform === 'linux64' ? 'x64' : 'arm64';
119
+ if ((0, exports.isAmazonLinux2023)()) {
120
+ return `https://remotion.media/chromium-headless-shell-amazon-linux-${architecture}-${exports.TESTED_VERSION}.zip?clear`;
121
+ }
134
122
  if ((0, exports.canUseRemotionMediaBinaries)()) {
135
- return `https://remotion.media/chromium-headless-shell-linux-x64-${exports.TESTED_VERSION}.zip?clear`;
123
+ return `https://remotion.media/chromium-headless-shell-linux-${architecture}-${exports.TESTED_VERSION}.zip?clear`;
136
124
  }
137
- // Fall back to Google's CDN for older glibc
138
- return `https://storage.googleapis.com/chrome-for-testing-public/${exports.TESTED_VERSION}/${platform}/chrome-headless-shell-${platform}.zip`;
139
125
  }
140
- return `https://storage.googleapis.com/chrome-for-testing-public/${version !== null && version !== void 0 ? version : exports.TESTED_VERSION}/${platform}/chrome-headless-shell-${platform}.zip`;
141
126
  }
142
- return `https://storage.googleapis.com/chrome-for-testing-public/${version !== null && version !== void 0 ? version : exports.TESTED_VERSION}/${platform}/chrome-${platform}.zip`;
127
+ const archive = chromeMode === 'headless-shell' ? 'chrome-headless-shell' : 'chrome';
128
+ return `https://storage.googleapis.com/chrome-for-testing-public/${version !== null && version !== void 0 ? version : exports.TESTED_VERSION}/${platform}/${archive}-${platform}.zip`;
143
129
  }
144
130
  const logDownloadUrl = ({ url, logLevel, indent, }) => {
145
131
  logger_1.Log.info({ indent, logLevel }, `Downloading from: ${url}`);
@@ -1,2 +1 @@
1
1
  export declare const canUseParallelEncoding: (codec: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav") => boolean;
2
- export declare const getShouldUsePartitionedRendering: () => boolean;
@@ -1,19 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getShouldUsePartitionedRendering = exports.canUseParallelEncoding = void 0;
3
+ exports.canUseParallelEncoding = void 0;
4
4
  const is_audio_codec_1 = require("./is-audio-codec");
5
5
  const canUseParallelEncoding = (codec) => {
6
- if ((0, exports.getShouldUsePartitionedRendering)()) {
7
- return false;
8
- }
9
6
  if ((0, is_audio_codec_1.isAudioCodec)(codec)) {
10
7
  return false;
11
8
  }
12
- return codec === 'h264' || codec === 'h264-mkv' || codec === 'h265';
9
+ // GIF encoding uses a palette generated from the entire video.
10
+ return (codec === 'h264' ||
11
+ codec === 'h264-mkv' ||
12
+ codec === 'h264-ts' ||
13
+ codec === 'h265' ||
14
+ codec === 'vp8' ||
15
+ codec === 'vp9' ||
16
+ codec === 'av1' ||
17
+ codec === 'prores');
13
18
  };
14
19
  exports.canUseParallelEncoding = canUseParallelEncoding;
15
- const getShouldUsePartitionedRendering = () => {
16
- const shouldUsePartitionedRendering = process.env.REMOTION_PARTITIONED_RENDERING === 'true';
17
- return shouldUsePartitionedRendering;
18
- };
19
- exports.getShouldUsePartitionedRendering = getShouldUsePartitionedRendering;