hyperframes 0.8.143 → 0.8.144
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-Q5EYDUAY.js → add-CWRTVGDB.js} +12 -12
- package/dist/{animatedGifPrep-H2DUQEZ3.js → animatedGifPrep-JTOHIWI4.js} +7 -7
- package/dist/{asset-C7JBYYX4.js → asset-KU2Z4UFM.js} +2 -2
- package/dist/{assetCataloger-FRO4G6OU.js → assetCataloger-3CS2P7PA.js} +3 -3
- package/dist/{auth-FRWLCO36.js → auth-IDSOIQWG.js} +1 -1
- package/dist/{autoUpdate-E4OZXQK6.js → autoUpdate-373B4BA2.js} +2 -2
- package/dist/{backgroundChecks-FSUVHN5L.js → backgroundChecks-53Q3NAMG.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-4U73BYTU.js → batchRender-UKZA6BME.js} +4 -4
- package/dist/{beats-U6KJWF35.js → beats-N5JGEOFR.js} +13 -13
- package/dist/{benchmark-5ONT7V7B.js → benchmark-CUN3LN4V.js} +9 -9
- package/dist/{browser-R4DU46IE.js → browser-NCZT5AP6.js} +39 -55
- package/dist/{bundleWithLocalizedFonts-VH55VOAL.js → bundleWithLocalizedFonts-FWC7PE2D.js} +2 -2
- package/dist/{capture-26G2DPSI.js → capture-QBLG3VJR.js} +18 -18
- package/dist/{capture-OGQAEYKO.js → capture-YLS32UHT.js} +2 -2
- package/dist/{catalog-RKORTIUE.js → catalog-HIWNAFHW.js} +12 -12
- package/dist/{catch-up-4OBERRQO.js → catch-up-HGS7KIAC.js} +4 -4
- package/dist/{check-P2XDN57S.js → check-FH6UYYLO.js} +66 -55
- package/dist/{checkBrowser-NTGJGAEA.js → checkBrowser-RNWNOMCZ.js} +81 -30
- package/dist/{chunk-LVX6NK36.js → chunk-2DA2BBNY.js} +1 -1
- package/dist/{chunk-4M4EC7JX.js → chunk-3VYNNWVA.js} +12 -1
- package/dist/{chunk-N3DQEVSI.js → chunk-3XTEXWNN.js} +8 -5
- package/dist/{chunk-KO5QBV73.js → chunk-4LAR447G.js} +1 -1
- package/dist/{chunk-W35EKBS6.js → chunk-4OC7MQNB.js} +2 -2
- package/dist/{chunk-CLOH4LIB.js → chunk-54QISXOC.js} +2 -2
- package/dist/{chunk-HC7EVDEL.js → chunk-5HJ343GH.js} +1 -1
- package/dist/{chunk-33RZPZ4K.js → chunk-5VMR4WBS.js} +271 -119
- package/dist/{chunk-PJU63L6W.js → chunk-5WADG7PR.js} +1 -1
- package/dist/{chunk-LW6HO6U3.js → chunk-7RAYSCYT.js} +1 -1
- package/dist/{chunk-QRKLPWEX.js → chunk-7SDCIWHQ.js} +11 -2
- package/dist/{chunk-LAOCA3MQ.js → chunk-A4Q7W4LV.js} +13 -8
- package/dist/{chunk-BT27OYYX.js → chunk-A53CBD24.js} +18 -12
- package/dist/{chunk-4PFZPP2N.js → chunk-A6S35NYA.js} +54 -16
- package/dist/{chunk-HW4AKJ5F.js → chunk-AUBOF2PN.js} +1 -1
- package/dist/{chunk-ZLW2V65P.js → chunk-BSQ7XANM.js} +3 -2
- package/dist/{chunk-LCSMOLGX.js → chunk-BYSBRF24.js} +69 -8
- package/dist/{chunk-BFDJ63J5.js → chunk-DDIVWXN7.js} +1 -1
- package/dist/{chunk-KOEWEFHK.js → chunk-DIRJ322I.js} +10 -5
- package/dist/{chunk-PAGIICKN.js → chunk-EX6C672Y.js} +1 -1
- package/dist/{chunk-6XMFEICO.js → chunk-F2SMS24Q.js} +34 -19
- package/dist/{chunk-QVYVUCWD.js → chunk-GEWKFRFI.js} +1 -1
- package/dist/{chunk-P7THMINS.js → chunk-GZM2EFOE.js} +1 -1
- package/dist/{chunk-KJJLA674.js → chunk-GZVP4TWN.js} +1 -46
- package/dist/{chunk-TAMQYQGJ.js → chunk-I5KY7EZP.js} +1 -1
- package/dist/{chunk-XONFUK3M.js → chunk-IEIJRMLZ.js} +47 -35
- package/dist/chunk-IR35BCLK.js +13 -0
- package/dist/{chunk-2LBBHMKT.js → chunk-JEHFZQYT.js} +1 -1
- package/dist/{chunk-KDPYVTEU.js → chunk-KBB4RG6F.js} +6 -1
- package/dist/{chunk-VIVBA6E6.js → chunk-KFKZ3ISO.js} +1 -1
- package/dist/{sherpa-LVIUEAGF.js → chunk-L5TUCXWR.js} +11 -45
- package/dist/{chunk-GNBGPUJ7.js → chunk-LC3RQURJ.js} +3 -3
- package/dist/{chunk-I7QGQAZM.js → chunk-LFX2HEYP.js} +7 -7
- package/dist/{chunk-U3X3TPBW.js → chunk-MAYCCGMQ.js} +11 -2
- package/dist/{chunk-UICWP23D.js → chunk-MXNDKDFT.js} +3 -3
- package/dist/{chunk-POLR33RB.js → chunk-NOPBBSLA.js} +15 -17
- package/dist/{chunk-DF2BHILQ.js → chunk-NV4RXIQ7.js} +3 -3
- package/dist/{chunk-KQLGTGE5.js → chunk-OIDN7G42.js} +2 -2
- package/dist/{chunk-F26LCYRY.js → chunk-OUSLVRO4.js} +68 -77
- package/dist/{chunk-Y6QL2LGO.js → chunk-P6WH6QTV.js} +1 -1
- package/dist/{chunk-OBXQRJWQ.js → chunk-QATWIE4K.js} +1 -1
- package/dist/{chunk-QFN7NVWM.js → chunk-RG3QWWIE.js} +1 -1
- package/dist/{chunk-HLYOEIWM.js → chunk-RI53TS2Y.js} +2 -2
- package/dist/{chunk-5FISWJ37.js → chunk-RVFEDAUV.js} +4 -4
- package/dist/{chunk-HMT2RPZU.js → chunk-SLCFKB3Y.js} +13 -9
- package/dist/chunk-UPFUC4DB.js +136 -0
- package/dist/{chunk-BYK73CR7.js → chunk-VYSUZEJG.js} +5 -5
- package/dist/chunk-WJB7WI4J.js +3753 -0
- package/dist/{chunk-7UYBQ6NF.js → chunk-XGFHYAYN.js} +14 -10
- package/dist/{chunk-OSSHSIMD.js → chunk-XU5GGV6R.js} +1 -1
- package/dist/{chunk-FVYXDXEV.js → chunk-Y6UPYWJS.js} +2 -2
- package/dist/{chunk-UM2GRYM3.js → chunk-YJXHMIZA.js} +3 -3
- package/dist/{chunk-3NE7ZYU2.js → chunk-YUAXFWSQ.js} +3 -3
- package/dist/{chunk-TVCRUG2S.js → chunk-ZEUONDQG.js} +1 -1
- package/dist/{chunk-ZQQ3SEIE.js → chunk-ZOA2SC4P.js} +99 -31
- package/dist/{clean-YHGPY33K.js → clean-KPX27IKJ.js} +18 -18
- package/dist/cli.js +68 -56
- package/dist/{cloud-DOFI5ISR.js → cloud-P7DAOISN.js} +4 -4
- package/dist/{cloudrun-KTZ4XDHL.js → cloudrun-XM56TBOH.js} +4 -4
- package/dist/{compare-SMMIZN2C.js → compare-F6YAFZZM.js} +25 -25
- package/dist/{compiler-TEXQWW6N.js → compiler-JZ4GNFMG.js} +6 -4
- package/dist/{component-B3GCNGSS.js → component-3CFOGIQA.js} +3 -3
- package/dist/{compositions-OQNZZTKF.js → compositions-CPCMWF24.js} +11 -11
- package/dist/{delete-EL5LVSEP.js → delete-GYVKOKB6.js} +2 -2
- package/dist/{dist-5UVIRMSM.js → dist-KDJTFJHA.js} +2 -2
- package/dist/{dist-XN234YFQ.js → dist-YPWQDWJ4.js} +4 -4
- package/dist/{doctor-UOL3OI2A.js → doctor-GWI3B6JT.js} +13 -13
- package/dist/{events-NIZBS6S7.js → events-BRRUDPPT.js} +3 -3
- package/dist/{events-K2DB2PBC.js → events-V2QFN4YM.js} +2 -2
- package/dist/{feedback-QMP4E6L7.js → feedback-CXMD7FWL.js} +9 -9
- package/dist/{ffmpeg-QIUFEFTY.js → ffmpeg-T5SH2EFJ.js} +3 -2
- package/dist/{figma-2AUJRNVC.js → figma-YABDWD66.js} +3 -3
- package/dist/fontLocalizeCli.js +9 -9
- package/dist/{get-P5NC7SRM.js → get-L2SOQKHX.js} +2 -2
- package/dist/{gpuPolicy-7N5MCE2G.js → gpuPolicy-NBJNWHYS.js} +11 -9
- package/dist/{grade-compare-HV5AFZ6P.js → grade-compare-STXQPKYQ.js} +27 -27
- package/dist/{help-3TSTXBLN.js → help-4H6BSFLB.js} +2 -2
- package/dist/{history-D65XFJ6D.js → history-4IQOLTHJ.js} +5 -5
- package/dist/hyperframe-runtime.js +56 -56
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +56 -56
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/{info-TXV7MLFO.js → info-2CZOTNBC.js} +8 -8
- package/dist/{init-OSDMJZJV.js → init-6BXK42VS.js} +35 -36
- package/dist/{inspect-RQQSAYIJ.js → inspect-VKU47TBH.js} +26 -26
- package/dist/{installer-CDOB32HE.js → installer-T2BSSUDY.js} +5 -5
- package/dist/{keyframes-V75Q6GRM.js → keyframes-IEYVHRPI.js} +6 -6
- package/dist/{lambda-RODV4RCX.js → lambda-TIKG25CK.js} +5 -5
- package/dist/{layout-IZAI5SFC.js → layout-XOI4PT7A.js} +26 -26
- package/dist/{lint-PLXOXY5R.js → lint-DWCMVIX5.js} +8 -8
- package/dist/{lintProject-OQ6H6XBR.js → lintProject-UBZ3TDHU.js} +2 -2
- package/dist/{list-BQBPNKDZ.js → list-7GXKG5QM.js} +2 -2
- package/dist/{login-NP6F4FHC.js → login-BQ5L2UHX.js} +4 -4
- package/dist/{manager-CT3D67CG.js → manager-BPSR6D3V.js} +2 -2
- package/dist/{manager-GXYF4AVO.js → manager-YKMHR6LN.js} +8 -5
- package/dist/{media-treatment-PXGMZ4A4.js → media-treatment-IFB7OSZ3.js} +12 -12
- package/dist/{models-CEZM6XZ7.js → models-TY4PJ545.js} +59 -19
- package/dist/{motionShot-R4GHYWYM.js → motionShot-WXMFHICW.js} +21 -22
- package/dist/{normalize-H6KUHHEI.js → normalize-U3SL5VG3.js} +2 -2
- package/dist/{normalize-audio-MQ7NFCOV.js → normalize-audio-RFD776HQ.js} +6 -6
- package/dist/{open-AKQTGNXF.js → open-7IXXGO2E.js} +4 -4
- package/dist/parakeetRunner-IHLYYMTZ.js +67 -0
- package/dist/{pipeline-SYJYP2RM.js → pipeline-TXKPLL2U.js} +10 -9
- package/dist/{play-NBH4B7PL.js → play-J2KP64UK.js} +19 -19
- package/dist/{preflight-Y5DN5D37.js → preflight-B4AFK3RG.js} +4 -4
- package/dist/{present-XAX55CFS.js → present-MHHNRVRA.js} +15 -15
- package/dist/{preview-OLANKNFA.js → preview-CONUOFFQ.js} +19 -19
- package/dist/{producer-Q6YNZZUJ.js → producer-ZI46K7HH.js} +1 -1
- package/dist/{projectConfig-EM26P45P.js → projectConfig-FGGVG5MV.js} +7 -7
- package/dist/{publication-OXWJZKSX.js → publication-TXFBMW6B.js} +3 -3
- package/dist/{publish-4VBWP2UB.js → publish-YZSPBFRD.js} +11 -11
- package/dist/{remove-background-REB7427G.js → remove-background-4ATVLHLG.js} +11 -10
- package/dist/{render-K25YOG3M.js → render-6FBYLYGJ.js} +11 -11
- package/dist/{render-3CVZ2SZG.js → render-GFW5BPES.js} +4 -4
- package/dist/{render-TSE75QUL.js → render-MH4IUPWB.js} +26 -26
- package/dist/{render-batch-GGUOK3DS.js → render-batch-XUCZ2PUJ.js} +4 -4
- package/dist/{renderCancellation-PZRWB53I.js → renderCancellation-XF7M7IUP.js} +10 -9
- package/dist/renderSetupWorker.js +32 -44
- package/dist/{resolver-S5VK6UCB.js → resolver-W7AYCQGS.js} +5 -5
- package/dist/sherpa-LDUB5NLY.js +75 -0
- package/dist/sherpaWorker.js +2 -1
- package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +1 -1
- package/dist/{skills-I65FU5HD.js → skills-VENERS5X.js} +7 -7
- package/dist/{skillsUpdateCheck-J57RNNIV.js → skillsUpdateCheck-UXFYTACG.js} +3 -3
- package/dist/{snapshot-YROOGY22.js → snapshot-C6T74HTI.js} +28 -28
- package/dist/{src-X426BZAG.js → src-FS5RSVEI.js} +8 -8
- package/dist/{src-JO5JOV7Y.js → src-VUJ2FUFK.js} +8 -6
- package/dist/{staticProjectServer-5VMBS262.js → staticProjectServer-V2RZ4DWD.js} +15 -15
- package/dist/studio/assets/{hyperframes-player-BXSuksFh.js → hyperframes-player-Bw_jIaSX.js} +3 -3
- package/dist/studio/assets/{index-J7jpL4pj.js → index-BVM9NuWl.js} +141 -141
- package/dist/studio/assets/{index-BgOVCqjo.js → index-Cj7W_c7p.js} +1 -1
- package/dist/studio/assets/{index-FgyO_5Kv.js → index-DyH9dT7b.js} +1 -1
- package/dist/studio/{chunk-TFLU2MGI.js → chunk-3GHTHPZD.js} +8 -1
- package/dist/studio/chunk-3GHTHPZD.js.map +1 -0
- package/dist/studio/{chunk-H2DUOXTF.js → chunk-G3EDKRZH.js} +3 -3
- package/dist/studio/{chunk-UYWON5AX.js → chunk-PEAKCOUW.js} +7 -3
- package/dist/studio/chunk-PEAKCOUW.js.map +1 -0
- package/dist/studio/{chunk-LOVBLSMR.js → chunk-Y2OHHNM2.js} +35 -19
- package/dist/studio/chunk-Y2OHHNM2.js.map +1 -0
- package/dist/studio/{domEditingLayers-KBTPQKGA.js → domEditingLayers-PYST4G45.js} +3 -3
- package/dist/studio/index.html +1 -1
- package/dist/studio/index.js +139 -70
- package/dist/studio/index.js.map +1 -1
- package/dist/studio/player.js +3 -3
- package/dist/studio/ui.d.ts +4 -5
- package/dist/studio/ui.js +1 -1
- package/dist/{studio-api-VRBZUGAE.js → studio-api-TQE7KWKO.js} +9 -9
- package/dist/{studioServer-DBNKZ6I6.js → studioServer-CYKSQK7L.js} +68 -52
- package/dist/{telemetry-CXAX3TO3.js → telemetry-A23PPRD6.js} +3 -3
- package/dist/{timeline-VQ34WH7J.js → timeline-T3QSGT3A.js} +69 -47
- package/dist/{tokens-62R7VFAZ.js → tokens-RT5HWA6C.js} +2 -2
- package/dist/{transcribe-XOHPPL2O.js → transcribe-FOLNOC5G.js} +115 -51
- package/dist/{transcribe-7KR7IPJA.js → transcribe-HCF64LQK.js} +14 -12
- package/dist/{tts-MUV42JXT.js → tts-B6AHFQEO.js} +1 -1
- package/dist/{updateCheck-POYNH3B5.js → updateCheck-27PIP3AA.js} +2 -2
- package/dist/{upgrade-NBNOT7J2.js → upgrade-TVGXBUPJ.js} +2 -2
- package/dist/{urlDownloader-3NS63A7B.js → urlDownloader-KBLBJKRL.js} +6 -6
- package/dist/{validate-Y2QDHAEP.js → validate-ZMYGK4QI.js} +20 -20
- package/dist/{video-SJDMTSTL.js → video-AVE5GIGM.js} +7 -7
- package/package.json +1 -1
- package/dist/chunk-6TPZSTCL.js +0 -3681
- package/dist/studio/chunk-LOVBLSMR.js.map +0 -1
- package/dist/studio/chunk-TFLU2MGI.js.map +0 -1
- package/dist/studio/chunk-UYWON5AX.js.map +0 -1
- package/dist/{screenshotCapture-TEUIWXWN.js → screenshotCapture-3JXXUZND.js} +3 -3
- package/dist/studio/{chunk-H2DUOXTF.js.map → chunk-G3EDKRZH.js.map} +0 -0
- package/dist/studio/{domEditingLayers-KBTPQKGA.js.map → domEditingLayers-PYST4G45.js.map} +0 -0
- package/dist/{synthesize-C3IWDAXF.js → synthesize-UCI4X5O7.js} +4 -4
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
renderFrameIdForRenderId,
|
|
27
27
|
resolveAuthoredTimingWindow,
|
|
28
28
|
toFps
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-3VYNNWVA.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-
|
|
58
|
+
} from "./chunk-WJB7WI4J.js";
|
|
59
59
|
import {
|
|
60
60
|
clampAudioGain,
|
|
61
61
|
isAudibleVideoElement
|
|
@@ -557,9 +557,93 @@ function applyConcreteGpuScreenshotClamp(currentForceScreenshot, resolvedGpuMode
|
|
|
557
557
|
var SDR_RGB_TO_BT709_FILTER = "scale=out_color_matrix=bt709:out_range=tv:flags=neighbor";
|
|
558
558
|
var SDR_CAPTURE_TO_BT709_FILTER = `scale=in_color_matrix=bt601:in_range=pc:flags=neighbor,format=gbrp,${SDR_RGB_TO_BT709_FILTER}`;
|
|
559
559
|
|
|
560
|
+
// ../parsers/dist/htmlAttributeSpans.js
|
|
561
|
+
function readAttributeValue(html, at) {
|
|
562
|
+
while (/[\t\n\f\r ]/.test(html.charAt(at))) at++;
|
|
563
|
+
const quote = ['"', "'"].includes(html.charAt(at)) ? html.charAt(at) : "";
|
|
564
|
+
if (quote) at++;
|
|
565
|
+
const valueStart = at;
|
|
566
|
+
if (quote) {
|
|
567
|
+
const closing = html.indexOf(quote, at);
|
|
568
|
+
at = closing === -1 ? html.length : closing;
|
|
569
|
+
} else {
|
|
570
|
+
while (at < html.length && !/[\t\n\f\r >]/.test(html[at])) at++;
|
|
571
|
+
}
|
|
572
|
+
const valueEnd = at;
|
|
573
|
+
const end = quote ? Math.min(valueEnd + 1, html.length) : valueEnd;
|
|
574
|
+
return { value: html.slice(valueStart, valueEnd), valueStart, valueEnd, quote, end };
|
|
575
|
+
}
|
|
576
|
+
function readAttribute(html, start) {
|
|
577
|
+
let at = start;
|
|
578
|
+
while (at < html.length && !/[\t\n\f\r =/>]/.test(html[at])) at++;
|
|
579
|
+
if (at === start) return null;
|
|
580
|
+
const name = html.slice(start, at).toLowerCase();
|
|
581
|
+
const nameEnd = at;
|
|
582
|
+
while (/[\t\n\f\r ]/.test(html[at] ?? "")) at++;
|
|
583
|
+
if (html[at] !== "=") return { kind: "boolean", name, start, end: nameEnd };
|
|
584
|
+
return { kind: "value", name, start, ...readAttributeValue(html, at + 1) };
|
|
585
|
+
}
|
|
586
|
+
function readOpeningTag(html, start, name, at) {
|
|
587
|
+
const attributes = [];
|
|
588
|
+
while (at < html.length) {
|
|
589
|
+
while (/[\t\n\f\r /]/.test(html[at] ?? "")) at++;
|
|
590
|
+
if (at >= html.length || html[at] === ">") break;
|
|
591
|
+
const attribute = readAttribute(html, at);
|
|
592
|
+
if (attribute === null) {
|
|
593
|
+
at++;
|
|
594
|
+
continue;
|
|
595
|
+
}
|
|
596
|
+
attributes.push(attribute);
|
|
597
|
+
at = attribute.end;
|
|
598
|
+
}
|
|
599
|
+
const closed = html[at] === ">";
|
|
600
|
+
return {
|
|
601
|
+
name: name.toLowerCase(),
|
|
602
|
+
start,
|
|
603
|
+
bodyEnd: at,
|
|
604
|
+
end: closed ? at + 1 : at,
|
|
605
|
+
closed,
|
|
606
|
+
rawTextEnd: null,
|
|
607
|
+
attributes
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
function scanHtmlOpeningTags(html) {
|
|
611
|
+
const tags = [];
|
|
612
|
+
const opening = /<!--[\s\S]*?(?:--!?>|$)|<([a-z][^\t\n\f\r />]*)/gi;
|
|
613
|
+
let match;
|
|
614
|
+
while ((match = opening.exec(html)) !== null) {
|
|
615
|
+
if (!match[1]) continue;
|
|
616
|
+
const tag = readOpeningTag(html, match.index, match[1], opening.lastIndex);
|
|
617
|
+
tags.push(tag);
|
|
618
|
+
opening.lastIndex = tag.end;
|
|
619
|
+
if ([
|
|
620
|
+
"script",
|
|
621
|
+
"style",
|
|
622
|
+
"textarea",
|
|
623
|
+
"title",
|
|
624
|
+
"xmp",
|
|
625
|
+
"iframe",
|
|
626
|
+
"noembed",
|
|
627
|
+
"noframes",
|
|
628
|
+
"plaintext"
|
|
629
|
+
].includes(tag.name)) {
|
|
630
|
+
if (tag.name === "plaintext") {
|
|
631
|
+
tag.rawTextEnd = html.length;
|
|
632
|
+
break;
|
|
633
|
+
}
|
|
634
|
+
const closing = new RegExp(`</${tag.name}(?=[\\t\\n\\f\\r />])`, "gi");
|
|
635
|
+
closing.lastIndex = tag.end;
|
|
636
|
+
const end = closing.exec(html);
|
|
637
|
+
tag.rawTextEnd = end?.index ?? html.length;
|
|
638
|
+
opening.lastIndex = tag.rawTextEnd;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
return tags;
|
|
642
|
+
}
|
|
643
|
+
|
|
560
644
|
// ../engine/src/services/browserManager.ts
|
|
561
645
|
import { execSync } from "child_process";
|
|
562
|
-
import { existsSync, readdirSync } from "fs";
|
|
646
|
+
import { existsSync, readdirSync, statSync } from "fs";
|
|
563
647
|
import { join as join2 } from "path";
|
|
564
648
|
import { homedir } from "os";
|
|
565
649
|
|
|
@@ -801,6 +885,7 @@ async function getPuppeteer() {
|
|
|
801
885
|
if (!_puppeteer) throw new Error("Neither puppeteer nor puppeteer-core found");
|
|
802
886
|
return _puppeteer;
|
|
803
887
|
}
|
|
888
|
+
var GPU_PROBE_TIMEOUT_MS = 15e3;
|
|
804
889
|
async function probeHardwareWebGlInfo(ppt, options) {
|
|
805
890
|
let probeBrowser;
|
|
806
891
|
try {
|
|
@@ -810,37 +895,44 @@ async function probeHardwareWebGlInfo(ppt, options) {
|
|
|
810
895
|
args: options.args,
|
|
811
896
|
defaultViewport: { width: 64, height: 64 },
|
|
812
897
|
executablePath: options.executablePath,
|
|
813
|
-
timeout: options.browserTimeout
|
|
814
|
-
|
|
815
|
-
const page = await probeBrowser.newPage();
|
|
816
|
-
return await page.evaluate(() => {
|
|
817
|
-
const unavailable = { hasWebGL: false, vendor: "", renderer: "" };
|
|
818
|
-
const c = document.createElement("canvas");
|
|
819
|
-
let gl = c.getContext("webgl");
|
|
820
|
-
if (gl === null) {
|
|
821
|
-
gl = c.getContext("experimental-webgl");
|
|
822
|
-
}
|
|
823
|
-
if (gl === null) return unavailable;
|
|
824
|
-
const ext = gl.getExtension("WEBGL_debug_renderer_info");
|
|
825
|
-
let vendorParam = gl.VENDOR;
|
|
826
|
-
let rendererParam = gl.RENDERER;
|
|
827
|
-
if (ext !== null) {
|
|
828
|
-
vendorParam = ext.UNMASKED_VENDOR_WEBGL;
|
|
829
|
-
rendererParam = ext.UNMASKED_RENDERER_WEBGL;
|
|
830
|
-
}
|
|
831
|
-
const vendor = gl.getParameter(vendorParam);
|
|
832
|
-
const renderer = gl.getParameter(rendererParam);
|
|
833
|
-
return {
|
|
834
|
-
hasWebGL: true,
|
|
835
|
-
vendor: vendor == null ? "" : String(vendor),
|
|
836
|
-
renderer: renderer == null ? "" : String(renderer)
|
|
837
|
-
};
|
|
898
|
+
timeout: options.browserTimeout,
|
|
899
|
+
waitForInitialPage: false
|
|
838
900
|
});
|
|
901
|
+
return await rejectAfter(
|
|
902
|
+
readWebGlInfo(probeBrowser),
|
|
903
|
+
GPU_PROBE_TIMEOUT_MS,
|
|
904
|
+
`GPU probe page did not answer within ${GPU_PROBE_TIMEOUT_MS}ms`
|
|
905
|
+
);
|
|
839
906
|
} finally {
|
|
840
|
-
|
|
841
|
-
});
|
|
907
|
+
if (probeBrowser) await closeBrowserAfterFailedProbe(probeBrowser);
|
|
842
908
|
}
|
|
843
909
|
}
|
|
910
|
+
async function readWebGlInfo(browser) {
|
|
911
|
+
const page = await browser.newPage();
|
|
912
|
+
return await page.evaluate(() => {
|
|
913
|
+
const unavailable = { hasWebGL: false, vendor: "", renderer: "" };
|
|
914
|
+
const c = document.createElement("canvas");
|
|
915
|
+
let gl = c.getContext("webgl");
|
|
916
|
+
if (gl === null) {
|
|
917
|
+
gl = c.getContext("experimental-webgl");
|
|
918
|
+
}
|
|
919
|
+
if (gl === null) return unavailable;
|
|
920
|
+
const ext = gl.getExtension("WEBGL_debug_renderer_info");
|
|
921
|
+
let vendorParam = gl.VENDOR;
|
|
922
|
+
let rendererParam = gl.RENDERER;
|
|
923
|
+
if (ext !== null) {
|
|
924
|
+
vendorParam = ext.UNMASKED_VENDOR_WEBGL;
|
|
925
|
+
rendererParam = ext.UNMASKED_RENDERER_WEBGL;
|
|
926
|
+
}
|
|
927
|
+
const vendor = gl.getParameter(vendorParam);
|
|
928
|
+
const renderer = gl.getParameter(rendererParam);
|
|
929
|
+
return {
|
|
930
|
+
hasWebGL: true,
|
|
931
|
+
vendor: vendor == null ? "" : String(vendor),
|
|
932
|
+
renderer: renderer == null ? "" : String(renderer)
|
|
933
|
+
};
|
|
934
|
+
});
|
|
935
|
+
}
|
|
844
936
|
function compareBrowserVersionsDescending(left, right) {
|
|
845
937
|
const parse = (value) => {
|
|
846
938
|
const version = value.slice(value.indexOf("-") + 1);
|
|
@@ -871,6 +963,14 @@ var CACHED_HEADLESS_SHELL_EXECUTABLES = {
|
|
|
871
963
|
function cachedHeadlessShellExecutable(hostPlatform = process.platform, hostArch = process.arch) {
|
|
872
964
|
return CACHED_HEADLESS_SHELL_EXECUTABLES[`${hostPlatform}/${hostArch}`];
|
|
873
965
|
}
|
|
966
|
+
function isNonEmptyFile(path) {
|
|
967
|
+
try {
|
|
968
|
+
const stat = statSync(path, { throwIfNoEntry: false });
|
|
969
|
+
return stat?.isFile() === true && stat.size > 0;
|
|
970
|
+
} catch {
|
|
971
|
+
return false;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
874
974
|
function findCachedHeadlessShell(baseDir) {
|
|
875
975
|
if (!existsSync(baseDir)) return void 0;
|
|
876
976
|
const executable = cachedHeadlessShellExecutable();
|
|
@@ -881,7 +981,7 @@ function findCachedHeadlessShell(baseDir) {
|
|
|
881
981
|
for (const version of versions) {
|
|
882
982
|
if (exceedsChromeCeiling(version, ceiling)) continue;
|
|
883
983
|
const binary = join2(baseDir, version, ...executable);
|
|
884
|
-
if (
|
|
984
|
+
if (isNonEmptyFile(binary)) return binary;
|
|
885
985
|
}
|
|
886
986
|
} catch {
|
|
887
987
|
}
|
|
@@ -937,15 +1037,15 @@ async function awaitBeforeDeadline(operation, deadline, label) {
|
|
|
937
1037
|
if (remainingMs <= 0) {
|
|
938
1038
|
throw new Error(`beginFrame probe timeout before ${label}`);
|
|
939
1039
|
}
|
|
1040
|
+
return rejectAfter(operation, remainingMs, `beginFrame probe timeout during ${label}`);
|
|
1041
|
+
}
|
|
1042
|
+
async function rejectAfter(operation, timeoutMs, message) {
|
|
940
1043
|
let timeout;
|
|
941
1044
|
try {
|
|
942
1045
|
return await Promise.race([
|
|
943
1046
|
operation,
|
|
944
1047
|
new Promise((_, reject) => {
|
|
945
|
-
timeout = setTimeout(
|
|
946
|
-
() => reject(new Error(`beginFrame probe timeout during ${label}`)),
|
|
947
|
-
remainingMs
|
|
948
|
-
);
|
|
1048
|
+
timeout = setTimeout(() => reject(new Error(message)), timeoutMs);
|
|
949
1049
|
})
|
|
950
1050
|
]);
|
|
951
1051
|
} finally {
|
|
@@ -1359,8 +1459,9 @@ function buildChromeArgs(options, config) {
|
|
|
1359
1459
|
return chromeArgs;
|
|
1360
1460
|
}
|
|
1361
1461
|
function compositionRequiresWebGpu(html) {
|
|
1362
|
-
for (const
|
|
1363
|
-
|
|
1462
|
+
for (const tag of scanHtmlOpeningTags(html)) {
|
|
1463
|
+
const names = tag.attributes.map((attribute) => attribute.name);
|
|
1464
|
+
if (names.includes("data-composition-id")) return names.includes("data-requires-webgpu");
|
|
1364
1465
|
}
|
|
1365
1466
|
return false;
|
|
1366
1467
|
}
|
|
@@ -5170,6 +5271,7 @@ async function constructCaptureSession(input) {
|
|
|
5170
5271
|
browserConsoleBuffer: [],
|
|
5171
5272
|
scriptLoadFailures: [],
|
|
5172
5273
|
pageErrors: [],
|
|
5274
|
+
subTimelineWaitMemo: sessionOptions.subTimelineWaitMemo ?? {},
|
|
5173
5275
|
warnings: [],
|
|
5174
5276
|
capturePerf: {
|
|
5175
5277
|
frames: 0,
|
|
@@ -5318,15 +5420,52 @@ async function pollHfReady(page, timeoutMs, intervalMs = 100) {
|
|
|
5318
5420
|
State: __hf=${diag.hasHf}, seek=${diag.hasSeek}, player=${diag.hasPlayer}, renderReady=${diag.renderReady}, duration=${diag.duration}`
|
|
5319
5421
|
);
|
|
5320
5422
|
}
|
|
5321
|
-
async function
|
|
5423
|
+
async function listUnregisteredTimelineIds(page) {
|
|
5424
|
+
const evaluated = await page.evaluate(`(function() {
|
|
5425
|
+
var hosts = document.querySelectorAll("[data-composition-id]");
|
|
5426
|
+
var timelines = window.__timelines || {};
|
|
5427
|
+
var m = [];
|
|
5428
|
+
for (var i = 0; i < hosts.length; i++) {
|
|
5429
|
+
if (hosts[i].hasAttribute("data-no-timeline")) continue;
|
|
5430
|
+
var id = hosts[i].getAttribute("data-composition-id");
|
|
5431
|
+
if (id && !timelines[id]) m.push(id);
|
|
5432
|
+
}
|
|
5433
|
+
return m;
|
|
5434
|
+
})()`);
|
|
5435
|
+
return Array.isArray(evaluated) ? evaluated.map((id) => String(id)) : [];
|
|
5436
|
+
}
|
|
5437
|
+
async function waitForSubCompositionTimelines(session, page, timeoutMs) {
|
|
5438
|
+
const memo = session.subTimelineWaitMemo;
|
|
5439
|
+
session.subTimelineWaitOutcome = await pollSubCompositionTimelines(page, timeoutMs, {
|
|
5440
|
+
getScriptLoadFailures: () => session.scriptLoadFailures,
|
|
5441
|
+
onPending: (ids) => {
|
|
5442
|
+
session.pendingTimelineIds = [...ids];
|
|
5443
|
+
},
|
|
5444
|
+
shouldStop: () => session.vfxFailure !== void 0,
|
|
5445
|
+
knownUnregisteredIds: memo.unregisteredIds
|
|
5446
|
+
});
|
|
5447
|
+
const cleanTimeout = session.subTimelineWaitOutcome === "timeout" && session.vfxFailure === void 0 && session.pageErrors.length === 0 && session.scriptLoadFailures.length === 0;
|
|
5448
|
+
if (cleanTimeout) {
|
|
5449
|
+
memo.unregisteredIds = session.pendingTimelineIds ?? [];
|
|
5450
|
+
}
|
|
5451
|
+
}
|
|
5452
|
+
async function pollSubCompositionTimelines(page, timeoutMs, {
|
|
5453
|
+
intervalMs = 150,
|
|
5454
|
+
getScriptLoadFailures,
|
|
5455
|
+
scriptFailureGraceMs = 2e3,
|
|
5456
|
+
onPending,
|
|
5457
|
+
shouldStop,
|
|
5458
|
+
knownUnregisteredIds = []
|
|
5459
|
+
} = {}) {
|
|
5322
5460
|
const expression = `(function() {
|
|
5323
5461
|
var hosts = document.querySelectorAll("[data-composition-id]");
|
|
5324
5462
|
if (hosts.length === 0) return true;
|
|
5325
5463
|
var timelines = window.__timelines || {};
|
|
5464
|
+
var known = ${JSON.stringify(knownUnregisteredIds)};
|
|
5326
5465
|
for (var i = 0; i < hosts.length; i++) {
|
|
5327
5466
|
if (hosts[i].hasAttribute("data-no-timeline")) continue;
|
|
5328
5467
|
var id = hosts[i].getAttribute("data-composition-id");
|
|
5329
|
-
if (!id) continue;
|
|
5468
|
+
if (!id || known.indexOf(id) !== -1) continue;
|
|
5330
5469
|
if (!timelines[id]) return false;
|
|
5331
5470
|
}
|
|
5332
5471
|
return true;
|
|
@@ -5350,7 +5489,11 @@ async function pollSubCompositionTimelines(page, timeoutMs, intervalMs = 150, ge
|
|
|
5350
5489
|
}
|
|
5351
5490
|
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
5352
5491
|
}
|
|
5353
|
-
|
|
5492
|
+
const pendingIds = ready && knownUnregisteredIds.length === 0 ? [] : await listUnregisteredTimelineIds(page);
|
|
5493
|
+
if (ready && pendingIds.length > 0 && (getScriptLoadFailures?.() ?? []).length > 0) {
|
|
5494
|
+
scriptFailureBail = true;
|
|
5495
|
+
}
|
|
5496
|
+
if (ready && pendingIds.length === 0) {
|
|
5354
5497
|
await page.evaluate(`(function() {
|
|
5355
5498
|
if (typeof window.__hfForceTimelineRebind === "function") {
|
|
5356
5499
|
window.__hfForceTimelineRebind();
|
|
@@ -5358,18 +5501,6 @@ async function pollSubCompositionTimelines(page, timeoutMs, intervalMs = 150, ge
|
|
|
5358
5501
|
})()`);
|
|
5359
5502
|
return "ready";
|
|
5360
5503
|
}
|
|
5361
|
-
const evaluated = await page.evaluate(`(function() {
|
|
5362
|
-
var hosts = document.querySelectorAll("[data-composition-id]");
|
|
5363
|
-
var timelines = window.__timelines || {};
|
|
5364
|
-
var m = [];
|
|
5365
|
-
for (var i = 0; i < hosts.length; i++) {
|
|
5366
|
-
if (hosts[i].hasAttribute("data-no-timeline")) continue;
|
|
5367
|
-
var id = hosts[i].getAttribute("data-composition-id");
|
|
5368
|
-
if (id && !timelines[id]) m.push(id);
|
|
5369
|
-
}
|
|
5370
|
-
return m;
|
|
5371
|
-
})()`);
|
|
5372
|
-
const pendingIds = Array.isArray(evaluated) ? evaluated.map((id) => String(id)) : [];
|
|
5373
5504
|
onPending?.(pendingIds);
|
|
5374
5505
|
const missing = pendingIds.join(", ");
|
|
5375
5506
|
if (scriptFailureBail) {
|
|
@@ -5739,17 +5870,7 @@ async function initializeSession(session) {
|
|
|
5739
5870
|
const pageReadyTimeout = session.config?.playerReadyTimeout ?? DEFAULT_CONFIG.playerReadyTimeout;
|
|
5740
5871
|
await pollHfReady(page, pageReadyTimeout);
|
|
5741
5872
|
logInitPhase("pollHfReady complete");
|
|
5742
|
-
session
|
|
5743
|
-
page,
|
|
5744
|
-
pageReadyTimeout,
|
|
5745
|
-
void 0,
|
|
5746
|
-
() => session.scriptLoadFailures,
|
|
5747
|
-
void 0,
|
|
5748
|
-
(ids) => {
|
|
5749
|
-
session.pendingTimelineIds = [...ids];
|
|
5750
|
-
},
|
|
5751
|
-
() => session.vfxFailure !== void 0
|
|
5752
|
-
);
|
|
5873
|
+
await waitForSubCompositionTimelines(session, page, pageReadyTimeout);
|
|
5753
5874
|
logInitPhase(`pollSubCompositionTimelines complete (${session.subTimelineWaitOutcome})`);
|
|
5754
5875
|
assertVfxIntact(session);
|
|
5755
5876
|
recordSubTimelineWarning(session, pageReadyTimeout);
|
|
@@ -5855,17 +5976,7 @@ async function initializeSession(session) {
|
|
|
5855
5976
|
const pageReadyTimeout = session.config?.playerReadyTimeout ?? DEFAULT_CONFIG.playerReadyTimeout;
|
|
5856
5977
|
await pollHfReady(page, pageReadyTimeout);
|
|
5857
5978
|
logInitPhase("pollHfReady complete");
|
|
5858
|
-
session
|
|
5859
|
-
page,
|
|
5860
|
-
pageReadyTimeout,
|
|
5861
|
-
void 0,
|
|
5862
|
-
() => session.scriptLoadFailures,
|
|
5863
|
-
void 0,
|
|
5864
|
-
(ids) => {
|
|
5865
|
-
session.pendingTimelineIds = [...ids];
|
|
5866
|
-
},
|
|
5867
|
-
() => session.vfxFailure !== void 0
|
|
5868
|
-
);
|
|
5979
|
+
await waitForSubCompositionTimelines(session, page, pageReadyTimeout);
|
|
5869
5980
|
logInitPhase(`pollSubCompositionTimelines complete (${session.subTimelineWaitOutcome})`);
|
|
5870
5981
|
assertVfxIntact(session);
|
|
5871
5982
|
recordSubTimelineWarning(session, pageReadyTimeout);
|
|
@@ -6302,7 +6413,10 @@ async function createStaticVerificationPage(session) {
|
|
|
6302
6413
|
});
|
|
6303
6414
|
await page.evaluate(`window.__hfFlushSync?.()`);
|
|
6304
6415
|
await pollHfReady(page, pageReadyTimeout);
|
|
6305
|
-
await pollSubCompositionTimelines(page, pageReadyTimeout
|
|
6416
|
+
await pollSubCompositionTimelines(page, pageReadyTimeout, {
|
|
6417
|
+
getScriptLoadFailures: () => session.scriptLoadFailures,
|
|
6418
|
+
knownUnregisteredIds: session.subTimelineWaitMemo.unregisteredIds
|
|
6419
|
+
});
|
|
6306
6420
|
await applyVideoMetadataHints(page, session.options.videoMetadataHints);
|
|
6307
6421
|
const skipVideoIds = session.options.skipReadinessVideoIds ?? [];
|
|
6308
6422
|
await Promise.all([
|
|
@@ -7231,7 +7345,7 @@ import {
|
|
|
7231
7345
|
openSync,
|
|
7232
7346
|
readFileSync as readFileSync3,
|
|
7233
7347
|
readdirSync as readdirSync2,
|
|
7234
|
-
statSync as
|
|
7348
|
+
statSync as statSync3,
|
|
7235
7349
|
writeFileSync as writeFileSync2,
|
|
7236
7350
|
writeSync
|
|
7237
7351
|
} from "fs";
|
|
@@ -7425,7 +7539,7 @@ var H264_ENCODER_BY_GPU = {
|
|
|
7425
7539
|
qsv: "h264_qsv",
|
|
7426
7540
|
amf: "h264_amf"
|
|
7427
7541
|
};
|
|
7428
|
-
var
|
|
7542
|
+
var GPU_PROBE_TIMEOUT_MS2 = 2e3;
|
|
7429
7543
|
var GPU_PROBE_KILL_GRACE_MS = 1e3;
|
|
7430
7544
|
function getCompiledGpuEncoders(ffmpegEncodersStdout) {
|
|
7431
7545
|
return GPU_ENCODER_CANDIDATES.filter(
|
|
@@ -7542,7 +7656,7 @@ async function canUseGpuEncoder(encoder) {
|
|
|
7542
7656
|
});
|
|
7543
7657
|
trackChildProcess(ffmpeg);
|
|
7544
7658
|
const outcome = await new ManagedChildProcess(ffmpeg, {
|
|
7545
|
-
deadlineAtMs: Date.now() +
|
|
7659
|
+
deadlineAtMs: Date.now() + GPU_PROBE_TIMEOUT_MS2,
|
|
7546
7660
|
terminationGraceMs: GPU_PROBE_KILL_GRACE_MS
|
|
7547
7661
|
}).wait();
|
|
7548
7662
|
const usable = outcome.reason === "exit" && outcome.exitCode === 0;
|
|
@@ -7558,7 +7672,7 @@ async function canUseGpuEncoder(encoder) {
|
|
|
7558
7672
|
function logGpuProbeFailure(encoder, result) {
|
|
7559
7673
|
if (!isGpuProbeDebugEnabled()) return;
|
|
7560
7674
|
if (result.code === 0 && !result.error && !result.timedOut) return;
|
|
7561
|
-
const reason = result.error ? result.error.message : result.timedOut ? `timed out after ${
|
|
7675
|
+
const reason = result.error ? result.error.message : result.timedOut ? `timed out after ${GPU_PROBE_TIMEOUT_MS2}ms` : `exit=${String(result.code)} signal=${String(result.signal ?? "")}`;
|
|
7562
7676
|
const stderr = result.stderr?.trim();
|
|
7563
7677
|
console.warn(`[gpuEncoder] ${encoder} probe failed: ${reason}${stderr ? `
|
|
7564
7678
|
${stderr}` : ""}`);
|
|
@@ -7783,7 +7897,7 @@ async function runFfmpegPipeline(producerArgs, consumerArgs, opts) {
|
|
|
7783
7897
|
|
|
7784
7898
|
// ../engine/src/utils/ffprobe.ts
|
|
7785
7899
|
import { spawn as spawn3 } from "child_process";
|
|
7786
|
-
import { createReadStream, readFileSync, statSync } from "fs";
|
|
7900
|
+
import { createReadStream, readFileSync, statSync as statSync2 } from "fs";
|
|
7787
7901
|
import { StringDecoder } from "string_decoder";
|
|
7788
7902
|
import { basename } from "path";
|
|
7789
7903
|
var FFPROBE_STDERR_MAX_BYTES = 8 * 1024;
|
|
@@ -7886,7 +8000,8 @@ var audioMetadataCache = /* @__PURE__ */ new Map();
|
|
|
7886
8000
|
var mediaProbeOutputCache = /* @__PURE__ */ new Map();
|
|
7887
8001
|
var mediaProbeOutputSignalCaches = /* @__PURE__ */ new WeakMap();
|
|
7888
8002
|
var MEDIA_PROBE_OUTPUT_CACHE_MAX_ENTRIES = 128;
|
|
7889
|
-
var
|
|
8003
|
+
var AUDIO_DURATION_PROBE_MARGIN_SECONDS = 0.05;
|
|
8004
|
+
var AUDIO_DURATION_PROBE_TAIL_SECONDS = 1;
|
|
7890
8005
|
var STILL_IMAGE_DEMUXERS = /* @__PURE__ */ new Set([
|
|
7891
8006
|
"apng",
|
|
7892
8007
|
"bmp_pipe",
|
|
@@ -7938,7 +8053,7 @@ function isPngImageProbe(output) {
|
|
|
7938
8053
|
}
|
|
7939
8054
|
function mediaFileIdentity(filePath) {
|
|
7940
8055
|
try {
|
|
7941
|
-
const stat =
|
|
8056
|
+
const stat = statSync2(filePath, { bigint: true });
|
|
7942
8057
|
return [stat.dev, stat.ino, stat.size, stat.mtimeNs, stat.ctimeNs].join(":");
|
|
7943
8058
|
} catch {
|
|
7944
8059
|
return null;
|
|
@@ -8011,7 +8126,7 @@ async function readFileRange(filePath, start, length, signal) {
|
|
|
8011
8126
|
async function hasCompletePngStructure(filePath, signal) {
|
|
8012
8127
|
try {
|
|
8013
8128
|
signal?.throwIfAborted();
|
|
8014
|
-
const fileSize =
|
|
8129
|
+
const fileSize = statSync2(filePath).size;
|
|
8015
8130
|
const signature = await readFileRange(filePath, 0, 8, signal);
|
|
8016
8131
|
signal?.throwIfAborted();
|
|
8017
8132
|
if (signature.length !== 8 || !signature.equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]))) {
|
|
@@ -8300,29 +8415,16 @@ async function extractAudioMetadata(filePath, options) {
|
|
|
8300
8415
|
const streamDuration = audioStream.duration ? parseFloat(audioStream.duration) : void 0;
|
|
8301
8416
|
const sampleRate = audioStream.sample_rate ? parseInt(audioStream.sample_rate) : 44100;
|
|
8302
8417
|
const audioCodec = audioStream.codec_name || "unknown";
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
"stream=nb_read_packets",
|
|
8314
|
-
"-print_format",
|
|
8315
|
-
"json"
|
|
8316
|
-
],
|
|
8317
|
-
options?.signal
|
|
8318
|
-
);
|
|
8319
|
-
const packetOutput = parseProbeJson(packetStdout);
|
|
8320
|
-
const packetCount = Number(packetOutput.streams[0]?.nb_read_packets);
|
|
8321
|
-
if (Number.isFinite(packetCount) && packetCount > 0) {
|
|
8322
|
-
durationSeconds = packetCount * AAC_LC_SAMPLES_PER_PACKET / sampleRate;
|
|
8323
|
-
}
|
|
8324
|
-
} catch (error) {
|
|
8325
|
-
if (options?.signal?.aborted) throw error;
|
|
8418
|
+
if (sampleRate > 0) {
|
|
8419
|
+
const decoded = await probeDecodedAudioDuration(
|
|
8420
|
+
filePath,
|
|
8421
|
+
sampleRate,
|
|
8422
|
+
audioStartSeconds(audioStream, output.format),
|
|
8423
|
+
durationSeconds,
|
|
8424
|
+
options?.signal
|
|
8425
|
+
);
|
|
8426
|
+
if (decoded !== null) {
|
|
8427
|
+
durationSeconds = reconcileAudioDuration(durationSeconds, decoded, output.format);
|
|
8326
8428
|
}
|
|
8327
8429
|
}
|
|
8328
8430
|
return {
|
|
@@ -8338,6 +8440,55 @@ async function extractAudioMetadata(filePath, options) {
|
|
|
8338
8440
|
writeMetadataCache(audioMetadataCache, filePath, identity, probePromise);
|
|
8339
8441
|
return probePromise;
|
|
8340
8442
|
}
|
|
8443
|
+
function audioStartSeconds(stream, format) {
|
|
8444
|
+
const start = parseFloat(stream.start_time ?? format.start_time ?? "");
|
|
8445
|
+
return Number.isFinite(start) ? start : 0;
|
|
8446
|
+
}
|
|
8447
|
+
function reconcileAudioDuration(containerSeconds, decodedSeconds, format) {
|
|
8448
|
+
const difference = decodedSeconds - containerSeconds;
|
|
8449
|
+
const trustShorter = format.format_name === "aac";
|
|
8450
|
+
if (difference > AUDIO_DURATION_PROBE_MARGIN_SECONDS) return decodedSeconds;
|
|
8451
|
+
if (trustShorter && difference < -AUDIO_DURATION_PROBE_MARGIN_SECONDS) return decodedSeconds;
|
|
8452
|
+
return containerSeconds;
|
|
8453
|
+
}
|
|
8454
|
+
async function probeDecodedAudioDuration(filePath, sampleRate, startSeconds, containerDurationSeconds, signal) {
|
|
8455
|
+
const probe = async (readInterval) => {
|
|
8456
|
+
const args = [
|
|
8457
|
+
"-select_streams",
|
|
8458
|
+
"a:0",
|
|
8459
|
+
"-show_entries",
|
|
8460
|
+
"frame=best_effort_timestamp_time,nb_samples",
|
|
8461
|
+
"-of",
|
|
8462
|
+
"csv=p=0"
|
|
8463
|
+
];
|
|
8464
|
+
if (readInterval) args.unshift("-read_intervals", readInterval);
|
|
8465
|
+
try {
|
|
8466
|
+
const stdout = await runFfprobe(
|
|
8467
|
+
filePath,
|
|
8468
|
+
args,
|
|
8469
|
+
signal,
|
|
8470
|
+
// CSV, not JSON: a tail truncated under the size cap still parses.
|
|
8471
|
+
{ retainTail: true, maxChars: 64 * 1024 }
|
|
8472
|
+
);
|
|
8473
|
+
return stdout.split("\n").map((line) => {
|
|
8474
|
+
const [timestampText, samplesText] = line.trim().split(",");
|
|
8475
|
+
const timestamp = Number(timestampText);
|
|
8476
|
+
const nbSamples = Number(samplesText);
|
|
8477
|
+
return Number.isFinite(timestamp) && Number.isFinite(nbSamples) ? { timestamp, nbSamples } : void 0;
|
|
8478
|
+
}).filter((frame) => frame !== void 0).at(-1);
|
|
8479
|
+
} catch (error) {
|
|
8480
|
+
if (signal?.aborted) throw signal.reason ?? error;
|
|
8481
|
+
return void 0;
|
|
8482
|
+
}
|
|
8483
|
+
};
|
|
8484
|
+
const tailStart = Math.max(
|
|
8485
|
+
startSeconds,
|
|
8486
|
+
startSeconds + containerDurationSeconds - AUDIO_DURATION_PROBE_TAIL_SECONDS
|
|
8487
|
+
);
|
|
8488
|
+
const lastFrame = await probe(`${tailStart}%`) ?? await probe();
|
|
8489
|
+
if (!lastFrame) return null;
|
|
8490
|
+
return lastFrame.timestamp + lastFrame.nbSamples / sampleRate - startSeconds;
|
|
8491
|
+
}
|
|
8341
8492
|
var keyframeCache = /* @__PURE__ */ new Map();
|
|
8342
8493
|
var PROBLEMATIC_KEYFRAME_INTERVAL_SECONDS = 2;
|
|
8343
8494
|
async function analyzeKeyframeIntervals(filePath, metadata) {
|
|
@@ -8785,7 +8936,7 @@ async function encodeFramesFromDir(framesDir, framePattern, outputPath, options,
|
|
|
8785
8936
|
failureReason: isExternalFfmpegInterruption(result) ? "external_interruption" : void 0
|
|
8786
8937
|
};
|
|
8787
8938
|
}
|
|
8788
|
-
const fileSize = existsSync4(outputPath) ?
|
|
8939
|
+
const fileSize = existsSync4(outputPath) ? statSync3(outputPath).size : 0;
|
|
8789
8940
|
return {
|
|
8790
8941
|
success: true,
|
|
8791
8942
|
outputPath,
|
|
@@ -8919,7 +9070,7 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
|
|
|
8919
9070
|
failureReason: concatResult.externalInterruption ? "external_interruption" : void 0
|
|
8920
9071
|
};
|
|
8921
9072
|
}
|
|
8922
|
-
const fileSize = existsSync4(outputPath) ?
|
|
9073
|
+
const fileSize = existsSync4(outputPath) ? statSync3(outputPath).size : 0;
|
|
8923
9074
|
return {
|
|
8924
9075
|
success: true,
|
|
8925
9076
|
outputPath,
|
|
@@ -9151,7 +9302,7 @@ function quantizationTableError(buffer, start, end) {
|
|
|
9151
9302
|
// ../engine/src/services/streamingEncoder.ts
|
|
9152
9303
|
import { spawn as spawn4 } from "child_process";
|
|
9153
9304
|
import { once } from "events";
|
|
9154
|
-
import { existsSync as existsSync5, mkdirSync as mkdirSync3, statSync as
|
|
9305
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync3, statSync as statSync4 } from "fs";
|
|
9155
9306
|
import { dirname as dirname3 } from "path";
|
|
9156
9307
|
function createFrameReorderBuffer(startFrame, endFrame) {
|
|
9157
9308
|
let cursor = startFrame;
|
|
@@ -9516,7 +9667,7 @@ FFmpeg stopped after ${streamingTimeout} ms without consuming a frame.` : "";
|
|
|
9516
9667
|
}) ? "external_interruption" : void 0
|
|
9517
9668
|
};
|
|
9518
9669
|
}
|
|
9519
|
-
const fileSize = existsSync5(outputPath) ?
|
|
9670
|
+
const fileSize = existsSync5(outputPath) ? statSync4(outputPath).size : 0;
|
|
9520
9671
|
return { success: true, durationMs, fileSize };
|
|
9521
9672
|
},
|
|
9522
9673
|
getExitStatus: () => exitStatus,
|
|
@@ -9736,7 +9887,7 @@ import {
|
|
|
9736
9887
|
readdirSync as readdirSync3,
|
|
9737
9888
|
rmdirSync,
|
|
9738
9889
|
rmSync as rmSync2,
|
|
9739
|
-
statSync as
|
|
9890
|
+
statSync as statSync5,
|
|
9740
9891
|
unlinkSync
|
|
9741
9892
|
} from "fs";
|
|
9742
9893
|
import { createHash, randomUUID } from "crypto";
|
|
@@ -10346,7 +10497,7 @@ async function fetchToPartial(url, partialPath, controller, options) {
|
|
|
10346
10497
|
const readableStream = Readable.fromWeb(response.body);
|
|
10347
10498
|
const fileStream = createWriteStream(partialPath, { flags: "wx" });
|
|
10348
10499
|
await pipeline(readableStream, inspector, fileStream, { signal: controller.signal });
|
|
10349
|
-
const localSize =
|
|
10500
|
+
const localSize = statSync5(partialPath).size;
|
|
10350
10501
|
const sha256Bytes = sha256.digest();
|
|
10351
10502
|
const localSha256 = sha256Bytes.toString("hex");
|
|
10352
10503
|
const md5Base64 = md5.digest("base64");
|
|
@@ -10760,7 +10911,7 @@ import {
|
|
|
10760
10911
|
readdirSync as readdirSync5,
|
|
10761
10912
|
renameSync,
|
|
10762
10913
|
rmSync as rmSync3,
|
|
10763
|
-
statSync as
|
|
10914
|
+
statSync as statSync6,
|
|
10764
10915
|
utimesSync,
|
|
10765
10916
|
writeFileSync as writeFileSync3
|
|
10766
10917
|
} from "fs";
|
|
@@ -10821,7 +10972,7 @@ var SCHEMA_PREFIX = "hfcache-v6-";
|
|
|
10821
10972
|
var KEY_HEX_CHARS = 16;
|
|
10822
10973
|
function readKeyStat(videoPath) {
|
|
10823
10974
|
try {
|
|
10824
|
-
const stat =
|
|
10975
|
+
const stat = statSync6(videoPath);
|
|
10825
10976
|
return { mtimeMs: Math.floor(stat.mtimeMs), size: stat.size };
|
|
10826
10977
|
} catch {
|
|
10827
10978
|
return null;
|
|
@@ -10955,7 +11106,7 @@ function removeDir(path) {
|
|
|
10955
11106
|
}
|
|
10956
11107
|
function collectGcEntry(dir, name, now, minAgeMs, stats, remove) {
|
|
10957
11108
|
try {
|
|
10958
|
-
const dirStat =
|
|
11109
|
+
const dirStat = statSync6(dir);
|
|
10959
11110
|
if (isPartialChild(name) && now - dirStat.mtimeMs >= minAgeMs) {
|
|
10960
11111
|
remove(dir);
|
|
10961
11112
|
stats.agedPartialsRemoved += 1;
|
|
@@ -10963,7 +11114,7 @@ function collectGcEntry(dir, name, now, minAgeMs, stats, remove) {
|
|
|
10963
11114
|
}
|
|
10964
11115
|
let lastUseMs = dirStat.mtimeMs;
|
|
10965
11116
|
try {
|
|
10966
|
-
lastUseMs =
|
|
11117
|
+
lastUseMs = statSync6(join9(dir, COMPLETE_SENTINEL)).mtimeMs;
|
|
10967
11118
|
} catch {
|
|
10968
11119
|
}
|
|
10969
11120
|
return { dir, size: directorySizeBytes(dir), lastUseMs, ageMs: now - lastUseMs };
|
|
@@ -10973,7 +11124,7 @@ function collectGcEntry(dir, name, now, minAgeMs, stats, remove) {
|
|
|
10973
11124
|
}
|
|
10974
11125
|
function gcSweepDue(rootDir, maxAgeMs) {
|
|
10975
11126
|
try {
|
|
10976
|
-
return Date.now() -
|
|
11127
|
+
return Date.now() - statSync6(join9(rootDir, GC_MARKER)).mtimeMs > maxAgeMs;
|
|
10977
11128
|
} catch {
|
|
10978
11129
|
return true;
|
|
10979
11130
|
}
|
|
@@ -15590,7 +15741,7 @@ function getSystemResources() {
|
|
|
15590
15741
|
// ../engine/src/services/fileServer.ts
|
|
15591
15742
|
import { Hono } from "hono";
|
|
15592
15743
|
import { serve } from "@hono/node-server";
|
|
15593
|
-
import { readFileSync as readFileSync7, openSync as openSync4, fstatSync, closeSync as closeSync4, statSync as
|
|
15744
|
+
import { readFileSync as readFileSync7, openSync as openSync4, fstatSync, closeSync as closeSync4, statSync as statSync7, constants } from "fs";
|
|
15594
15745
|
import { join as join16, extname as extname3 } from "path";
|
|
15595
15746
|
var MIME_TYPES = {
|
|
15596
15747
|
".html": "text/html; charset=utf-8",
|
|
@@ -15627,7 +15778,7 @@ function readRegularFile(filePath) {
|
|
|
15627
15778
|
} catch (error) {
|
|
15628
15779
|
if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR"))
|
|
15629
15780
|
return null;
|
|
15630
|
-
if (!
|
|
15781
|
+
if (!statSync7(filePath, { throwIfNoEntry: false })?.isFile()) return null;
|
|
15631
15782
|
throw error;
|
|
15632
15783
|
}
|
|
15633
15784
|
try {
|
|
@@ -16065,6 +16216,7 @@ export {
|
|
|
16065
16216
|
releaseBrowser,
|
|
16066
16217
|
drainBrowserPool,
|
|
16067
16218
|
closeBrowserPool,
|
|
16219
|
+
usesSoftwareWebGpu,
|
|
16068
16220
|
buildChromeArgs,
|
|
16069
16221
|
compositionRequiresWebGpu,
|
|
16070
16222
|
WebGpuUnavailableError,
|
|
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
resolveCaptureBrowserGpuMode
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7SDCIWHQ.js";
|
|
10
10
|
import {
|
|
11
11
|
requestCliExit
|
|
12
12
|
} from "./chunk-PBN6GBJE.js";
|