hyperframes 0.8.199 → 0.8.200

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 (170) hide show
  1. package/dist/{add-7LA5CGDM.js → add-MFJDOJHQ.js} +13 -13
  2. package/dist/{animatedGifPrep-NB2MZTMQ.js → animatedGifPrep-WBZ2VVP6.js} +6 -6
  3. package/dist/api.js +14 -14
  4. package/dist/{asset-4BIOI6GN.js → asset-PTAQLOR6.js} +2 -2
  5. package/dist/{assetCataloger-TX5KL5VV.js → assetCataloger-N3UGZ2RC.js} +6 -6
  6. package/dist/{audio-ZGMIIDNU.js → audio-CPHWRLC4.js} +13 -13
  7. package/dist/{auth-OQ5PWEUG.js → auth-ZWOJIYK7.js} +2 -2
  8. package/dist/{autoUpdate-QREPD6I4.js → autoUpdate-DO74673A.js} +2 -2
  9. package/dist/{backgroundChecks-5CJPJX2O.js → backgroundChecks-HOAN7YB6.js} +3 -3
  10. package/dist/backgroundChecksWorker.js +3 -3
  11. package/dist/{batchRender-BW2ZK4MA.js → batchRender-AZFHTPSV.js} +3 -3
  12. package/dist/{beats-I5XARMDB.js → beats-JRMM6JQQ.js} +9 -9
  13. package/dist/{benchmark-S2WWY4U7.js → benchmark-2PEQUV7H.js} +10 -10
  14. package/dist/{browser-PAXVQYQZ.js → browser-2D6IHFO6.js} +6 -6
  15. package/dist/{bundleWithLocalizedFonts-3ED26VCR.js → bundleWithLocalizedFonts-ERB43NFP.js} +2 -2
  16. package/dist/{capture-OVITDMKK.js → capture-3ODEX55X.js} +2 -2
  17. package/dist/{capture-23574YLP.js → capture-WNC2DWF7.js} +10 -10
  18. package/dist/{captureCompositionFrame-KAUUHCOL.js → captureCompositionFrame-JXXTHR7J.js} +11 -11
  19. package/dist/{catalog-CM3VXSQE.js → catalog-MHTRTKSY.js} +13 -13
  20. package/dist/{catch-up-HMFREOC2.js → catch-up-XNDRKMKL.js} +6 -6
  21. package/dist/{check-CYJZ6CGT.js → check-7IB355TM.js} +34 -34
  22. package/dist/{checkBrowser-GZJ3W2OP.js → checkBrowser-E3ZCTAGY.js} +29 -29
  23. package/dist/{chunk-RYCANWOM.js → chunk-2LKHE32Z.js} +5 -5
  24. package/dist/{chunk-HRZ6ZBKO.js → chunk-32V3VHMK.js} +65 -9
  25. package/dist/{chunk-TF7LCULS.js → chunk-3XXSRN36.js} +2 -2
  26. package/dist/{chunk-4QG64APO.js → chunk-3YGSZSEN.js} +1 -1
  27. package/dist/{chunk-M2GO2AAS.js → chunk-4UPGPCMB.js} +1 -1
  28. package/dist/{chunk-JN63IPHT.js → chunk-4VZAIVZQ.js} +1 -1
  29. package/dist/{chunk-K5O6JTJQ.js → chunk-57Y5X4VU.js} +4 -4
  30. package/dist/{chunk-D5CZCYYT.js → chunk-5ULL3P6S.js} +2 -2
  31. package/dist/{chunk-DMRDGGNM.js → chunk-63JJFXAD.js} +9 -7
  32. package/dist/{chunk-QYOUK3UO.js → chunk-63S4VUOL.js} +2 -2
  33. package/dist/{chunk-VWPU6URV.js → chunk-733CEBPF.js} +5 -5
  34. package/dist/{chunk-7QB46WTF.js → chunk-7D7V3UDI.js} +1 -1
  35. package/dist/{chunk-TVR744AS.js → chunk-7LRVGYKZ.js} +1 -1
  36. package/dist/{chunk-BYLC52GJ.js → chunk-7NWSVRFE.js} +1 -1
  37. package/dist/{chunk-YAMRODVV.js → chunk-7WV27W7R.js} +3 -2
  38. package/dist/{chunk-DWUOGV3M.js → chunk-ACH5ZR7X.js} +3 -3
  39. package/dist/{chunk-QH4425AL.js → chunk-BERGVZKN.js} +1 -1
  40. package/dist/{chunk-K65XUUJX.js → chunk-BIZPUWBG.js} +1 -1
  41. package/dist/{chunk-T6AGUTZJ.js → chunk-BQA3X7TI.js} +3 -32
  42. package/dist/{chunk-XP55QWOB.js → chunk-D35MPIGJ.js} +13 -13
  43. package/dist/{chunk-Z6Q4ASCD.js → chunk-DRTUJVLE.js} +1 -1
  44. package/dist/{chunk-UMBCYIFE.js → chunk-FTD5QXGF.js} +1 -1
  45. package/dist/{chunk-GQACWAOC.js → chunk-FTUKOLLB.js} +1 -1
  46. package/dist/{chunk-65HUC64P.js → chunk-FZ3R5XOH.js} +1 -1
  47. package/dist/{chunk-UVQLSMAR.js → chunk-G7RKSAKS.js} +3 -1
  48. package/dist/{chunk-7SKOZHIY.js → chunk-GR2G5L2O.js} +2 -2
  49. package/dist/{chunk-NUZMP7SV.js → chunk-GYSPF5ZT.js} +16 -16
  50. package/dist/{chunk-KFZPWUPN.js → chunk-H2X4TQVK.js} +7 -7
  51. package/dist/{chunk-IELYOY6S.js → chunk-HBRPELT6.js} +3 -3
  52. package/dist/{chunk-7YZME6DE.js → chunk-HN6TP4D2.js} +1 -1
  53. package/dist/{chunk-JFIEV2J4.js → chunk-HXHSGDU6.js} +6 -6
  54. package/dist/{chunk-M6IMQBK6.js → chunk-I4VEFPZE.js} +1 -1
  55. package/dist/{chunk-S5WSJVHP.js → chunk-I6A2B3IJ.js} +3 -3
  56. package/dist/{chunk-NY2OH5XD.js → chunk-ISN6BAZX.js} +1 -1
  57. package/dist/{chunk-LPDNR3R4.js → chunk-IW4LKYDY.js} +2 -2
  58. package/dist/{chunk-CMHVLASW.js → chunk-JBQNDHRT.js} +1 -1
  59. package/dist/{chunk-OZVRCLEN.js → chunk-KPUTRG54.js} +2 -2
  60. package/dist/{chunk-6RRO4GE3.js → chunk-KVFSXCN6.js} +1 -1
  61. package/dist/{chunk-HOAXHVRR.js → chunk-ML4IULLQ.js} +10 -10
  62. package/dist/{chunk-TTWFTEUG.js → chunk-NC3TVM27.js} +5 -5
  63. package/dist/{chunk-HK45GJMI.js → chunk-OE7AUN6G.js} +118 -39
  64. package/dist/{chunk-FHDKRWQN.js → chunk-OMXXJSCK.js} +12 -12
  65. package/dist/{chunk-SQQZUUK6.js → chunk-OYVVDYM6.js} +10 -10
  66. package/dist/{chunk-FV5GKRAO.js → chunk-PFFR4NQV.js} +2 -2
  67. package/dist/chunk-PW22CDII.js +3901 -0
  68. package/dist/{chunk-UBSAHYWA.js → chunk-Q5IJYX7X.js} +2 -2
  69. package/dist/{chunk-GQVTTWZF.js → chunk-QDK7XCOB.js} +1 -1
  70. package/dist/{chunk-IMVTN367.js → chunk-QP4UWICL.js} +2 -2
  71. package/dist/{chunk-XVZZQVT4.js → chunk-QYQY5ACN.js} +1 -1
  72. package/dist/{chunk-KG3BVLA4.js → chunk-RFQ6BIRL.js} +1 -1
  73. package/dist/{chunk-FZ2VPLXL.js → chunk-TDF2O2RM.js} +2 -2
  74. package/dist/{chunk-BFYDVTD3.js → chunk-TOC6E65N.js} +1 -1
  75. package/dist/{chunk-2KZSKIYY.js → chunk-TTFHBTXQ.js} +1 -1
  76. package/dist/{chunk-PO5PAROC.js → chunk-TUVNQA5B.js} +2 -2
  77. package/dist/{chunk-W2LGJSEN.js → chunk-UIOZIIB7.js} +33 -3
  78. package/dist/{chunk-L6FG62QM.js → chunk-UUFY6A7I.js} +320 -64
  79. package/dist/{chunk-3CFTCM7X.js → chunk-VFLBOKDI.js} +3 -3
  80. package/dist/{chunk-AHZLNYZY.js → chunk-WAG4AX5C.js} +1 -1
  81. package/dist/{chunk-ILFDFMYJ.js → chunk-XV7ZNBVY.js} +3 -3
  82. package/dist/{chunk-T4IJMVCB.js → chunk-ZFBET3PD.js} +1 -1
  83. package/dist/{clean-QX6LKOWJ.js → clean-BOYUTBAU.js} +16 -16
  84. package/dist/cli.js +53 -53
  85. package/dist/{cloud-ASA7Y3HA.js → cloud-3O2MEZO4.js} +4 -4
  86. package/dist/{cloudrun-LK4GJWUZ.js → cloudrun-MCTN22O6.js} +4 -4
  87. package/dist/{compare-426Z2ND6.js → compare-A57RHCPB.js} +26 -26
  88. package/dist/{compiler-WER7FC5O.js → compiler-LVNWLZCX.js} +2 -2
  89. package/dist/{component-HTDWZMEG.js → component-MIJC3LWO.js} +3 -3
  90. package/dist/{compositions-EKRLQ5TU.js → compositions-OUNZAEC3.js} +11 -11
  91. package/dist/{delete-KHXM6R7A.js → delete-X6Q3S3SL.js} +2 -2
  92. package/dist/{deploy-WJ5JQJBD.js → deploy-XXMIXGUF.js} +1 -1
  93. package/dist/{dist-EYJATCTF.js → dist-2UO4RVFN.js} +4 -2
  94. package/dist/{doctor-NB3G2GDG.js → doctor-ASSDEPCO.js} +12 -12
  95. package/dist/{events-6EL5NIJV.js → events-4ULC5VUK.js} +4 -4
  96. package/dist/{events-LH6W5ZCV.js → events-DVWSV3TQ.js} +5 -5
  97. package/dist/{feedback-2GNY725M.js → feedback-OB3NJPNF.js} +8 -8
  98. package/dist/{ffmpeg-XX3O53B3.js → ffmpeg-JH3JXES2.js} +6 -6
  99. package/dist/{figma-X7KKOOXB.js → figma-GV4OGXC2.js} +3 -3
  100. package/dist/fontLocalizeCli.js +8 -8
  101. package/dist/{get-M57U7QCX.js → get-FLMCUJGR.js} +2 -2
  102. package/dist/{gpuPolicy-GIBBYBI5.js → gpuPolicy-RZ2OUY4M.js} +6 -6
  103. package/dist/{grade-compare-XNY37UYQ.js → grade-compare-O62JAOA7.js} +27 -27
  104. package/dist/{help-ZXSPZBUG.js → help-6POZ4GNV.js} +1 -1
  105. package/dist/{history-G5B4IPBH.js → history-72ZIF5WR.js} +8 -8
  106. package/dist/hyperframe.manifest.json +1 -1
  107. package/dist/hyperframe.runtime.iife.js +65 -62
  108. package/dist/hyperframes-player.global.js +3 -3
  109. package/dist/{info-ZWZDG54W.js → info-GGIFZ5CT.js} +9 -9
  110. package/dist/{init-F4XMU6SV.js → init-QYRN6HG2.js} +27 -27
  111. package/dist/{inspect-6VXFMQRR.js → inspect-KSL4YVIU.js} +27 -27
  112. package/dist/{installer-4M3Y5T5F.js → installer-ENQCLSJQ.js} +4 -4
  113. package/dist/{keyframes-3U466AWX.js → keyframes-6PNLGKOO.js} +8 -8
  114. package/dist/{lambda-OPSTAEF6.js → lambda-3RFOOJV6.js} +6 -6
  115. package/dist/{layout-B3MXD3F3.js → layout-3XFC6N3L.js} +27 -27
  116. package/dist/{lint-TVOEGW63.js → lint-5XGLCTV5.js} +8 -8
  117. package/dist/{list-M5GQSFVT.js → list-B76BTLOM.js} +2 -2
  118. package/dist/{login-HBHGZIDN.js → login-MNXS7GEL.js} +4 -4
  119. package/dist/{manager-COSJVRAE.js → manager-BWU4U7DV.js} +3 -3
  120. package/dist/{manager-VLIJARMF.js → manager-QZZVJV7Z.js} +7 -7
  121. package/dist/{media-treatment-RQZ437VS.js → media-treatment-J3OWRCBF.js} +13 -13
  122. package/dist/{models-2CCKVBTR.js → models-MCDUTV54.js} +10 -10
  123. package/dist/{motionShot-3IFRSICA.js → motionShot-RWEH3VWI.js} +15 -15
  124. package/dist/{normalize-audio-23H2MBDP.js → normalize-audio-N7VRZODX.js} +6 -6
  125. package/dist/{open-J33KT3G7.js → open-ROUFAVKD.js} +13 -13
  126. package/dist/{parakeetRunner-QTXNEMVY.js → parakeetRunner-PTVV5M44.js} +11 -11
  127. package/dist/{pipeline-2ECWWEBD.js → pipeline-HN5KMORF.js} +7 -7
  128. package/dist/{play-G5777L7A.js → play-AO7AF4Y4.js} +18 -18
  129. package/dist/{preflight-NVFB4HXQ.js → preflight-ARNDDFGX.js} +9 -9
  130. package/dist/{present-4EI2BE4Z.js → present-FBPKUC5R.js} +14 -14
  131. package/dist/{preview-HYCIDZ52.js → preview-35X5G426.js} +18 -18
  132. package/dist/{producer-6JAATJVD.js → producer-FVGPLR5E.js} +1 -1
  133. package/dist/{projectConfig-XPGN76VV.js → projectConfig-SRUJLOHL.js} +6 -6
  134. package/dist/{publication-YRZ7EBUV.js → publication-XH2BRL3V.js} +2 -2
  135. package/dist/{publish-UIDHN7KD.js → publish-RI4ZQZNT.js} +7 -7
  136. package/dist/{remove-background-LPQP4WBN.js → remove-background-J22P5JFW.js} +8 -8
  137. package/dist/{render-NZSNQFYW.js → render-2EZQT4IS.js} +14 -14
  138. package/dist/{render-DT3OCUCV.js → render-IJUKJILU.js} +32 -31
  139. package/dist/{render-LFJQNVCK.js → render-UXYZN6D2.js} +5 -5
  140. package/dist/{render-batch-QI2A45WH.js → render-batch-X34UZ442.js} +5 -5
  141. package/dist/renderSetupWorker.js +3 -3
  142. package/dist/{resolver-4YDXG4PP.js → resolver-UUEIRLMY.js} +4 -4
  143. package/dist/{sherpa-XLKWFYFO.js → sherpa-FI4VNAFT.js} +10 -10
  144. package/dist/{skills-OVVLZHF5.js → skills-LGKXQFW7.js} +7 -7
  145. package/dist/{skillsUpdateCheck-Y2UQA7I5.js → skillsUpdateCheck-NDPKSX3H.js} +3 -3
  146. package/dist/{snapshot-7NVB5WSO.js → snapshot-JM6427YW.js} +31 -31
  147. package/dist/{src-ACAFJXAJ.js → src-26NBARTO.js} +7 -7
  148. package/dist/{src-QQPHMIJ7.js → src-WEECPY6E.js} +5 -5
  149. package/dist/{staticProjectServer-JUN6BRTW.js → staticProjectServer-I5WGMJOV.js} +13 -13
  150. package/dist/{status-H5WLKQDS.js → status-SCCC7A6N.js} +2 -2
  151. package/dist/studio/assets/{hyperframes-player-BDtBfwof.js → hyperframes-player-LmRUJE8q.js} +1 -1
  152. package/dist/studio/assets/{index-BFfBBQMu.js → index-BmTWk8xf.js} +108 -108
  153. package/dist/studio/assets/{index--W_0fuR8.js → index-CKNiEwbW.js} +1 -1
  154. package/dist/studio/index.html +1 -1
  155. package/dist/{studio-api-D76Q4Q2N.js → studio-api-N774Q4NO.js} +6 -6
  156. package/dist/{studioServer-HG3RFAOY.js → studioServer-KZIM5UBJ.js} +46 -46
  157. package/dist/{system-7F3UEHQT.js → system-HV7PYIXE.js} +4 -3
  158. package/dist/{telemetry-Q2EHWVO4.js → telemetry-JIETM7WP.js} +5 -5
  159. package/dist/{timeline-WDQCCETQ.js → timeline-JJ6JG7GQ.js} +16 -16
  160. package/dist/{tokens-2GJWP2HY.js → tokens-VOIMSCGX.js} +2 -2
  161. package/dist/{transcribe-Z63Y53GQ.js → transcribe-2V23EQHD.js} +16 -16
  162. package/dist/{transcribe-SRLAY6RG.js → transcribe-7BDHDQVP.js} +9 -9
  163. package/dist/{updateCheck-MJ6NDE3T.js → updateCheck-7B7L3UWO.js} +2 -2
  164. package/dist/{upgrade-D5XEX3XE.js → upgrade-TUA2QZTY.js} +2 -2
  165. package/dist/{urlDownloader-R7BZ47TY.js → urlDownloader-CGV6EYL7.js} +5 -5
  166. package/dist/{validate-F5BIDZLN.js → validate-JLCXEI2U.js} +21 -21
  167. package/dist/{video-QUG5OG5Q.js → video-TI3EOA2D.js} +6 -6
  168. package/dist/warmCheck.js +34 -34
  169. package/package.json +1 -1
  170. package/dist/chunk-2ONVJ7NT.js +0 -3901
@@ -14,6 +14,7 @@ import {
14
14
  MEDIA_VISUAL_STYLE_PROPERTIES,
15
15
  RENDER_FRAME_ID_PREFIX,
16
16
  RENDER_FRAME_ID_SUFFIX,
17
+ SCENE_CALLBACK_ERROR_PREFIX,
17
18
  exportClipWindow,
18
19
  firstFrameColourArgs,
19
20
  fpsToFfmpegArg,
@@ -27,7 +28,7 @@ import {
27
28
  renderFrameIdForRenderId,
28
29
  resolveAuthoredTimingWindow,
29
30
  toFps
30
- } from "./chunk-UVQLSMAR.js";
31
+ } from "./chunk-G7RKSAKS.js";
31
32
  import {
32
33
  AUDIO_GROUP_RENDER_ID_ATTR,
33
34
  COLOR_GRADING_SOURCE_HIDDEN_ATTR,
@@ -64,7 +65,7 @@ import {
64
65
  sourceTimeAt,
65
66
  timeAtSourceTime,
66
67
  volumeSegmentSampleCount
67
- } from "./chunk-2ONVJ7NT.js";
68
+ } from "./chunk-PW22CDII.js";
68
69
  import {
69
70
  clampAudioGain,
70
71
  clipGain,
@@ -107,9 +108,10 @@ import {
107
108
  LOW_MEMORY_TOTAL_MB_THRESHOLD,
108
109
  describeWslGpuAccess,
109
110
  detectWsl,
111
+ getAvailableMemoryMb,
110
112
  getSystemTotalMb,
111
113
  isLowMemorySystem
112
- } from "./chunk-W2LGJSEN.js";
114
+ } from "./chunk-UIOZIIB7.js";
113
115
 
114
116
  // ../engine/src/config.ts
115
117
  import { tmpdir } from "os";
@@ -4507,29 +4509,60 @@ async function initThreeDProjection(page) {
4507
4509
  return { ok: false, groups: 0, quads: 0, reason: e instanceof Error ? e.message : String(e) };
4508
4510
  }
4509
4511
  }
4510
- async function detectCssEffectRisk(page) {
4512
+ async function scanCssEffects(page, collect) {
4511
4513
  try {
4512
- return await page.evaluate(() => {
4514
+ return await page.evaluate((collectAll) => {
4513
4515
  const root = document.querySelector("[data-composition-id]");
4514
- if (!root) return null;
4516
+ if (!root) return { reason: null, bounded: true, callbackFrom: null };
4517
+ let reason = null;
4518
+ let bounded = true;
4519
+ const targets = /* @__PURE__ */ new Set();
4520
+ const hit = (name, els) => {
4521
+ reason = reason ?? name;
4522
+ if (els && els.length > 0) for (const el of Array.from(els)) targets.add(el);
4523
+ else bounded = false;
4524
+ return !collectAll;
4525
+ };
4515
4526
  const scanComputed = () => {
4516
4527
  const els = [root, ...Array.from(root.querySelectorAll("*"))];
4517
4528
  for (const el of els) {
4518
4529
  const cs = getComputedStyle(el);
4519
4530
  const bf = cs.backdropFilter || cs.webkitBackdropFilter || "";
4520
- if (bf && bf !== "none") return "backdrop-filter";
4531
+ if (bf && bf !== "none" && hit("backdrop-filter", [el])) return true;
4521
4532
  const f = cs.filter || "";
4522
- if (f && f !== "none" && f.indexOf("blur(") !== -1) return "filter:blur";
4523
- if (f && f !== "none" && f.indexOf("drop-shadow(") !== -1) return "filter:drop-shadow";
4533
+ if (f && f !== "none" && f.indexOf("blur(") !== -1 && hit("filter:blur", [el])) {
4534
+ return true;
4535
+ }
4536
+ if (f && f !== "none" && f.indexOf("drop-shadow(") !== -1 && hit("filter:drop-shadow", [el])) {
4537
+ return true;
4538
+ }
4524
4539
  const mbm = cs.mixBlendMode || "";
4525
- if (mbm && mbm !== "normal") return "mix-blend-mode";
4540
+ if (mbm && mbm !== "normal" && hit("mix-blend-mode", [el])) return true;
4526
4541
  const an = cs.animationName || "";
4527
4542
  const ad = cs.animationDuration || "0s";
4528
- if (an && an !== "none" && ad !== "0s" && parseFloat(ad) > 0) return "css-animation";
4543
+ if (an && an !== "none" && ad !== "0s" && parseFloat(ad) > 0 && hit("css-animation", null)) {
4544
+ return true;
4545
+ }
4529
4546
  }
4530
- return null;
4547
+ return false;
4531
4548
  };
4532
4549
  const scanStyleSheets = () => {
4550
+ const ruleTargets = (rule) => {
4551
+ const selector = rule.selectorText;
4552
+ if (!selector) return [];
4553
+ try {
4554
+ return Array.from(
4555
+ root.querySelectorAll(
4556
+ selector.replace(
4557
+ /::?(before|after|first-line|first-letter|marker|placeholder|selection|backdrop)/g,
4558
+ ""
4559
+ )
4560
+ )
4561
+ );
4562
+ } catch {
4563
+ return [];
4564
+ }
4565
+ };
4533
4566
  for (const sheet of Array.from(document.styleSheets)) {
4534
4567
  let rules = null;
4535
4568
  try {
@@ -4539,52 +4572,151 @@ async function detectCssEffectRisk(page) {
4539
4572
  }
4540
4573
  for (const rule of Array.from(rules ?? [])) {
4541
4574
  const txt = rule.cssText || "";
4542
- if (/backdrop-filter\s*:\s*(?!none)/i.test(txt)) return "backdrop-filter";
4543
- if (/(?:^|[^-])filter\s*:[^;{}]*blur\(/i.test(txt)) return "filter:blur";
4544
- if (/(?:^|[^-])filter\s*:[^;{}]*drop-shadow\(/i.test(txt)) {
4545
- return "filter:drop-shadow";
4546
- }
4547
- if (/mix-blend-mode\s*:\s*(?!normal)/i.test(txt)) return "mix-blend-mode";
4575
+ let name = null;
4576
+ if (/backdrop-filter\s*:\s*(?!none)/i.test(txt)) name = "backdrop-filter";
4577
+ else if (/(?:^|[^-])filter\s*:[^;{}]*blur\(/i.test(txt)) name = "filter:blur";
4578
+ else if (/(?:^|[^-])filter\s*:[^;{}]*drop-shadow\(/i.test(txt)) {
4579
+ name = "filter:drop-shadow";
4580
+ } else if (/mix-blend-mode\s*:\s*(?!normal)/i.test(txt)) name = "mix-blend-mode";
4581
+ if (name && hit(name, ruleTargets(rule))) return true;
4548
4582
  }
4549
4583
  }
4550
- return null;
4584
+ return false;
4551
4585
  };
4552
4586
  const scanTweenVars = () => {
4553
4587
  const walk = (tl) => {
4554
- if (typeof tl.getChildren !== "function") return null;
4588
+ if (typeof tl.getChildren !== "function") return false;
4555
4589
  for (const c of tl.getChildren(false, true, true)) {
4556
- const sub = walk(c);
4557
- if (sub) return sub;
4590
+ if (walk(c)) return true;
4558
4591
  const vars = c.vars || {};
4559
4592
  for (const k of Object.keys(vars)) {
4560
4593
  const kl = k.toLowerCase();
4561
- if (kl.includes("blend")) return "mix-blend-mode";
4562
- if (kl.includes("backdrop")) return "backdrop-filter";
4563
- if (kl === "filter" && /blur\(/i.test(String(vars[k] ?? ""))) return "filter:blur";
4564
- if (kl === "filter" && /drop-shadow\(/i.test(String(vars[k] ?? ""))) {
4565
- return "filter:drop-shadow";
4594
+ let name = null;
4595
+ if (kl.includes("blend")) name = "mix-blend-mode";
4596
+ else if (kl.includes("backdrop")) name = "backdrop-filter";
4597
+ else if (kl === "filter" && /blur\(/i.test(String(vars[k] ?? ""))) {
4598
+ name = "filter:blur";
4599
+ } else if (kl === "filter" && /drop-shadow\(/i.test(String(vars[k] ?? ""))) {
4600
+ name = "filter:drop-shadow";
4566
4601
  }
4602
+ if (!name) continue;
4603
+ const els = (typeof c.targets === "function" ? c.targets() : []).filter(
4604
+ (t) => t instanceof Element
4605
+ );
4606
+ if (hit(name, els)) return true;
4567
4607
  }
4568
4608
  }
4569
- return null;
4609
+ return false;
4570
4610
  };
4571
4611
  const tls = window.__timelines || {};
4572
4612
  for (const tl of Object.values(tls)) {
4573
- const r = walk(tl);
4574
- if (r) return r;
4613
+ if (walk(tl)) return true;
4575
4614
  }
4576
- return null;
4615
+ return false;
4577
4616
  };
4578
4617
  const scanWebgl = () => {
4579
4618
  const aw = window;
4580
4619
  const accel = (aw.__hf_accel_canvases ?? []).filter((c) => root.contains(c));
4581
- return accel.length > 0 ? "webgl-context" : null;
4620
+ return accel.length > 0 && hit("webgl-context", null);
4582
4621
  };
4583
- return scanComputed() || scanStyleSheets() || scanTweenVars() || scanWebgl();
4584
- });
4622
+ for (const scan of [scanComputed, scanStyleSheets, scanTweenVars, scanWebgl]) {
4623
+ if (scan()) break;
4624
+ }
4625
+ const calls = ["onStart", "onUpdate", "onComplete", "onRepeat", "onReverseComplete"];
4626
+ const firstCallback = (node, offset) => {
4627
+ const start = offset + (typeof node.startTime === "function" ? node.startTime() : 0);
4628
+ let first = calls.some((k) => typeof node.vars?.[k] === "function") ? start : Infinity;
4629
+ if (typeof node.getChildren === "function") {
4630
+ for (const child of node.getChildren(false, true, true)) {
4631
+ first = Math.min(first, firstCallback(child, start));
4632
+ }
4633
+ }
4634
+ return first;
4635
+ };
4636
+ const timelines = window.__timelines;
4637
+ const callbackStart = reason ? Math.min(Infinity, ...Object.values(timelines ?? {}).map((tl) => firstCallback(tl, 0))) : Infinity;
4638
+ window.__hfCssFxTargets = [...targets];
4639
+ return {
4640
+ reason,
4641
+ bounded,
4642
+ callbackFrom: Number.isFinite(callbackStart) ? callbackStart : null
4643
+ };
4644
+ }, collect);
4585
4645
  } catch {
4586
- return null;
4646
+ return { reason: null, bounded: true, callbackFrom: null };
4647
+ }
4648
+ }
4649
+
4650
+ // ../engine/src/services/riskFrames.ts
4651
+ var SCAN_CHUNK_FRAMES = 240;
4652
+ var MAX_RISK_FRAME_FRACTION = 0.6;
4653
+ var RISK_RENDER_ADDED_BYTES = 1e9;
4654
+ var RISK_RENDER_HEADROOM_BYTES = 15e8;
4655
+ var PIXELS_1080P = 1920 * 1080;
4656
+ var RISK_RANGE_HYSTERESIS_FRAMES = 12;
4657
+ async function scanCssEffectLiveFrames(page, fps, totalFrames, maxFrames) {
4658
+ const live = /* @__PURE__ */ new Set();
4659
+ for (let from = 0; from < totalFrames; from += SCAN_CHUNK_FRAMES) {
4660
+ const times = [];
4661
+ for (let f = from; f < Math.min(totalFrames, from + SCAN_CHUNK_FRAMES); f++) {
4662
+ times.push(quantizeTimeToFrame(f / fps, fps));
4663
+ }
4664
+ const hits = await page.evaluate(async (ts) => {
4665
+ const w = window;
4666
+ const targets = w.__hfCssFxTargets ?? [];
4667
+ const paints = (el) => getComputedStyle(el).visibility !== "hidden" || Array.from(el.querySelectorAll("*")).some(
4668
+ (d) => getComputedStyle(d).visibility === "visible"
4669
+ );
4670
+ const shows = (el) => {
4671
+ for (let n = el; n; n = n.parentElement) {
4672
+ const cs = getComputedStyle(n);
4673
+ if (cs.display === "none" || Number(cs.opacity) === 0) return false;
4674
+ }
4675
+ return paints(el);
4676
+ };
4677
+ const out = [];
4678
+ for (let i = 0; i < ts.length; i++) {
4679
+ w.__hf?.seek?.(ts[i]);
4680
+ await w.__hfWaitForSeekCompletion?.();
4681
+ if (targets.some(shows)) out.push(i);
4682
+ }
4683
+ return out;
4684
+ }, times);
4685
+ for (const i of hits) live.add(from + i);
4686
+ if (live.size > maxFrames) break;
4687
+ }
4688
+ return live.size > maxFrames ? null : live;
4689
+ }
4690
+ function planRiskFrames(frames, totalFrames) {
4691
+ const sorted = [...new Set(frames)].sort((a, b) => a - b);
4692
+ const plan = /* @__PURE__ */ new Set();
4693
+ let rangeStart = -1;
4694
+ let rangeEnd = -1;
4695
+ const flush = () => {
4696
+ for (let f = Math.max(0, rangeStart - 1); f <= Math.min(totalFrames - 1, rangeEnd + 1); f++) {
4697
+ plan.add(f);
4698
+ }
4699
+ };
4700
+ for (const f of sorted) {
4701
+ if (rangeStart >= 0 && f - rangeEnd <= RISK_RANGE_HYSTERESIS_FRAMES) {
4702
+ rangeEnd = f;
4703
+ continue;
4704
+ }
4705
+ if (rangeStart >= 0) flush();
4706
+ rangeStart = f;
4707
+ rangeEnd = f;
4587
4708
  }
4709
+ if (rangeStart >= 0) flush();
4710
+ return plan.size > totalFrames * MAX_RISK_FRAME_FRACTION ? null : plan;
4711
+ }
4712
+ function withFramesAfterCallback(live, callbackFrom, fps, totalFrames) {
4713
+ if (callbackFrom === null) return live;
4714
+ for (let f = Math.max(0, Math.floor(callbackFrom * fps) - 1); f < totalFrames; f++) live.add(f);
4715
+ return live;
4716
+ }
4717
+ function riskSessionFits(availableMb, outputPixels) {
4718
+ const rss = RISK_RENDER_ADDED_BYTES * Math.max(1, outputPixels / PIXELS_1080P);
4719
+ return availableMb * 1024 * 1024 - rss >= RISK_RENDER_HEADROOM_BYTES;
4588
4720
  }
4589
4721
 
4590
4722
  // ../engine/src/utils/psnrFilterAvailability.ts
@@ -5333,16 +5465,31 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
5333
5465
  );
5334
5466
  await routeToFallback();
5335
5467
  } else {
5468
+ const perFrame = session.options.deFrameFallback === true && drawElementWorkerEncodeEligible(session, transparent) && !forceDE;
5469
+ const riskFrames = /* @__PURE__ */ new Set();
5470
+ const riskReasons = [];
5471
+ let cssFrames = 0;
5472
+ const routeWholeRender = async (reason, trigger, message) => {
5473
+ session.deGateReason = reason;
5474
+ session.deFallbackTrigger = trigger;
5475
+ console.log(
5476
+ `[engine] fast capture falls back to ${session.launchCaptureMode} capture: ${message}`
5477
+ );
5478
+ await routeToFallback();
5479
+ };
5336
5480
  if (!forceDE && process.env.HF_FAST_CAPTURE_CSSFX !== "true") {
5337
- const cssFx = await detectCssEffectRisk(page);
5481
+ const cssFx = (await scanCssEffects(page, false)).reason;
5338
5482
  if (cssFx) {
5339
- session.deGateReason = `css_effect:${(cssFx.split(":")[0] ?? "").replace(/[^a-z-]/gi, "")}`;
5340
- session.deFallbackTrigger = cssFx;
5341
- console.log(
5342
- `[engine] fast capture falls back to ${session.launchCaptureMode} capture: ${cssFx} detected (drawElementImage cannot reproduce it; see fast-capture-limitations.md)`
5343
- );
5344
- await routeToFallback();
5345
- return;
5483
+ const gateReason = `css_effect:${(cssFx.split(":")[0] ?? "").replace(/[^a-z-]/gi, "")}`;
5484
+ const gateMessage = `${cssFx} detected (drawElementImage cannot reproduce it; see fast-capture-limitations.md)`;
5485
+ cssFrames = perFrame ? await renderFrameCount(session, page) : 0;
5486
+ const live = cssFrames > 0 ? await cssEffectRiskFrames(session, cssFrames) : null;
5487
+ if (!live) {
5488
+ await routeWholeRender(gateReason, cssFx, gateMessage);
5489
+ return;
5490
+ }
5491
+ for (const f of live) riskFrames.add(f);
5492
+ riskReasons.push(cssFx);
5346
5493
  }
5347
5494
  }
5348
5495
  if (!forceDE && process.env.HF_FAST_CAPTURE_INTERVAL_SS !== "false") {
@@ -5354,14 +5501,43 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
5354
5501
  `timeline at-risk predictor: ${atRisk.size}/${totalFrames} frames (${Math.round(atRiskFraction * 100)}%)`
5355
5502
  );
5356
5503
  if (atRisk.size > 0 && atRiskFraction > fractionFloor) {
5357
- session.deGateReason = "at_risk_timeline";
5358
- session.deFallbackTrigger = "at_risk_timeline";
5359
- console.log(
5360
- `[engine] fast capture falls back to ${session.launchCaptureMode} capture: ${atRisk.size}/${totalFrames} frames animate a compositor-incompatible prop (blend/3D/clip/mask); drawElementImage drops these mid-animation (deterministic timeline gate; see fast-capture-limitations.md Lim 7)`
5504
+ if (perFrame) {
5505
+ for (const f of atRisk) riskFrames.add(f);
5506
+ riskReasons.push("at_risk_timeline");
5507
+ } else {
5508
+ await routeWholeRender(
5509
+ "at_risk_timeline",
5510
+ "at_risk_timeline",
5511
+ `${atRisk.size}/${totalFrames} frames animate a compositor-incompatible prop (blend/3D/clip/mask); drawElementImage drops these mid-animation (deterministic timeline gate; see fast-capture-limitations.md Lim 7)`
5512
+ );
5513
+ return;
5514
+ }
5515
+ }
5516
+ }
5517
+ if (riskFrames.size > 0) {
5518
+ const total = cssFrames > 0 ? cssFrames : await renderFrameCount(session, page);
5519
+ const plan = total > 0 ? planRiskFrames(riskFrames, total) : null;
5520
+ if (!plan) {
5521
+ await routeWholeRender(
5522
+ "risk_frames",
5523
+ riskReasons.join("+"),
5524
+ `${riskFrames.size}/${total} frames need screenshot capture (${riskReasons.join(", ")}), too many to keep fast capture for the rest`
5525
+ );
5526
+ return;
5527
+ }
5528
+ if (!riskSessionFits(getAvailableMemoryMb(), session.options.width * session.options.height)) {
5529
+ await routeWholeRender(
5530
+ "risk_session_memory",
5531
+ riskReasons.join("+"),
5532
+ `${plan.size} frames need screenshot capture (${riskReasons.join(", ")}) but too little memory is available for per-frame capture`
5361
5533
  );
5362
- await routeToFallback();
5363
5534
  return;
5364
5535
  }
5536
+ session.deRiskFrames = plan;
5537
+ session.deRiskReason = riskReasons.join("+");
5538
+ logInitPhase(
5539
+ `fast capture keeps ${total - plan.size}/${total} frames; ${plan.size} frame(s) capture by screenshot (${session.deRiskReason})`
5540
+ );
5365
5541
  }
5366
5542
  const threeD = await initThreeDProjection(page);
5367
5543
  if (!forceDE && !threeD.ok) {
@@ -5379,6 +5555,7 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
5379
5555
  );
5380
5556
  }
5381
5557
  await armStaticDedup(session, page, logInitPhase);
5558
+ for (const f of session.deRiskFrames ?? []) session.staticFrames?.delete(f);
5382
5559
  if (!session.onBeforeCapture && !forceDE) {
5383
5560
  const hasVideos = await page.evaluate(() => document.querySelector("video") !== null);
5384
5561
  if (hasVideos) {
@@ -5393,6 +5570,52 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
5393
5570
  await initTransparentBackground(session.page);
5394
5571
  }
5395
5572
  }
5573
+ function drawElementWorkerEncodeEligible(session, transparent) {
5574
+ return (session.config?.enableDrawElementWorkerEncode ?? false) && !transparent && session.beginFrameTimeTicks === 0;
5575
+ }
5576
+ async function cssEffectRiskFrames(session, totalFrames) {
5577
+ let scratch = null;
5578
+ try {
5579
+ scratch = await createCaptureSession(
5580
+ session.serverUrl,
5581
+ session.outputDir,
5582
+ { ...session.options, onMemorySample: void 0 },
5583
+ null,
5584
+ {
5585
+ ...session.config,
5586
+ useDrawElement: false,
5587
+ staticFrameDedup: false,
5588
+ enableBrowserPool: false
5589
+ }
5590
+ );
5591
+ await initializeSession(scratch);
5592
+ const scan = await scanCssEffects(scratch.page, true);
5593
+ if (!scan.reason || !scan.bounded) return null;
5594
+ const fps = fpsToNumber(session.options.fps);
5595
+ const live = await scanCssEffectLiveFrames(
5596
+ scratch.page,
5597
+ fps,
5598
+ totalFrames,
5599
+ totalFrames * MAX_RISK_FRAME_FRACTION
5600
+ );
5601
+ return live && withFramesAfterCallback(live, scan.callbackFrom, fps, totalFrames);
5602
+ } catch (error) {
5603
+ console.log(
5604
+ `[engine] fast capture: effect scan failed (${error instanceof Error ? error.message : String(error)})`
5605
+ );
5606
+ return null;
5607
+ } finally {
5608
+ if (scratch) await closeCaptureSession(scratch).catch(() => {
5609
+ });
5610
+ }
5611
+ }
5612
+ async function renderFrameCount(session, page) {
5613
+ const duration = session.options.compositionDurationSeconds ?? await page.evaluate(
5614
+ () => window.__hf?.duration ?? 0
5615
+ );
5616
+ const total = Math.ceil(duration * fpsToNumber(session.options.fps));
5617
+ return isStaticDedupFrameAnalysisSafe(total) ? total : 0;
5618
+ }
5396
5619
  async function finalizeDrawElementInit(session, page, logInitPhase, opts) {
5397
5620
  const { transparent, forceDE } = opts;
5398
5621
  await decodeDynamicCssBackgroundImages(page);
@@ -5416,7 +5639,7 @@ async function finalizeDrawElementInit(session, page, logInitPhase, opts) {
5416
5639
  logInitPhase(`screenshot fallback: ${boundaryFrames.size} clip-boundary frame(s)`);
5417
5640
  }
5418
5641
  }
5419
- const workerEncodeEnabled = (session.config?.enableDrawElementWorkerEncode ?? false) && !transparent && session.beginFrameTimeTicks === 0;
5642
+ const workerEncodeEnabled = drawElementWorkerEncodeEligible(session, transparent);
5420
5643
  if (workerEncodeEnabled) {
5421
5644
  await initDrawElementWorkerEncode(page);
5422
5645
  session.workerEncodeEnabled = true;
@@ -5433,6 +5656,16 @@ async function completeDeferredDrawElementInit(session) {
5433
5656
  });
5434
5657
  session.deInitDeferred = false;
5435
5658
  }
5659
+ async function installMediaPageHooks(page, options) {
5660
+ await installMediaRenderIdBridge(page);
5661
+ if (options.skipReadinessVideoIds?.length) {
5662
+ await page.evaluateOnNewDocument(
5663
+ holdRenderFrameVideos,
5664
+ options.skipReadinessVideoIds,
5665
+ MEDIA_RENDER_ID_ATTR
5666
+ );
5667
+ }
5668
+ }
5436
5669
  async function createCaptureSession(serverUrl, outputDir, options, onBeforeCapture = null, config) {
5437
5670
  if (!existsSync3(outputDir)) mkdirSync(outputDir, { recursive: true });
5438
5671
  const headlessShell = resolveHeadlessShellPath(config);
@@ -5544,14 +5777,7 @@ async function constructCaptureSession(input) {
5544
5777
  w.__name = (fn, _name) => fn;
5545
5778
  }
5546
5779
  });
5547
- await installMediaRenderIdBridge(page);
5548
- if (options.skipReadinessVideoIds?.length) {
5549
- await page.evaluateOnNewDocument(
5550
- holdRenderFrameVideos,
5551
- options.skipReadinessVideoIds,
5552
- MEDIA_RENDER_ID_ATTR
5553
- );
5554
- }
5780
+ await installMediaPageHooks(page, options);
5555
5781
  if (useDrawElement) {
5556
5782
  await page.evaluateOnNewDocument(instrumentAcceleratedCanvases);
5557
5783
  }
@@ -6157,6 +6383,13 @@ function recordConsoleScriptError(session, error) {
6157
6383
  const message = new VfxFailureError(error).message;
6158
6384
  recordCaptureWarnings(session, [{ code: "vfx_failure", message, details: { sources: [error] } }]);
6159
6385
  }
6386
+ function loggedEarlierInRender(session, text) {
6387
+ if (!text.startsWith(SCENE_CALLBACK_ERROR_PREFIX)) return false;
6388
+ const logged = session.subTimelineWaitMemo.loggedSceneCallbackErrors ??= [];
6389
+ if (logged.includes(text)) return true;
6390
+ logged.push(text);
6391
+ return false;
6392
+ }
6160
6393
  function recordPageError(session, error) {
6161
6394
  if (error && !session.pageErrors.includes(error)) session.pageErrors.push(error);
6162
6395
  }
@@ -6199,7 +6432,9 @@ async function initializeSession(session) {
6199
6432
  const text = msg.text();
6200
6433
  const locationUrl = msg.location()?.url ?? "";
6201
6434
  const diagnostic = formatConsoleDiagnostic(type, text, locationUrl);
6202
- if (!diagnostic.suppressHostLog) console.log(diagnostic.text);
6435
+ if (!diagnostic.suppressHostLog && !loggedEarlierInRender(session, text)) {
6436
+ console.log(diagnostic.text);
6437
+ }
6203
6438
  appendBrowserDiagnostic(session, diagnostic.text);
6204
6439
  const scriptFailure = classifyConsoleScriptFailure(type, text);
6205
6440
  if (scriptFailure) recordScriptLoadFailure(session, scriptFailure);
@@ -6814,6 +7049,7 @@ async function createStaticVerificationPage(session) {
6814
7049
  w.__name = (fn, _name) => fn;
6815
7050
  }
6816
7051
  });
7052
+ await installMediaPageHooks(page, session.options);
6817
7053
  if (session.options.variables && Object.keys(session.options.variables).length > 0) {
6818
7054
  const variablesJson = JSON.stringify(session.options.variables);
6819
7055
  await page.evaluateOnNewDocument((json) => {
@@ -7171,6 +7407,14 @@ async function redrawDrawElementFrame(session, frameIndex, time, seekOptions, he
7171
7407
  true
7172
7408
  );
7173
7409
  }
7410
+ function assertNotRiskFrame(session, frameIndex) {
7411
+ if (session.deRiskFrames?.has(frameIndex)) {
7412
+ throw new DrawElementCaptureError(
7413
+ frameIndex,
7414
+ "frame needs screenshot capture, which this capture path cannot hand over"
7415
+ );
7416
+ }
7417
+ }
7174
7418
  async function captureFrameSurface(session, frameIndex, time, seekOptions, heldVideoTime) {
7175
7419
  const { page, options } = session;
7176
7420
  const { quantizedTime, seekMs, beforeCaptureMs } = await prepareFrameForCapture(
@@ -7208,6 +7452,7 @@ async function captureFrameSurface(session, frameIndex, time, seekOptions, heldV
7208
7452
  "boundary screenshot requested on an injected canvas page"
7209
7453
  );
7210
7454
  } else if (session.captureMode === "drawelement") {
7455
+ assertNotRiskFrame(session, frameIndex);
7211
7456
  if (session.beginFrameTimeTicks > 0) {
7212
7457
  const client = await getCdpSession(page);
7213
7458
  await client.send("HeadlessExperimental.beginFrame", {
@@ -7453,6 +7698,7 @@ async function captureFrameToBuffer(session, frameIndex, time) {
7453
7698
  async function captureFrameToBufferPipelined(session, frameIndex, time) {
7454
7699
  const { page, options } = session;
7455
7700
  const startTime = Date.now();
7701
+ assertNotRiskFrame(session, frameIndex);
7456
7702
  if (session.staticFrames?.has(frameIndex) && session.lastEncodeResult) {
7457
7703
  const lastIdx = session.lastEncodeResultFrame ?? frameIndex - 1;
7458
7704
  let gapStatic = true;
@@ -7539,6 +7785,7 @@ async function captureFramesBatchPipelined(session, frameIndices, times) {
7539
7785
  throw new Error("[FrameCapture] Session not initialized");
7540
7786
  }
7541
7787
  assertVfxIntact(session);
7788
+ for (const frameIndex of frameIndices) assertNotRiskFrame(session, frameIndex);
7542
7789
  const startTime = Date.now();
7543
7790
  const fps = fpsToNumber(options.fps);
7544
7791
  const quantized = times.map((t) => quantizeTimeToFrame(t, fps));
@@ -7719,12 +7966,14 @@ async function captureDeVerificationFrames(session, page, logInitPhase) {
7719
7966
  }
7720
7967
  const boundary = await computeClipBoundaryFrames(page, fps);
7721
7968
  const fractions = computeDeVerifySampleFractions(k);
7722
- const disposable = session.onBeforeCapture ? null : await createStaticVerificationPage(session).catch(() => {
7969
+ const truthInjector = session.onBeforeCapture?.fresh?.() ?? null;
7970
+ const disposable = session.onBeforeCapture && truthInjector === null ? null : await createStaticVerificationPage(session).catch(() => {
7723
7971
  logInitPhase("self-verify truth page unavailable; reading it on the render page");
7724
7972
  return null;
7725
7973
  });
7726
7974
  const isolated = disposable !== null;
7727
7975
  const truthPage = disposable ?? page;
7976
+ const injectFrames = isolated ? truthInjector ?? session.onBeforeCapture : session.onBeforeCapture;
7728
7977
  const seekTo = (t) => seekDeVerifyTruth(truthPage, t, !isolated);
7729
7978
  const frames = /* @__PURE__ */ new Map();
7730
7979
  try {
@@ -7733,12 +7982,13 @@ async function captureDeVerificationFrames(session, page, logInitPhase) {
7733
7982
  for (const f of fractions) {
7734
7983
  let idx = Math.min(totalFrames - 1, Math.max(1, Math.round(totalFrames * f)));
7735
7984
  let guard = 0;
7736
- while (boundary.has(idx) && guard++ < 6) idx = Math.min(totalFrames - 1, idx + 2);
7737
- if (boundary.has(idx)) continue;
7985
+ const skip = (i) => boundary.has(i) || session.deRiskFrames?.has(i) === true;
7986
+ while (skip(idx) && guard++ < 6) idx = Math.min(totalFrames - 1, idx + 2);
7987
+ if (skip(idx)) continue;
7738
7988
  if (frames.has(idx)) continue;
7739
7989
  const t = quantizeTimeToFrame(idx / fps, fps);
7740
7990
  await seekTo(t);
7741
- if (session.onBeforeCapture) await session.onBeforeCapture(truthPage, t);
7991
+ await injectFrames?.(truthPage, t);
7742
7992
  await pageScreenshotCapture(truthPage, session.options);
7743
7993
  frames.set(idx, await pageScreenshotCapture(truthPage, session.options));
7744
7994
  }
@@ -7816,6 +8066,7 @@ function getCapturePerfSummary(session) {
7816
8066
  deVerifyArmed: session.deVerifyFrames?.size ?? 0,
7817
8067
  deVerifyInitMs: session.deVerifyInitMs ?? 0,
7818
8068
  deBoundaryFrames: session.clipBoundaryFrames?.size ?? 0,
8069
+ deRiskFrames: session.deRiskFrames?.size ?? 0,
7819
8070
  deNcprFallbacks: ncprFallbacks,
7820
8071
  deFrameTimeouts: session.deFrameTimeouts ?? 0
7821
8072
  };
@@ -13947,7 +14198,7 @@ function createVideoFrameInjector(frameLookup, config) {
13947
14198
  touchCacheDir(cacheDir);
13948
14199
  lastCacheTouchByDir.set(cacheDir, now);
13949
14200
  }
13950
- return async (page, time, heldVideoTime) => {
14201
+ const inject = async (page, time, heldVideoTime) => {
13951
14202
  for (const cacheDir of frameLookup.frameDirs()) renewCacheLease(cacheDir);
13952
14203
  const activePayloads = frameLookup.getActiveFramePayloads(time);
13953
14204
  if (heldVideoTime !== void 0) {
@@ -13994,6 +14245,7 @@ function createVideoFrameInjector(frameLookup, config) {
13994
14245
  }
13995
14246
  }
13996
14247
  };
14248
+ return Object.assign(inject, { fresh: () => createVideoFrameInjector(frameLookup, config) });
13997
14249
  }
13998
14250
  async function hideVideoElements(page, videoIds) {
13999
14251
  await setVideoElementsVisibility(page, videoIds, false);
@@ -17469,7 +17721,11 @@ async function executeParallelCapture(serverUrl, workDir, tasks, captureOptions,
17469
17721
  captureOptions.deVerifySamples,
17470
17722
  tasks.length
17471
17723
  );
17472
- const workerCaptureOptions = deVerifySamples === captureOptions.deVerifySamples ? captureOptions : { ...captureOptions, deVerifySamples };
17724
+ const workerCaptureOptions = {
17725
+ ...captureOptions,
17726
+ deVerifySamples,
17727
+ deFrameFallback: false
17728
+ };
17473
17729
  const peerController = new AbortController();
17474
17730
  const workerSignal = signal ? AbortSignal.any([signal, peerController.signal]) : peerController.signal;
17475
17731
  const failureHandler = createPoolFailureHandler({
@@ -11,17 +11,17 @@ import {
11
11
  distroLabel,
12
12
  getFFmpegInstallHint,
13
13
  parseLddMissingLibs
14
- } from "./chunk-QYOUK3UO.js";
14
+ } from "./chunk-63S4VUOL.js";
15
15
  import {
16
16
  ensureBrowser,
17
17
  findBrowser
18
- } from "./chunk-GQVTTWZF.js";
18
+ } from "./chunk-QDK7XCOB.js";
19
19
  import {
20
20
  runCancellableProcess
21
21
  } from "./chunk-BL4U6U52.js";
22
22
  import {
23
23
  getFreeDiskMb
24
- } from "./chunk-T6AGUTZJ.js";
24
+ } from "./chunk-BQA3X7TI.js";
25
25
  import {
26
26
  FFMPEG_PATH_ENV,
27
27
  FFPROBE_PATH_ENV,
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  DISTRIBUTED_FPS,
12
12
  isDistributedFps
13
- } from "./chunk-UVQLSMAR.js";
13
+ } from "./chunk-G7RKSAKS.js";
14
14
  import {
15
15
  parseHTML
16
16
  } from "./chunk-SDYDNHEE.js";
@@ -15,13 +15,13 @@ import {
15
15
  findFFmpeg,
16
16
  findFFprobe,
17
17
  getFFmpegInstallHint
18
- } from "./chunk-QYOUK3UO.js";
18
+ } from "./chunk-63S4VUOL.js";
19
19
  import {
20
20
  DEFAULT_VP9_CPU_USED,
21
21
  SDR_RGB_TO_BT709_FILTER,
22
22
  SDR_RGB_TO_TAGGED_BT709_FILTER,
23
23
  renderProvenanceArgs
24
- } from "./chunk-L6FG62QM.js";
24
+ } from "./chunk-UUFY6A7I.js";
25
25
  import {
26
26
  runCancellableProcess
27
27
  } from "./chunk-BL4U6U52.js";
@@ -317,7 +317,7 @@ async function decoderTransposesDimensions(inputPath) {
317
317
  }
318
318
  async function probeMedia(inputPath) {
319
319
  const isImage = inferInputKind(inputPath) === "image";
320
- const engine = await import("./src-QQPHMIJ7.js");
320
+ const engine = await import("./src-WEECPY6E.js");
321
321
  const meta = await engine.extractMediaMetadata(inputPath);
322
322
  if (isImage) {
323
323
  return { width: meta.width, height: meta.height, fps: 0, frameCount: 1 };