hyperframes 0.8.146 → 0.8.148

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 (143) hide show
  1. package/dist/{add-6J4TLUDW.js → add-JAHZJYB7.js} +11 -11
  2. package/dist/{animatedGifPrep-TPYA45ZZ.js → animatedGifPrep-HV4ZFVPV.js} +5 -5
  3. package/dist/{asset-B4C6ZU4V.js → asset-SJA7DT6Q.js} +2 -2
  4. package/dist/{assetCataloger-GX4B55VB.js → assetCataloger-JJQ4JW2P.js} +2 -2
  5. package/dist/{auth-T2V3URGO.js → auth-RR3OIXLH.js} +1 -1
  6. package/dist/{autoUpdate-O4R7IOYP.js → autoUpdate-KLDV2XWV.js} +2 -2
  7. package/dist/{backgroundChecks-SQHGZCSH.js → backgroundChecks-OVL3E2RK.js} +3 -3
  8. package/dist/backgroundChecksWorker.js +3 -3
  9. package/dist/{batchRender-T7S2CGJE.js → batchRender-2SAJGOHU.js} +3 -3
  10. package/dist/{beats-RNEXDM7U.js → beats-HTYS42CC.js} +10 -10
  11. package/dist/{benchmark-IVK6FCEU.js → benchmark-CAHP4GLB.js} +8 -8
  12. package/dist/{browser-WUE6VK2N.js → browser-M7I67IGX.js} +3 -3
  13. package/dist/{bundleWithLocalizedFonts-EEIRL7FT.js → bundleWithLocalizedFonts-EKRXJBXU.js} +2 -2
  14. package/dist/{capture-K3EONGGU.js → capture-P5SNZ6HL.js} +2 -2
  15. package/dist/{capture-LEKIGJ4G.js → capture-YZQZ5LKM.js} +8 -8
  16. package/dist/{catalog-IXYQ2KXW.js → catalog-LREZPRJS.js} +11 -11
  17. package/dist/{catch-up-IIF7HKR6.js → catch-up-2MLRYAYP.js} +4 -4
  18. package/dist/{check-W7CDOXNP.js → check-BH6NUR22.js} +28 -28
  19. package/dist/{checkBrowser-5VSXEHBZ.js → checkBrowser-BM6JBFST.js} +27 -27
  20. package/dist/{chunk-ZZ7H4IJ6.js → chunk-24GKVAEE.js} +9 -9
  21. package/dist/{chunk-A72OAGNB.js → chunk-2HWB4TCI.js} +1 -1
  22. package/dist/chunk-3WD4JNMU.js +3795 -0
  23. package/dist/{chunk-XJUZEB44.js → chunk-4S4VUXW3.js} +1 -1
  24. package/dist/{chunk-HBGJYBGE.js → chunk-54TV77W5.js} +2 -2
  25. package/dist/{chunk-JBQJKC23.js → chunk-62RUQJ5J.js} +1 -1
  26. package/dist/{chunk-6TTAXMDG.js → chunk-6VKQ5JT3.js} +2 -2
  27. package/dist/{chunk-HTM4CIFS.js → chunk-74JDPWQ3.js} +5 -5
  28. package/dist/{chunk-BAKPN2D2.js → chunk-AHBYQRGI.js} +1 -1
  29. package/dist/{chunk-K7ES5RSK.js → chunk-ASEJ2FBO.js} +1 -1
  30. package/dist/{chunk-FKLYMV3U.js → chunk-AY2BONTF.js} +1 -1
  31. package/dist/{chunk-EGO6Z24R.js → chunk-BB3HJLHD.js} +3 -3
  32. package/dist/{chunk-Z5C4LEAD.js → chunk-C24LU5XD.js} +6 -6
  33. package/dist/{chunk-FJLHVAPO.js → chunk-CNEYCO24.js} +3 -3
  34. package/dist/{chunk-UOBYRLDD.js → chunk-ELACLQPC.js} +1 -1
  35. package/dist/{chunk-DUU77E2S.js → chunk-JN4EK6MC.js} +9 -9
  36. package/dist/{chunk-XVIYZU3D.js → chunk-K35E45SI.js} +1 -1
  37. package/dist/{chunk-KG265HQ7.js → chunk-K4RIT6PX.js} +2 -2
  38. package/dist/{chunk-MOL32UKR.js → chunk-KMJLHHBF.js} +1 -1
  39. package/dist/{chunk-TBOMPYG6.js → chunk-KQESKXAC.js} +2 -2
  40. package/dist/{chunk-3HSWLZ6S.js → chunk-KQHJKJ3V.js} +1 -1
  41. package/dist/{chunk-ETNQF37F.js → chunk-NT7EK6ET.js} +1 -1
  42. package/dist/{chunk-KPJMBC4K.js → chunk-O3EALI4M.js} +1 -1
  43. package/dist/{chunk-KFZUUXUN.js → chunk-OLENCLFE.js} +2 -2
  44. package/dist/{chunk-DDNS2674.js → chunk-PR7QQBSC.js} +1 -1
  45. package/dist/{chunk-FDL4HV44.js → chunk-Q2Y5OZCY.js} +2 -2
  46. package/dist/{chunk-SYMSKGXI.js → chunk-QIJLIULK.js} +2 -2
  47. package/dist/{chunk-2NAUEDA6.js → chunk-QX26JK43.js} +1 -1
  48. package/dist/{chunk-CVPWZ5LY.js → chunk-RKBES4XP.js} +1 -1
  49. package/dist/{chunk-WUZ6TMAO.js → chunk-S7E2I3HT.js} +1 -1
  50. package/dist/{chunk-LE7T4ML7.js → chunk-SP6XL3NP.js} +1 -1
  51. package/dist/{chunk-VT563F4O.js → chunk-TLGJRK6Q.js} +7 -7
  52. package/dist/{chunk-TH4OXAWY.js → chunk-URYAKNQ2.js} +1 -1
  53. package/dist/{chunk-54UXJKFF.js → chunk-UTBQSOEC.js} +1 -1
  54. package/dist/{chunk-WU2B74TL.js → chunk-VC7JBNPS.js} +83 -107
  55. package/dist/{chunk-ZVZSFDW3.js → chunk-VHJPGKUW.js} +2 -2
  56. package/dist/{chunk-R6R74HNZ.js → chunk-VXM4BH23.js} +34 -21
  57. package/dist/{chunk-QSSPIATO.js → chunk-X2G54Y2V.js} +1 -1
  58. package/dist/{chunk-4RUILXS6.js → chunk-XIL7KT5Q.js} +2 -2
  59. package/dist/{chunk-UZUUVYAO.js → chunk-YQK445YQ.js} +2 -2
  60. package/dist/{chunk-AJ5R4GM6.js → chunk-ZK3BQXHC.js} +1 -1
  61. package/dist/{clean-2GDD2B4F.js → clean-K7GYTLQE.js} +11 -11
  62. package/dist/cli.js +52 -52
  63. package/dist/{cloud-LUKGDTTE.js → cloud-I3J5HTN7.js} +4 -4
  64. package/dist/{cloudrun-NQF5KFQI.js → cloudrun-MJQ363PB.js} +3 -3
  65. package/dist/{compare-4P6O4ONG.js → compare-LHW6NEFR.js} +22 -22
  66. package/dist/{compiler-ACCPOZMQ.js → compiler-NPD3MYMO.js} +2 -2
  67. package/dist/{component-SDDOLNJD.js → component-LTPK2D3K.js} +3 -3
  68. package/dist/{compositions-P2L6HUVQ.js → compositions-QGEHXGIL.js} +9 -9
  69. package/dist/{delete-Q6S4BJ3F.js → delete-ATNRBUDJ.js} +2 -2
  70. package/dist/{dist-GPDOV3IQ.js → dist-CUIR3GFX.js} +2 -2
  71. package/dist/{doctor-NL73UKHV.js → doctor-6B76R5BJ.js} +7 -7
  72. package/dist/{events-AVOPOKO3.js → events-33GOPHSS.js} +3 -3
  73. package/dist/{events-X7KPU7LG.js → events-BLABPRD5.js} +2 -2
  74. package/dist/{feedback-GJZ5NXSH.js → feedback-HLXEG7RT.js} +6 -6
  75. package/dist/{figma-V7SVQQI5.js → figma-T6W7H23L.js} +3 -3
  76. package/dist/fontLocalizeCli.js +7 -7
  77. package/dist/{get-FO3YZYEU.js → get-UDMLOTKJ.js} +2 -2
  78. package/dist/{gpuPolicy-QGS4TFWP.js → gpuPolicy-M2JZGGVW.js} +5 -5
  79. package/dist/{grade-compare-7ICSN7KE.js → grade-compare-P4CHFVBR.js} +22 -22
  80. package/dist/{help-Y5LYZG7K.js → help-4MW6L6YB.js} +1 -1
  81. package/dist/{history-RKGBRNLD.js → history-336VM6SH.js} +5 -5
  82. package/dist/hyperframe-runtime.js +62 -62
  83. package/dist/hyperframe.manifest.json +1 -1
  84. package/dist/hyperframe.runtime.iife.js +62 -62
  85. package/dist/hyperframes-player.global.js +1 -1
  86. package/dist/{info-GGUTL2NR.js → info-FPMIDMD5.js} +7 -7
  87. package/dist/{init-PG7NA5SQ.js → init-IWM4PWLO.js} +20 -20
  88. package/dist/{inspect-FCXUB6DE.js → inspect-IIG7756C.js} +23 -23
  89. package/dist/{installer-LZ4X5TZZ.js → installer-Q4MMZKLA.js} +4 -4
  90. package/dist/{keyframes-R3K6WJ3N.js → keyframes-TWO4BXBA.js} +6 -6
  91. package/dist/{lambda-3GAKHMC3.js → lambda-2JB2QUK2.js} +4 -4
  92. package/dist/{layout-XNIZIGA2.js → layout-TPKEKFQQ.js} +23 -23
  93. package/dist/{lint-4KDS2F4O.js → lint-H3KL7KSX.js} +6 -6
  94. package/dist/{list-OVPURFPK.js → list-LYPO4KRE.js} +2 -2
  95. package/dist/{login-EE2AX2PE.js → login-SQQWKWTD.js} +4 -4
  96. package/dist/{media-treatment-UDUEOP67.js → media-treatment-KSRINVUA.js} +8 -8
  97. package/dist/{models-LPK2O4B2.js → models-WUBF6GDB.js} +8 -8
  98. package/dist/{motionShot-G76XBOYI.js → motionShot-STKG4KYQ.js} +11 -11
  99. package/dist/{normalize-audio-TUKWZ3OR.js → normalize-audio-CA47XZ4I.js} +4 -4
  100. package/dist/{open-7XB2TGVB.js → open-B5WYEM3Z.js} +4 -4
  101. package/dist/{parakeetRunner-DL556HXL.js → parakeetRunner-JBK2JPEH.js} +7 -7
  102. package/dist/{pipeline-34N5DLWU.js → pipeline-FEAAD2RJ.js} +5 -5
  103. package/dist/{play-DDA2UUQF.js → play-2LC5XRM6.js} +16 -16
  104. package/dist/{present-LLNRKXF5.js → present-XKYF3VGC.js} +12 -12
  105. package/dist/{preview-H3ZZS46F.js → preview-WDPZRHE5.js} +15 -15
  106. package/dist/{producer-IFQOZK2G.js → producer-343ENLAM.js} +1 -1
  107. package/dist/{projectConfig-SBRMQZGG.js → projectConfig-YXKU3CTB.js} +6 -6
  108. package/dist/{publication-5BQICRZO.js → publication-ODXP3JI7.js} +2 -2
  109. package/dist/{publish-XDUZA3E3.js → publish-3OYXNY44.js} +7 -7
  110. package/dist/{remove-background-GNKRMFQS.js → remove-background-F6QTJIPZ.js} +6 -6
  111. package/dist/{render-KTTC3EE5.js → render-JKB6GZDB.js} +8 -8
  112. package/dist/{render-JM6KNRIA.js → render-QQ7NUREG.js} +18 -18
  113. package/dist/{render-PCFO45RK.js → render-SC77I7FT.js} +3 -3
  114. package/dist/{render-batch-7R2NRNVJ.js → render-batch-4F44JFAB.js} +3 -3
  115. package/dist/{renderCancellation-GP3XD2FS.js → renderCancellation-7OEBNE2L.js} +5 -5
  116. package/dist/{resolver-C4FPX72I.js → resolver-7MYXNEAX.js} +4 -4
  117. package/dist/{sherpa-MZP3MV2X.js → sherpa-FOXB4XBN.js} +7 -7
  118. package/dist/{skills-OET4XSHR.js → skills-GG756RCG.js} +5 -5
  119. package/dist/{skillsUpdateCheck-IPFSKKJD.js → skillsUpdateCheck-N2LDCNAS.js} +3 -3
  120. package/dist/{snapshot-EC4N75MS.js → snapshot-2LDOY65W.js} +23 -23
  121. package/dist/{src-ZZQJOKO6.js → src-PTIV7IVV.js} +6 -6
  122. package/dist/{src-LIERUCFW.js → src-VMTHSARJ.js} +6 -4
  123. package/dist/{staticProjectServer-YH2RHYKW.js → staticProjectServer-QBB6WUAY.js} +12 -12
  124. package/dist/studio/assets/{hyperframes-player-tkxyWf5H.js → hyperframes-player-BBBg-uvu.js} +1 -1
  125. package/dist/studio/assets/{index-Cg48BxAo.js → index-BJIpZeuk.js} +115 -115
  126. package/dist/studio/assets/{index-Dllxg4aU.js → index-BXJLeCqB.js} +1 -1
  127. package/dist/studio/assets/{index-BrdqOkqP.js → index-DARhiE_i.js} +1 -1
  128. package/dist/studio/assets/{index-CVd4O6eH.css → index-DkQKsFxx.css} +1 -1
  129. package/dist/studio/index.html +2 -2
  130. package/dist/{studio-api-T2TS2CHL.js → studio-api-VPTZF2AW.js} +6 -6
  131. package/dist/{studioServer-GJVVJUEL.js → studioServer-VZKX2MG7.js} +33 -33
  132. package/dist/{telemetry-ZQ5XVE6Z.js → telemetry-76XND6XK.js} +3 -3
  133. package/dist/{timeline-I2T5WIPD.js → timeline-UJLTA4AX.js} +12 -12
  134. package/dist/{tokens-ONUWOXEX.js → tokens-VMWANYJY.js} +2 -2
  135. package/dist/{transcribe-BCQMA537.js → transcribe-FD7A2SH3.js} +7 -7
  136. package/dist/{transcribe-ZLJF7V5Y.js → transcribe-JNOG667L.js} +6 -6
  137. package/dist/{updateCheck-ZWHDXF73.js → updateCheck-WI3HYM72.js} +2 -2
  138. package/dist/{upgrade-32JGFZWS.js → upgrade-52RIOKFX.js} +2 -2
  139. package/dist/{urlDownloader-EVDP43GM.js → urlDownloader-352AY25I.js} +4 -4
  140. package/dist/{validate-G4PUGQCI.js → validate-MJVNR7YY.js} +17 -17
  141. package/dist/{video-TILEY3VJ.js → video-72VNEQEI.js} +5 -5
  142. package/package.json +1 -1
  143. package/dist/chunk-Z6FLHIDV.js +0 -3795
@@ -26,7 +26,7 @@ import {
26
26
  renderFrameIdForRenderId,
27
27
  resolveAuthoredTimingWindow,
28
28
  toFps
29
- } from "./chunk-BAKPN2D2.js";
29
+ } from "./chunk-AHBYQRGI.js";
30
30
  import {
31
31
  AUDIO_GROUP_RENDER_ID_ATTR,
32
32
  COLOR_GRADING_SOURCE_HIDDEN_ATTR,
@@ -55,7 +55,7 @@ import {
55
55
  shiftRateLane,
56
56
  sourceTimeAt,
57
57
  timeAtSourceTime
58
- } from "./chunk-Z6FLHIDV.js";
58
+ } from "./chunk-3WD4JNMU.js";
59
59
  import {
60
60
  clampAudioGain,
61
61
  isAudibleVideoElement
@@ -6105,20 +6105,26 @@ async function prepareFrameForCapture(session, frameIndex, time, seekOptions, he
6105
6105
  seekOptions?.subFrameDivisions
6106
6106
  );
6107
6107
  const seekStart = Date.now();
6108
+ session.captureStep = "seeking the timeline";
6108
6109
  const hasPendingComposite = await seekPageTimeline(page, quantizedTime, seekOptions);
6110
+ session.captureStep = "decoding CSS background images";
6109
6111
  await decodeDynamicCssBackgroundImages(page);
6110
6112
  const seekMs = Date.now() - seekStart;
6111
6113
  const beforeCaptureStart = Date.now();
6112
6114
  if (session.onBeforeCapture) {
6115
+ session.captureStep = "injecting video frames";
6113
6116
  await session.onBeforeCapture(page, quantizedTime, heldVideoTime);
6114
6117
  }
6118
+ session.captureStep = "waiting for page seek handlers";
6115
6119
  await waitForPendingSeekCompletion(page);
6120
+ session.captureStep = "loading color-grading LUTs";
6116
6121
  await page.evaluate(async () => {
6117
6122
  const runtime = window.__hf?.colorGrading;
6118
6123
  await runtime?.waitForActiveLuts?.();
6119
6124
  });
6120
6125
  const beforeCaptureMs = Date.now() - beforeCaptureStart;
6121
6126
  if (hasPendingComposite && session.captureMode !== "beginframe" && session.captureMode !== "drawelement") {
6127
+ session.captureStep = "compositing the page";
6122
6128
  await page.evaluate(async () => {
6123
6129
  const w = window;
6124
6130
  if (typeof w.__hf_page_composite_prepare === "function") {
@@ -6138,6 +6144,7 @@ async function prepareFrameForCapture(session, frameIndex, time, seekOptions, he
6138
6144
  }
6139
6145
  });
6140
6146
  }
6147
+ session.captureStep = "capturing the frame";
6141
6148
  return { quantizedTime, seekMs, beforeCaptureMs };
6142
6149
  }
6143
6150
  function computeAuthoredClipBoundaryFrames(schedule, fps) {
@@ -6868,10 +6875,12 @@ async function captureAccumulatedFrame(session, frameIndex, absFrameIndex, plan)
6868
6875
  const fps = fpsToNumber(session.options.fps);
6869
6876
  const frameTime = quantizeSeekTime(absFrameIndex / fps, fps);
6870
6877
  const eventfulSeekStart = Date.now();
6878
+ session.captureStep = "seeking the timeline";
6871
6879
  await seekPageTimeline(session.page, frameTime, void 0);
6872
6880
  const totals = { seekMs: Date.now() - eventfulSeekStart, beforeCaptureMs: 0, screenshotMs: 0 };
6873
6881
  if (session.onBeforeCapture) {
6874
6882
  const injectStart = Date.now();
6883
+ session.captureStep = "injecting video frames";
6875
6884
  await session.onBeforeCapture(session.page, frameTime, frameTime);
6876
6885
  totals.beforeCaptureMs += Date.now() - injectStart;
6877
6886
  }
@@ -6910,6 +6919,7 @@ async function captureAccumulatedFrame(session, frameIndex, absFrameIndex, plan)
6910
6919
  accumulator.add(sample.buffer);
6911
6920
  }
6912
6921
  const restoreSeekStart = Date.now();
6922
+ session.captureStep = "seeking the timeline";
6913
6923
  await seekPageTimeline(session.page, frameTime, { suppressEvents: true });
6914
6924
  totals.seekMs += Date.now() - restoreSeekStart;
6915
6925
  const blended = accumulator.finish();
@@ -7083,6 +7093,7 @@ async function captureFramesBatchPipelined(session, frameIndices, times) {
7083
7093
  const startTime = Date.now();
7084
7094
  const fps = fpsToNumber(options.fps);
7085
7095
  const quantized = times.map((t) => quantizeTimeToFrame(t, fps));
7096
+ session.captureStep = "capturing the frame";
7086
7097
  const { encodeResults, failedAt, error } = await produceDrawElementFrameBatch(
7087
7098
  page,
7088
7099
  quantized,
@@ -8352,6 +8363,7 @@ async function extractMediaMetadata(filePath) {
8352
8363
  durationSeconds: containerDuration,
8353
8364
  videoStreamDurationSeconds: effectiveStreamDuration,
8354
8365
  videoStreamStartSeconds: streamStart,
8366
+ videoStreamLeadSeconds: streamLeadSeconds(output, videoStream),
8355
8367
  width: videoStream.width || stillImage()?.width || 0,
8356
8368
  height: videoStream.height || stillImage()?.height || 0,
8357
8369
  fps,
@@ -8456,13 +8468,28 @@ async function extractAudioMetadata(filePath, options) {
8456
8468
  sampleRate,
8457
8469
  channels: audioStream.channels || 2,
8458
8470
  audioCodec,
8459
- bitrate: output.format.bit_rate ? parseInt(output.format.bit_rate) : void 0
8471
+ bitrate: output.format.bit_rate ? parseInt(output.format.bit_rate) : void 0,
8472
+ latestStreamLeadSeconds: latestStreamLeadSeconds(output)
8460
8473
  };
8461
8474
  })();
8462
8475
  if (options?.signal) return probePromise;
8463
8476
  writeMetadataCache(audioMetadataCache, filePath, identity, probePromise);
8464
8477
  return probePromise;
8465
8478
  }
8479
+ function audioVideoStreamStarts(output) {
8480
+ return (output?.streams ?? []).filter(
8481
+ (s) => (s.codec_type === "audio" || s.codec_type === "video") && s.disposition?.attached_pic !== 1
8482
+ ).map((s) => parseFloat(s.start_time ?? "")).filter(Number.isFinite);
8483
+ }
8484
+ function streamLeadSeconds(output, stream) {
8485
+ const starts = audioVideoStreamStarts(output);
8486
+ const start = parseFloat(stream.start_time ?? "");
8487
+ return Number.isFinite(start) && starts.length > 0 ? Math.max(0, start - Math.min(...starts)) : 0;
8488
+ }
8489
+ function latestStreamLeadSeconds(output) {
8490
+ const starts = audioVideoStreamStarts(output);
8491
+ return starts.length > 0 ? Math.max(...starts) - Math.min(...starts) : 0;
8492
+ }
8466
8493
  function audioStartSeconds(stream, format) {
8467
8494
  const start = parseFloat(stream.start_time ?? format.start_time ?? "");
8468
8495
  return Number.isFinite(start) ? start : 0;
@@ -11930,9 +11957,9 @@ async function extractVideoFramesRange(videoPath, videoId, startTime, duration,
11930
11957
  if (framePaths.size > 0 && duration > 0 && !options.finalFrameOnly && !options.frameRanges) {
11931
11958
  const expectedAtFps = extractionFrameCountForDuration(duration, normalizedFps, metadata.isVFR);
11932
11959
  if (expectedAtFps > 0 && framePaths.size <= expectedAtFps * 0.6) {
11933
- const correctedDuration = startTime + framePaths.size / fps;
11934
- if (correctedDuration < metadata.videoStreamDurationSeconds) {
11935
- metadata.videoStreamDurationSeconds = correctedDuration;
11960
+ const correctedStreamDuration = startTime + framePaths.size / fps - (metadata.videoStreamLeadSeconds ?? 0);
11961
+ if (correctedStreamDuration < metadata.videoStreamDurationSeconds) {
11962
+ metadata.videoStreamDurationSeconds = correctedStreamDuration;
11936
11963
  }
11937
11964
  }
11938
11965
  }
@@ -11973,7 +12000,7 @@ function resolveSegmentDuration(requested, mediaStart, sourceDuration) {
11973
12000
  return sourceRemaining > 0 ? sourceRemaining : sourceDuration;
11974
12001
  }
11975
12002
  function resolvePlayableVideoDuration(metadata) {
11976
- return Number.isFinite(metadata.videoStreamDurationSeconds) && metadata.videoStreamDurationSeconds > 0 ? metadata.videoStreamDurationSeconds : metadata.durationSeconds;
12003
+ return Number.isFinite(metadata.videoStreamDurationSeconds) && metadata.videoStreamDurationSeconds > 0 ? (metadata.videoStreamLeadSeconds ?? 0) + metadata.videoStreamDurationSeconds : metadata.durationSeconds;
11977
12004
  }
11978
12005
  function canHoldFinalFramePastEof(video) {
11979
12006
  const timelineDuration = video.end - video.start;
@@ -12087,10 +12114,11 @@ function resolveTimelineExtractionWindow(video, resolvedDuration, timelineEnd, s
12087
12114
  async function resolveFinalFrameExtractionWindow(videoPath, video, metadata, window2, signal) {
12088
12115
  if (!window2.ensureFinalFrame) return window2;
12089
12116
  const playableDuration = resolvePlayableVideoDuration(metadata);
12090
- const finalFrameTimestamp = await extractFinalVideoFrameTimestamp(
12117
+ const videoStreamLead = metadata.videoStreamLeadSeconds ?? 0;
12118
+ const finalFrameTimestamp = videoStreamLead + await extractFinalVideoFrameTimestamp(
12091
12119
  videoPath,
12092
12120
  {
12093
- videoStreamDurationSeconds: playableDuration,
12121
+ videoStreamDurationSeconds: playableDuration - videoStreamLead,
12094
12122
  videoStreamStartSeconds: metadata.videoStreamStartSeconds
12095
12123
  },
12096
12124
  signal
@@ -12903,6 +12931,10 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
12903
12931
  phaseBreakdown: breakdown
12904
12932
  };
12905
12933
  }
12934
+ var BROWSER_SHOWS_UPCOMING_FIRST_FRAME_WITHIN_SECONDS = 1;
12935
+ function isVideoHiddenBeforeStreamStart(videoStreamLeadSeconds, mediaTime) {
12936
+ return (videoStreamLeadSeconds ?? 0) - mediaTime >= BROWSER_SHOWS_UPCOMING_FIRST_FRAME_WITHIN_SECONDS - 1e-6;
12937
+ }
12906
12938
  function getFrameIndexAtTime(extracted, globalTime, videoStart, loop = false, mediaStart = 0, holdLastFrame = false, playbackRate = 1) {
12907
12939
  let localTime = Math.max(0, globalTime - videoStart);
12908
12940
  const normalizedPlaybackRate = normalizeRateSpec(playbackRate);
@@ -12920,6 +12952,12 @@ function getFrameIndexAtTime(extracted, globalTime, videoStart, loop = false, me
12920
12952
  }
12921
12953
  const frameIndex = Math.floor(sourceTime * extracted.fps + 1e-9);
12922
12954
  if (frameIndex < 0 || extracted.totalFrames <= 0) return null;
12955
+ if (isVideoHiddenBeforeStreamStart(
12956
+ extracted.metadata.videoStreamLeadSeconds,
12957
+ mediaStart + sourceTime
12958
+ )) {
12959
+ return null;
12960
+ }
12923
12961
  if (frameIndex >= extracted.totalFrames) {
12924
12962
  return loop || holdLastFrame ? extracted.totalFrames - 1 : null;
12925
12963
  }
@@ -14258,11 +14296,11 @@ function buildAtempoFilter(playbackRate) {
14258
14296
  }
14259
14297
  var RAMP_SLICE_SECONDS = 0.25;
14260
14298
  var MAX_RAMP_SLICES = 240;
14261
- function buildRampFilterComplex(lane, duration, tailFilter) {
14299
+ function buildRampFilterComplex(lane, duration, headFilter, tailFilter) {
14262
14300
  const slices = Math.min(MAX_RAMP_SLICES, Math.max(1, Math.ceil(duration / RAMP_SLICE_SECONDS)));
14263
14301
  const step = duration / slices;
14264
14302
  const split = Array.from({ length: slices }, (_, i) => `[s${i}]`).join("");
14265
- const parts = [`[0:a]asplit=${slices}${split}`];
14303
+ const parts = [`[0:a]${headFilter ? `${headFilter},` : ""}asplit=${slices}${split}`];
14266
14304
  for (let i = 0; i < slices; i += 1) {
14267
14305
  const from = sourceTimeAt(lane, i * step);
14268
14306
  const to = sourceTimeAt(lane, (i + 1) * step);
@@ -14282,24 +14320,16 @@ function buildRampFilterComplex(lane, duration, tailFilter) {
14282
14320
  if (tailFilter) parts.push(`[cat]${tailFilter}[out]`);
14283
14321
  return parts.join(";");
14284
14322
  }
14285
- function preparedAudioOutputArgs(srcPath, playbackRate, duration = 0) {
14286
- return stereoOutputArgs(srcPath).then((channelArgs) => {
14287
- const filters = [];
14288
- const outputArgs = [];
14289
- if (channelArgs[0] === "-af" && channelArgs[1]) {
14290
- filters.push(channelArgs[1]);
14291
- } else {
14292
- outputArgs.push(...channelArgs);
14293
- }
14294
- if (typeof playbackRate === "object") {
14295
- const graph = buildRampFilterComplex(playbackRate, duration, filters.join(",") || null);
14296
- return ["-filter_complex", graph, "-map", "[out]", ...outputArgs];
14297
- }
14298
- const atempo = buildAtempoFilter(playbackRate);
14299
- if (atempo) filters.push(atempo);
14300
- if (filters.length > 0) outputArgs.push("-af", filters.join(","));
14301
- return outputArgs;
14302
- });
14323
+ function preparedAudioOutputArgs(metadata, playbackRate, duration, headFilter) {
14324
+ const channelFilter = metadata?.channels === 1 ? STEREO_CHANNEL_FILTER : null;
14325
+ const outputArgs = channelFilter ? [] : ["-ac", "2"];
14326
+ if (typeof playbackRate === "object") {
14327
+ const graph = buildRampFilterComplex(playbackRate, duration, headFilter, channelFilter);
14328
+ return ["-filter_complex", graph, "-map", "[out]", ...outputArgs];
14329
+ }
14330
+ const filters = [headFilter, channelFilter, buildAtempoFilter(playbackRate)].filter(Boolean);
14331
+ if (filters.length > 0) outputArgs.push("-af", filters.join(","));
14332
+ return outputArgs;
14303
14333
  }
14304
14334
  function escapeExpressionCommas(expression) {
14305
14335
  return expression.replace(/\\/g, "\\\\").replace(/,/g, "\\,");
@@ -14310,14 +14340,6 @@ function legacyFilterScriptOptionIsUnsupported(stderr) {
14310
14340
  var MAX_VOLUME_SEGMENTS = 32;
14311
14341
  var VOLUME_SIMPLIFY_EPSILON = 5e-3;
14312
14342
  var STEREO_CHANNEL_FILTER = "pan=stereo|FL=FL+FC|FR=FR+FC";
14313
- async function stereoOutputArgs(srcPath) {
14314
- try {
14315
- const { channels } = await extractAudioMetadata(srcPath);
14316
- if (channels === 1) return ["-af", STEREO_CHANNEL_FILTER];
14317
- } catch {
14318
- }
14319
- return ["-ac", "2"];
14320
- }
14321
14343
  function simplifyVolumeKeyframes(keyframes) {
14322
14344
  if (keyframes.length < 3) return keyframes;
14323
14345
  const keep = new Array(keyframes.length).fill(false);
@@ -14581,71 +14603,24 @@ function parseAudioElements(html) {
14581
14603
  }
14582
14604
  return elements;
14583
14605
  }
14584
- async function extractAudioFromVideo(videoPath, outputPath, options, signal, config) {
14585
- const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
14586
- const outputDir = dirname6(outputPath);
14587
- if (!existsSync10(outputDir)) mkdirSync7(outputDir, { recursive: true });
14588
- const playbackRate = normalizeRateSpec(options?.playbackRate);
14589
- const args = [];
14590
- if (options?.startTime !== void 0) args.push("-ss", String(options.startTime));
14591
- if (options?.duration !== void 0) {
14592
- args.push("-t", String(sourceTimeAt(playbackRate, options.duration)));
14593
- }
14594
- args.push("-i", videoPath);
14595
- const outputArgs = await preparedAudioOutputArgs(videoPath, playbackRate, options?.duration);
14596
- args.push("-vn", "-acodec", "pcm_s16le", "-ar", "48000", ...outputArgs);
14597
- if (playbackRate !== 1 && options?.duration !== void 0) {
14598
- args.push("-t", String(options.duration));
14599
- }
14600
- args.push("-y", outputPath);
14601
- const result = await runFfmpeg(args, { signal, timeout: ffmpegProcessTimeout });
14602
- if (signal?.aborted) {
14603
- const failure = {
14604
- stage: "cancelled",
14605
- reason: "cancelled",
14606
- owner: "user",
14607
- retryable: false,
14608
- detail: "Audio extract cancelled"
14609
- };
14610
- return {
14611
- success: false,
14612
- outputPath,
14613
- durationMs: result.durationMs,
14614
- error: failure.detail,
14615
- failure
14616
- };
14617
- }
14618
- if (!result.success) {
14619
- const failure = ffmpegFailure("extract", result);
14620
- return {
14621
- success: false,
14622
- outputPath,
14623
- durationMs: result.durationMs,
14624
- error: failure.detail,
14625
- failure
14626
- };
14627
- }
14628
- return { success: true, outputPath, durationMs: result.durationMs };
14629
- }
14630
- async function prepareAudioTrack(srcPath, outputPath, mediaStart, duration, playbackRate = 1, signal, config) {
14606
+ async function extractAudioSegment(srcPath, outputPath, stage, mediaStart, duration, playbackRate = 1, signal, config) {
14631
14607
  const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
14632
14608
  const outputDir = dirname6(outputPath);
14633
14609
  if (!existsSync10(outputDir)) mkdirSync7(outputDir, { recursive: true });
14634
14610
  const normalizedPlaybackRate = normalizeRateSpec(playbackRate);
14635
- const outputArgs = await preparedAudioOutputArgs(srcPath, normalizedPlaybackRate, duration);
14636
- const args = [
14637
- "-ss",
14638
- String(mediaStart),
14639
- "-t",
14640
- String(sourceTimeAt(normalizedPlaybackRate, duration)),
14641
- "-i",
14642
- srcPath,
14643
- "-acodec",
14644
- "pcm_s16le",
14645
- "-ar",
14646
- "48000",
14647
- ...outputArgs
14648
- ];
14611
+ const sourceDuration = sourceTimeAt(normalizedPlaybackRate, duration);
14612
+ const metadata = await extractAudioMetadata(srcPath).catch(() => null);
14613
+ const inputSeek = mediaStart >= (metadata?.latestStreamLeadSeconds ?? 0);
14614
+ const start = formatFilterNumber(mediaStart);
14615
+ const timestampTrim = inputSeek ? null : `atrim=start=${start}:end=${formatFilterNumber(mediaStart + sourceDuration)},asetpts=PTS-${start}/TB,aresample=async=1:first_pts=0`;
14616
+ const outputArgs = preparedAudioOutputArgs(
14617
+ metadata,
14618
+ normalizedPlaybackRate,
14619
+ duration,
14620
+ timestampTrim
14621
+ );
14622
+ const args = inputSeek ? ["-ss", String(mediaStart), "-t", String(sourceDuration), "-i", srcPath] : ["-i", srcPath];
14623
+ args.push("-vn", "-acodec", "pcm_s16le", "-ar", "48000", ...outputArgs);
14649
14624
  if (normalizedPlaybackRate !== 1) args.push("-t", String(duration));
14650
14625
  args.push("-y", outputPath);
14651
14626
  const result = await runFfmpeg(args, { signal, timeout: ffmpegProcessTimeout });
@@ -14655,7 +14630,7 @@ async function prepareAudioTrack(srcPath, outputPath, mediaStart, duration, play
14655
14630
  reason: "cancelled",
14656
14631
  owner: "user",
14657
14632
  retryable: false,
14658
- detail: "Audio prepare cancelled"
14633
+ detail: `Audio ${stage} cancelled`
14659
14634
  };
14660
14635
  return {
14661
14636
  success: false,
@@ -14665,7 +14640,7 @@ async function prepareAudioTrack(srcPath, outputPath, mediaStart, duration, play
14665
14640
  failure: failure2
14666
14641
  };
14667
14642
  }
14668
- const failure = !result.success ? ffmpegFailure("prepare", result) : void 0;
14643
+ const failure = !result.success ? ffmpegFailure(stage, result) : void 0;
14669
14644
  return {
14670
14645
  success: result.success,
14671
14646
  outputPath,
@@ -15007,14 +14982,13 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
15007
14982
  let audioSrcPath = srcPath;
15008
14983
  if (element.type === "video") {
15009
14984
  const extractedPath = join13(workDir, `${element.id}-extracted.wav`);
15010
- const extractResult = await extractAudioFromVideo(
14985
+ const extractResult = await extractAudioSegment(
15011
14986
  srcPath,
15012
14987
  extractedPath,
15013
- {
15014
- startTime: element.mediaStart,
15015
- duration: element.end - element.start,
15016
- playbackRate: element.playbackRate
15017
- },
14988
+ "extract",
14989
+ element.mediaStart,
14990
+ element.end - element.start,
14991
+ element.playbackRate,
15018
14992
  effectiveSignal,
15019
14993
  config
15020
14994
  );
@@ -15034,9 +15008,10 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
15034
15008
  audioSrcPath = extractedPath;
15035
15009
  } else {
15036
15010
  const trimmedPath = join13(workDir, `${element.id}-trimmed.wav`);
15037
- const prepResult = await prepareAudioTrack(
15011
+ const prepResult = await extractAudioSegment(
15038
15012
  srcPath,
15039
15013
  trimmedPath,
15014
+ "prepare",
15040
15015
  element.mediaStart,
15041
15016
  element.end - element.start,
15042
15017
  element.playbackRate,
@@ -16616,6 +16591,7 @@ export {
16616
16591
  resolveVideoExtractionWindow,
16617
16592
  resolveVideoExtractionDuration,
16618
16593
  extractAllVideoFrames,
16594
+ isVideoHiddenBeforeStreamStart,
16619
16595
  getFrameAtTime,
16620
16596
  analyzeClipMediaFit,
16621
16597
  FrameLookupTable,
@@ -6,10 +6,10 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  getMimeType
9
- } from "./chunk-Z5C4LEAD.js";
9
+ } from "./chunk-C24LU5XD.js";
10
10
  import {
11
11
  injectTagsAtHeadStart
12
- } from "./chunk-Z6FLHIDV.js";
12
+ } from "./chunk-3WD4JNMU.js";
13
13
 
14
14
  // src/utils/compositionServer.ts
15
15
  import { createHash } from "crypto";
@@ -16,7 +16,7 @@ import {
16
16
  EncoderInterruptedError,
17
17
  encoderFailureError,
18
18
  prepareAnimatedGifInputs
19
- } from "./chunk-KG265HQ7.js";
19
+ } from "./chunk-K4RIT6PX.js";
20
20
  import {
21
21
  createStudioPositionSeekReapplyScript
22
22
  } from "./chunk-EOOEC32M.js";
@@ -105,6 +105,7 @@ import {
105
105
  isNotMediaPayload,
106
106
  isTransientBrowserError,
107
107
  isVideoFrameFormat,
108
+ isVideoHiddenBeforeStreamStart,
108
109
  isVideoPastTimelineEnd,
109
110
  mergeWorkerFrames,
110
111
  muxVideoWithAudio,
@@ -145,7 +146,7 @@ import {
145
146
  validateEngineConfigSnapshot,
146
147
  verifyDiskDrawElementSamples,
147
148
  writeCapturedFrame
148
- } from "./chunk-WU2B74TL.js";
149
+ } from "./chunk-VC7JBNPS.js";
149
150
  import {
150
151
  assignBundledRuntimeCompositionIds,
151
152
  buildVariablesByCompScript,
@@ -158,7 +159,7 @@ import {
158
159
  isTemplateEntry,
159
160
  parsesAsScript,
160
161
  prepareFlattenedInnerRoot
161
- } from "./chunk-JBQJKC23.js";
162
+ } from "./chunk-62RUQJ5J.js";
162
163
  import {
163
164
  LOW_MEMORY_TOTAL_MB_THRESHOLD,
164
165
  getCgroupMemoryLimitMb,
@@ -179,7 +180,7 @@ import {
179
180
  resolveAbsoluteMediaStartSeconds,
180
181
  resolveAuthoredTimingWindow,
181
182
  toFps
182
- } from "./chunk-BAKPN2D2.js";
183
+ } from "./chunk-AHBYQRGI.js";
183
184
  import {
184
185
  COMPOSITION_SOURCE_URL,
185
186
  HF_COLOR_GRADING_ATTR,
@@ -206,7 +207,7 @@ import {
206
207
  shouldClampResolvedMediaDuration,
207
208
  sourceTimeAt,
208
209
  styleElementsFor
209
- } from "./chunk-Z6FLHIDV.js";
210
+ } from "./chunk-3WD4JNMU.js";
210
211
  import {
211
212
  MAX_AUDIO_GAIN
212
213
  } from "./chunk-YA62XGXS.js";
@@ -2216,6 +2217,8 @@ function blitHdrVideoLayer(canvas, el, time, fps, hdrVideoFrameSources, hdrStart
2216
2217
  frameSource.loop
2217
2218
  );
2218
2219
  if (effectiveIndex === null) return;
2220
+ const mediaTime = (frameSource.mediaStart ?? 0) + effectiveIndex / fps;
2221
+ if (isVideoHiddenBeforeStreamStart(frameSource.videoStreamLeadSeconds, mediaTime)) return;
2219
2222
  const frameOffset = effectiveIndex * frameSource.frameSize;
2220
2223
  try {
2221
2224
  if (hdrPerf) hdrPerf.hdrVideoLayerBlits += 1;
@@ -2824,7 +2827,10 @@ async function extractHdrVideoFrames(args) {
2824
2827
  initialWindow,
2825
2828
  abortSignal
2826
2829
  );
2827
- extractionWindows.set(videoId, window2);
2830
+ extractionWindows.set(videoId, {
2831
+ window: window2,
2832
+ videoStreamLeadSeconds: metadata.videoStreamLeadSeconds
2833
+ });
2828
2834
  prep.hdrVideoStartTimes.set(videoId, window2.compositionStart);
2829
2835
  plannedVideos.push({
2830
2836
  durationSeconds: window2.durationSeconds,
@@ -2843,14 +2849,16 @@ async function extractHdrVideoFrames(args) {
2843
2849
  try {
2844
2850
  for (const [videoId, srcPath] of prep.hdrVideoSrcPaths) {
2845
2851
  const video = composition.videos.find((v) => v.id === videoId);
2846
- const window2 = extractionWindows.get(videoId);
2847
- if (!video || !window2) continue;
2852
+ const planned = extractionWindows.get(videoId);
2853
+ if (!video || !planned) continue;
2854
+ const { window: window2 } = planned;
2848
2855
  mkdirSync2(framesDir, { recursive: true });
2849
2856
  const frameDir = mkdtempSync2(join7(framesDir, `hdr_${tempDirSafePrefix(videoId)}-`));
2850
2857
  createdFrameDirs.add(frameDir);
2851
2858
  const dims = prep.hdrExtractionDims.get(videoId) ?? { width, height };
2852
2859
  const rawPath = join7(frameDir, "frames.rgb48le");
2853
- const extractionStart = String(window2.extractionMediaStart ?? window2.mediaStart);
2860
+ const extractionMediaStart = window2.extractionMediaStart ?? window2.mediaStart;
2861
+ const extractionStart = String(extractionMediaStart);
2854
2862
  const ffmpegArgs = [];
2855
2863
  if (window2.finalFrameOnly) {
2856
2864
  ffmpegArgs.push("-i", srcPath, "-ss", extractionStart, "-frames:v", "1");
@@ -2910,7 +2918,9 @@ async function extractHdrVideoFrames(args) {
2910
2918
  frameSize,
2911
2919
  frameCount,
2912
2920
  scratch: Buffer.allocUnsafe(frameSize),
2913
- loop: video.loop
2921
+ loop: video.loop,
2922
+ mediaStart: extractionMediaStart,
2923
+ videoStreamLeadSeconds: planned.videoStreamLeadSeconds
2914
2924
  });
2915
2925
  handedOff = true;
2916
2926
  } finally {
@@ -3476,12 +3486,13 @@ function buildRenderPerfSummary(input) {
3476
3486
  // ../producer/src/services/render/stages/captureStreamingStage.ts
3477
3487
  var DEFAULT_CAPTURE_STALL_MS = 6e4;
3478
3488
  var DE_STALL_POLL_MS = 5e3;
3489
+ var STALL_ADVICE = "Chrome stopped answering. If another app is keeping the GPU or CPU busy (a 3D render, a game, another export), let it finish or render one job at a time, then retry.";
3479
3490
  var ParallelCaptureStallError = class extends Error {
3480
3491
  variant;
3481
3492
  constructor(args) {
3482
3493
  const phases = args.phaseSummary ? ` Last worker phases: ${args.phaseSummary}.` : "";
3483
3494
  super(
3484
- args.variant === "drain" ? `[Render] Parallel ${args.captureLabel} capture stalled: no frame progress for ${args.stallTimeoutMs}ms (stuck at ${args.lastCapturedFrames}/${args.totalFrames}).${phases}` : `[Render] Parallel ${args.captureLabel} capture stalled after ${args.stallTimeoutMs}ms with no frame progress (last frame ${args.lastCapturedFrames}/${args.totalFrames}); retrying on a fresh screenshot session.${phases}`
3495
+ (args.variant === "drain" ? `[Render] Parallel ${args.captureLabel} capture stalled: no frame progress for ${args.stallTimeoutMs}ms (stuck at ${args.lastCapturedFrames}/${args.totalFrames}).${phases}` : `[Render] Parallel ${args.captureLabel} capture stalled after ${args.stallTimeoutMs}ms with no frame progress (last frame ${args.lastCapturedFrames}/${args.totalFrames}); retrying on a fresh screenshot session.${phases}`) + ` ${STALL_ADVICE}`
3485
3496
  );
3486
3497
  this.name = "ParallelCaptureStallError";
3487
3498
  this.variant = args.variant;
@@ -3499,12 +3510,13 @@ function captureModeLabel(mode) {
3499
3510
  }
3500
3511
  var SequentialCaptureStallError = class extends Error {
3501
3512
  captureMode;
3502
- constructor(captureMode, stallTimeoutMs, frameIndex, totalFrames) {
3513
+ constructor(session, stallTimeoutMs, frameIndex, totalFrames) {
3514
+ const step = session.captureStep ? ` while ${session.captureStep}` : "";
3503
3515
  super(
3504
- `[Render] Sequential ${captureModeLabel(captureMode)} capture stalled: no frame progress for ${stallTimeoutMs}ms (stuck at frame ${frameIndex}/${totalFrames}).`
3516
+ `[Render] Sequential ${captureModeLabel(session.captureMode)} capture stalled: no frame progress for ${stallTimeoutMs}ms (stuck at frame ${frameIndex}/${totalFrames}${step}). ` + STALL_ADVICE
3505
3517
  );
3506
3518
  this.name = "SequentialCaptureStallError";
3507
- this.captureMode = captureMode;
3519
+ this.captureMode = session.captureMode;
3508
3520
  }
3509
3521
  };
3510
3522
  function raceAgainstStall(promise, deadlineMs, input, signal) {
@@ -3513,9 +3525,9 @@ function raceAgainstStall(promise, deadlineMs, input, signal) {
3513
3525
  () => {
3514
3526
  reject(
3515
3527
  signal?.aborted ? new Error(
3516
- `[Render] Sequential ${captureModeLabel(input.captureMode)} capture aborted while a capture call was in flight (frame ${input.frameIndex}/${input.totalFrames}).`
3528
+ `[Render] Sequential ${captureModeLabel(input.session.captureMode)} capture aborted while a capture call was in flight (frame ${input.frameIndex}/${input.totalFrames}).`
3517
3529
  ) : new SequentialCaptureStallError(
3518
- input.captureMode,
3530
+ input.session,
3519
3531
  input.stallTimeoutMs,
3520
3532
  input.frameIndex,
3521
3533
  input.totalFrames
@@ -3643,7 +3655,7 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
3643
3655
  const captureWithStallGuard = (idx, promise) => raceAgainstStall(
3644
3656
  promise,
3645
3657
  stallTimeoutMs - (Date.now() - lastProgressAt),
3646
- { captureMode: session.captureMode, frameIndex: idx, totalFrames, stallTimeoutMs },
3658
+ { session, frameIndex: idx, totalFrames, stallTimeoutMs },
3647
3659
  abortSignal
3648
3660
  );
3649
3661
  const drainPrev = async () => {
@@ -3997,7 +4009,7 @@ async function runCaptureStreamingStage(input) {
3997
4009
  const { buffer } = await raceAgainstStall(
3998
4010
  captureFrameToBuffer(session, i, time),
3999
4011
  stallTimeoutMs - (Date.now() - lastProgressAt),
4000
- { captureMode: session.captureMode, frameIndex: i, totalFrames, stallTimeoutMs },
4012
+ { session, frameIndex: i, totalFrames, stallTimeoutMs },
4001
4013
  abortSignal
4002
4014
  );
4003
4015
  await reorderBuffer.waitForFrame(i);
@@ -4086,7 +4098,7 @@ async function captureSegmentFrames(ctx, segment, encoder) {
4086
4098
  ctx.captureFrame(ctx.session, i, time),
4087
4099
  ctx.stallTimeoutMs - (Date.now() - lastProgressAt),
4088
4100
  {
4089
- captureMode: ctx.session.captureMode,
4101
+ session: ctx.session,
4090
4102
  frameIndex: i,
4091
4103
  totalFrames: ctx.totalFrames,
4092
4104
  stallTimeoutMs: ctx.stallTimeoutMs
@@ -14308,7 +14320,7 @@ function startServer(options = {}) {
14308
14320
  });
14309
14321
  async function shutdown(signal) {
14310
14322
  log.info(`Received ${signal}, shutting down`);
14311
- const { drainBrowserPool } = await import("./src-LIERUCFW.js");
14323
+ const { drainBrowserPool } = await import("./src-VMTHSARJ.js");
14312
14324
  await drainBrowserPool().catch(() => {
14313
14325
  });
14314
14326
  const handle = await Promise.race([
@@ -14802,6 +14814,7 @@ function readVideoMetadata(value, field) {
14802
14814
  // overwhelmingly common start-at-zero domain. Preserve that compatibility
14803
14815
  // while carrying non-zero edit-list/transport timestamps in new plans.
14804
14816
  videoStreamStartSeconds: record.videoStreamStartSeconds === void 0 ? 0 : readFiniteNumber(record.videoStreamStartSeconds, `${field}.videoStreamStartSeconds`),
14817
+ videoStreamLeadSeconds: record.videoStreamLeadSeconds === void 0 ? 0 : readFiniteNumber(record.videoStreamLeadSeconds, `${field}.videoStreamLeadSeconds`),
14805
14818
  width: readPositiveInteger(record.width, `${field}.width`),
14806
14819
  height: readPositiveInteger(record.height, `${field}.height`),
14807
14820
  fps: readFiniteNumber(record.fps, `${field}.fps`),
@@ -15493,7 +15506,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
15493
15506
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
15494
15507
  if (probeResult.probeSession) {
15495
15508
  try {
15496
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-LIERUCFW.js");
15509
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-VMTHSARJ.js");
15497
15510
  await closeCaptureSession2(probeResult.probeSession);
15498
15511
  } catch (err) {
15499
15512
  log.warn("[plan] probe session close failed", {
@@ -8,7 +8,7 @@ import {
8
8
  flush,
9
9
  shouldTrack,
10
10
  trackEvent
11
- } from "./chunk-2NAUEDA6.js";
11
+ } from "./chunk-QX26JK43.js";
12
12
  import {
13
13
  getPowerState
14
14
  } from "./chunk-XBSPQ52S.js";
@@ -7,10 +7,10 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  parseFeedbackRating,
9
9
  trackRenderFeedback
10
- } from "./chunk-QSSPIATO.js";
10
+ } from "./chunk-X2G54Y2V.js";
11
11
  import {
12
12
  shouldTrack
13
- } from "./chunk-2NAUEDA6.js";
13
+ } from "./chunk-QX26JK43.js";
14
14
  import {
15
15
  detectAgentRuntime
16
16
  } from "./chunk-XBSPQ52S.js";
@@ -7,10 +7,10 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  trackLintReport,
9
9
  trackLintRuleStreak
10
- } from "./chunk-QSSPIATO.js";
10
+ } from "./chunk-X2G54Y2V.js";
11
11
  import {
12
12
  shouldTrack
13
- } from "./chunk-2NAUEDA6.js";
13
+ } from "./chunk-QX26JK43.js";
14
14
  import {
15
15
  LINT_RULE_COUNT,
16
16
  LINT_RULE_GROUP_COUNTS
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
 
8
8
  // src/utils/producer.ts
9
9
  async function loadProducer() {
10
- return await import("./src-ZZQJOKO6.js");
10
+ return await import("./src-PTIV7IVV.js");
11
11
  }
12
12
 
13
13
  export {