hyperframes 0.8.200 → 0.8.201

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 (191) hide show
  1. package/dist/{add-MFJDOJHQ.js → add-33XNCMY4.js} +14 -17
  2. package/dist/{animatedGifPrep-WBZ2VVP6.js → animatedGifPrep-MI7Z4OYQ.js} +8 -11
  3. package/dist/api.js +16 -19
  4. package/dist/{asset-PTAQLOR6.js → asset-RMRQN24O.js} +2 -2
  5. package/dist/{assetCataloger-N3UGZ2RC.js → assetCataloger-KWTQNFUU.js} +8 -11
  6. package/dist/{audio-CPHWRLC4.js → audio-SQDZZS6X.js} +33 -31
  7. package/dist/{auth-ZWOJIYK7.js → auth-PNC6K5ZD.js} +2 -2
  8. package/dist/{autoUpdate-DO74673A.js → autoUpdate-MBZFLUF2.js} +2 -2
  9. package/dist/{backgroundChecks-HOAN7YB6.js → backgroundChecks-ZMSPA6TK.js} +3 -3
  10. package/dist/backgroundChecksWorker.js +3 -3
  11. package/dist/{batchRender-AZFHTPSV.js → batchRender-2MMOZRMW.js} +5 -7
  12. package/dist/{beats-JRMM6JQQ.js → beats-GDLNPR4A.js} +32 -23
  13. package/dist/{benchmark-2PEQUV7H.js → benchmark-AUKB3XDF.js} +11 -13
  14. package/dist/{browser-2D6IHFO6.js → browser-C3AU5TST.js} +5 -5
  15. package/dist/{bundleWithLocalizedFonts-ERB43NFP.js → bundleWithLocalizedFonts-G3UT65XI.js} +2 -2
  16. package/dist/{capture-WNC2DWF7.js → capture-EKNPCFPF.js} +15 -17
  17. package/dist/{capture-3ODEX55X.js → capture-XGBPNGC5.js} +2 -2
  18. package/dist/{captureCompositionFrame-JXXTHR7J.js → captureCompositionFrame-4HHLPTDH.js} +13 -16
  19. package/dist/{catalog-MHTRTKSY.js → catalog-HLDNEJX3.js} +14 -17
  20. package/dist/{catch-up-XNDRKMKL.js → catch-up-LRFV4LJO.js} +5 -5
  21. package/dist/{check-7IB355TM.js → check-XWHWGNYE.js} +39 -42
  22. package/dist/{checkBrowser-E3ZCTAGY.js → checkBrowser-KSOBXPJ3.js} +34 -37
  23. package/dist/{chunk-MMQ52NIZ.js → chunk-2BGOB2QK.js} +500 -17
  24. package/dist/{chunk-5ULL3P6S.js → chunk-2FA53V5S.js} +2 -2
  25. package/dist/{chunk-PFFR4NQV.js → chunk-3J5KO4EJ.js} +8 -10
  26. package/dist/{chunk-FTD5QXGF.js → chunk-47NZWTJL.js} +2 -2
  27. package/dist/{chunk-HXHSGDU6.js → chunk-53E45AKI.js} +60 -34
  28. package/dist/{chunk-TOC6E65N.js → chunk-6UFEOVR5.js} +2 -2
  29. package/dist/{chunk-I4VEFPZE.js → chunk-6XGO7ZKS.js} +1 -1
  30. package/dist/{chunk-G7RKSAKS.js → chunk-74UH2KGI.js} +28 -6
  31. package/dist/{chunk-7LRVGYKZ.js → chunk-7EJ7OZGC.js} +16 -3
  32. package/dist/{chunk-7D7V3UDI.js → chunk-7WEGIXI3.js} +2 -2
  33. package/dist/{chunk-NC3TVM27.js → chunk-A7YO6YSD.js} +6 -6
  34. package/dist/{chunk-OE7AUN6G.js → chunk-AK2MOAJY.js} +82 -34
  35. package/dist/{chunk-3XXSRN36.js → chunk-B67P2WP3.js} +2 -2
  36. package/dist/chunk-B7CYKBXQ.js +36 -0
  37. package/dist/{chunk-63JJFXAD.js → chunk-CD5ZU6PN.js} +6 -6
  38. package/dist/{chunk-IC6BO4GU.js → chunk-CV32PRH3.js} +65 -21
  39. package/dist/{chunk-Q5IJYX7X.js → chunk-DS3XITZ5.js} +2 -2
  40. package/dist/{chunk-XV7ZNBVY.js → chunk-DWULQYOQ.js} +3 -3
  41. package/dist/{chunk-VHBBV5DH.js → chunk-ERUINDRT.js} +62 -25
  42. package/dist/{chunk-FMTJ4I6I.js → chunk-FDWN4XAD.js} +1 -1
  43. package/dist/{chunk-57Y5X4VU.js → chunk-GC6N2LH5.js} +10 -12
  44. package/dist/{chunk-5CTORVUM.js → chunk-GHROWWUN.js} +32 -1
  45. package/dist/{chunk-ZFBET3PD.js → chunk-GKXH4C2B.js} +1 -1
  46. package/dist/{chunk-63S4VUOL.js → chunk-GNX3BCQP.js} +1 -1
  47. package/dist/{chunk-HBRPELT6.js → chunk-I4DHHX7E.js} +3 -3
  48. package/dist/{chunk-TDF2O2RM.js → chunk-IDRUJFT4.js} +2 -2
  49. package/dist/{chunk-H2X4TQVK.js → chunk-IFOZZYHK.js} +7 -7
  50. package/dist/{chunk-VFLBOKDI.js → chunk-IHQBTZHE.js} +3 -3
  51. package/dist/{chunk-KPUTRG54.js → chunk-IIH24PKY.js} +2 -2
  52. package/dist/{chunk-BIZPUWBG.js → chunk-ITJAHKYO.js} +1 -1
  53. package/dist/{chunk-6JR2XUEE.js → chunk-IXXVS2Z4.js} +1 -1
  54. package/dist/{chunk-QP4UWICL.js → chunk-JOI7TNCX.js} +2 -2
  55. package/dist/{chunk-RFQ6BIRL.js → chunk-JXLHLR26.js} +1 -1
  56. package/dist/{chunk-DY53XJ3P.js → chunk-K2AUGELJ.js} +1 -1
  57. package/dist/{chunk-733CEBPF.js → chunk-L33EDCSR.js} +5 -5
  58. package/dist/{chunk-7NWSVRFE.js → chunk-LVEXHBSH.js} +1 -1
  59. package/dist/{chunk-XOTUPVIF.js → chunk-MSGWR7WP.js} +9 -1
  60. package/dist/{chunk-ACH5ZR7X.js → chunk-ORMTNJBS.js} +3 -3
  61. package/dist/{chunk-DRTUJVLE.js → chunk-Q537KXWA.js} +153 -44
  62. package/dist/{chunk-7WV27W7R.js → chunk-Q6SHXSZX.js} +2 -2
  63. package/dist/{chunk-QDK7XCOB.js → chunk-QB4K2EWI.js} +1 -1
  64. package/dist/{chunk-BQA3X7TI.js → chunk-QSFWGZG6.js} +4 -6
  65. package/dist/{chunk-D35MPIGJ.js → chunk-QTWSMJ22.js} +15 -15
  66. package/dist/{chunk-4UPGPCMB.js → chunk-QXBZ6VBL.js} +1 -1
  67. package/dist/{chunk-FZ3R5XOH.js → chunk-QYTGUWNF.js} +1 -1
  68. package/dist/{chunk-JBQNDHRT.js → chunk-RVKJDAYE.js} +1 -1
  69. package/dist/{chunk-32V3VHMK.js → chunk-SEAHCCQ4.js} +6 -43
  70. package/dist/{chunk-GR2G5L2O.js → chunk-SGKG7DNX.js} +3 -3
  71. package/dist/{chunk-KVFSXCN6.js → chunk-SIZYTGG4.js} +1 -1
  72. package/dist/{chunk-3YGSZSEN.js → chunk-SZNCAINN.js} +1 -1
  73. package/dist/{chunk-I6A2B3IJ.js → chunk-T33GLS6C.js} +3 -3
  74. package/dist/{chunk-OYVVDYM6.js → chunk-TAXGZAXM.js} +10 -10
  75. package/dist/{chunk-FTUKOLLB.js → chunk-TOT3CLUK.js} +1 -1
  76. package/dist/{chunk-TTFHBTXQ.js → chunk-TYRDDIIH.js} +1 -1
  77. package/dist/{chunk-ML4IULLQ.js → chunk-U2EK5MFR.js} +10 -10
  78. package/dist/{chunk-QXPZGDTI.js → chunk-UIIGEPYY.js} +3 -3
  79. package/dist/{chunk-UUFY6A7I.js → chunk-UKB62QOT.js} +131 -92
  80. package/dist/{chunk-4VZAIVZQ.js → chunk-UOSTDTBF.js} +1 -1
  81. package/dist/{chunk-IW4LKYDY.js → chunk-VCVUEK65.js} +3 -3
  82. package/dist/{chunk-TUVNQA5B.js → chunk-VF2VMKNI.js} +3 -3
  83. package/dist/{chunk-QYQY5ACN.js → chunk-VKTUZP7U.js} +1 -1
  84. package/dist/{chunk-ISN6BAZX.js → chunk-WO3XZ6HC.js} +1 -1
  85. package/dist/{chunk-HN6TP4D2.js → chunk-X72DJZCM.js} +1 -1
  86. package/dist/{chunk-PGDWNIOK.js → chunk-XDMZY3H7.js} +57 -5
  87. package/dist/{chunk-BERGVZKN.js → chunk-XG365L6T.js} +1 -1
  88. package/dist/{chunk-GYSPF5ZT.js → chunk-XHVQIOOF.js} +19 -19
  89. package/dist/{chunk-OMXXJSCK.js → chunk-XONIZ5CH.js} +13 -13
  90. package/dist/{chunk-2LKHE32Z.js → chunk-YBJECXQJ.js} +5 -5
  91. package/dist/{chunk-WAG4AX5C.js → chunk-YTBE4JCX.js} +1 -1
  92. package/dist/{chunk-VLVQQJOX.js → chunk-ZDVJXWEG.js} +22 -3
  93. package/dist/chunk-ZKHXN2BV.js +3983 -0
  94. package/dist/{clean-BOYUTBAU.js → clean-EUKURSX2.js} +21 -24
  95. package/dist/cli.js +54 -54
  96. package/dist/{cloud-3O2MEZO4.js → cloud-LJDRNQ2N.js} +4 -4
  97. package/dist/{cloudrun-MCTN22O6.js → cloudrun-AXVFD6KV.js} +7 -9
  98. package/dist/{compare-A57RHCPB.js → compare-T3LMATAF.js} +31 -34
  99. package/dist/{compiler-LVNWLZCX.js → compiler-KH6DMHIJ.js} +6 -10
  100. package/dist/{component-MIJC3LWO.js → component-2FOHCMP2.js} +3 -3
  101. package/dist/{compositions-OUNZAEC3.js → compositions-REQ6ARAO.js} +13 -16
  102. package/dist/{delete-X6Q3S3SL.js → delete-KEPP2QAZ.js} +2 -2
  103. package/dist/{deploy-XXMIXGUF.js → deploy-N756FEME.js} +1 -1
  104. package/dist/{deterministicFonts-RMA7GDJC.js → deterministicFonts-4FULD3AS.js} +2 -2
  105. package/dist/{dist-2UO4RVFN.js → dist-5ULOGA6A.js} +28 -16
  106. package/dist/{dist-ONHJ6ZDA.js → dist-TFHABY7N.js} +2 -4
  107. package/dist/{doctor-ASSDEPCO.js → doctor-2SJPC4WZ.js} +14 -17
  108. package/dist/{dotEnv-64S3VKGH.js → dotEnv-RPHCAUBZ.js} +1 -1
  109. package/dist/{events-DVWSV3TQ.js → events-24ZE2PKB.js} +4 -4
  110. package/dist/{events-4ULC5VUK.js → events-U53QH4XZ.js} +3 -3
  111. package/dist/{feedback-OB3NJPNF.js → feedback-QFMLDLUN.js} +10 -12
  112. package/dist/{ffmpeg-JH3JXES2.js → ffmpeg-7XNWNO7M.js} +8 -11
  113. package/dist/{figma-GV4OGXC2.js → figma-B4JO44CV.js} +3 -3
  114. package/dist/fontLocalizeCli.js +11 -14
  115. package/dist/{get-FLMCUJGR.js → get-7CFVCINR.js} +2 -2
  116. package/dist/{gpuPolicy-RZ2OUY4M.js → gpuPolicy-MU7CFSAF.js} +8 -11
  117. package/dist/{grade-compare-O62JAOA7.js → grade-compare-Q23U2HGS.js} +32 -35
  118. package/dist/{help-6POZ4GNV.js → help-M67MEDV3.js} +1 -1
  119. package/dist/{history-72ZIF5WR.js → history-I2PZXOFL.js} +8 -8
  120. package/dist/hyperframe.manifest.json +1 -1
  121. package/dist/hyperframe.runtime.iife.js +65 -64
  122. package/dist/hyperframes-player.global.js +3 -3
  123. package/dist/{info-GGIFZ5CT.js → info-Z2MX54IE.js} +10 -12
  124. package/dist/{init-QYRN6HG2.js → init-SWH5KZO2.js} +29 -32
  125. package/dist/{inspect-KSL4YVIU.js → inspect-WBBDB3YS.js} +32 -35
  126. package/dist/{installer-ENQCLSJQ.js → installer-DQIHGUBJ.js} +6 -9
  127. package/dist/{keyframes-6PNLGKOO.js → keyframes-PSNEUS6P.js} +7 -7
  128. package/dist/{lambda-3RFOOJV6.js → lambda-KSZFMQ3L.js} +9 -11
  129. package/dist/{layout-3XFC6N3L.js → layout-AAOI7W2M.js} +32 -35
  130. package/dist/{lint-5XGLCTV5.js → lint-GGNVITIK.js} +9 -11
  131. package/dist/{lintProject-FKPKSU6M.js → lintProject-Q36Y3AHA.js} +2 -4
  132. package/dist/{list-B76BTLOM.js → list-OFPDL2AM.js} +2 -2
  133. package/dist/{login-MNXS7GEL.js → login-MZAHGGP4.js} +4 -4
  134. package/dist/{manager-BWU4U7DV.js → manager-F34TSFV6.js} +2 -2
  135. package/dist/{manager-QZZVJV7Z.js → manager-ZOFTZTRY.js} +9 -12
  136. package/dist/{media-treatment-J3OWRCBF.js → media-treatment-PF67GSUD.js} +66 -42
  137. package/dist/{models-MCDUTV54.js → models-WR7CL54R.js} +12 -15
  138. package/dist/{motionShot-RWEH3VWI.js → motionShot-ISLDWLIU.js} +17 -20
  139. package/dist/{normalize-audio-N7VRZODX.js → normalize-audio-D7AH5GFZ.js} +44 -26
  140. package/dist/{open-ROUFAVKD.js → open-HPVBB2CX.js} +14 -17
  141. package/dist/{parakeetRunner-PTVV5M44.js → parakeetRunner-P6PE4WXG.js} +13 -16
  142. package/dist/{pipeline-HN5KMORF.js → pipeline-XKBZG2CM.js} +9 -12
  143. package/dist/{play-AO7AF4Y4.js → play-QXHO47ZH.js} +23 -26
  144. package/dist/{preflight-ARNDDFGX.js → preflight-KZCU66ES.js} +11 -14
  145. package/dist/{present-FBPKUC5R.js → present-ERGC5PR4.js} +19 -22
  146. package/dist/{preview-35X5G426.js → preview-AGTOQIE7.js} +20 -23
  147. package/dist/{producer-FVGPLR5E.js → producer-4ONVM5A2.js} +1 -1
  148. package/dist/{projectConfig-SRUJLOHL.js → projectConfig-7T4VY6RJ.js} +8 -11
  149. package/dist/{publication-XH2BRL3V.js → publication-J5TS5VR3.js} +4 -6
  150. package/dist/{publish-RI4ZQZNT.js → publish-BSOVXRF4.js} +11 -14
  151. package/dist/{remove-background-J22P5JFW.js → remove-background-645NVCGL.js} +10 -13
  152. package/dist/{render-UXYZN6D2.js → render-55TYPJ5U.js} +7 -9
  153. package/dist/{render-2EZQT4IS.js → render-IAVH33YG.js} +37 -33
  154. package/dist/{render-IJUKJILU.js → render-R3L44QAP.js} +34 -37
  155. package/dist/{render-batch-X34UZ442.js → render-batch-JWWLQ7ZC.js} +7 -9
  156. package/dist/renderSetupWorker.js +4 -6
  157. package/dist/{resolver-UUEIRLMY.js → resolver-DBAFWC4F.js} +6 -8
  158. package/dist/{sherpa-FI4VNAFT.js → sherpa-UPWG6TKY.js} +12 -15
  159. package/dist/skills/hyperframes/references/runtimes.md +26 -0
  160. package/dist/skills/media-use/references/mixing.md +1 -1
  161. package/dist/skills/media-use/scripts/lib/grade-analyzer.mjs +38 -26
  162. package/dist/{skills-LGKXQFW7.js → skills-ILH52UL4.js} +6 -6
  163. package/dist/{skillsUpdateCheck-NDPKSX3H.js → skillsUpdateCheck-ZHFDGMEL.js} +3 -3
  164. package/dist/{snapshot-JM6427YW.js → snapshot-WMVHIQVQ.js} +93 -60
  165. package/dist/{src-26NBARTO.js → src-46QTOHZE.js} +10 -13
  166. package/dist/{src-WEECPY6E.js → src-HPLELQRK.js} +11 -10
  167. package/dist/{staticProjectServer-I5WGMJOV.js → staticProjectServer-FHP2YQFV.js} +19 -22
  168. package/dist/{status-SCCC7A6N.js → status-LR7VXITS.js} +1 -1
  169. package/dist/studio/assets/{hyperframes-player-LmRUJE8q.js → hyperframes-player-BNeO6YSP.js} +1 -1
  170. package/dist/studio/assets/{index-BmTWk8xf.js → index-CZWE0FI8.js} +162 -162
  171. package/dist/studio/assets/{index-CKNiEwbW.js → index-DiNYtcMK.js} +1 -1
  172. package/dist/studio/index.html +1 -1
  173. package/dist/{studio-api-N774Q4NO.js → studio-api-5YHQ4Y2D.js} +12 -15
  174. package/dist/{studioServer-KZIM5UBJ.js → studioServer-P6IC76SV.js} +53 -56
  175. package/dist/{system-HV7PYIXE.js → system-YD4AW5ZX.js} +1 -1
  176. package/dist/{telemetry-JIETM7WP.js → telemetry-WZ7OGFWQ.js} +4 -4
  177. package/dist/{timeline-JJ6JG7GQ.js → timeline-U6S7BGMI.js} +23 -25
  178. package/dist/{tokens-VOIMSCGX.js → tokens-FPUYNZSV.js} +2 -2
  179. package/dist/{transcribe-2V23EQHD.js → transcribe-DJX4E2PE.js} +18 -21
  180. package/dist/{transcribe-7BDHDQVP.js → transcribe-DZHTKXI5.js} +11 -14
  181. package/dist/{updateCheck-7B7L3UWO.js → updateCheck-2LHWRDE7.js} +2 -2
  182. package/dist/{upgrade-TUA2QZTY.js → upgrade-WAQHCAUS.js} +2 -2
  183. package/dist/{urlDownloader-CGV6EYL7.js → urlDownloader-HZQPXQET.js} +7 -10
  184. package/dist/{validate-JLCXEI2U.js → validate-D6XJ7OSS.js} +26 -29
  185. package/dist/{video-TI3EOA2D.js → video-A4CQ4WDL.js} +8 -11
  186. package/dist/warmCheck.js +39 -42
  187. package/package.json +1 -1
  188. package/dist/chunk-BSQ7XANM.js +0 -210
  189. package/dist/chunk-PKZ7RK5N.js +0 -281
  190. package/dist/chunk-PW22CDII.js +0 -3901
  191. package/dist/chunk-X7HBSTCZ.js +0 -53
@@ -28,7 +28,7 @@ import {
28
28
  renderFrameIdForRenderId,
29
29
  resolveAuthoredTimingWindow,
30
30
  toFps
31
- } from "./chunk-G7RKSAKS.js";
31
+ } from "./chunk-74UH2KGI.js";
32
32
  import {
33
33
  AUDIO_GROUP_RENDER_ID_ATTR,
34
34
  COLOR_GRADING_SOURCE_HIDDEN_ATTR,
@@ -43,11 +43,14 @@ import {
43
43
  PAGE_MOTION_BLUR_OFF_GLOBAL,
44
44
  VOLUME_TARGET,
45
45
  acceleratedCanvasTrackerSource,
46
+ clampAudioGain,
47
+ clipGain,
46
48
  enabledAudioFxNodes,
47
49
  fxAutomationTarget,
48
50
  gainedVolume,
49
51
  gainedVolumePoints,
50
52
  injectScriptsIntoHtml,
53
+ isAudibleVideoElement,
51
54
  isBentSegment,
52
55
  normalizeAudioFxParams,
53
56
  normalizePlaybackRate,
@@ -65,12 +68,7 @@ import {
65
68
  sourceTimeAt,
66
69
  timeAtSourceTime,
67
70
  volumeSegmentSampleCount
68
- } from "./chunk-PW22CDII.js";
69
- import {
70
- clampAudioGain,
71
- clipGain,
72
- isAudibleVideoElement
73
- } from "./chunk-X7HBSTCZ.js";
71
+ } from "./chunk-ZKHXN2BV.js";
74
72
  import {
75
73
  redactTelemetryString,
76
74
  redactUrlQueryStrings
@@ -88,7 +86,7 @@ import {
88
86
  } from "./chunk-4UMPIPCQ.js";
89
87
  import {
90
88
  resolveReferencedStart
91
- } from "./chunk-IC6BO4GU.js";
89
+ } from "./chunk-CV32PRH3.js";
92
90
  import {
93
91
  FFMPEG_PATH_ENV,
94
92
  FFPROBE_PATH_ENV,
@@ -100,7 +98,7 @@ import {
100
98
  } from "./chunk-6BNTGNGD.js";
101
99
  import {
102
100
  isPathInside
103
- } from "./chunk-BSQ7XANM.js";
101
+ } from "./chunk-2BGOB2QK.js";
104
102
  import {
105
103
  parseHTML
106
104
  } from "./chunk-SDYDNHEE.js";
@@ -1399,7 +1397,7 @@ async function launchBrowser(fingerprint) {
1399
1397
  const gpuFlags = fingerprint.args.filter(
1400
1398
  (a) => a.startsWith("--use-gl=") || a.startsWith("--use-angle=")
1401
1399
  );
1402
- console.log(
1400
+ console.error(
1403
1401
  `[BrowserManager] Browser launched (${browserVersion}, ${captureMode}, gl=${gpuFlags.join(" ") || "default"}, headlessShell=${!!fingerprint.executablePath}, platform=${process.platform})`
1404
1402
  );
1405
1403
  if (captureMode === "beginframe") {
@@ -1592,31 +1590,50 @@ function compositionRequiresWebGpu(html) {
1592
1590
  var WebGpuUnavailableError = class extends Error {
1593
1591
  constructor() {
1594
1592
  super(
1595
- "This composition declares data-requires-webgpu, but no hardware WebGPU adapter could be obtained on this browser launch. Run on a host with a GPU, set PRODUCER_ALLOW_SOFTWARE_WEBGPU=true to render it on SwiftShader (slow), or remove data-requires-webgpu."
1593
+ "This composition declares data-requires-webgpu, but a usable WebGPU device could not be created on this browser launch. Run on a host with a GPU, set PRODUCER_ALLOW_SOFTWARE_WEBGPU=true to render it on SwiftShader (slow), or remove data-requires-webgpu."
1596
1594
  );
1597
1595
  this.name = "WebGpuUnavailableError";
1598
1596
  }
1599
1597
  };
1600
- var WEBGPU_ADAPTER_PROBE_TIMEOUT_MS = 1e4;
1598
+ var WEBGPU_DEVICE_PROBE_TIMEOUT_MS = 1e4;
1601
1599
  async function assertWebGpuAdapterAvailable(page, requiresWebGpu, softwareWebGpu = false) {
1602
1600
  if (!requiresWebGpu) return;
1603
- const hasUsableAdapter = await page.evaluate(
1601
+ const hasUsableDevice = await page.evaluate(
1604
1602
  async (timeoutMs, acceptFallback) => {
1605
1603
  if (typeof navigator === "undefined" || !navigator.gpu) return false;
1604
+ let expired = false;
1605
+ let timer;
1606
1606
  try {
1607
- const adapter = await Promise.race([
1608
- navigator.gpu.requestAdapter(),
1609
- new Promise((resolve2) => setTimeout(() => resolve2(null), timeoutMs))
1607
+ const probe = async () => {
1608
+ const adapter = await navigator.gpu.requestAdapter();
1609
+ if (!adapter || expired || !acceptFallback && adapter.info.isFallbackAdapter)
1610
+ return false;
1611
+ const device = await adapter.requestDevice();
1612
+ try {
1613
+ return !expired;
1614
+ } finally {
1615
+ device.destroy();
1616
+ }
1617
+ };
1618
+ return await Promise.race([
1619
+ probe(),
1620
+ new Promise((resolve2) => {
1621
+ timer = setTimeout(() => {
1622
+ expired = true;
1623
+ resolve2(false);
1624
+ }, timeoutMs);
1625
+ })
1610
1626
  ]);
1611
- return !!adapter && (acceptFallback || !adapter.info.isFallbackAdapter);
1612
1627
  } catch {
1613
1628
  return false;
1629
+ } finally {
1630
+ clearTimeout(timer);
1614
1631
  }
1615
1632
  },
1616
- WEBGPU_ADAPTER_PROBE_TIMEOUT_MS,
1633
+ WEBGPU_DEVICE_PROBE_TIMEOUT_MS,
1617
1634
  softwareWebGpu
1618
1635
  );
1619
- if (!hasUsableAdapter) throw new WebGpuUnavailableError();
1636
+ if (!hasUsableDevice) throw new WebGpuUnavailableError();
1620
1637
  }
1621
1638
  function getBrowserGpuArgs(mode, platform) {
1622
1639
  if (mode === "software") {
@@ -2834,6 +2851,9 @@ async function captureScreenshotWithAlpha(page, width, height) {
2834
2851
  });
2835
2852
  }
2836
2853
  }
2854
+ function capturesAlpha(options) {
2855
+ return options.transparent ?? options.format === "png";
2856
+ }
2837
2857
  var TRANSPARENT_BG_STYLE_ID = "__hf_transparent_bg__";
2838
2858
  async function initTransparentBackground(page, { clearCompositionRoot = false } = {}) {
2839
2859
  const client = await getCdpSession(page);
@@ -4751,19 +4771,26 @@ function pathEncodingHint(configuredPath) {
4751
4771
  }
4752
4772
 
4753
4773
  // ../engine/src/utils/psnrFilterAvailability.ts
4754
- var cachedFilterList = null;
4774
+ var cachedLists = /* @__PURE__ */ new Map();
4775
+ function listed(flag) {
4776
+ let list = cachedLists.get(flag);
4777
+ if (!list) cachedLists.set(flag, list = listFfmpeg(flag));
4778
+ return list;
4779
+ }
4780
+ var listsWord = (stdout, name) => stdout !== null && new RegExp(`(^|\\s)${name}(\\s|$)`, "m").test(stdout);
4755
4781
  function isPsnrFilterAvailable() {
4756
4782
  return isFfmpegFilterAvailable("psnr");
4757
4783
  }
4758
4784
  async function isFfmpegFilterAvailable(name) {
4759
- if (cachedFilterList === null) cachedFilterList = listFilters();
4760
- const stdout = await cachedFilterList;
4761
- return stdout !== null && new RegExp(`(^|\\s)${name}(\\s|$)`, "m").test(stdout);
4785
+ return listsWord(await listed("-filters"), name);
4762
4786
  }
4763
- async function listFilters() {
4787
+ async function isFfmpegHwaccelAvailable(name) {
4788
+ return listsWord(await listed("-hwaccels"), name);
4789
+ }
4790
+ async function listFfmpeg(flag) {
4764
4791
  const execFileP = promisify(execFile);
4765
4792
  try {
4766
- const { stdout } = await execFileP(getFfmpegBinary(), ["-hide_banner", "-filters"], {
4793
+ const { stdout } = await execFileP(getFfmpegBinary(), ["-hide_banner", flag], {
4767
4794
  maxBuffer: 4 * 1024 * 1024,
4768
4795
  timeout: 5e3,
4769
4796
  windowsHide: true
@@ -5408,14 +5435,14 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
5408
5435
  if ((session.config?.useDrawElement ?? false) && supersampling) {
5409
5436
  session.deGateReason = "supersampling";
5410
5437
  session.deFallbackTrigger = "supersampling";
5411
- console.log(
5438
+ console.error(
5412
5439
  "[engine] --experimental-fast-capture disabled for this render: drawElementImage ignores deviceScaleFactor, so scaled (DPR other than 1) output uses screenshot capture."
5413
5440
  );
5414
5441
  }
5415
5442
  if ((session.config?.useDrawElement ?? false) && !supersampling && forceScreenshot) {
5416
5443
  session.deGateReason = "render_mode_hint";
5417
5444
  session.deFallbackTrigger = "render_mode_hint";
5418
- console.log(
5445
+ console.error(
5419
5446
  "[engine] fast capture falls back to screenshot: render-mode compatibility hint forced screenshot capture (e.g. raw requestAnimationFrame composition)."
5420
5447
  );
5421
5448
  }
@@ -5423,7 +5450,7 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
5423
5450
  const gpuBackend = await detectGpuBackend(page);
5424
5451
  session.isSwiftShader = gpuBackend.isSwiftShader;
5425
5452
  session.gpuRenderer = classifyGpuRenderer(gpuBackend.renderer);
5426
- const transparent = session.options.format === "png";
5453
+ const transparent = capturesAlpha(session.options);
5427
5454
  async function routeToFallback() {
5428
5455
  session.captureMode = session.launchCaptureMode;
5429
5456
  if (transparent) {
@@ -5441,7 +5468,7 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
5441
5468
  if (!supportsDrawElement) {
5442
5469
  session.deGateReason = "unsupported_chrome";
5443
5470
  session.deFallbackTrigger = "unsupported_chrome";
5444
- console.log(
5471
+ console.error(
5445
5472
  `[engine] fast capture falls back to ${session.launchCaptureMode} capture: this Chrome build does not implement canvas.drawElementImage (Dev/Canary-only feature); run \`hyperframes browser ensure --force\` to fetch a supported build, or set HYPERFRAMES_BROWSER_PATH to one.`
5446
5473
  );
5447
5474
  await routeToFallback();
@@ -5460,7 +5487,7 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
5460
5487
  if (mode === "screenshot") {
5461
5488
  session.deGateReason = "swiftshader";
5462
5489
  session.deFallbackTrigger = "swiftshader";
5463
- console.log(
5490
+ console.error(
5464
5491
  `[engine] fast capture falls back to ${session.launchCaptureMode} capture: SwiftShader (software rasterizer, no GPU egress to skip, drawElement is parity-or-slower; see fast-capture-limitations.md)`
5465
5492
  );
5466
5493
  await routeToFallback();
@@ -5472,7 +5499,7 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
5472
5499
  const routeWholeRender = async (reason, trigger, message) => {
5473
5500
  session.deGateReason = reason;
5474
5501
  session.deFallbackTrigger = trigger;
5475
- console.log(
5502
+ console.error(
5476
5503
  `[engine] fast capture falls back to ${session.launchCaptureMode} capture: ${message}`
5477
5504
  );
5478
5505
  await routeToFallback();
@@ -5543,7 +5570,7 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
5543
5570
  if (!forceDE && !threeD.ok) {
5544
5571
  session.deGateReason = "3d_init_failed";
5545
5572
  session.deFallbackTrigger = "3d_init_failed";
5546
- console.log(
5573
+ console.error(
5547
5574
  `[engine] fast capture falls back to ${session.launchCaptureMode} capture: 3D projection init failed (${threeD.reason ?? "unknown"})`
5548
5575
  );
5549
5576
  await routeToFallback();
@@ -5566,7 +5593,7 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
5566
5593
  }
5567
5594
  await finalizeDrawElementInit(session, page, logInitPhase, { transparent, forceDE });
5568
5595
  }
5569
- } else if (session.options.format === "png") {
5596
+ } else if (capturesAlpha(session.options)) {
5570
5597
  await initTransparentBackground(session.page);
5571
5598
  }
5572
5599
  }
@@ -5600,7 +5627,7 @@ async function cssEffectRiskFrames(session, totalFrames) {
5600
5627
  );
5601
5628
  return live && withFramesAfterCallback(live, scan.callbackFrom, fps, totalFrames);
5602
5629
  } catch (error) {
5603
- console.log(
5630
+ console.error(
5604
5631
  `[engine] fast capture: effect scan failed (${error instanceof Error ? error.message : String(error)})`
5605
5632
  );
5606
5633
  return null;
@@ -5649,9 +5676,9 @@ async function finalizeDrawElementInit(session, page, logInitPhase, opts) {
5649
5676
  async function completeDeferredDrawElementInit(session) {
5650
5677
  if (!session.deInitDeferred || !session.onBeforeCapture) return;
5651
5678
  const page = session.page;
5652
- const logInitPhase = (phase) => console.log(`[initSession:${session.captureMode}] ${phase} (deferred drawElement init)`);
5679
+ const logInitPhase = (phase) => console.error(`[initSession:${session.captureMode}] ${phase} (deferred drawElement init)`);
5653
5680
  await finalizeDrawElementInit(session, page, logInitPhase, {
5654
- transparent: session.options.format === "png",
5681
+ transparent: capturesAlpha(session.options),
5655
5682
  forceDE: process.env.HF_FORCE_DRAWELEMENT === "1"
5656
5683
  });
5657
5684
  session.deInitDeferred = false;
@@ -5672,7 +5699,7 @@ async function createCaptureSession(serverUrl, outputDir, options, onBeforeCaptu
5672
5699
  const isLinux = process.platform === "linux";
5673
5700
  const forceScreenshot = config?.forceScreenshot ?? DEFAULT_CONFIG.forceScreenshot;
5674
5701
  const useDrawElement = config?.useDrawElement ?? false;
5675
- const drawElementTransparent = useDrawElement && options.format === "png";
5702
+ const drawElementTransparent = useDrawElement && capturesAlpha(options);
5676
5703
  if (useDrawElement && (config?.enablePageSideCompositing ?? DEFAULT_CONFIG.enablePageSideCompositing)) {
5677
5704
  console.warn(
5678
5705
  "[engine] useDrawElement is incompatible with page-side shader compositing, ignoring enablePageSideCompositing for this render. Prefer resolveConfig, which disables page-side compositing automatically for fast-capture renders."
@@ -6433,7 +6460,7 @@ async function initializeSession(session) {
6433
6460
  const locationUrl = msg.location()?.url ?? "";
6434
6461
  const diagnostic = formatConsoleDiagnostic(type, text, locationUrl);
6435
6462
  if (!diagnostic.suppressHostLog && !loggedEarlierInRender(session, text)) {
6436
- console.log(diagnostic.text);
6463
+ console.error(diagnostic.text);
6437
6464
  }
6438
6465
  appendBrowserDiagnostic(session, diagnostic.text);
6439
6466
  const scriptFailure = classifyConsoleScriptFailure(type, text);
@@ -6495,7 +6522,7 @@ async function initializeSession(session) {
6495
6522
  const pageNavigationTimeout = session.config?.pageNavigationTimeout ?? DEFAULT_CONFIG.pageNavigationTimeout;
6496
6523
  const initStart = Date.now();
6497
6524
  const logInitPhase = (phase) => {
6498
- console.log(`[initSession:${session.captureMode}] ${phase} (${Date.now() - initStart}ms)`);
6525
+ console.error(`[initSession:${session.captureMode}] ${phase} (${Date.now() - initStart}ms)`);
6499
6526
  };
6500
6527
  const gotoEntryPage = async () => {
6501
6528
  appendBrowserDiagnostic(
@@ -7082,7 +7109,7 @@ async function createStaticVerificationPage(session) {
7082
7109
  page.evaluate(`document.fonts?.ready`),
7083
7110
  waitForOptionalTailwindReady(page, pageReadyTimeout)
7084
7111
  ]);
7085
- if (session.options.format === "png") await initTransparentBackground(page);
7112
+ if (capturesAlpha(session.options)) await initTransparentBackground(page);
7086
7113
  return page;
7087
7114
  } catch (error) {
7088
7115
  await page.close().catch(() => {
@@ -7619,11 +7646,17 @@ async function captureAccumulatedFrame(session, frameIndex, absFrameIndex, plan)
7619
7646
  ...totals
7620
7647
  };
7621
7648
  }
7649
+ function framesAreStatic(staticFrames, from, to) {
7650
+ for (let frame = from; frame <= to; frame++) {
7651
+ if (!staticFrames.has(frame)) return false;
7652
+ }
7653
+ return true;
7654
+ }
7622
7655
  async function captureFrameCore(session, frameIndex, time) {
7623
7656
  const { options } = session;
7624
7657
  const startTime = Date.now();
7625
7658
  const absFrameIndex = Math.floor(time * fpsToNumber(options.fps) + 1e-9);
7626
- if (session.staticFrames?.has(absFrameIndex) && session.lastFrameBuffer && session.lastFrameAbsoluteIndex === absFrameIndex - 1 && (!session.motionBlur || motionBlurWindowIsStatic(session.motionBlur, absFrameIndex, session.staticFrames))) {
7659
+ if (session.staticFrames?.has(absFrameIndex) && session.lastFrameBuffer && session.lastFrameAbsoluteIndex !== void 0 && framesAreStatic(session.staticFrames, session.lastFrameAbsoluteIndex + 1, absFrameIndex) && (!session.motionBlur || motionBlurWindowIsStatic(session.motionBlur, absFrameIndex, session.staticFrames))) {
7627
7660
  session.staticDedupCount = (session.staticDedupCount ?? 0) + 1;
7628
7661
  session.lastFrameAbsoluteIndex = absFrameIndex;
7629
7662
  return {
@@ -7644,7 +7677,7 @@ async function captureFrameCore(session, frameIndex, time) {
7644
7677
  session.capturePerf.frameMs.push(captureTimeMs);
7645
7678
  if (session.capturePerf.frames === 1) {
7646
7679
  const blur = await describePageMotionBlur(session.page).catch(() => null);
7647
- if (blur) console.log(blur);
7680
+ if (blur) console.error(blur);
7648
7681
  }
7649
7682
  if (session.staticFrames) {
7650
7683
  session.lastFrameBuffer = buffer;
@@ -7688,7 +7721,7 @@ async function captureFrameToBuffer(session, frameIndex, time) {
7688
7721
  DE_FRAME_TIMEOUT_MS,
7689
7722
  () => {
7690
7723
  session.deFrameTimeouts = (session.deFrameTimeouts ?? 0) + 1;
7691
- console.log(
7724
+ console.error(
7692
7725
  `[engine] fast capture frame ${frameIndex}: capture exceeded ${DE_FRAME_TIMEOUT_MS}ms; renderer stalled after drawElementImage (PRINFRA-488). Failing the drawElement attempt so the whole render retries via screenshot.`
7693
7726
  );
7694
7727
  }
@@ -7701,13 +7734,7 @@ async function captureFrameToBufferPipelined(session, frameIndex, time) {
7701
7734
  assertNotRiskFrame(session, frameIndex);
7702
7735
  if (session.staticFrames?.has(frameIndex) && session.lastEncodeResult) {
7703
7736
  const lastIdx = session.lastEncodeResultFrame ?? frameIndex - 1;
7704
- let gapStatic = true;
7705
- for (let j = lastIdx + 1; j <= frameIndex; j++) {
7706
- if (!session.staticFrames.has(j)) {
7707
- gapStatic = false;
7708
- break;
7709
- }
7710
- }
7737
+ const gapStatic = framesAreStatic(session.staticFrames, lastIdx + 1, frameIndex);
7711
7738
  if (gapStatic) {
7712
7739
  session.staticDedupCount = (session.staticDedupCount ?? 0) + 1;
7713
7740
  session.capturePerf.frames += 1;
@@ -7821,7 +7848,7 @@ async function captureFramesBatchPipelined(session, frameIndices, times) {
7821
7848
  session.deNcprFallbacks = (session.deNcprFallbacks ?? 0) + 1;
7822
7849
  throw new DrawElementCaptureError(frameIndices[failedAt] ?? failedAt, reason, error);
7823
7850
  } else {
7824
- console.log(
7851
+ console.error(
7825
7852
  `[engine] fast capture: batch produce failed at frame ${frameIndices[failedAt] ?? "?"} (${error ?? "?"}); re-capturing ${frameIndices.length - failedAt} frame(s) per-frame`
7826
7853
  );
7827
7854
  for (let i = failedAt; i < frameIndices.length; i++) {
@@ -7862,7 +7889,7 @@ async function closeCaptureSession(session) {
7862
7889
  }
7863
7890
  if (session.page && !session.pageReleased) {
7864
7891
  const blur = await describePageMotionBlurAtEnd(session.page);
7865
- if (blur) console.log(blur);
7892
+ if (blur) console.error(blur);
7866
7893
  }
7867
7894
  const reused = session.staticDedupCount ?? 0;
7868
7895
  if (session.staticFrames && reused > 0) {
@@ -7870,7 +7897,7 @@ async function closeCaptureSession(session) {
7870
7897
  const total = captured + reused;
7871
7898
  const pct = total > 0 ? Math.round(reused / total * 100) : 0;
7872
7899
  const avgTotalMs = captured > 0 ? Math.round(session.capturePerf.totalMs / captured) : 0;
7873
- console.log(
7900
+ console.error(
7874
7901
  `[static-dedup] reused ${reused}/${total} frame(s) (${pct}%), est. ~${reused * avgTotalMs}ms saved (avg ${avgTotalMs}ms/frame)`
7875
7902
  );
7876
7903
  session.staticDedupCount = 0;
@@ -8645,8 +8672,8 @@ ${tail}` : `FFmpeg exited with code ${exitCode}`;
8645
8672
  }
8646
8673
  function describeFfmpegFailure(result, timeoutMs) {
8647
8674
  const error = formatFfmpegError(result.exitCode, result.stderr);
8648
- if (result.terminationReason === "deadline") {
8649
- return `FFmpeg timed out after ${timeoutMs} ms (ffmpegProcessTimeout; long renders can raise FFMPEG_PROCESS_TIMEOUT_MS). ${error}`;
8675
+ if (result.terminationReason === "inactivity") {
8676
+ return `FFmpeg timed out after ${timeoutMs} ms without progress (ffmpegProcessTimeout, FFMPEG_PROCESS_TIMEOUT_MS). ${error}`;
8650
8677
  }
8651
8678
  if (result.exitCode !== null) return error;
8652
8679
  const signalOrRequestedStop = result.terminationReason === "exit" ? result.signal : result.terminationReason;
@@ -8685,17 +8712,18 @@ var ABORTED_BEFORE_START = {
8685
8712
  };
8686
8713
  async function runFfmpeg(args, opts) {
8687
8714
  if (opts?.signal?.aborted) return { ...ABORTED_BEFORE_START };
8688
- const stallTimeout = opts?.stallTimeout;
8689
8715
  let framesWritten = 0;
8690
- const readStats = ffmpegStatsReader(({ frames }) => {
8691
- if (frames === void 0 || frames <= framesWritten) return;
8692
- framesWritten = frames;
8716
+ let secondsWritten = 0;
8717
+ const readStats = ffmpegStatsReader(({ frames = 0, seconds = 0 }) => {
8718
+ if (frames <= framesWritten && seconds <= secondsWritten) return;
8719
+ framesWritten = Math.max(frames, framesWritten);
8720
+ secondsWritten = Math.max(seconds, secondsWritten);
8693
8721
  managed.markActivity();
8694
8722
  });
8695
8723
  const managed = new ManagedChildProcess(spawnFfmpeg(args), {
8696
8724
  signal: opts?.signal,
8697
- ...stallTimeout === void 0 ? { deadlineAtMs: Date.now() + (opts?.timeout ?? DEFAULT_TIMEOUT) } : { inactivityTimeoutMs: stallTimeout },
8698
- onStderr: stallTimeout === void 0 ? opts?.onStderr : (chunk) => {
8725
+ inactivityTimeoutMs: opts?.timeout ?? DEFAULT_TIMEOUT,
8726
+ onStderr: (chunk) => {
8699
8727
  readStats(chunk);
8700
8728
  opts?.onStderr?.(chunk);
8701
8729
  }
@@ -9686,7 +9714,7 @@ var ENCODER_PRESETS = {
9686
9714
  function appendEncodeTimeoutMessage(error, timedOut, timeoutMs) {
9687
9715
  if (!timedOut) return error;
9688
9716
  return `${error}
9689
- FFmpeg killed after exceeding ffmpegEncodeTimeout (${timeoutMs} ms). Long or high-frame-count renders may need more time: set FFMPEG_ENCODE_TIMEOUT_MS to a higher value (ms), or set PRODUCER_ENABLE_CHUNKED_ENCODE=true to encode in smaller chunks instead of one long-running ffmpeg process.`;
9717
+ FFmpeg killed after writing no new frame for ffmpegEncodeTimeout (${timeoutMs} ms). An encode that is still writing frames is never stopped; if this encoder legitimately pauses longer between frames, raise FFMPEG_ENCODE_TIMEOUT_MS (ms).`;
9690
9718
  }
9691
9719
  function isAacSidecar(audioPath) {
9692
9720
  return extname(audioPath).toLowerCase() === ".aac";
@@ -10001,7 +10029,7 @@ async function encodeFramesFromDir(framesDir, framePattern, outputPath, options,
10001
10029
  fileSize: 0,
10002
10030
  error: appendEncodeTimeoutMessage(
10003
10031
  frameReadFailure(result.stderr, framePattern, 0, framesRead, frameCount) + formatFfmpegError(result.exitCode, result.stderr),
10004
- result.terminationReason === "deadline",
10032
+ result.terminationReason === "inactivity",
10005
10033
  encodeTimeout
10006
10034
  ),
10007
10035
  failureReason: isExternalFfmpegInterruption(result) ? "external_interruption" : void 0
@@ -10047,7 +10075,7 @@ async function concatVideoFiles(inputPaths, outputPath, signal, config) {
10047
10075
  success: false,
10048
10076
  error: appendEncodeTimeoutMessage(
10049
10077
  `Chunk concat failed: ${result.stderr.slice(-400)}`,
10050
- result.terminationReason === "deadline",
10078
+ result.terminationReason === "inactivity",
10051
10079
  encodeTimeout
10052
10080
  ),
10053
10081
  externalInterruption: isExternalFfmpegInterruption(result)
@@ -10120,7 +10148,7 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
10120
10148
  framesRead,
10121
10149
  framesInChunk
10122
10150
  ) + `Chunk ${i} encode failed: ${processResult.stderr.slice(-400)}`,
10123
- processResult.terminationReason === "deadline",
10151
+ processResult.terminationReason === "inactivity",
10124
10152
  encodeTimeout
10125
10153
  )
10126
10154
  };
@@ -11488,7 +11516,7 @@ function checksumMismatchError(source, status, telemetry) {
11488
11516
  true
11489
11517
  );
11490
11518
  }
11491
- async function fetchToPartial(url, partialPath, controller, options) {
11519
+ async function fetchToPartial(url, partialPath, controller, options, onSizedBodyBytes) {
11492
11520
  const { response, finalUrl } = await fetchWithValidatedRedirects(url, controller);
11493
11521
  const finalIdentity = safeDownloadUrlIdentity(finalUrl);
11494
11522
  const rangeDisposition = classifyRangeDisposition(response);
@@ -11556,6 +11584,7 @@ async function fetchToPartial(url, partialPath, controller, options) {
11556
11584
  const inspector = new Transform({
11557
11585
  transform(chunk, _encoding, callback) {
11558
11586
  const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
11587
+ if (declaredLength !== void 0) onSizedBodyBytes();
11559
11588
  receivedBytes += bytes.length;
11560
11589
  sha256.update(bytes);
11561
11590
  md5.update(bytes);
@@ -11680,16 +11709,26 @@ async function runDownloadAttempt(url, localPath, timeoutMs, attempt, options, s
11680
11709
  controller.abort();
11681
11710
  };
11682
11711
  signal?.addEventListener("abort", onCallerAbort, { once: true });
11683
- const timeoutId = setTimeout(() => {
11684
- timedOut = true;
11685
- controller.abort();
11686
- }, timeoutMs);
11712
+ let timeoutId;
11713
+ const armTimeout = () => {
11714
+ clearTimeout(timeoutId);
11715
+ timeoutId = setTimeout(() => {
11716
+ timedOut = true;
11717
+ controller.abort();
11718
+ }, timeoutMs);
11719
+ };
11720
+ armTimeout();
11721
+ let sizedBodyStarted = false;
11722
+ const extendTimeout = () => {
11723
+ sizedBodyStarted = true;
11724
+ armTimeout();
11725
+ };
11687
11726
  const identity = safeDownloadUrlIdentity(url);
11688
11727
  try {
11689
11728
  if (callerAborted) {
11690
11729
  throw new UrlDownloadError("cancelled", false, "Download cancelled");
11691
11730
  }
11692
- const integrity = await fetchToPartial(url, partialPath, controller, options);
11731
+ const integrity = await fetchToPartial(url, partialPath, controller, options, extendTimeout);
11693
11732
  let outcome = syncAndPublishPartial(partialPath, localPath);
11694
11733
  let publishedIntegrity = integrity;
11695
11734
  if (outcome === "race_reused") {
@@ -11748,7 +11787,7 @@ async function runDownloadAttempt(url, localPath, timeoutMs, attempt, options, s
11748
11787
  const classified2 = new UrlDownloadError(
11749
11788
  "timeout",
11750
11789
  true,
11751
- `Download timeout after ${timeoutMs / 1e3}s`
11790
+ sizedBodyStarted ? `Download stalled: no data for ${timeoutMs / 1e3}s` : `Download timeout after ${timeoutMs / 1e3}s`
11752
11791
  );
11753
11792
  emitDownloadTelemetry(options, {
11754
11793
  urlFingerprint: identity.urlFingerprint,
@@ -12806,7 +12845,8 @@ async function extractVideoFramesRangeUnredacted(videoPath, videoId, startTime,
12806
12845
  const isHdr = isHdrColorSpace(metadata.colorSpace);
12807
12846
  const isMacOS = process.platform === "darwin";
12808
12847
  const toneMappedToSdr = options.toneMapHdrToSdr === true && isHdr && await toneMapsWithZscale();
12809
- const decodeWithVideoToolbox = isHdr && isMacOS && !toneMappedToSdr;
12848
+ const keepsHdrForChrome = isHdr && isMacOS && !toneMappedToSdr;
12849
+ const decodeWithVideoToolbox = keepsHdrForChrome || isMacOS && !metadata.hasAlpha && !codecMayHaveAlpha(metadata.videoCodec) && await isFfmpegHwaccelAvailable("videotoolbox");
12810
12850
  const sampleAtOutputFps = !options.finalFrameOnly;
12811
12851
  if (options.frameRanges && (!sampleAtOutputFps || metadata.isVFR)) {
12812
12852
  throw new Error("frameRanges extraction needs a constant-frame-rate source");
@@ -12826,7 +12866,7 @@ async function extractVideoFramesRangeUnredacted(videoPath, videoId, startTime,
12826
12866
  args.push("-ss", String(startTime), "-i", videoPath, "-t", String(duration));
12827
12867
  }
12828
12868
  const vfFilters = [];
12829
- if (decodeWithVideoToolbox) {
12869
+ if (keepsHdrForChrome) {
12830
12870
  vfFilters.push("format=nv12");
12831
12871
  }
12832
12872
  const samplingAt = vfFilters.length;
@@ -12856,7 +12896,7 @@ async function extractVideoFramesRangeUnredacted(videoPath, videoId, startTime,
12856
12896
  const encodeArgs = ["-q:v", format === "jpg" ? String(Math.ceil((100 - quality) / 3)) : "0"];
12857
12897
  if (format === "png") encodeArgs.push("-compression_level", "1");
12858
12898
  encodeArgs.push("-y", outputPattern);
12859
- const runOptions = { signal, stallTimeout: ffmpegProcessTimeout };
12899
+ const runOptions = { signal, timeout: ffmpegProcessTimeout };
12860
12900
  const filterArgsFor = (seek) => {
12861
12901
  const filters = [...vfFilters];
12862
12902
  filters.splice(samplingAt, 0, ...samplingFilters(seek));
@@ -14600,10 +14640,10 @@ var NotMediaPayloadError = class extends Error {
14600
14640
  retryable = false;
14601
14641
  elementFingerprints;
14602
14642
  constructor(elementFingerprints) {
14603
- const listed = elementFingerprints.slice(0, MAX_LISTED_FINGERPRINTS).join(",");
14643
+ const listed2 = elementFingerprints.slice(0, MAX_LISTED_FINGERPRINTS).join(",");
14604
14644
  const elided = elementFingerprints.length - MAX_LISTED_FINGERPRINTS;
14605
14645
  super(
14606
- `${elementFingerprints.length} media source(s) are text documents (HTML/XML/JSON), not media containers [elements=${listed}${elided > 0 ? `,+${elided}` : ""}]. Either an unresolved nested-composition preview URL was authored as a media src, or the source answered with an error page or API error body carrying a success status.`
14646
+ `${elementFingerprints.length} media source(s) are text documents (HTML/XML/JSON), not media containers [elements=${listed2}${elided > 0 ? `,+${elided}` : ""}]. Either an unresolved nested-composition preview URL was authored as a media src, or the source answered with an error page or API error body carrying a success status.`
14607
14647
  );
14608
14648
  this.name = "NotMediaPayloadError";
14609
14649
  this.elementFingerprints = elementFingerprints;
@@ -16003,7 +16043,7 @@ function ffmpegFailure(stage, result, timeoutMs, elementId) {
16003
16043
  } else if (result.terminationReason === "abort") {
16004
16044
  reason = "cancelled";
16005
16045
  owner = "user";
16006
- } else if (result.terminationReason === "deadline" || result.terminationReason === "inactivity") {
16046
+ } else if (result.terminationReason === "inactivity") {
16007
16047
  reason = "ffmpeg_timeout";
16008
16048
  retryable = true;
16009
16049
  } else if (result.terminationReason === "spawn_error") {
@@ -16300,13 +16340,8 @@ async function generateSilence(outputPath, duration, signal, config) {
16300
16340
  failure
16301
16341
  };
16302
16342
  }
16303
- var MIX_TIMEOUT_MS_PER_FILM_SECOND = 100;
16304
- function mixProcessTimeout(config, totalDuration) {
16305
- const configured = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
16306
- return Math.max(configured, Math.ceil(totalDuration * MIX_TIMEOUT_MS_PER_FILM_SECOND));
16307
- }
16308
16343
  async function mixAudioTracksFlat(tracks, outputPath, totalDuration, signal, config) {
16309
- const ffmpegProcessTimeout = mixProcessTimeout(config, totalDuration);
16344
+ const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
16310
16345
  const masterOutputGain = config?.audioGain ?? DEFAULT_CONFIG.audioGain;
16311
16346
  if (tracks.length === 0) {
16312
16347
  const result2 = await generateSilence(outputPath, totalDuration, signal, config);
@@ -16427,7 +16462,7 @@ function groupNormalizeOptionUnsupported(stderr) {
16427
16462
  return /normalize/i.test(stderr) && /(?:unrecognized option|option (?:was )?not found|no option name)/i.test(stderr);
16428
16463
  }
16429
16464
  async function mixGroupMembersFlat(memberTracks, outputPath, totalDuration, signal, config) {
16430
- const ffmpegProcessTimeout = mixProcessTimeout(config, totalDuration);
16465
+ const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
16431
16466
  const outputDir = dirname7(outputPath);
16432
16467
  if (!existsSync11(outputDir)) mkdirSync7(outputDir, { recursive: true });
16433
16468
  const buildInputFilters = (ignoreKeyframes, padMembers) => memberTracks.map((track, i) => {
@@ -17402,7 +17437,7 @@ async function captureFrameRange(session, task, captureOptions, signal, onFrameC
17402
17437
  if (signal?.aborted) throw new Error("Parallel worker cancelled");
17403
17438
  const time = i * captureOptions.fps.den / captureOptions.fps.num;
17404
17439
  if (dbg && i < task.startFrame + dbgWin) {
17405
- console.log(`[par:w${task.workerId}] +${Date.now() - dbgT0}ms produce ${i} start`);
17440
+ console.error(`[par:w${task.workerId}] +${Date.now() - dbgT0}ms produce ${i} start`);
17406
17441
  }
17407
17442
  const { encodeResult } = await runCaptureOperation(
17408
17443
  "frame_capture",
@@ -17412,23 +17447,25 @@ async function captureFrameRange(session, task, captureOptions, signal, onFrameC
17412
17447
  encodeResult.catch(() => {
17413
17448
  });
17414
17449
  if (dbg && i < task.startFrame + dbgWin) {
17415
- console.log(`[par:w${task.workerId}] +${Date.now() - dbgT0}ms produce ${i} kicked`);
17450
+ console.error(`[par:w${task.workerId}] +${Date.now() - dbgT0}ms produce ${i} kicked`);
17416
17451
  }
17417
17452
  if (prev) {
17418
17453
  if (dbg && prev.idx < task.startFrame + dbgWin) {
17419
- console.log(
17454
+ console.error(
17420
17455
  `[par:w${task.workerId}] +${Date.now() - dbgT0}ms drain ${prev.idx} await-encode`
17421
17456
  );
17422
17457
  }
17423
17458
  const buf = await awaitEncode(prev.idx, prev.encodeResult);
17424
17459
  if (dbg && prev.idx < task.startFrame + dbgWin) {
17425
- console.log(
17460
+ console.error(
17426
17461
  `[par:w${task.workerId}] +${Date.now() - dbgT0}ms drain ${prev.idx} encoded ${buf.length}B`
17427
17462
  );
17428
17463
  }
17429
17464
  await onFrameBuffer(prev.idx, buf, session);
17430
17465
  if (dbg && prev.idx < task.startFrame + dbgWin) {
17431
- console.log(`[par:w${task.workerId}] +${Date.now() - dbgT0}ms drain ${prev.idx} written`);
17466
+ console.error(
17467
+ `[par:w${task.workerId}] +${Date.now() - dbgT0}ms drain ${prev.idx} written`
17468
+ );
17432
17469
  }
17433
17470
  framesCaptured++;
17434
17471
  if (onFrameCaptured) onFrameCaptured(task.workerId, prev.idx);
@@ -17478,7 +17515,7 @@ function selectVerifySampleIndicesForTask(sampleIndices, task) {
17478
17515
  return selected.sort((a, b) => a - b);
17479
17516
  }
17480
17517
  function logParDebug(message) {
17481
- if (process.env.HF_DE_PAR_DEBUG === "1") console.log(message());
17518
+ if (process.env.HF_DE_PAR_DEBUG === "1") console.error(message());
17482
17519
  }
17483
17520
  function assertDiskSampleAboveFloor(db, verifyMinDb, idx, workerId) {
17484
17521
  if (db < verifyMinDb) {
@@ -17487,7 +17524,7 @@ function assertDiskSampleAboveFloor(db, verifyMinDb, idx, workerId) {
17487
17524
  { kind: "psnr", frameIndex: idx, failedDb: db, verifyThresholdDb: verifyMinDb }
17488
17525
  );
17489
17526
  }
17490
- console.log(
17527
+ console.error(
17491
17528
  `[Parallel] drawElement disk self-verify passed (worker ${workerId}, frame ${idx}, ${db === Infinity ? "inf" : db.toFixed(1)}dB)`
17492
17529
  );
17493
17530
  }
@@ -18269,6 +18306,7 @@ export {
18269
18306
  beginFrameCapture,
18270
18307
  pageScreenshotCapture,
18271
18308
  captureScreenshotWithAlpha,
18309
+ capturesAlpha,
18272
18310
  initTransparentBackground,
18273
18311
  captureAlphaPng,
18274
18312
  DOM_LAYER_MASK_STYLE_ID,
@@ -18366,6 +18404,7 @@ export {
18366
18404
  spawnStreamingEncoder,
18367
18405
  HF_AUDIO_GROUP_TAG,
18368
18406
  HF_AUDIO_GROUP_ATTR,
18407
+ isSelfOrAncestorHidden,
18369
18408
  safeDownloadUrlIdentity,
18370
18409
  writeUrlDownloadTelemetry,
18371
18410
  isBlockedNetworkHost,
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-HVW7ABXD.js";
13
13
  import {
14
14
  DEFAULT_REGISTRY_URL
15
- } from "./chunk-BERGVZKN.js";
15
+ } from "./chunk-XG365L6T.js";
16
16
 
17
17
  // src/utils/projectConfig.ts
18
18
  import { readFileSync, writeFileSync } from "fs";