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