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
@@ -8,7 +8,7 @@ import {
8
8
  EncoderInterruptedError,
9
9
  encoderFailureError,
10
10
  prepareAnimatedGifInputs
11
- } from "./chunk-7SKOZHIY.js";
11
+ } from "./chunk-GR2G5L2O.js";
12
12
  import {
13
13
  GENERIC_FAMILIES,
14
14
  collectFontFamilyCustomProperties,
@@ -161,7 +161,7 @@ import {
161
161
  verifyDiskDrawElementSamples,
162
162
  videoAudioId,
163
163
  writeCapturedFrame
164
- } from "./chunk-L6FG62QM.js";
164
+ } from "./chunk-UUFY6A7I.js";
165
165
  import {
166
166
  DISTRIBUTED_FPS,
167
167
  HF_VFX_ATTR,
@@ -177,7 +177,7 @@ import {
177
177
  parseVfxChain,
178
178
  resolveAuthoredTimingWindow,
179
179
  toFps
180
- } from "./chunk-UVQLSMAR.js";
180
+ } from "./chunk-G7RKSAKS.js";
181
181
  import {
182
182
  assignBundledRuntimeCompositionIds,
183
183
  buildVariablesByCompScript,
@@ -189,7 +189,7 @@ import {
189
189
  inlineSubCompositions,
190
190
  parsesAsScript,
191
191
  prepareFlattenedInnerRoot
192
- } from "./chunk-HRZ6ZBKO.js";
192
+ } from "./chunk-32V3VHMK.js";
193
193
  import {
194
194
  COMPOSITION_SOURCE_URL,
195
195
  HF_COLOR_GRADING_ATTR,
@@ -220,7 +220,7 @@ import {
220
220
  sourceTimeAt,
221
221
  styleElementsFor,
222
222
  timeAtSourceTime
223
- } from "./chunk-2ONVJ7NT.js";
223
+ } from "./chunk-PW22CDII.js";
224
224
  import {
225
225
  MAX_AUDIO_GAIN
226
226
  } from "./chunk-X7HBSTCZ.js";
@@ -282,7 +282,7 @@ import {
282
282
  LOW_MEMORY_TOTAL_MB_THRESHOLD,
283
283
  getCgroupMemoryLimitMb,
284
284
  getSystemTotalMb
285
- } from "./chunk-W2LGJSEN.js";
285
+ } from "./chunk-UIOZIIB7.js";
286
286
 
287
287
  // ../producer/src/services/renderOrchestrator.ts
288
288
  import {
@@ -2282,6 +2282,7 @@ function aggregateDrawElement(perfs, de) {
2282
2282
  blankDeterministicAccepts: drain?.blankDeterministicAccepts ?? 0,
2283
2283
  blankRecaptures: drain?.blankRecaptures ?? 0,
2284
2284
  boundaryFrames: perfs.reduce((sum2, p) => sum2 + (p.deBoundaryFrames ?? 0), 0),
2285
+ riskFrames: perfs.reduce((sum2, p) => sum2 + (p.deRiskFrames ?? 0), 0),
2285
2286
  ncprFallbacks: perfs.reduce((sum2, p) => sum2 + (p.deNcprFallbacks ?? 0), 0),
2286
2287
  frameTimeouts: perfs.reduce((sum2, p) => sum2 + (p.deFrameTimeouts ?? 0), 0)
2287
2288
  };
@@ -3862,11 +3863,21 @@ function createDrainFrameGuard(args) {
3862
3863
  return buf;
3863
3864
  };
3864
3865
  }
3865
- async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEncoder, reorderBuffer, assertNotAborted, onProgress, log, stats, abortSignal) {
3866
+ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEncoder, reorderBuffer, assertNotAborted, onProgress, log, stats, abortSignal, risk) {
3866
3867
  let prev = null;
3867
3868
  const frameTime = (i) => i * job.config.fps.den / job.config.fps.num;
3868
3869
  const guard = createDrainFrameGuard({ log, stats, frameTime });
3869
- const guardFrame = (idx, buf) => guard(session, idx, buf);
3870
+ const guardFrame = (item, buf) => item.trusted ? Promise.resolve(buf) : guard(session, item.idx, buf);
3871
+ const captureRisk = async (idx) => {
3872
+ await risk.open();
3873
+ lastProgressAt = Date.now();
3874
+ return raceAgainstStall(
3875
+ risk.capture(idx, frameTime(idx)),
3876
+ stallTimeoutMs - (Date.now() - lastProgressAt),
3877
+ { session, frameIndex: idx, totalFrames, stallTimeoutMs },
3878
+ abortSignal
3879
+ );
3880
+ };
3870
3881
  const stallTimeoutMs = resolveCaptureStallTimeoutMs();
3871
3882
  let lastProgressAt = Date.now();
3872
3883
  const captureWithStallGuard = (idx, promise) => raceAgainstStall(
@@ -3878,7 +3889,7 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
3878
3889
  const drainPrev = async () => {
3879
3890
  if (!prev) return;
3880
3891
  assertNotAborted();
3881
- const buf = await guardFrame(prev.idx, await prev.encodeResult);
3892
+ const buf = await guardFrame(prev, await prev.encodeResult);
3882
3893
  await reorderBuffer.waitForFrame(prev.idx);
3883
3894
  ensureFrameWritten(await currentEncoder.writeFrame(buf), prev.idx, currentEncoder);
3884
3895
  reorderBuffer.advanceTo(prev.idx + 1);
@@ -3898,7 +3909,7 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
3898
3909
  const drainBatch = async (batch) => {
3899
3910
  for (const item of batch) {
3900
3911
  assertNotAborted();
3901
- const buf = await guardFrame(item.idx, await item.encodeResult);
3912
+ const buf = await guardFrame(item, await item.encodeResult);
3902
3913
  await reorderBuffer.waitForFrame(item.idx);
3903
3914
  ensureFrameWritten(await currentEncoder.writeFrame(buf), item.idx, currentEncoder);
3904
3915
  reorderBuffer.advanceTo(item.idx + 1);
@@ -3916,7 +3927,7 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
3916
3927
  };
3917
3928
  if (batchN > 1 && !session.onBeforeCapture) {
3918
3929
  const boundarySS = process.env.HF_FAST_CAPTURE_BOUNDARY_SS === "true";
3919
- const batchable = (f) => !session.staticFrames?.has(f) && !(boundarySS && session.clipBoundaryFrames?.has(f));
3930
+ const batchable = (f) => !session.staticFrames?.has(f) && !(boundarySS && session.clipBoundaryFrames?.has(f)) && !risk?.frames.has(f);
3920
3931
  let prevBatch = [];
3921
3932
  let i = 0;
3922
3933
  while (i < totalFrames) {
@@ -3933,6 +3944,11 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
3933
3944
  );
3934
3945
  await drainBatch(prevBatch);
3935
3946
  prevBatch = results.map((r) => ({ idx: r.frameIndex, encodeResult: r.encodeResult }));
3947
+ } else if (risk?.frames.has(i)) {
3948
+ const buffer = await captureRisk(i);
3949
+ await drainBatch(prevBatch);
3950
+ prevBatch = [{ idx: i, encodeResult: Promise.resolve(buffer), trusted: true }];
3951
+ i++;
3936
3952
  } else {
3937
3953
  const { encodeResult } = await captureWithStallGuard(
3938
3954
  i,
@@ -3948,6 +3964,12 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
3948
3964
  }
3949
3965
  for (let i = 0; i < totalFrames; i++) {
3950
3966
  assertNotAborted();
3967
+ if (risk?.frames.has(i)) {
3968
+ const buffer = await captureRisk(i);
3969
+ await drainPrev();
3970
+ prev = { idx: i, encodeResult: Promise.resolve(buffer), trusted: true };
3971
+ continue;
3972
+ }
3951
3973
  const time = frameTime(i);
3952
3974
  const { encodeResult } = await captureWithStallGuard(
3953
3975
  i,
@@ -4194,6 +4216,24 @@ async function runCaptureStreamingStage(input) {
4194
4216
  prepareCaptureSessionForReuse(session, framesDir, videoInjector);
4195
4217
  probeSession = null;
4196
4218
  }
4219
+ let riskSession = null;
4220
+ const openRiskSession = async () => {
4221
+ const opened = await createCaptureSession(
4222
+ fileServer.url,
4223
+ framesDir,
4224
+ buildCaptureOptions(),
4225
+ createRenderVideoFrameInjector(),
4226
+ {
4227
+ ...captureCfg,
4228
+ useDrawElement: false,
4229
+ staticFrameDedup: false,
4230
+ enableBrowserPool: false
4231
+ }
4232
+ );
4233
+ riskSession = opened;
4234
+ await initializeSession(opened);
4235
+ return opened;
4236
+ };
4197
4237
  try {
4198
4238
  if (!session.isInitialized) {
4199
4239
  await initializeSession(session);
@@ -4208,6 +4248,7 @@ async function runCaptureStreamingStage(input) {
4208
4248
  blankDeterministicAccepts: 0,
4209
4249
  blankRecaptures: 0
4210
4250
  };
4251
+ const riskFrames = session.deRiskFrames;
4211
4252
  await runWorkerEncodePipelineLoop(
4212
4253
  session,
4213
4254
  totalFrames,
@@ -4218,7 +4259,16 @@ async function runCaptureStreamingStage(input) {
4218
4259
  onProgress,
4219
4260
  log,
4220
4261
  deDrainStats,
4221
- abortSignal
4262
+ abortSignal,
4263
+ riskFrames && riskFrames.size > 0 ? {
4264
+ frames: riskFrames,
4265
+ // Opened on the first risk frame, in a browser of its own: pages sharing a
4266
+ // browser share a compositor, which starves the drawElement page's paint events.
4267
+ open: async () => {
4268
+ riskSession ??= await openRiskSession();
4269
+ },
4270
+ capture: async (frameIndex, time) => (await captureFrameToBuffer(riskSession, frameIndex, time)).buffer
4271
+ } : void 0
4222
4272
  );
4223
4273
  } else {
4224
4274
  const stallTimeoutMs = resolveCaptureStallTimeoutMs();
@@ -4256,6 +4306,7 @@ async function runCaptureStreamingStage(input) {
4256
4306
  } finally {
4257
4307
  lastBrowserConsole = session.browserConsoleBuffer;
4258
4308
  await closeCaptureSession(session);
4309
+ if (riskSession) await closeCaptureSession(riskSession);
4259
4310
  }
4260
4311
  }
4261
4312
  const encodeFrom = job.progress;
@@ -4415,7 +4466,7 @@ function openSegmentedSessionReuse(input, session) {
4415
4466
  async function openSegmentedSession(input) {
4416
4467
  const captureCfg = input.cfg.forceScreenshot === input.plan.forceScreenshot ? input.cfg : { ...input.cfg, forceScreenshot: input.plan.forceScreenshot };
4417
4468
  const videoInjector = input.createRenderVideoFrameInjector();
4418
- const captureOptions = input.buildCaptureOptions();
4469
+ const captureOptions = { ...input.buildCaptureOptions(), deFrameFallback: false };
4419
4470
  const ownBrowser = shouldDisableBrowserPoolForParallelWorker({
4420
4471
  parallel: (input.workerCount ?? 1) > 1
4421
4472
  });
@@ -5684,7 +5735,7 @@ function placeAudio(audio, window2) {
5684
5735
  }
5685
5736
 
5686
5737
  // ../core/dist/generated/position-edits-render-inline.js
5687
- var POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function T(){return globalThis}function P(e,t){if(typeof window>"u")return;let o=T(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(s){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var x=null;function R(e,t){if(x)try{x({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){P("runtime.analytics.site1",o)}}var W="http://www.w3.org/1999/xhtml";function N(e){return e!=null&&e.nodeType===1}function k(e){return N(e)&&(e.namespaceURI===W||e.namespaceURI==="http://www.w3.org/2000/svg")}var w="data-hf-edit-base-x",y="data-hf-edit-base-y",m="data-hf-edit-original-translate",_=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},O=e=>{let t=[],o=0,r="";for(let s of e.trim())s==="("&&(o+=1),s===")"&&(o=Math.max(0,o-1)),/\\s/.test(s)&&o===0?(r&&t.push(r),r=""):r+=s;return r&&t.push(r),t},$=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,E=(e,t)=>$.test(e)&&$.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,C=(e,t,o)=>{if(!e||e==="none")return`${t} ${o}`;let[r,s,a]=O(e);if(r===void 0)return`${t} ${o}`;if(s===void 0)return`${E(r,t)} ${o}`;let i=a===void 0?"":` ${a}`;return`${E(r,t)} ${E(s,o)}${i}`},V=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},j=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let o=e.ownerDocument.defaultView,r=o?o.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},b=new WeakMap;function B(e,t){let o=b.get(e);if(!t?.force&&o!==void 0&&e.style.getPropertyValue("translate")!==o){R("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=_(e.getAttribute("data-x"))-_(e.getAttribute(w)),s=_(e.getAttribute("data-y"))-_(e.getAttribute(y));e.hasAttribute(m)||e.setAttribute(m,j(e)),o===void 0&&V(e);let a=e.getAttribute(m)??"",i=C(a,`${r}px`,`${s}px`);e.style.setProperty("translate",i),b.set(e,e.style.getPropertyValue("translate"))}function S(e,t){let o=e.querySelectorAll(`[${m}]:not([${w}]):not([${y}])`);for(let a=0;a<o.length;a++){let i=o[a];if(i===void 0||!k(i))continue;let g=i.getAttribute(m)??"";g===""?i.style.removeProperty("translate"):i.style.setProperty("translate",g),i.removeAttribute(m),b.delete(i)}let r=e.querySelectorAll(`[${w}], [${y}]`),s=0;for(let a=0;a<r.length;a++){let i=r[a];i===void 0||!k(i)||(B(i,t),s+=1)}return s}var L="__hfPositionEditsSeekReapplyWrapped",D=new WeakSet,F=new WeakMap,M=new WeakMap;function H(e){let t=e,o=()=>{try{S(t.document)}catch{}},r=n=>typeof n=="function"&&(D.has(n)||!!n[L]),s=n=>{D.add(n);try{Object.defineProperty(n,L,{value:!0})}catch{}},a=n=>{if(typeof n!="function"||r(n))return n;let l=function(...u){let d=n.apply(this,u);return o(),d};return s(l),l},i=(n,l)=>{let u=F.get(n);if(u?.has(l))return!0;let d=Object.getOwnPropertyDescriptor(n,l);if(d?.configurable===!1){let c=n[l];return typeof c=="function"&&(n[l]=a(c),o()),!1}let p=n[l],f=d?.set;return Object.defineProperty(n,l,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>p,set:c=>{p=a(c),f?.call(n,c)}}),p=a(p),u??(u=new Set),u.add(l),F.set(n,u),o(),!0},g=(n,l)=>{let u=M.get(t),d=Object.getOwnPropertyDescriptor(t,n);if(!u?.has(n)){if(d?.configurable===!1){let c=t[n];return c?i(c,l):!1}let f=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>f,set:c=>{f=c,f&&i(f,l)}}),u??(u=new Set),u.add(n),M.set(t,u)}let p=t[n];return p?i(p,l):!1},h=()=>{let n=g("__hf","seek"),l=g("__player","renderSeek");return n&&l};if(h())return;let v=120,A=t.setInterval(()=>{if(h()){t.clearInterval(A);return}v-=1,v<=0&&t.clearInterval(A)},50)}function I(){document.querySelector(`[${w}], [${y}]`)&&(S(document),H(window))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",I,{once:!0}):I();})();\n';
5738
+ var POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function P(){return globalThis}function T(e,t){if(typeof window>"u")return;let o=P(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(s){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var x=null;function R(e,t){if(x)try{x({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){T("runtime.analytics.site1",o)}}var W="http://www.w3.org/1999/xhtml";function N(e){return e!=null&&e.nodeType===1}function k(e){return N(e)&&(e.namespaceURI===W||e.namespaceURI==="http://www.w3.org/2000/svg")}var w="data-hf-edit-base-x",y="data-hf-edit-base-y",m="data-hf-edit-original-translate",_=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},C=e=>{let t=[],o=0,r="";for(let s of e.trim())s==="("&&(o+=1),s===")"&&(o=Math.max(0,o-1)),/\\s/.test(s)&&o===0?(r&&t.push(r),r=""):r+=s;return r&&t.push(r),t},L=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,E=(e,t)=>L.test(e)&&L.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,O=(e,t,o)=>{if(!e||e==="none")return`${t} ${o}`;let[r,s,a]=C(e);if(r===void 0)return`${t} ${o}`;if(s===void 0)return`${E(r,t)} ${o}`;let i=a===void 0?"":` ${a}`;return`${E(r,t)} ${E(s,o)}${i}`},V=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},j=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let o=e.ownerDocument.defaultView,r=o?o.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},b=new WeakMap;function B(e,t){let o=b.get(e);if(!t?.force&&o!==void 0&&e.style.getPropertyValue("translate")!==o){R("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=_(e.getAttribute("data-x"))-_(e.getAttribute(w)),s=_(e.getAttribute("data-y"))-_(e.getAttribute(y));e.hasAttribute(m)||e.setAttribute(m,j(e)),o===void 0&&V(e);let a=e.getAttribute(m)??"",i=O(a,`${r}px`,`${s}px`);e.style.setProperty("translate",i),b.set(e,e.style.getPropertyValue("translate"))}function S(e,t){let o=e.querySelectorAll(`[${m}]:not([${w}]):not([${y}])`);for(let a=0;a<o.length;a++){let i=o[a];if(i===void 0||!k(i))continue;let g=i.getAttribute(m)??"";g===""?i.style.removeProperty("translate"):i.style.setProperty("translate",g),i.removeAttribute(m),b.delete(i)}let r=e.querySelectorAll(`[${w}], [${y}]`),s=0;for(let a=0;a<r.length;a++){let i=r[a];i===void 0||!k(i)||(B(i,t),s+=1)}return s}var $="__hfPositionEditsSeekReapplyWrapped",D=new WeakSet,F=new WeakMap,I=new WeakMap;function M(e){let t=e,o=()=>{try{S(t.document)}catch{}},r=n=>typeof n=="function"&&(D.has(n)||!!n[$]),s=n=>{D.add(n);try{Object.defineProperty(n,$,{value:!0})}catch{}},a=n=>{if(typeof n!="function"||r(n))return n;let l=function(...u){let d=n.apply(this,u);return o(),d};return s(l),l},i=(n,l)=>{let u=F.get(n);if(u?.has(l))return!0;let d=Object.getOwnPropertyDescriptor(n,l);if(d?.configurable===!1){let c=n[l];return typeof c=="function"&&(n[l]=a(c),o()),!1}let p=n[l],f=d?.set;return Object.defineProperty(n,l,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>p,set:c=>{p=a(c),f?.call(n,c)}}),p=a(p),u??(u=new Set),u.add(l),F.set(n,u),o(),!0},g=(n,l)=>{let u=I.get(t),d=Object.getOwnPropertyDescriptor(t,n);if(!u?.has(n)){if(d?.configurable===!1){let c=t[n];return c?i(c,l):!1}let f=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>f,set:c=>{f=c,f&&i(f,l)}}),u??(u=new Set),u.add(n),I.set(t,u)}let p=t[n];return p?i(p,l):!1},h=()=>{let n=g("__hf","seek"),l=g("__player","renderSeek");return n&&l};if(h())return;let v=120,A=t.setInterval(()=>{if(h()){t.clearInterval(A);return}v-=1,v<=0&&t.clearInterval(A)},50)}function H(){document.querySelector(`[${w}], [${y}]`)&&(S(document),M(window))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",H,{once:!0}):H();})();\n';
5688
5739
  function getPositionEditsRenderScript() {
5689
5740
  return POSITION_EDITS_RENDER_IIFE;
5690
5741
  }
@@ -5997,10 +6048,6 @@ var THREE_D_CONTEXT_PATTERN = /transform-style\s*:\s*preserve-3d|backface-visibi
5997
6048
  function detectThreeDTransformUsage(html) {
5998
6049
  return THREE_D_CONTEXT_PATTERN.test(html);
5999
6050
  }
6000
- var MIX_BLEND_MODE_PATTERN = /mix-blend-mode\s*:/i;
6001
- function detectMixBlendModeUsage(html) {
6002
- return MIX_BLEND_MODE_PATTERN.test(html);
6003
- }
6004
6051
  var BACKGROUND_IMAGE_DECL_PATTERN = /(?:^|;|\{)\s*background(?:-image)?\s*:[^;}]*(?:\bgradient\s*\(|url\s*\()/i;
6005
6052
  function detectAncestorBackgroundImage(html) {
6006
6053
  const { document: document2 } = parseHTML(html);
@@ -7013,7 +7060,6 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
7013
7060
  const renderModeHints = detectRenderModeHints(sanitizedHtml, options.pageMotionBlur);
7014
7061
  const hasShaderTransitions = detectShaderTransitionUsage(sanitizedHtml);
7015
7062
  const usesThreeDTransforms = detectThreeDTransformUsage(sanitizedHtml);
7016
- const usesMixBlendMode = detectMixBlendModeUsage(sanitizedHtml);
7017
7063
  const hasAncestorBackgroundImage = detectAncestorBackgroundImage(sanitizedHtml);
7018
7064
  const normalizedFontHtml = normalizeSystemFontPrimaryFamilies(
7019
7065
  injectTextRenderingRule(
@@ -7127,7 +7173,6 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
7127
7173
  renderModeHints,
7128
7174
  hasShaderTransitions,
7129
7175
  usesThreeDTransforms,
7130
- usesMixBlendMode,
7131
7176
  hasAncestorBackgroundImage
7132
7177
  };
7133
7178
  }
@@ -7534,13 +7579,6 @@ async function runCompileStage(input) {
7534
7579
  "[Render] Fast capture: composition uses a CSS 3D rendering context (perspective / preserve-3d / backface-visibility), so disabling drawElementImage for this render. Capture uses the platform's baseline route."
7535
7580
  );
7536
7581
  }
7537
- if (cfg.useDrawElement && process.env.HF_FAST_CAPTURE_BLEND !== "true" && compiled.usesMixBlendMode) {
7538
- cfg.useDrawElement = false;
7539
- deCompileGate = "mix_blend_mode";
7540
- log.info(
7541
- "[Render] Fast capture: composition uses mix-blend-mode, so disabling drawElementImage for this render. Capture uses the platform's baseline route."
7542
- );
7543
- }
7544
7582
  if (cfg.useDrawElement && process.env.HF_FAST_CAPTURE_ANCESTOR_BG !== "true" && compiled.hasAncestorBackgroundImage) {
7545
7583
  cfg.useDrawElement = false;
7546
7584
  deCompileGate = "ancestor_background_image";
@@ -8900,10 +8938,11 @@ async function constrainAacTruePeak(input) {
8900
8938
  const timeoutMs = input.timeoutMs ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
8901
8939
  return enforceAacTruePeak({
8902
8940
  audioPath: input.audioPath,
8941
+ sourcePath: input.sourcePath,
8903
8942
  targetDurationSeconds: input.targetDurationSeconds,
8904
8943
  signal: input.signal,
8905
- probeTruePeak: (audioPath, signal) => measureTruePeakDbfs(audioPath, { timeoutMs, signal }),
8906
- encode: defaultAacEncoder(timeoutMs, input.signal, input.sourcePath)
8944
+ probeTruePeak: input.probeTruePeakDbfs ?? ((audioPath, signal) => measureTruePeakDbfs(audioPath, { timeoutMs, signal })),
8945
+ encode: input.encodeAac ?? defaultAacEncoder(timeoutMs, input.signal, input.sourcePath)
8907
8946
  });
8908
8947
  }
8909
8948
  async function enforceAacTruePeak(input) {
@@ -8913,6 +8952,7 @@ async function enforceAacTruePeak(input) {
8913
8952
  const correctedPath = join17(scratchDir, "audio.m4a");
8914
8953
  const measurements = [];
8915
8954
  let attenuationDb = 0;
8955
+ let sourcePeakDbfs;
8916
8956
  let measuredPath = input.audioPath;
8917
8957
  for (let pass = 0; pass <= MAX_TRUE_PEAK_CORRECTION_PASSES; pass += 1) {
8918
8958
  const truePeakDbfs = await input.probeTruePeak(measuredPath, input.signal);
@@ -8929,7 +8969,11 @@ async function enforceAacTruePeak(input) {
8929
8969
  }
8930
8970
  if (pass === MAX_TRUE_PEAK_CORRECTION_PASSES) break;
8931
8971
  const headroomDb = AAC_TRUE_PEAK_CORRECTION_HEADROOM_DB * 2 ** pass;
8932
- attenuationDb += AAC_DELIVERY_TRUE_PEAK_DBFS - headroomDb - truePeakDbfs;
8972
+ if (input.sourcePath && sourcePeakDbfs === void 0) {
8973
+ sourcePeakDbfs = await input.probeTruePeak(input.sourcePath, input.signal);
8974
+ }
8975
+ const referenceDbfs = Math.max(truePeakDbfs, (sourcePeakDbfs ?? -Infinity) + attenuationDb);
8976
+ attenuationDb += AAC_DELIVERY_TRUE_PEAK_DBFS - headroomDb - referenceDbfs;
8933
8977
  const result = await input.encode(
8934
8978
  input.audioPath,
8935
8979
  correctedPath,
@@ -9351,7 +9395,7 @@ async function runCaptureStage(input) {
9351
9395
  );
9352
9396
  }
9353
9397
  }
9354
- const captureOptions = buildCaptureOptions();
9398
+ const captureOptions = { ...buildCaptureOptions(), deFrameFallback: false };
9355
9399
  const remedy = diskCaptureRemedy(cfg, job.config.format ?? "mp4", job.duration ?? 0, workerCount);
9356
9400
  const checkDiskProjection = createDiskCaptureProjection({
9357
9401
  framesDir,
@@ -11766,6 +11810,9 @@ function resolveDeShortBand(args) {
11766
11810
  function shouldPreferSingleWorkerDrawElement(args) {
11767
11811
  return args.workerCount > 1 && args.useDrawElement && !args.deCompileGate && !args.forceScreenshot && outputUsesH264Pipeline(args.outputFormat) && args.minFrames > 0 && args.totalFrames >= args.minFrames && args.singleWorkerStreamingOk && !args.layeredOrEffectRoute && !args.supersampling && !args.probeDeGated && !args.experimentalParallelDeOptIn;
11768
11812
  }
11813
+ function probeNeedsScreenshotFrames(session) {
11814
+ return (session?.deRiskFrames?.size ?? 0) > 0;
11815
+ }
11769
11816
  function isProbeDeGated(session) {
11770
11817
  return session !== null && session.captureMode !== "drawelement" && !session.deInitDeferred;
11771
11818
  }
@@ -12444,6 +12491,7 @@ async function executeRenderPipeline(input) {
12444
12491
  // Probe-resolved duration: drawElement self-verification derives its
12445
12492
  // sample frame indices from this so they land inside the drained range.
12446
12493
  compositionDurationSeconds: job.duration,
12494
+ deFrameFallback: true,
12447
12495
  requiresWebGpu: compositionRequiresWebGpu(compiled.html),
12448
12496
  // Live route for Chrome memory (spec §5 Phase −1). The aggregate route
12449
12497
  // through CapturePerfSummary only exists on success; a mid-capture
@@ -12544,7 +12592,7 @@ async function executeRenderPipeline(input) {
12544
12592
  minFrames: deParallelMinFrames,
12545
12593
  layeredOrEffectRoute: hasHdrContent || compiled.hasShaderTransitions,
12546
12594
  supersampling: deviceScaleFactor !== 1,
12547
- probeDeGated: isProbeDeGated(probeSession),
12595
+ probeDeGated: isProbeDeGated(probeSession) || probeNeedsScreenshotFrames(probeSession),
12548
12596
  experimentalParallelDeOptIn: process.env.PRODUCER_EXPERIMENTAL_FAST_CAPTURE === "true" || process.env.HF_DE_PARALLEL_STREAM === "true",
12549
12597
  routerEnabled: deParallelRouterEnabled,
12550
12598
  // Router pins 3 workers for the streaming path; don't pin when a
@@ -12586,6 +12634,8 @@ async function executeRenderPipeline(input) {
12586
12634
  deInversionEligible = false;
12587
12635
  deParallelRouterEligible = false;
12588
12636
  deShortBand = void 0;
12637
+ } else if (probeNeedsScreenshotFrames(probeSession)) {
12638
+ deParallelRouterEligible = false;
12589
12639
  }
12590
12640
  }
12591
12641
  const deProbeGateReason = isProbeDeGated(probeSession) ? probeSession.deGateReason : void 0;
@@ -12777,7 +12827,8 @@ async function executeRenderPipeline(input) {
12777
12827
  deParallelStreamForced
12778
12828
  );
12779
12829
  const deParallelStreamVerified = (deParallelStreamForced || process.env.HF_DE_PARALLEL_STREAM === "true") && useStreamingEncode && workerCount > 1;
12780
- if (shouldClampDefaultDrawElement({
12830
+ const routeDropsScreenshotFrames = cfg.useDrawElement && probeNeedsScreenshotFrames(probeSession) && (!useStreamingEncode || workerCount !== 1);
12831
+ if (routeDropsScreenshotFrames || shouldClampDefaultDrawElement({
12781
12832
  useDrawElement: cfg.useDrawElement,
12782
12833
  fastCaptureExplicitOptIn: process.env.PRODUCER_EXPERIMENTAL_FAST_CAPTURE === "true",
12783
12834
  useStreamingEncode,
@@ -14352,6 +14403,18 @@ function planFrameWeights(input) {
14352
14403
  }
14353
14404
  return weights;
14354
14405
  }
14406
+ function withChunkCaptureCost(slices, weights) {
14407
+ const lightest = weights.reduce((least, weight) => Math.min(least, weight), Infinity);
14408
+ return slices.map((slice) => {
14409
+ let sum2 = 0;
14410
+ for (let frame = slice.startFrame; frame < slice.endFrame; frame++) sum2 += weights[frame];
14411
+ const cost = Math.round(sum2 / (slice.endFrame - slice.startFrame) / lightest * 100) / 100;
14412
+ return cost > 1 ? { ...slice, captureCost: cost } : slice;
14413
+ });
14414
+ }
14415
+ function effectiveChunkFrames(frames, captureCost = 1) {
14416
+ return Math.round(frames * captureCost);
14417
+ }
14355
14418
  function buildWeightedChunkSlices(weights, chunkCount, minFrames, maxFrames) {
14356
14419
  if (isUniformFrameCost(weights)) return null;
14357
14420
  const totalFrames = weights.length;
@@ -15670,7 +15733,10 @@ function buildPlanChunkSlices(frameWeights, config, chunkCount, effectiveChunkSi
15670
15733
  MIN_CHUNK_SIZE,
15671
15734
  Math.min(config.targetChunkFrames ?? MAX_CHUNK_SIZE, MAX_CHUNK_SIZE, maxFramesPerChunk)
15672
15735
  ) : null;
15673
- return weighted ?? buildChunkSlices(frameWeights.length, chunkCount, effectiveChunkSize);
15736
+ return withChunkCaptureCost(
15737
+ weighted ?? buildChunkSlices(frameWeights.length, chunkCount, effectiveChunkSize),
15738
+ frameWeights
15739
+ );
15674
15740
  }
15675
15741
  async function readFontSnapshotSha() {
15676
15742
  const module = await import("./fontData.generated-NXAOI4GH.js");
@@ -15957,7 +16023,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
15957
16023
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
15958
16024
  if (probeResult.probeSession) {
15959
16025
  try {
15960
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-QQPHMIJ7.js");
16026
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-WEECPY6E.js");
15961
16027
  await closeCaptureSession2(probeResult.probeSession);
15962
16028
  } catch (err) {
15963
16029
  log.warn("[plan] probe session close failed", {
@@ -17631,7 +17697,7 @@ function startServer(options = {}) {
17631
17697
  });
17632
17698
  async function shutdown(signal) {
17633
17699
  log.info(`Received ${signal}, shutting down`);
17634
- const { drainBrowserPool } = await import("./src-QQPHMIJ7.js");
17700
+ const { drainBrowserPool } = await import("./src-WEECPY6E.js");
17635
17701
  await drainBrowserPool().catch(() => {
17636
17702
  });
17637
17703
  const handle = await Promise.race([
@@ -17992,7 +18058,12 @@ function parseChunkSlices(value) {
17992
18058
  throw new PlanV2IntegrityError(`meta/chunks.json contains duplicate chunk index ${index}`);
17993
18059
  }
17994
18060
  indexes.add(index);
17995
- return { index, startFrame, endFrame };
18061
+ if (chunk.captureCost === void 0) return { index, startFrame, endFrame };
18062
+ const captureCost = chunk.captureCost;
18063
+ if (typeof captureCost !== "number" || !Number.isFinite(captureCost) || captureCost <= 1) {
18064
+ throw new PlanV2IntegrityError(`${field}.captureCost must be a number above 1`);
18065
+ }
18066
+ return { index, startFrame, endFrame, captureCost };
17996
18067
  });
17997
18068
  }
17998
18069
  function buildVideoChunkDependencies(executionPlanDir, dimensions) {
@@ -19140,15 +19211,17 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19140
19211
  deferredVideos.filter((video) => remoteVideoIds.has(video.videoId))
19141
19212
  )
19142
19213
  });
19214
+ const captureFrames = effectiveChunkFrames(framesInChunk, slice.captureCost);
19143
19215
  const chunkWorkerCount = resolveChunkCaptureWorkers(
19144
- framesInChunk,
19145
- calculateOptimalWorkers(framesInChunk, void 0, cfg),
19216
+ captureFrames,
19217
+ calculateOptimalWorkers(captureFrames, void 0, cfg),
19146
19218
  options?.maxCaptureWorkers
19147
19219
  );
19148
19220
  let session = null;
19149
19221
  let outputKind;
19150
19222
  let framesEncoded = 0;
19151
19223
  let sessionBootMs = 0;
19224
+ let videoExtractMs = 0;
19152
19225
  let captureStageMs = 0;
19153
19226
  let encodeStageMs = 0;
19154
19227
  let captureMode;
@@ -19214,6 +19287,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19214
19287
  session = null;
19215
19288
  }
19216
19289
  }
19290
+ const extractStarted = Date.now();
19217
19291
  const deferredVideoFrames = planVideos ? extractDeferredVideoFramesForChunk({
19218
19292
  planDir,
19219
19293
  planVideos,
@@ -19223,6 +19297,9 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19223
19297
  cfg,
19224
19298
  remoteSources,
19225
19299
  shownBoxes
19300
+ }).then((frames) => {
19301
+ videoExtractMs = Date.now() - extractStarted;
19302
+ return frames;
19226
19303
  }) : Promise.resolve([]);
19227
19304
  extraction = deferredVideoFrames;
19228
19305
  const videoFrameLookup = planVideos && planVideos.extracted.length > 0 ? deferredVideoFrames.then(
@@ -19440,6 +19517,8 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19440
19517
  sessionBootMs,
19441
19518
  captureStageMs,
19442
19519
  encodeStageMs,
19520
+ // Wall time of the chunk's own video frame extraction; it overlaps captureStageMs, so do not add them.
19521
+ videoExtractMs,
19443
19522
  workers: chunkWorkerCount,
19444
19523
  captureMode,
19445
19524
  // Device-pixel box each video's frames were extracted to cover; a video not listed kept full size.
@@ -7,19 +7,19 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  ambiguousIssue,
9
9
  loadBrowserScript
10
- } from "./chunk-SQQZUUK6.js";
10
+ } from "./chunk-OYVVDYM6.js";
11
11
  import {
12
12
  auditClipDurations,
13
13
  shouldIgnoreHttpError,
14
14
  shouldIgnoreRequestFailure
15
- } from "./chunk-XP55QWOB.js";
15
+ } from "./chunk-D35MPIGJ.js";
16
16
  import {
17
17
  serveStaticProjectHtml
18
- } from "./chunk-TTWFTEUG.js";
18
+ } from "./chunk-NC3TVM27.js";
19
19
  import {
20
20
  STUDIO_PREVIEW_CAPTURE_MODE,
21
21
  STUDIO_PREVIEW_MARK_META
22
- } from "./chunk-JFIEV2J4.js";
22
+ } from "./chunk-HXHSGDU6.js";
23
23
  import {
24
24
  artifactDirectory,
25
25
  finishSnapshotRun
@@ -31,7 +31,7 @@ import {
31
31
  proxyVariantFor,
32
32
  resolveProxies,
33
33
  scanProjectMediaCodecMap
34
- } from "./chunk-Z6Q4ASCD.js";
34
+ } from "./chunk-DRTUJVLE.js";
35
35
  import {
36
36
  AUDIT_SEEK_OPTIONS,
37
37
  DEFAULT_ZOOM_PADDING_PX,
@@ -45,21 +45,21 @@ import {
45
45
  seekCompositionTimeline,
46
46
  seekInPage,
47
47
  waitForPreferredSeekTarget
48
- } from "./chunk-HOAXHVRR.js";
48
+ } from "./chunk-ML4IULLQ.js";
49
49
  import {
50
50
  BrowserCleanupError,
51
51
  closeManagedBrowser,
52
52
  onStopSignal
53
- } from "./chunk-2KZSKIYY.js";
53
+ } from "./chunk-TTFHBTXQ.js";
54
54
  import {
55
55
  findStageProxyBox
56
- } from "./chunk-T4IJMVCB.js";
56
+ } from "./chunk-ZFBET3PD.js";
57
57
  import {
58
58
  resolveAutoProxy
59
- } from "./chunk-JN63IPHT.js";
59
+ } from "./chunk-4VZAIVZQ.js";
60
60
  import {
61
61
  injectTagsAtHeadStart
62
- } from "./chunk-2ONVJ7NT.js";
62
+ } from "./chunk-PW22CDII.js";
63
63
  import {
64
64
  normalizeErrorMessage
65
65
  } from "./chunk-T2EUWCJE.js";
@@ -434,7 +434,7 @@ function proxyFailedDraft(message) {
434
434
  return { code: "media_proxy_failed", severity: "warning", message, time: 0 };
435
435
  }
436
436
  async function loadCheckHtmlWithDeferredMedia(dir) {
437
- const { bundleWithLocalizedFonts } = await import("./bundleWithLocalizedFonts-3ED26VCR.js");
437
+ const { bundleWithLocalizedFonts } = await import("./bundleWithLocalizedFonts-ERB43NFP.js");
438
438
  return injectTagsAtHeadStart(
439
439
  await bundleWithLocalizedFonts(dir),
440
440
  `<meta name="${STUDIO_PREVIEW_MARK_META}" content="${STUDIO_PREVIEW_CAPTURE_MODE}">`
@@ -493,7 +493,7 @@ async function runBrowserCheck(project, options, motion, runGrid, deadline, prel
493
493
  ).map((draft) => runtimeFinding(draft, rootAnchor))
494
494
  }));
495
495
  const launchSettleMs = Date.now() - launchSettleStart;
496
- const { analyzeClipMediaFit } = await import("./src-QQPHMIJ7.js");
496
+ const { analyzeClipMediaFit } = await import("./src-WEECPY6E.js");
497
497
  for (const entry of await auditClipDurations(page, analyzeClipMediaFit, options.timeout)) {
498
498
  drafts.push({ code: "clip_media_fit", severity: entry.level, message: entry.text, time: 0 });
499
499
  }
@@ -6,27 +6,27 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  resolveProject
9
- } from "./chunk-K65XUUJX.js";
9
+ } from "./chunk-BIZPUWBG.js";
10
10
  import {
11
11
  serveStaticProjectHtml
12
- } from "./chunk-TTWFTEUG.js";
12
+ } from "./chunk-NC3TVM27.js";
13
13
  import {
14
14
  AUDIT_SEEK_OPTIONS,
15
15
  installPageFunctionGuard,
16
16
  seekCompositionTimeline,
17
17
  waitForCompositionFonts,
18
18
  waitForRuntimeReady
19
- } from "./chunk-HOAXHVRR.js";
19
+ } from "./chunk-ML4IULLQ.js";
20
20
  import {
21
21
  launchManagedBrowser,
22
22
  resolveManagedGpuMode
23
- } from "./chunk-2KZSKIYY.js";
23
+ } from "./chunk-TTFHBTXQ.js";
24
24
  import {
25
25
  gotoWhenSent
26
26
  } from "./chunk-MOEGCMKI.js";
27
27
  import {
28
28
  pageNavigationTimeoutMs
29
- } from "./chunk-S5WSJVHP.js";
29
+ } from "./chunk-I6A2B3IJ.js";
30
30
  import {
31
31
  defineCommand
32
32
  } from "./chunk-S3S4TGEH.js";
@@ -40,7 +40,7 @@ import {
40
40
  import {
41
41
  printDeprecationNotice,
42
42
  withMeta
43
- } from "./chunk-4QG64APO.js";
43
+ } from "./chunk-3YGSZSEN.js";
44
44
  import {
45
45
  normalizeErrorMessage
46
46
  } from "./chunk-T2EUWCJE.js";
@@ -715,7 +715,7 @@ async function collectTweenBoundaries(page) {
715
715
  });
716
716
  }
717
717
  async function bundleProjectHtml(projectDir) {
718
- const { bundleToSingleHtml } = await import("./compiler-WER7FC5O.js");
718
+ const { bundleToSingleHtml } = await import("./compiler-LVNWLZCX.js");
719
719
  return bundleToSingleHtml(projectDir);
720
720
  }
721
721
  async function alignViewportToComposition(page, url) {
@@ -732,15 +732,15 @@ async function alignViewportToComposition(page, url) {
732
732
  await gotoWhenSent(page, url, pageNavigationTimeoutMs());
733
733
  }
734
734
  async function runLayoutAudit(projectDir, opts) {
735
- const { ensureBrowser } = await import("./manager-COSJVRAE.js");
735
+ const { ensureBrowser } = await import("./manager-BWU4U7DV.js");
736
736
  const puppeteer = await import("puppeteer-core");
737
- const { buildChromeArgs } = await import("./src-QQPHMIJ7.js");
737
+ const { buildChromeArgs } = await import("./src-WEECPY6E.js");
738
738
  const {
739
739
  assertWebGpuAdapterAvailable,
740
740
  compositionRequiresWebGpu,
741
741
  resolveLocalBrowserGpuMode,
742
742
  resolveLocalWebGpu
743
- } = await import("./gpuPolicy-GIBBYBI5.js");
743
+ } = await import("./gpuPolicy-RZ2OUY4M.js");
744
744
  const html = await bundleProjectHtml(projectDir);
745
745
  const server = await serveStaticProjectHtml(
746
746
  projectDir,
@@ -11,13 +11,13 @@ import {
11
11
  isAllowedHtmlAttribute,
12
12
  isSafeAttributeValue,
13
13
  sanitizeRichTextChildren
14
- } from "./chunk-UVQLSMAR.js";
14
+ } from "./chunk-G7RKSAKS.js";
15
15
  import {
16
16
  EXCLUDED_TAGS,
17
17
  ensureHfIds,
18
18
  mintHfId,
19
19
  walkCompositionDescendants
20
- } from "./chunk-HRZ6ZBKO.js";
20
+ } from "./chunk-32V3VHMK.js";
21
21
  import {
22
22
  decodedUrlPath,
23
23
  removeElementWithGsapCascade