hyperframes 0.9.5 → 0.9.6
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-XI5CW2YO.js → add-FI2ERBMZ.js} +11 -11
- package/dist/{agentPromptGenerator-EEP7CJRK.js → agentPromptGenerator-DZTXHJV3.js} +5 -5
- package/dist/{animatedGifPrep-3VKPC32B.js → animatedGifPrep-GXQA4KCD.js} +5 -5
- package/dist/api.d.ts +2 -0
- package/dist/api.js +19 -19
- package/dist/{asset-RYVHIREA.js → asset-BRSG6JNL.js} +2 -2
- package/dist/{assetCataloger-MG3GSWNQ.js → assetCataloger-KVWF4SRK.js} +6 -6
- package/dist/{audio-CNKU2KQR.js → audio-BVZOX6LU.js} +502 -143
- package/dist/{auth-MX2SGZQH.js → auth-HFFN7USX.js} +2 -2
- package/dist/{autoUpdate-MB3SWOXG.js → autoUpdate-JNGMUXLZ.js} +2 -2
- package/dist/{backgroundChecks-TYCDOGQX.js → backgroundChecks-O4ADPXOL.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-PHXZBVEA.js → batchRender-A2HW6QW7.js} +3 -3
- package/dist/{beats-5SXSGNUM.js → beats-F7Q3G6VW.js} +7 -7
- package/dist/{benchmark-V5Y5OQ3W.js → benchmark-4BDMIYTW.js} +8 -8
- package/dist/{billing-FFWAEIQ6.js → billing-35NVMZWK.js} +1 -1
- package/dist/{browser-CJ2HDBEC.js → browser-S6ADXSB7.js} +3 -3
- package/dist/{bundleWithLocalizedFonts-2FPP3MMD.js → bundleWithLocalizedFonts-EE27EYEU.js} +2 -2
- package/dist/{capture-424KH55L.js → capture-CXDJO524.js} +18 -18
- package/dist/{capture-KE3474CJ.js → capture-LWWBL6SH.js} +3 -3
- package/dist/{captureCompositionFrame-ZPZCQTYL.js → captureCompositionFrame-BB2ZGM6R.js} +10 -10
- package/dist/{catalog-3S4LAGZH.js → catalog-RQ6HIUBG.js} +11 -11
- package/dist/{catch-up-7ZLNBOG4.js → catch-up-PBAXR7FI.js} +4 -4
- package/dist/{check-6OCBPXX5.js → check-O4V4UWE3.js} +35 -35
- package/dist/{checkAudio-O5RDEOEX.js → checkAudio-EUT3AO3L.js} +8 -8
- package/dist/{checkBrowser-DJPH634D.js → checkBrowser-QQUBR4QI.js} +29 -29
- package/dist/{chunk-GC2GKCRQ.js → chunk-27AVZR7K.js} +17 -17
- package/dist/{chunk-JZJ3LLIO.js → chunk-2FNUCIHD.js} +1 -1
- package/dist/{chunk-ARNCWQNR.js → chunk-2KO357TJ.js} +1 -1
- package/dist/chunk-2KYY75JP.js +134 -0
- package/dist/{chunk-KLJEGC6M.js → chunk-3SB24TVT.js} +1 -1
- package/dist/{chunk-BXE6GDIL.js → chunk-44T2V4EW.js} +1 -1
- package/dist/{chunk-MX7NW3QW.js → chunk-47IBOMXH.js} +3 -3
- package/dist/{chunk-JDT5PZWS.js → chunk-4E7G2GME.js} +1 -1
- package/dist/{chunk-CRDXU4IX.js → chunk-4III3SDC.js} +9 -9
- package/dist/{chunk-CS6UO5NC.js → chunk-4VOK22DG.js} +1 -1
- package/dist/{chunk-TI4JPSFS.js → chunk-5BCFV2HE.js} +3 -3
- package/dist/{chunk-5T2D2XYR.js → chunk-6GZB32Q5.js} +1 -1
- package/dist/{chunk-HWIGWPIG.js → chunk-6JMNJYYR.js} +1 -1
- package/dist/{chunk-HDKRDALC.js → chunk-6UOHLXVU.js} +2 -2
- package/dist/{chunk-MGXQXY4C.js → chunk-7DKGU6CY.js} +2 -2
- package/dist/{chunk-WAQX3AYB.js → chunk-AB3ZXWI3.js} +1 -1
- package/dist/{chunk-5TBRPDH3.js → chunk-APVBITVZ.js} +55 -16
- package/dist/{chunk-XXFWK5Y7.js → chunk-BIJBGCF4.js} +1 -1
- package/dist/{chunk-ALBHEVJJ.js → chunk-BMRZP6X6.js} +1 -1
- package/dist/{chunk-YGSQABOD.js → chunk-BQQTZET2.js} +2 -2
- package/dist/{chunk-VPVO5COM.js → chunk-BUDP4GF4.js} +1 -1
- package/dist/{chunk-QIFINY2N.js → chunk-C47ZGVKT.js} +7 -7
- package/dist/{chunk-ZFQ4N6D2.js → chunk-CUAZHDVV.js} +3 -3
- package/dist/{chunk-TWIPYH4G.js → chunk-DETBSOYO.js} +1 -1
- package/dist/{chunk-C555UZ5B.js → chunk-DUSSDJJC.js} +2 -2
- package/dist/{chunk-NRO2PLEC.js → chunk-E2VWKW2A.js} +2 -2
- package/dist/{chunk-IWMVCOUX.js → chunk-FB366S4I.js} +5 -5
- package/dist/{chunk-6447ORC2.js → chunk-FDZXVTBY.js} +1 -1
- package/dist/{chunk-JAYAOI3W.js → chunk-FIIFME5M.js} +1 -1
- package/dist/{chunk-JX5GUEFA.js → chunk-FM7VWSN3.js} +1 -1
- package/dist/{chunk-MYTROPEC.js → chunk-FP37FSOT.js} +2 -2
- package/dist/{chunk-64OUBJSX.js → chunk-G4VDT5D7.js} +1 -1
- package/dist/{chunk-EG2ESF6S.js → chunk-GKVERDJ2.js} +1 -1
- package/dist/{chunk-CGXL36FR.js → chunk-GP7OHHXR.js} +1 -1
- package/dist/{chunk-KW2ZREKY.js → chunk-GR3LU4D5.js} +1 -1
- package/dist/{chunk-6PLIPRVQ.js → chunk-GYPSZFRF.js} +2 -2
- package/dist/{chunk-7FERR4YN.js → chunk-HTTGTROQ.js} +1 -1
- package/dist/{chunk-PMQ65BTY.js → chunk-I2OMLFBJ.js} +1 -1
- package/dist/{chunk-7XCGHD55.js → chunk-I47SIQGX.js} +4 -4
- package/dist/{chunk-PYOEIKGI.js → chunk-IG3GSBHB.js} +2 -2
- package/dist/{chunk-46DXV7OQ.js → chunk-IVFZG3CU.js} +2 -2
- package/dist/{chunk-HZMM3D6P.js → chunk-JFIBO4CZ.js} +1 -1
- package/dist/{chunk-2RLI5ISA.js → chunk-JLKEXS4I.js} +2 -2
- package/dist/{chunk-SXKFFBN3.js → chunk-JLLNDU2F.js} +84 -8
- package/dist/{chunk-JAJ6PAR6.js → chunk-KAWNVSAE.js} +7 -7
- package/dist/{chunk-5FAU3XAO.js → chunk-KJDQS24S.js} +2 -2
- package/dist/{chunk-SBPDYU34.js → chunk-KJLZZ4MY.js} +1 -1
- package/dist/{chunk-MCROAQ7A.js → chunk-KXAGCBVO.js} +8 -8
- package/dist/{chunk-HMMHCSSN.js → chunk-L6MNWJTL.js} +1 -1
- package/dist/{chunk-HZDSKYTV.js → chunk-LS4CCRTK.js} +1 -1
- package/dist/{chunk-Y6TDJUHR.js → chunk-M4WEGGF7.js} +2 -2
- package/dist/{chunk-UL3SKAZB.js → chunk-ODKXNWDL.js} +2 -2
- package/dist/{chunk-6U4EV64B.js → chunk-P5GOQDA2.js} +8 -8
- package/dist/{chunk-MBOZUQFZ.js → chunk-PWYAOU4I.js} +1 -1
- package/dist/{chunk-RTUQDHKE.js → chunk-QDB7EFLI.js} +94 -10
- package/dist/{chunk-YK6ERJTN.js → chunk-RYNMIBZM.js} +2 -2
- package/dist/{chunk-YPBGUVLY.js → chunk-SAWXMCHB.js} +1 -1
- package/dist/{chunk-NUGADGXQ.js → chunk-SWWDVPVO.js} +1 -1
- package/dist/{chunk-RW4DTMPK.js → chunk-T57ARBNR.js} +7 -7
- package/dist/{chunk-44IJ426Z.js → chunk-TIXW6JWD.js} +1 -1
- package/dist/chunk-TNWWLO4T.js +5030 -0
- package/dist/{chunk-M56MEMPF.js → chunk-TS4HYR6I.js} +1 -1
- package/dist/{chunk-FEC4UQK2.js → chunk-VFOCEFRZ.js} +5 -5
- package/dist/{chunk-K4SINZFP.js → chunk-VG4JPJMI.js} +2 -2
- package/dist/{chunk-MNW4FTAJ.js → chunk-VWRIARRR.js} +12 -12
- package/dist/{chunk-T46SP3UD.js → chunk-W3G7DNCR.js} +2 -2
- package/dist/{chunk-WAK6IPMP.js → chunk-WCET3OHQ.js} +4 -4
- package/dist/{chunk-5FFHLOVF.js → chunk-XC3LDNBH.js} +1 -1
- package/dist/{chunk-JD7MLLJD.js → chunk-YDG5LVIK.js} +4 -4
- package/dist/{chunk-NVPB37H4.js → chunk-YFISKULK.js} +2 -2
- package/dist/{chunk-S5SVW6ZY.js → chunk-YIWNZ2CI.js} +13 -13
- package/dist/{chunk-WTUIK6Y4.js → chunk-YOZPHSYV.js} +2 -0
- package/dist/{chunk-DRXVRDUX.js → chunk-YUMVQB2F.js} +1 -1
- package/dist/{chunk-RUZ63CJF.js → chunk-YVUOJW4H.js} +1 -1
- package/dist/{chunk-4W2ZN4HT.js → chunk-YY7YI2FW.js} +1 -1
- package/dist/{chunk-3B3LGZ36.js → chunk-ZP3LPFTA.js} +9 -9
- package/dist/{chunk-Q2LWMJAQ.js → chunk-ZR2GMFNH.js} +2 -2
- package/dist/{chunk-H7KAHDJJ.js → chunk-ZV5GD5LV.js} +3 -3
- package/dist/{clean-ZKPZ4HHG.js → clean-2AFJGFIG.js} +15 -15
- package/dist/cli.js +58 -57
- package/dist/{cloud-GQZYBRBI.js → cloud-JM5MFMVV.js} +4 -4
- package/dist/{cloudrun-TWSNNKIV.js → cloudrun-PNVETMPA.js} +4 -4
- package/dist/{compare-3IXL3WVG.js → compare-ST4DXEMX.js} +26 -26
- package/dist/{compiler-SKQTN3EA.js → compiler-UCX3MZVN.js} +2 -2
- package/dist/{component-RV72K74J.js → component-ECFJIDUD.js} +3 -3
- package/dist/{compositions-W2IKF36U.js → compositions-ZCAD47PD.js} +9 -9
- package/dist/{curve-TRCKVHYB.js → curve-NYXZWGPO.js} +9 -9
- package/dist/{cuts-SRXTGX33.js → cuts-CKUCNNOX.js} +10 -10
- package/dist/{delete-7PZLZFBE.js → delete-MVGSOWSC.js} +2 -2
- package/dist/{deploy-GORJQIPX.js → deploy-WBKPSWPG.js} +4 -4
- package/dist/{describeProject-ZIFVZUSV.js → describeProject-ZDI5B6JO.js} +6 -6
- package/dist/{diff-PHRMVJMC.js → diff-3UYDXIEZ.js} +21 -21
- package/dist/{dist-4KKPG6A5.js → dist-XRAW3URT.js} +2 -2
- package/dist/{doctor-C6Q2FECX.js → doctor-A4HMMBII.js} +9 -9
- package/dist/{energy-CNXVSSE6.js → energy-RN6KTYH6.js} +10 -10
- package/dist/{events-FSUH46NR.js → events-6NE2NRCQ.js} +12 -12
- package/dist/{events-27C4TXPP.js → events-AO3FEPL3.js} +3 -3
- package/dist/{events-UG3LC2PB.js → events-LSEMS2LO.js} +2 -2
- package/dist/{extract-GLPADLLV.js → extract-6UO4QR77.js} +10 -10
- package/dist/{face-TTOHRJEY.js → face-FTKPGC2O.js} +10 -10
- package/dist/{feedback-BYONPSSM.js → feedback-GSKVBGA7.js} +6 -6
- package/dist/{ffmpeg-WAM27CD6.js → ffmpeg-HPMQUKY4.js} +5 -5
- package/dist/{figma-Y4UR2EDE.js → figma-UIWB3XSX.js} +3 -3
- package/dist/fontLocalizeCli.js +8 -8
- package/dist/{frames-CNQUJEUV.js → frames-U3LLSXSV.js} +11 -11
- package/dist/{generate-BPYDIEPB.js → generate-AFCKBHGB.js} +13 -13
- package/dist/{get-4LY5VJW2.js → get-J3TJCAZW.js} +2 -2
- package/dist/{gpuPolicy-OUHJ7GVX.js → gpuPolicy-W2OEEW7Y.js} +5 -5
- package/dist/{grade-compare-WEZBE3WM.js → grade-compare-AOXNJ53Z.js} +27 -27
- package/dist/{heifImagePrep-7L4HH33F.js → heifImagePrep-4RSVCLPX.js} +6 -6
- package/dist/{help-QKNWJOBV.js → help-5NYIBLJJ.js} +2 -1
- package/dist/{history-XQEWP2IW.js → history-KAXYCLVT.js} +6 -6
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +64 -64
- package/dist/hyperframes-player.global.js +90 -3
- package/dist/{info-AMRQ5R4N.js → info-Z6KNUMH6.js} +7 -7
- package/dist/{init-4VTMKZSQ.js → init-GSMXQX3U.js} +30 -27
- package/dist/{ink-KB3LZMJY.js → ink-IPPBJFH3.js} +10 -10
- package/dist/{inspect-ZWN2DVO4.js → inspect-MXIGEN6Z.js} +27 -27
- package/dist/{installer-2NUMLKHQ.js → installer-JXI2JC3T.js} +4 -4
- package/dist/{keyframes-I456RFGP.js → keyframes-Z53YGH5F.js} +6 -6
- package/dist/{lambda-2QKB4BJM.js → lambda-KD7ZRYVK.js} +9 -9
- package/dist/{layout-WPHWXQCM.js → layout-NLDWEPDQ.js} +27 -27
- package/dist/{lint-EO5DXJ36.js → lint-MSZMGQO5.js} +6 -6
- package/dist/{list-LZOUUJBY.js → list-OLNBKKB4.js} +2 -2
- package/dist/{localPage-SZWQWWJ7.js → localPage-BQ2LKHED.js} +5 -5
- package/dist/{login-IEWPNTGD.js → login-TBJVG5PZ.js} +4 -4
- package/dist/{look-6L3CPY4H.js → look-T5V6JBD5.js} +10 -10
- package/dist/{manager-C7677YAV.js → manager-FHVSGJNR.js} +6 -6
- package/dist/{measure-TINTS6YY.js → measure-KI3XY2MJ.js} +11 -11
- package/dist/{media-treatment-3BDHM4P6.js → media-treatment-UZI55RS3.js} +11 -11
- package/dist/{media-use-JC2B2JSE.js → media-use-2PIPVWX4.js} +1 -1
- package/dist/{models-JMM25YO6.js → models-MV4HBZKZ.js} +9 -9
- package/dist/{motionShot-4WB3SH6V.js → motionShot-A3TWOBRE.js} +13 -13
- package/dist/{normalize-audio-2ZJKR5G3.js → normalize-audio-37WYHLP4.js} +8 -8
- package/dist/{open-LMYSLYH2.js → open-4PPPV45S.js} +11 -11
- package/dist/{parakeetRunner-HTQVLX2B.js → parakeetRunner-J22MMWSM.js} +10 -10
- package/dist/{pipeline-FMVCPIRU.js → pipeline-GE4LBTRO.js} +8 -8
- package/dist/{play-GFHBG3NZ.js → play-MZSW7GIL.js} +18 -18
- package/dist/{preflight-L5GC6ASI.js → preflight-NXMN7P4B.js} +6 -6
- package/dist/{present-PW3RWNWF.js → present-TWZLASXI.js} +14 -14
- package/dist/{preview-IRLHPLSD.js → preview-OEXP2RPO.js} +16 -16
- package/dist/probe-HNAD6ACH.js +69 -0
- package/dist/{producer-M6IWCFMK.js → producer-E4AN4ADM.js} +1 -1
- package/dist/{projectConfig-IVJE7A42.js → projectConfig-HKWVTV5Q.js} +10 -6
- package/dist/{publication-BS2YATIF.js → publication-DTIE7G2E.js} +2 -2
- package/dist/{publish-OTRA2JWM.js → publish-CUU5W6CP.js} +8 -8
- package/dist/{remove-background-UV37Y7T7.js → remove-background-2MRQ3YH4.js} +9 -9
- package/dist/{render-XSDVVBEY.js → render-EEIQAOGV.js} +34 -15
- package/dist/{render-3FANM5MO.js → render-JP6JUXWP.js} +5 -5
- package/dist/{render-7VBLI4AZ.js → render-QRWGJUCD.js} +30 -30
- package/dist/{render-batch-DPWJHKFY.js → render-batch-46SYPMYV.js} +5 -5
- package/dist/{resolver-VQ32ZH6Y.js → resolver-DPRCISSD.js} +4 -4
- package/dist/reverse-MY6DSOXL.js +32 -0
- package/dist/{run-MTGSR5HH.js → run-2VGZ3URU.js} +1 -1
- package/dist/{sherpa-BSIBIIIO.js → sherpa-5LOEXZ46.js} +9 -9
- package/dist/{skills-S7JNBPZZ.js → skills-BBHR4SHX.js} +5 -5
- package/dist/{skillsUpdateCheck-WFEV6VYU.js → skillsUpdateCheck-HBOVCIXG.js} +3 -3
- package/dist/{snapshot-NCWXYS2E.js → snapshot-S264O54Z.js} +31 -31
- package/dist/{src-AYBT7IBT.js → src-G2EK32ZO.js} +7 -7
- package/dist/{src-7WW3KXOI.js → src-GLO4X3WA.js} +12 -4
- package/dist/start-6AFMEXPO.js +226 -0
- package/dist/{staticProjectServer-VYZV4BSU.js → staticProjectServer-KWSV5IRS.js} +16 -16
- package/dist/{status-Z5BPMROD.js → status-5ZRM4R4N.js} +1 -1
- package/dist/studio/assets/hyperframes-player-CGO8wE5a.js +565 -0
- package/dist/studio/assets/{index-BohL7wdo.js → index-COtefOSM.js} +1 -1
- package/dist/studio/assets/{index-CTbhykVD.js → index-DHPJjAUV.js} +4 -4
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-OTNMLH4B.js → studio-api-JJO6VEFD.js} +8 -8
- package/dist/{studioServer-AA4B3YP7.js → studioServer-YFZIESIH.js} +45 -45
- package/dist/{sync-3M7VO3UJ.js → sync-DBMNZ32Z.js} +10 -10
- package/dist/{telemetry-VJ3A6ZMD.js → telemetry-OPZTKPDG.js} +3 -3
- package/dist/{timeline-ZLZ45W7F.js → timeline-MCJUCDME.js} +16 -16
- package/dist/{tokens-WXEJNNJV.js → tokens-3DREMPWC.js} +2 -2
- package/dist/{transcribe-PPH5H67E.js → transcribe-AU7TPKMU.js} +8 -8
- package/dist/{transcribe-XMVXOBHM.js → transcribe-TMGPK6FM.js} +17 -17
- package/dist/{updateCheck-HDLNWLIC.js → updateCheck-YKTRFFFV.js} +2 -2
- package/dist/{upgrade-6UXVTJII.js → upgrade-UAKM3KAT.js} +2 -2
- package/dist/{urlDownloader-DPN2KRCX.js → urlDownloader-77YL7TXO.js} +4 -4
- package/dist/{validate-BZOURM4G.js → validate-SR35R3QM.js} +21 -21
- package/dist/{video-BE42DAT2.js → video-GNMQTE4D.js} +6 -6
- package/dist/warmCheck.js +35 -35
- package/package.json +1 -1
- package/dist/chunk-2YQ2XYO5.js +0 -5030
- package/dist/probe-FPHFC3SD.js +0 -179
- package/dist/studio/assets/hyperframes-player-Cum4k6V2.js +0 -478
|
@@ -20,13 +20,13 @@ import {
|
|
|
20
20
|
findFFmpeg,
|
|
21
21
|
findFFprobe,
|
|
22
22
|
getFFmpegInstallHint
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-PWYAOU4I.js";
|
|
24
24
|
import {
|
|
25
25
|
formatBytes
|
|
26
26
|
} from "./chunk-5LOZWO2M.js";
|
|
27
27
|
import {
|
|
28
28
|
parseAnimatedGifMetadata
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-6JMNJYYR.js";
|
|
30
30
|
import {
|
|
31
31
|
cleanAssetUrl,
|
|
32
32
|
isRemoteOrInlineUrl,
|
|
@@ -49,11 +49,14 @@ import {
|
|
|
49
49
|
import { execFile } from "child_process";
|
|
50
50
|
import { createHash } from "crypto";
|
|
51
51
|
import {
|
|
52
|
+
closeSync,
|
|
52
53
|
copyFileSync,
|
|
53
54
|
createReadStream,
|
|
54
55
|
mkdirSync,
|
|
55
56
|
mkdtempSync,
|
|
57
|
+
openSync,
|
|
56
58
|
readFileSync,
|
|
59
|
+
readSync,
|
|
57
60
|
renameSync,
|
|
58
61
|
rmSync,
|
|
59
62
|
writeFileSync
|
|
@@ -62,6 +65,33 @@ import { tmpdir } from "os";
|
|
|
62
65
|
import { basename as basename2, dirname, extname, join, posix, relative, resolve } from "path";
|
|
63
66
|
import { promisify } from "util";
|
|
64
67
|
|
|
68
|
+
// src/cloud/offloadSniff.ts
|
|
69
|
+
function bytesMatchExtension(ext, head) {
|
|
70
|
+
const at = (offset, text) => head.toString("latin1", offset, offset + text.length) === text;
|
|
71
|
+
switch (ext) {
|
|
72
|
+
case ".mp3":
|
|
73
|
+
return at(0, "ID3") || head[0] === 255 && ((head[1] ?? 0) & 230) === 226;
|
|
74
|
+
case ".wav":
|
|
75
|
+
return at(0, "RIFF") && at(8, "WAVE");
|
|
76
|
+
case ".webp":
|
|
77
|
+
return at(0, "RIFF") && at(8, "WEBP");
|
|
78
|
+
case ".png":
|
|
79
|
+
return head.subarray(0, 4).equals(Buffer.from([137, 80, 78, 71]));
|
|
80
|
+
case ".jpg":
|
|
81
|
+
case ".jpeg":
|
|
82
|
+
return head[0] === 255 && head[1] === 216 && head[2] === 255;
|
|
83
|
+
case ".webm":
|
|
84
|
+
return head.subarray(0, 4).equals(Buffer.from([26, 69, 223, 163]));
|
|
85
|
+
case ".mov":
|
|
86
|
+
return ["ftyp", "moov", "mdat", "wide", "free"].some((box) => at(4, box));
|
|
87
|
+
case ".mp4":
|
|
88
|
+
case ".m4v":
|
|
89
|
+
return at(4, "ftyp") && !at(8, "M4A ") && !at(8, "M4B ") && !at(8, "M4P ");
|
|
90
|
+
default:
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
65
95
|
// src/cloud/offloadTrim.ts
|
|
66
96
|
import { basename } from "path";
|
|
67
97
|
var TRIM_MARGIN_SECONDS = 0.5;
|
|
@@ -419,7 +449,33 @@ async function trimGrid(sourcePath, kind) {
|
|
|
419
449
|
const fps = rate(real);
|
|
420
450
|
return Number.isFinite(fps) && Math.abs(fps - rate(average)) < 0.01 ? fps : null;
|
|
421
451
|
}
|
|
422
|
-
|
|
452
|
+
async function hasVideoStream(sourcePath) {
|
|
453
|
+
const ffprobe = findFFprobe();
|
|
454
|
+
if (!ffprobe) return true;
|
|
455
|
+
try {
|
|
456
|
+
const { stdout } = await execFileAsync(ffprobe, [
|
|
457
|
+
"-v",
|
|
458
|
+
"error",
|
|
459
|
+
"-select_streams",
|
|
460
|
+
"v:0",
|
|
461
|
+
"-show_entries",
|
|
462
|
+
"stream=codec_type",
|
|
463
|
+
"-of",
|
|
464
|
+
"csv=p=0",
|
|
465
|
+
"--",
|
|
466
|
+
sourcePath
|
|
467
|
+
]);
|
|
468
|
+
return stdout.trim() !== "";
|
|
469
|
+
} catch {
|
|
470
|
+
return true;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
var ffmpegReencoder = {
|
|
474
|
+
choose: choosePreset,
|
|
475
|
+
trimGrid,
|
|
476
|
+
hasVideo: hasVideoStream,
|
|
477
|
+
run: ffmpegReencode
|
|
478
|
+
};
|
|
423
479
|
async function stagedSha256(file) {
|
|
424
480
|
if (Buffer.isBuffer(file)) return createHash("sha256").update(file).digest("hex");
|
|
425
481
|
const hash = createHash("sha256");
|
|
@@ -465,19 +521,39 @@ function assertFitsAsset(path, filename, size) {
|
|
|
465
521
|
);
|
|
466
522
|
}
|
|
467
523
|
}
|
|
524
|
+
function readHead(file) {
|
|
525
|
+
if (Buffer.isBuffer(file)) return file.subarray(0, 16);
|
|
526
|
+
const fd = openSync(file.absPath, "r");
|
|
527
|
+
try {
|
|
528
|
+
const head = Buffer.alloc(16);
|
|
529
|
+
readSync(fd, head, 0, 16, 0);
|
|
530
|
+
return head;
|
|
531
|
+
} finally {
|
|
532
|
+
closeSync(fd);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
468
535
|
async function planFile(ctx, path, file) {
|
|
469
|
-
|
|
536
|
+
let kind = mediaKind(path);
|
|
470
537
|
const size = stagedSize(file);
|
|
471
538
|
if (!kind || size < OFFLOAD_MIN_BYTES) return null;
|
|
472
|
-
const
|
|
473
|
-
const
|
|
539
|
+
const ext = extname(path).toLowerCase();
|
|
540
|
+
const accepted = ACCEPTED[ext];
|
|
541
|
+
let asIs = accepted !== void 0 && size <= accepted.maxBytes && bytesMatchExtension(ext, readHead(file));
|
|
542
|
+
let sourcePath;
|
|
543
|
+
if (kind === "video" && ctx.reencoder.hasVideo) {
|
|
544
|
+
sourcePath = snapshotPath(path, file, ctx.tempFiles);
|
|
545
|
+
if (!await ctx.reencoder.hasVideo(sourcePath)) {
|
|
546
|
+
kind = "audio";
|
|
547
|
+
asIs = false;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
474
550
|
const mayBeCached = ctx.opts.upload !== void 0 || (asIs ? ctx.cachedSizes.has(size) : ctx.cachedSizes.size > 0);
|
|
475
551
|
const sha256 = mayBeCached ? await stagedSha256(file) : void 0;
|
|
476
552
|
const keyFor = (variant2) => sha256 && `${ctx.opts.apiBaseUrl} ${sha256} ${variant2}`;
|
|
477
553
|
if (asIs) {
|
|
478
554
|
return { key: keyFor("as-is"), sourcePath: "", contentType: accepted?.contentType };
|
|
479
555
|
}
|
|
480
|
-
|
|
556
|
+
sourcePath ??= snapshotPath(path, file, ctx.tempFiles);
|
|
481
557
|
const preset = await ctx.reencoder.choose(sourcePath, kind);
|
|
482
558
|
if (!preset) return null;
|
|
483
559
|
const segments = kind === "image" ? null : await planFileTrim(ctx, path, sourcePath, kind);
|
|
@@ -543,7 +619,7 @@ async function prepareEntryGifs(ctx, fileMap) {
|
|
|
543
619
|
if (!html || !/\.gif\b/i.test(html)) return;
|
|
544
620
|
const sourceAssets = entryGifSources(ctx, entryPath, html);
|
|
545
621
|
if (!sourceAssets) return;
|
|
546
|
-
const prep = ctx.opts.gifPrep ?? (await import("./src-
|
|
622
|
+
const prep = ctx.opts.gifPrep ?? (await import("./src-G2EK32ZO.js")).prepareAnimatedGifInputs;
|
|
547
623
|
const outputDir = mkdtempSync(join(tmpdir(), "hf-offload-gif-"));
|
|
548
624
|
ctx.tempFiles.push(outputDir);
|
|
549
625
|
const result = await prep(html, {
|
|
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
getMimeType,
|
|
9
9
|
injectMediaCodecMapIntoHtml
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-P5GOQDA2.js";
|
|
11
11
|
import {
|
|
12
12
|
PROXY_VARIANT_CONFIG,
|
|
13
13
|
ProxyCapacityError,
|
|
@@ -18,26 +18,26 @@ import {
|
|
|
18
18
|
recordProxyRequest,
|
|
19
19
|
resolveProxy,
|
|
20
20
|
resolveProxyVariantRequest
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-W3G7DNCR.js";
|
|
22
22
|
import {
|
|
23
23
|
findStageProxyBox
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-GR3LU4D5.js";
|
|
25
25
|
import {
|
|
26
26
|
resolveAutoProxy
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-APVBITVZ.js";
|
|
28
28
|
import {
|
|
29
29
|
openRangeEnd
|
|
30
30
|
} from "./chunk-VEIGTKYZ.js";
|
|
31
31
|
import {
|
|
32
32
|
listenOnBrowserSafePort
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-QDB7EFLI.js";
|
|
34
34
|
import {
|
|
35
35
|
stripSdrPngColourTags
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-JFIBO4CZ.js";
|
|
37
37
|
import {
|
|
38
38
|
PREVIEW_PROXY_BOX_PARAM,
|
|
39
39
|
parsePreviewProxyBox
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-6JMNJYYR.js";
|
|
41
41
|
import {
|
|
42
42
|
decodeWellFormedEscapes
|
|
43
43
|
} from "./chunk-C2KEGBR3.js";
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
emitWords,
|
|
22
22
|
getPreparedWavDurationSeconds,
|
|
23
23
|
prepareWav
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-47IBOMXH.js";
|
|
25
25
|
import {
|
|
26
26
|
stoppedByCancelSignal
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-TIXW6JWD.js";
|
|
28
28
|
import {
|
|
29
29
|
verifies
|
|
30
30
|
} from "./chunk-RZ6CXJ56.js";
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
Semaphore,
|
|
9
9
|
prepareHeifImageInputs,
|
|
10
10
|
withMediaProbeSlot
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7DKGU6CY.js";
|
|
12
12
|
import {
|
|
13
13
|
EncoderInterruptedError,
|
|
14
14
|
encoderFailureError,
|
|
15
15
|
prepareAnimatedGifInputs
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-BQQTZET2.js";
|
|
17
17
|
import {
|
|
18
18
|
GENERIC_FAMILIES,
|
|
19
19
|
collectFontFamilyCustomProperties,
|
|
@@ -185,7 +185,7 @@ import {
|
|
|
185
185
|
videoAudioId,
|
|
186
186
|
videoStartOnMediaTimeline,
|
|
187
187
|
writeCapturedFrame
|
|
188
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-QDB7EFLI.js";
|
|
189
189
|
import {
|
|
190
190
|
assignBundledRuntimeCompositionIds,
|
|
191
191
|
emitMountedModuleScripts,
|
|
@@ -197,7 +197,7 @@ import {
|
|
|
197
197
|
parsesAsScript,
|
|
198
198
|
prepareFlattenedInnerRoot,
|
|
199
199
|
stripSdrPngColourTags
|
|
200
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-JFIBO4CZ.js";
|
|
201
201
|
import {
|
|
202
202
|
collectScratchLeftovers,
|
|
203
203
|
removeScratch,
|
|
@@ -216,7 +216,7 @@ import {
|
|
|
216
216
|
parseVfxChain,
|
|
217
217
|
resolveAuthoredTimingWindow,
|
|
218
218
|
toFps
|
|
219
|
-
} from "./chunk-
|
|
219
|
+
} from "./chunk-6JMNJYYR.js";
|
|
220
220
|
import {
|
|
221
221
|
gsapCdnDist,
|
|
222
222
|
normalizeGsapBaseUrl
|
|
@@ -255,7 +255,7 @@ import {
|
|
|
255
255
|
sourceTimeAt,
|
|
256
256
|
styleElementsFor,
|
|
257
257
|
timeAtSourceTime
|
|
258
|
-
} from "./chunk-
|
|
258
|
+
} from "./chunk-TNWWLO4T.js";
|
|
259
259
|
import {
|
|
260
260
|
TRANSITIONS,
|
|
261
261
|
convertTransfer,
|
|
@@ -16893,7 +16893,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
|
|
|
16893
16893
|
if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
|
|
16894
16894
|
if (probeResult.probeSession) {
|
|
16895
16895
|
try {
|
|
16896
|
-
const { closeCaptureSession: closeCaptureSession2 } = await import("./src-
|
|
16896
|
+
const { closeCaptureSession: closeCaptureSession2 } = await import("./src-GLO4X3WA.js");
|
|
16897
16897
|
await closeCaptureSession2(probeResult.probeSession);
|
|
16898
16898
|
} catch (err) {
|
|
16899
16899
|
log.warn("[plan] probe session close failed", {
|
|
@@ -20276,7 +20276,7 @@ function startServer(options = {}) {
|
|
|
20276
20276
|
});
|
|
20277
20277
|
async function shutdown(signal) {
|
|
20278
20278
|
log.info(`Received ${signal}, shutting down`);
|
|
20279
|
-
const { drainBrowserPool } = await import("./src-
|
|
20279
|
+
const { drainBrowserPool } = await import("./src-GLO4X3WA.js");
|
|
20280
20280
|
await drainBrowserPool().catch(() => {
|
|
20281
20281
|
});
|
|
20282
20282
|
const handle = await Promise.race([
|
|
@@ -6,14 +6,14 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
loadProducer
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BMRZP6X6.js";
|
|
10
10
|
import {
|
|
11
11
|
resolveProjectRelativeSrc
|
|
12
12
|
} from "./chunk-WVRAFHJU.js";
|
|
13
13
|
|
|
14
14
|
// src/utils/projectMedia.ts
|
|
15
15
|
async function collectProjectMedia(projectDir) {
|
|
16
|
-
const { bundleToSingleHtml } = await import("./compiler-
|
|
16
|
+
const { bundleToSingleHtml } = await import("./compiler-UCX3MZVN.js");
|
|
17
17
|
const html = await bundleToSingleHtml(projectDir);
|
|
18
18
|
const producer = await loadProducer();
|
|
19
19
|
if (!producer.collectRenderMedia) throw new Error("Render media collector unavailable");
|
|
@@ -6,8 +6,8 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
|
|
8
8
|
// src/version.ts
|
|
9
|
-
var VERSION = true ? "0.9.
|
|
10
|
-
var PRODUCER_VERSION = true ? "0.9.
|
|
9
|
+
var VERSION = true ? "0.9.6" : "0.0.0-dev";
|
|
10
|
+
var PRODUCER_VERSION = true ? "0.9.6" : "0.0.0-dev";
|
|
11
11
|
|
|
12
12
|
export {
|
|
13
13
|
VERSION,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
splitElementInHtml,
|
|
20
20
|
unwrapElementsFromHtml,
|
|
21
21
|
wrapElementsInHtml
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-JLKEXS4I.js";
|
|
23
23
|
import {
|
|
24
24
|
DEFAULT_TARGET_LUFS,
|
|
25
25
|
absoluteLoudnessPlan,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
requestedProjectPath,
|
|
29
29
|
requiredFfmpeg,
|
|
30
30
|
resolveLocalAudioPath
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-FP37FSOT.js";
|
|
32
32
|
import {
|
|
33
33
|
MEDIA_LINK_ATTR,
|
|
34
34
|
relinkSplitHalves
|
|
@@ -55,11 +55,11 @@ import {
|
|
|
55
55
|
scanProjectMedia,
|
|
56
56
|
shouldPrewarmProxy,
|
|
57
57
|
waitForProxy
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-W3G7DNCR.js";
|
|
59
59
|
import {
|
|
60
60
|
probeAudioTrack,
|
|
61
61
|
probeMediaMetadata
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-4VOK22DG.js";
|
|
63
63
|
import {
|
|
64
64
|
HistoryBusyError,
|
|
65
65
|
MAX_WINDOW_IDLE_MS,
|
|
@@ -116,7 +116,7 @@ import {
|
|
|
116
116
|
ensureHfIds,
|
|
117
117
|
stampHfIdsInPlace,
|
|
118
118
|
stripSdrPngColourTags
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-JFIBO4CZ.js";
|
|
120
120
|
import {
|
|
121
121
|
PREVIEW_PROXY_BOX_PARAM,
|
|
122
122
|
PREVIEW_PROXY_LIGHT_PARAM,
|
|
@@ -128,7 +128,7 @@ import {
|
|
|
128
128
|
fpsToNumber,
|
|
129
129
|
parseFps,
|
|
130
130
|
parsePreviewProxyBox
|
|
131
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-6JMNJYYR.js";
|
|
132
132
|
import {
|
|
133
133
|
GSAP_BASE_URL_META,
|
|
134
134
|
gsapCdnDist,
|
|
@@ -150,7 +150,7 @@ import {
|
|
|
150
150
|
resolveRateSpec,
|
|
151
151
|
sourceTimeAt,
|
|
152
152
|
stripEmbeddedRuntimeScripts
|
|
153
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-TNWWLO4T.js";
|
|
154
154
|
import {
|
|
155
155
|
ProjectRootMissingError,
|
|
156
156
|
folderGone,
|
|
@@ -5617,7 +5617,7 @@ async function prepareGsapMutationScript(c, res, firstMutation) {
|
|
|
5617
5617
|
let block = extractGsapScriptBlock(html);
|
|
5618
5618
|
if (!block && (firstMutation.type === "add" || firstMutation.type === "add-with-keyframes")) {
|
|
5619
5619
|
const compId = html.match(/data-composition-id="([^"]+)"/)?.[1] ?? "main";
|
|
5620
|
-
const { GSAP_CDN } = await import("./dist-
|
|
5620
|
+
const { GSAP_CDN } = await import("./dist-XRAW3URT.js");
|
|
5621
5621
|
const bootstrap = [
|
|
5622
5622
|
`<script src="${GSAP_CDN}"></script>`,
|
|
5623
5623
|
"<script>",
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
renderFrameIdForRenderId,
|
|
43
43
|
resolveAuthoredTimingWindow,
|
|
44
44
|
toFps
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-6JMNJYYR.js";
|
|
46
46
|
import {
|
|
47
47
|
AUDIO_GROUP_RENDER_ID_ATTR,
|
|
48
48
|
AUTHORED_SOURCE_BEGIN,
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
sourceTimeAt,
|
|
86
86
|
timeAtSourceTime,
|
|
87
87
|
volumeSegmentSampleCount
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-TNWWLO4T.js";
|
|
89
89
|
import {
|
|
90
90
|
redactTelemetryString,
|
|
91
91
|
redactUrlQueryStrings
|
|
@@ -331,6 +331,7 @@ var DEFAULT_CONFIG = {
|
|
|
331
331
|
videoLayerPassthrough: false,
|
|
332
332
|
useDrawElement: true,
|
|
333
333
|
enableDrawElementWorkerEncode: true,
|
|
334
|
+
useInPageEncode: false,
|
|
334
335
|
// Auto-detected per host in `resolveConfig`; defaults off for the raw
|
|
335
336
|
// DEFAULT_CONFIG (used directly by tests and worker-sizing fallbacks).
|
|
336
337
|
lowMemoryMode: false,
|
|
@@ -375,6 +376,7 @@ var BOOLEAN_ENGINE_CONFIG_FIELDS = [
|
|
|
375
376
|
"videoLayerPassthrough",
|
|
376
377
|
"useDrawElement",
|
|
377
378
|
"enableDrawElementWorkerEncode",
|
|
379
|
+
"useInPageEncode",
|
|
378
380
|
"lowMemoryMode",
|
|
379
381
|
"enablePageSideCompositing",
|
|
380
382
|
"enableChunkedEncode",
|
|
@@ -650,6 +652,7 @@ function resolveConfig(overrides) {
|
|
|
650
652
|
"HF_DE_WORKER_ENCODE",
|
|
651
653
|
DEFAULT_CONFIG.enableDrawElementWorkerEncode
|
|
652
654
|
),
|
|
655
|
+
useInPageEncode: envBool("HF_INPAGE_ENCODE", DEFAULT_CONFIG.useInPageEncode),
|
|
653
656
|
lowMemoryMode: resolveLowMemoryMode(),
|
|
654
657
|
enablePageSideCompositing: envBool(
|
|
655
658
|
"HF_PAGE_SIDE_COMPOSITING",
|
|
@@ -3802,6 +3805,9 @@ async function probeBeginFrameLiveness(page, timeoutMs, frameTimeTicks, interval
|
|
|
3802
3805
|
}
|
|
3803
3806
|
}
|
|
3804
3807
|
var lastFrameCache = /* @__PURE__ */ new WeakMap();
|
|
3808
|
+
function forgetBeginFrameCapture(page) {
|
|
3809
|
+
lastFrameCache.delete(page);
|
|
3810
|
+
}
|
|
3805
3811
|
var PENDING_FRAME_RETRIES = 5;
|
|
3806
3812
|
async function sendBeginFrame(client, params) {
|
|
3807
3813
|
for (let attempt = 0; ; attempt++) {
|
|
@@ -3831,13 +3837,24 @@ async function beginFrameCapture(page, options, frameTimeTicks, interval) {
|
|
|
3831
3837
|
quality: isPng ? void 0 : options.quality ?? 80,
|
|
3832
3838
|
optimizeForSpeed: true
|
|
3833
3839
|
};
|
|
3834
|
-
const
|
|
3840
|
+
const cached = lastFrameCache.get(page);
|
|
3841
|
+
let screenshotTicks = frameTimeTicks;
|
|
3842
|
+
if (cached) {
|
|
3843
|
+
const probe = await sendBeginFrame(client, { frameTimeTicks, interval });
|
|
3844
|
+
if (!probe.hasDamage) return { buffer: cached, hasDamage: false };
|
|
3845
|
+
screenshotTicks = frameTimeTicks + interval / 2;
|
|
3846
|
+
}
|
|
3847
|
+
const result = await sendBeginFrame(client, {
|
|
3848
|
+
frameTimeTicks: screenshotTicks,
|
|
3849
|
+
interval,
|
|
3850
|
+
screenshot,
|
|
3851
|
+
noDisplayUpdates: cached !== void 0
|
|
3852
|
+
});
|
|
3835
3853
|
let buffer;
|
|
3836
3854
|
if (result.screenshotData) {
|
|
3837
3855
|
buffer = Buffer.from(result.screenshotData, "base64");
|
|
3838
3856
|
lastFrameCache.set(page, buffer);
|
|
3839
3857
|
} else {
|
|
3840
|
-
const cached = lastFrameCache.get(page);
|
|
3841
3858
|
if (cached) {
|
|
3842
3859
|
buffer = cached;
|
|
3843
3860
|
} else {
|
|
@@ -7976,6 +7993,7 @@ async function captureFrameSurface(session, frameIndex, time, seekOptions, heldV
|
|
|
7976
7993
|
interval: session.beginFrameIntervalMs,
|
|
7977
7994
|
noDisplayUpdates: false
|
|
7978
7995
|
});
|
|
7996
|
+
forgetBeginFrameCapture(page);
|
|
7979
7997
|
session.beginFrameSeekPresented = true;
|
|
7980
7998
|
}
|
|
7981
7999
|
const result = await beginFrameCapture(
|
|
@@ -11342,14 +11360,29 @@ function buildStreamingArgs(options, outputPath, gpuEncoder = null, nvencPresets
|
|
|
11342
11360
|
return args;
|
|
11343
11361
|
}
|
|
11344
11362
|
async function spawnStreamingEncoder(outputPath, options, signal, config) {
|
|
11345
|
-
const outputDir = dirname3(outputPath);
|
|
11346
|
-
if (!existsSync6(outputDir)) mkdirSync3(outputDir, { recursive: true });
|
|
11347
11363
|
let gpuEncoder = null;
|
|
11348
11364
|
if (options.useGpu) {
|
|
11349
11365
|
gpuEncoder = await getCachedGpuEncoder();
|
|
11350
11366
|
}
|
|
11351
11367
|
const nvencPresets = gpuEncoder === "nvenc" ? await getCachedNvencPresets() : void 0;
|
|
11352
11368
|
const args = buildStreamingArgs(options, outputPath, gpuEncoder, nvencPresets);
|
|
11369
|
+
const checksJpeg = !options.rawInputFormat && (options.imageFormat ?? "jpeg") === "jpeg";
|
|
11370
|
+
return spawnFfmpegStream(outputPath, args, {
|
|
11371
|
+
signal,
|
|
11372
|
+
config,
|
|
11373
|
+
checkFrame: checksJpeg ? (frame, index) => {
|
|
11374
|
+
const error = jpegInputError(frame);
|
|
11375
|
+
if (error) throw new Error(`Invalid JPEG input at frame ${index}: ${error}`);
|
|
11376
|
+
} : void 0
|
|
11377
|
+
});
|
|
11378
|
+
}
|
|
11379
|
+
function spawnFfmpegStream(outputPath, args, {
|
|
11380
|
+
signal,
|
|
11381
|
+
config,
|
|
11382
|
+
checkFrame
|
|
11383
|
+
}) {
|
|
11384
|
+
const outputDir = dirname3(outputPath);
|
|
11385
|
+
if (!existsSync6(outputDir)) mkdirSync3(outputDir, { recursive: true });
|
|
11353
11386
|
const ffmpeg = spawn5(getFfmpegBinary(), args, {
|
|
11354
11387
|
stdio: ["pipe", "pipe", "pipe"],
|
|
11355
11388
|
// See runFfmpeg.ts: keeps a console window off the user's desktop on Windows.
|
|
@@ -11422,10 +11455,7 @@ async function spawnStreamingEncoder(outputPath, options, signal, config) {
|
|
|
11422
11455
|
return false;
|
|
11423
11456
|
}
|
|
11424
11457
|
const copy = Buffer.from(buffer);
|
|
11425
|
-
|
|
11426
|
-
const error = jpegInputError(copy);
|
|
11427
|
-
if (error) throw new Error(`Invalid JPEG input at frame ${inputFrameIndex}: ${error}`);
|
|
11428
|
-
}
|
|
11458
|
+
checkFrame?.(copy, inputFrameIndex);
|
|
11429
11459
|
const accepted = stdin.write(copy);
|
|
11430
11460
|
inputFrameIndex++;
|
|
11431
11461
|
if (accepted) {
|
|
@@ -11499,6 +11529,56 @@ FFmpeg stopped after ${streamingTimeout} ms without consuming a frame.` : "";
|
|
|
11499
11529
|
return encoder;
|
|
11500
11530
|
}
|
|
11501
11531
|
|
|
11532
|
+
// ../engine/src/services/chunkStreamingEncoder.ts
|
|
11533
|
+
var BT709_LIMITED = {
|
|
11534
|
+
primaries: 1,
|
|
11535
|
+
transfer: 1,
|
|
11536
|
+
matrix: 1,
|
|
11537
|
+
fullRange: false
|
|
11538
|
+
};
|
|
11539
|
+
function buildChunkStreamingArgs(options, outputPath) {
|
|
11540
|
+
const { primaries, transfer, matrix, fullRange } = options.colour ?? BT709_LIMITED;
|
|
11541
|
+
const vui = [
|
|
11542
|
+
`colour_primaries=${primaries}`,
|
|
11543
|
+
`transfer_characteristics=${transfer}`,
|
|
11544
|
+
`matrix_coefficients=${matrix}`,
|
|
11545
|
+
`video_full_range_flag=${fullRange ? 1 : 0}`
|
|
11546
|
+
].join(":");
|
|
11547
|
+
const args = ["-f", "h264", "-framerate", fpsToFfmpegArg(options.fps), "-i", "-"];
|
|
11548
|
+
args.push("-c:v", "copy", "-bsf:v", `h264_metadata=${vui}`);
|
|
11549
|
+
args.push(
|
|
11550
|
+
...["-colorspace:v", "bt709", "-color_primaries:v", "bt709", "-color_trc:v", "bt709"],
|
|
11551
|
+
...["-color_range", fullRange ? "pc" : "tv"],
|
|
11552
|
+
...["-video_track_timescale", "90000", "-avoid_negative_ts", "make_zero"]
|
|
11553
|
+
);
|
|
11554
|
+
appendRenderProvenanceArgs(args, outputPath);
|
|
11555
|
+
args.push("-y", outputPath);
|
|
11556
|
+
return args;
|
|
11557
|
+
}
|
|
11558
|
+
function spawnChunkStreamingEncoder(outputPath, options, signal, config) {
|
|
11559
|
+
return spawnFfmpegStream(outputPath, buildChunkStreamingArgs(options, outputPath), {
|
|
11560
|
+
signal,
|
|
11561
|
+
config
|
|
11562
|
+
});
|
|
11563
|
+
}
|
|
11564
|
+
|
|
11565
|
+
// ../engine/src/services/inPageEncodeEligibility.ts
|
|
11566
|
+
function resolveInPageEncode(input) {
|
|
11567
|
+
const blocker = [
|
|
11568
|
+
[!input.enabled, "disabled"],
|
|
11569
|
+
[input.captureMode !== "drawelement", "capture is not drawElement"],
|
|
11570
|
+
[input.format !== "mp4", "output is not mp4"],
|
|
11571
|
+
[input.codec !== "h264", "codec is not h264"],
|
|
11572
|
+
[input.hdr, "hdr"],
|
|
11573
|
+
[input.transparent, "transparent"],
|
|
11574
|
+
[input.workers !== 1, "parallel workers"],
|
|
11575
|
+
[input.hls, "hls"],
|
|
11576
|
+
[input.videoLayer, "video layer passthrough"],
|
|
11577
|
+
[!input.encoderSupported, "page encoder unsupported"]
|
|
11578
|
+
].find(([blocked]) => blocked);
|
|
11579
|
+
return blocker ? { eligible: false, reason: blocker[1] } : { eligible: true };
|
|
11580
|
+
}
|
|
11581
|
+
|
|
11502
11582
|
// ../core/dist/audioGroups.js
|
|
11503
11583
|
var HF_AUDIO_GROUP_TAG = "hf-audio-group";
|
|
11504
11584
|
var HF_AUDIO_GROUP_ATTR = "data-audio-group";
|
|
@@ -19523,6 +19603,10 @@ export {
|
|
|
19523
19603
|
applyFaststart,
|
|
19524
19604
|
createFrameReorderBuffer,
|
|
19525
19605
|
spawnStreamingEncoder,
|
|
19606
|
+
BT709_LIMITED,
|
|
19607
|
+
buildChunkStreamingArgs,
|
|
19608
|
+
spawnChunkStreamingEncoder,
|
|
19609
|
+
resolveInPageEncode,
|
|
19526
19610
|
HF_AUDIO_GROUP_TAG,
|
|
19527
19611
|
HF_AUDIO_GROUP_ATTR,
|
|
19528
19612
|
isSelfOrAncestorHidden,
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
parseNumbers,
|
|
11
11
|
parseRoi,
|
|
12
12
|
probeVideo
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-2KO357TJ.js";
|
|
14
14
|
import {
|
|
15
15
|
c
|
|
16
16
|
} from "./chunk-2GICKZ3I.js";
|
|
17
17
|
import {
|
|
18
18
|
withMeta
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-L6MNWJTL.js";
|
|
20
20
|
import {
|
|
21
21
|
failCommand
|
|
22
22
|
} from "./chunk-66W5IWLO.js";
|
|
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
VERSION
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ODKXNWDL.js";
|
|
10
10
|
|
|
11
11
|
// src/registry/compatibility.ts
|
|
12
12
|
import { compareVersions } from "compare-versions";
|