hyperframes 0.8.225 → 0.8.226
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-ZGNY2AXJ.js → add-3NBOSGKQ.js} +12 -12
- package/dist/{agentPromptGenerator-GG4FFZH7.js → agentPromptGenerator-GQSDTAV5.js} +7 -7
- package/dist/{animatedGifPrep-NVDUG2CD.js → animatedGifPrep-UXFFDGA7.js} +7 -7
- package/dist/api.js +23 -23
- package/dist/{asset-UC3OQBB3.js → asset-VQVAYC7E.js} +2 -2
- package/dist/{assetCataloger-WQTNJMZU.js → assetCataloger-C6KNE2IQ.js} +8 -8
- package/dist/{audio-T6RWZHAA.js → audio-2KULGXHA.js} +17 -17
- package/dist/{auth-FSXEGF3B.js → auth-QNMLPJOW.js} +5 -5
- package/dist/{autoUpdate-LOBHDWAA.js → autoUpdate-VFQQ47UD.js} +2 -2
- package/dist/{backgroundChecks-RBFWIWBP.js → backgroundChecks-SSQ2U3ZY.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-LDZ6NO2X.js → batchRender-Y45PZC3Q.js} +3 -3
- package/dist/{beats-WFPPVM6N.js → beats-YSJT4NUG.js} +10 -10
- package/dist/{benchmark-7MYD5S26.js → benchmark-6UOMMUXF.js} +9 -9
- package/dist/{billing-2BJTLFDX.js → billing-WNOAP6KO.js} +4 -4
- package/dist/{browser-6C4IDYQE.js → browser-GM4ZTCRQ.js} +4 -4
- package/dist/{bundleWithLocalizedFonts-ARTT664T.js → bundleWithLocalizedFonts-CUTSKVRK.js} +2 -2
- package/dist/{capture-TWZ5DQHP.js → capture-J24XSJTZ.js} +17 -17
- package/dist/{capture-7TFC65RN.js → capture-SZ65WG5Z.js} +3 -3
- package/dist/{captureCompositionFrame-EMP6R3F6.js → captureCompositionFrame-5UUXIOF2.js} +13 -12
- package/dist/{catalog-W4RJO4FE.js → catalog-5EQFE3BC.js} +12 -12
- package/dist/{catch-up-OOCJH3O6.js → catch-up-ASBRKHDL.js} +5 -5
- package/dist/{check-BPPHG2CF.js → check-BA4SSXPY.js} +39 -38
- package/dist/{checkAudio-QEGCKX2V.js → checkAudio-TU4GPHIR.js} +10 -10
- package/dist/{checkBrowser-4JDYYAVA.js → checkBrowser-27SFNNPD.js} +33 -32
- package/dist/chunk-262C25DQ.js +31 -0
- package/dist/{chunk-AKMY4QVI.js → chunk-2GTFW4MK.js} +9 -1
- package/dist/{chunk-4A643C3B.js → chunk-2IQONCMF.js} +7 -7
- package/dist/{chunk-OZMZFJDW.js → chunk-2JBCK6DX.js} +1 -1
- package/dist/{chunk-TRPNLI6V.js → chunk-35LAWHTD.js} +23 -6
- package/dist/{chunk-LWTT7I7X.js → chunk-37PS2IPO.js} +1 -1
- package/dist/{chunk-SIYDHVN2.js → chunk-3V3XMQEF.js} +1 -1
- package/dist/{chunk-7RTPHNOO.js → chunk-3XYDZQJF.js} +7 -4
- package/dist/{chunk-BEMGUGGJ.js → chunk-3ZWUNOTS.js} +1 -1
- package/dist/{chunk-RR5QE7DB.js → chunk-4XYLQYUE.js} +18 -14
- package/dist/{chunk-Z7GIHPAZ.js → chunk-53ZOVLGJ.js} +2 -2
- package/dist/{chunk-WQCVZEXH.js → chunk-5TXYCG4M.js} +6 -6
- package/dist/{chunk-2YZD6CAF.js → chunk-5X65O5WM.js} +10 -3
- package/dist/{chunk-ADOBHVHW.js → chunk-6AEHVBMX.js} +2 -2
- package/dist/{chunk-G6Z47UQP.js → chunk-6CU2ZQGW.js} +26 -13
- package/dist/{chunk-EECV7SDN.js → chunk-6EQSJ7MT.js} +1 -1
- package/dist/{chunk-VLA6UJGH.js → chunk-6NJVSTSY.js} +5 -6
- package/dist/{chunk-ACUVSKUI.js → chunk-76N526VX.js} +13 -13
- package/dist/{chunk-KDF67KEB.js → chunk-7LUZ4RQX.js} +13 -13
- package/dist/{chunk-5HGS5MGD.js → chunk-7UKRCWBO.js} +271 -122
- package/dist/{chunk-GE4ABM5K.js → chunk-7WNPWUJP.js} +3 -3
- package/dist/{chunk-3HRQI6LJ.js → chunk-A23K6P7L.js} +1 -1
- package/dist/{chunk-GZPGTGRV.js → chunk-ABNPD4NF.js} +1 -1
- package/dist/{chunk-M4NN4AHH.js → chunk-AMTAKSKJ.js} +9 -9
- package/dist/{chunk-UCPEABYK.js → chunk-APCGOECM.js} +2 -2
- package/dist/{chunk-CGX4EOGT.js → chunk-B243Y7MM.js} +3 -3
- package/dist/{chunk-A25SCSOK.js → chunk-B52P2FU2.js} +1 -1
- package/dist/{chunk-BTDKWWND.js → chunk-B7OI3WAR.js} +1 -1
- package/dist/{chunk-4Z2SU2VC.js → chunk-BD2CQDXP.js} +18 -18
- package/dist/{chunk-4K6AS5TX.js → chunk-BJ3Q3XK7.js} +313 -149
- package/dist/{chunk-SVGHIMPQ.js → chunk-CRIVUWLA.js} +2 -2
- package/dist/{chunk-2EH3WQCS.js → chunk-CU3SVSKX.js} +5 -5
- package/dist/{chunk-3E2BO3L3.js → chunk-DGQOBTFQ.js} +1 -1
- package/dist/{chunk-IJWDVOIO.js → chunk-DW7W4J7D.js} +2 -2
- package/dist/{chunk-IB7I5IEC.js → chunk-EJEHDDVX.js} +1 -1
- package/dist/{chunk-35NDLXHZ.js → chunk-EQGBGOQQ.js} +9 -9
- package/dist/{chunk-HW6HTTBZ.js → chunk-ETH6WXKZ.js} +1 -1
- package/dist/{chunk-T5KG6H6L.js → chunk-EYDV3MHA.js} +7 -7
- package/dist/{chunk-UBH2R663.js → chunk-GADKBSZ5.js} +2 -2
- package/dist/{chunk-HT3D5AKG.js → chunk-GR2T3BOX.js} +6 -5
- package/dist/{chunk-X5BSSPC2.js → chunk-GUJ45PRX.js} +1 -1
- package/dist/chunk-HSXV7QPC.js +177 -0
- package/dist/{chunk-AMQFGICP.js → chunk-HYB3WSJL.js} +1 -1
- package/dist/{chunk-O3MGHHJO.js → chunk-JE5ZPFN2.js} +3 -3
- package/dist/{chunk-GI42ZB52.js → chunk-JIYNPDH6.js} +1 -1
- package/dist/{chunk-RDLJSUI4.js → chunk-KQARKGEJ.js} +16 -11
- package/dist/{chunk-G45NYKSM.js → chunk-LVV5EUSO.js} +3 -3
- package/dist/{chunk-NLELDFX7.js → chunk-MF6KVPWF.js} +3 -3
- package/dist/{chunk-6IV2N527.js → chunk-MWQNQA77.js} +2 -2
- package/dist/{chunk-BKHBSFEO.js → chunk-OMT75FQI.js} +3 -2
- package/dist/{chunk-AF3EN5XS.js → chunk-OQYGHP3E.js} +1 -1
- package/dist/{chunk-EQFDOQTG.js → chunk-OSCRZUEB.js} +1 -1
- package/dist/{chunk-E47ZWDMH.js → chunk-P7TDUSPH.js} +1 -1
- package/dist/{chunk-Y5OSQXGZ.js → chunk-PCH3O6I6.js} +5 -5
- package/dist/{chunk-R6JPOEDZ.js → chunk-PHUTMTHB.js} +1 -1
- package/dist/{chunk-UBXKKXXR.js → chunk-PVBSCPZI.js} +3 -3
- package/dist/{chunk-EEBIHQF2.js → chunk-PWHOMCFB.js} +2 -2
- package/dist/{chunk-XM5KYLIE.js → chunk-PXSCN6X5.js} +4 -4
- package/dist/{chunk-FPWCICAI.js → chunk-PZ6VVOOE.js} +1 -1
- package/dist/{chunk-K73PYNON.js → chunk-QSWUM7WR.js} +2 -5
- package/dist/{chunk-SXHSNLEC.js → chunk-RBYSMHB7.js} +1 -1
- package/dist/{chunk-UZ5AWZCA.js → chunk-RKDMYKGL.js} +1 -1
- package/dist/{chunk-3XQQLL3G.js → chunk-RRT5S42U.js} +1 -1
- package/dist/{chunk-Z57RQBIA.js → chunk-S4UDVFAN.js} +3 -3
- package/dist/{chunk-KEDN4LSV.js → chunk-TFJSU4IV.js} +2 -2
- package/dist/{chunk-4VTXUGDR.js → chunk-U6LQ4BTL.js} +1 -1
- package/dist/{chunk-CXVFPIOM.js → chunk-UIJLEBHQ.js} +1 -1
- package/dist/{chunk-5KADQQ6S.js → chunk-UXHGYMX4.js} +1 -1
- package/dist/{chunk-W464PHF3.js → chunk-V2N747YM.js} +7 -7
- package/dist/{chunk-QOYZ3U6G.js → chunk-V4SD6HQ6.js} +2 -3
- package/dist/{chunk-M3WOI7BU.js → chunk-VB77RRT7.js} +1 -1
- package/dist/{chunk-IORJ42GY.js → chunk-VUDMPRZN.js} +5 -6
- package/dist/{chunk-5I6XEO4W.js → chunk-WESIEW2M.js} +3 -25
- package/dist/{chunk-HMS6UHUW.js → chunk-WGVREWKN.js} +2 -2
- package/dist/{chunk-FJ3KUOUZ.js → chunk-XCGPPU32.js} +1 -1
- package/dist/{chunk-EIIMWDZW.js → chunk-XDTRM4OS.js} +4 -4
- package/dist/{chunk-LZB5AHFD.js → chunk-XH7SSJSQ.js} +1 -1
- package/dist/chunk-XINVBLXA.js +5030 -0
- package/dist/{chunk-7HSV5SJ4.js → chunk-XOFJZ3UG.js} +1 -1
- package/dist/{chunk-VHL26GNQ.js → chunk-Y2NSHQVE.js} +2 -2
- package/dist/{chunk-PICDT6ZW.js → chunk-YTQSLNIA.js} +1 -1
- package/dist/{chunk-KVBOJJ5R.js → chunk-Z257R7TN.js} +1 -1
- package/dist/{chunk-ZGQC6IU7.js → chunk-ZI64CTVC.js} +1 -1
- package/dist/{chunk-UQWOOANM.js → chunk-ZJE2XWQC.js} +2 -2
- package/dist/{chunk-652ERUZD.js → chunk-ZNXUM4D2.js} +2 -2
- package/dist/{clean-XWDDXLRP.js → clean-X5VL4ILR.js} +17 -17
- package/dist/cli.js +57 -57
- package/dist/{cloud-SETWVGKH.js → cloud-4GUUYRD3.js} +4 -4
- package/dist/{cloudrun-RHPVVXCR.js → cloudrun-KPL32MBI.js} +4 -4
- package/dist/{compare-FWMFV7A7.js → compare-CVEB5SQC.js} +30 -29
- package/dist/{compiler-SKRY6FPA.js → compiler-RRTQNBUH.js} +4 -4
- package/dist/{component-HGEIXY3U.js → component-TZ2SIYOX.js} +3 -3
- package/dist/{compositions-2TXJLBWE.js → compositions-KRTRDV72.js} +12 -12
- package/dist/{curve-SSFKIA2L.js → curve-ZXUAGU4T.js} +11 -11
- package/dist/{cuts-BWXHTOOP.js → cuts-GY2K2CTK.js} +20 -15
- package/dist/{delete-F5RDWZEJ.js → delete-ZT4FCUX2.js} +6 -6
- package/dist/{deploy-OH4SMYTG.js → deploy-DVKSQTC7.js} +1 -1
- package/dist/{describeProject-B7H4T5PW.js → describeProject-L4ZW5CI7.js} +8 -8
- package/dist/{diff-6JFFTFKR.js → diff-AFOP2B3Y.js} +89 -229
- package/dist/{dist-24QQO5IL.js → dist-DCP77RWC.js} +2 -2
- package/dist/{dist-YEYUGCOR.js → dist-DPOLFG5U.js} +2 -2
- package/dist/{doctor-XQCZB5BY.js → doctor-Y7YVL34W.js} +11 -11
- package/dist/{energy-MEMYSTFT.js → energy-YFLFELFX.js} +12 -12
- package/dist/{events-U6PXJI34.js → events-C5QV2MQG.js} +3 -3
- package/dist/{events-ZU2ATKWK.js → events-THASMGN6.js} +14 -14
- package/dist/{events-T7OLH6MW.js → events-VL7JKI2K.js} +4 -4
- package/dist/{extract-25TUTGCA.js → extract-GTNBVQ63.js} +15 -19
- package/dist/{face-KMLYOE5H.js → face-BSRKCB5W.js} +12 -12
- package/dist/{feedback-FE7GQTBH.js → feedback-MCQ2FKCC.js} +11 -11
- package/dist/{ffmpeg-CXYPYIZK.js → ffmpeg-3QNN3TQ5.js} +7 -7
- package/dist/{figma-QMKU7M7T.js → figma-IGXE3KWU.js} +3 -3
- package/dist/fontLocalizeCli.js +10 -10
- package/dist/{frames-2NPBO6LB.js → frames-XIFLB5KC.js} +13 -13
- package/dist/{generate-I6E3V7PU.js → generate-55FZPR3J.js} +18 -18
- package/dist/{get-JJWBP5NB.js → get-2MHD7XFA.js} +6 -6
- package/dist/{gpuPolicy-2OMDU74V.js → gpuPolicy-REJFNHWD.js} +7 -7
- package/dist/{grade-compare-QCA3VIKQ.js → grade-compare-CM45H7CR.js} +31 -30
- package/dist/{heifImagePrep-P53GG4GF.js → heifImagePrep-O3UZHGWR.js} +8 -8
- package/dist/{help-COSONWFD.js → help-V2GGIKP2.js} +1 -1
- package/dist/{history-CWKF5AXI.js → history-NUOQVUNY.js} +7 -7
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +67 -67
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/{info-SD74Y6V5.js → info-5CMRZEJA.js} +8 -8
- package/dist/{init-XAYQNTVF.js → init-JNL5R27I.js} +28 -28
- package/dist/ink-HGQUC6L3.js +148 -0
- package/dist/{inspect-Y5IIQBIW.js → inspect-GGOCM324.js} +31 -30
- package/dist/{installer-NQA4KXRP.js → installer-BBY3T5MJ.js} +4 -4
- package/dist/{keyframes-MNPCJZYU.js → keyframes-2D4ZS6HE.js} +8 -8
- package/dist/{lambda-PMI6IDVN.js → lambda-TY2ZCPEN.js} +11 -11
- package/dist/{layout-6IM6R6LX.js → layout-X5GT4O2L.js} +31 -30
- package/dist/{lint-6VUHVHFF.js → lint-NVOUXE2L.js} +9 -9
- package/dist/{lintProject-6H64SX3V.js → lintProject-54CNQ4HT.js} +2 -2
- package/dist/{list-XXTAS744.js → list-CB4UDTID.js} +6 -6
- package/dist/{localPage-2UHUS6LM.js → localPage-EYPZRIGY.js} +7 -7
- package/dist/{login-KM3LPYQ7.js → login-L7JTVKV5.js} +7 -7
- package/dist/{logout-LHTQV2BZ.js → logout-6CEIH4HW.js} +3 -3
- package/dist/{look-3CD3ZSXY.js → look-VHQA2JSS.js} +12 -12
- package/dist/{manager-C6GVT3EI.js → manager-FGQKQMI7.js} +8 -8
- package/dist/{measure-DWZX4YAK.js → measure-5F7QZLO5.js} +12 -11
- package/dist/{media-treatment-IIUPGQIX.js → media-treatment-RRFIZKSA.js} +14 -14
- package/dist/{media-use-HLHUEFDK.js → media-use-5YGFOFKI.js} +3 -3
- package/dist/{models-IWHY5V6N.js → models-5B2RGGBT.js} +11 -11
- package/dist/{motionShot-4NKHFUS7.js → motionShot-JJBQLYCC.js} +16 -15
- package/dist/{normalize-audio-M2RS5Q23.js → normalize-audio-LWTNZWDJ.js} +10 -10
- package/dist/{open-U7CCHUBO.js → open-PGRJXREV.js} +12 -12
- package/dist/{parakeetRunner-ZHG3S6GY.js → parakeetRunner-OV4NSPB3.js} +12 -12
- package/dist/{pipeline-66JR7EC7.js → pipeline-HXGPFQZC.js} +10 -10
- package/dist/{play-5COR53D2.js → play-JONX6CIM.js} +21 -21
- package/dist/{preflight-OKAO5NPW.js → preflight-7OKMMUWG.js} +8 -8
- package/dist/{present-YKFQC22R.js → present-EHU52MSU.js} +17 -17
- package/dist/{preview-3YNKJZME.js → preview-DCEIITM6.js} +19 -19
- package/dist/{probe-QMPDGKU5.js → probe-EA4N3WOT.js} +11 -11
- package/dist/{producer-WBVDP3IV.js → producer-FGAOUR7O.js} +1 -1
- package/dist/{projectConfig-UI4NZDN7.js → projectConfig-N3ZRVJKB.js} +6 -6
- package/dist/{publication-VPJZQCLA.js → publication-ZKY2LVN5.js} +2 -2
- package/dist/{publish-7RA2MK2M.js → publish-RZVDFTBX.js} +15 -15
- package/dist/{refresh-AM2ULRRV.js → refresh-MQTO43RB.js} +3 -3
- package/dist/{remove-background-ELC7V7KT.js → remove-background-V5UXYPJS.js} +11 -11
- package/dist/{render-WH7MPRZD.js → render-NEZLBRAY.js} +37 -35
- package/dist/{render-IYV73CG6.js → render-UJCPQXGB.js} +5 -5
- package/dist/{render-R7E7TTNE.js → render-YZSDHP3U.js} +60 -27
- package/dist/{render-batch-IN2ZXPS7.js → render-batch-KPGYARDI.js} +5 -5
- package/dist/renderSetupWorker.js +2 -2
- package/dist/{resolver-DIXFK5ZR.js → resolver-HWNPLSXK.js} +4 -4
- package/dist/{run-MCVU7AZX.js → run-OJ2GBYKB.js} +4 -4
- package/dist/{sherpa-FP6HX5KK.js → sherpa-HSBYKUQC.js} +11 -11
- package/dist/skills/media-use/audio/scripts/lib/heygen.mjs +3 -9
- package/dist/skills/media-use/audio/scripts/lib/heygen.test.mjs +6 -4
- package/dist/skills/media-use/scripts/lib/logo-provider.mjs +8 -3
- package/dist/skills/media-use/scripts/lib/logo-provider.test.mjs +14 -0
- package/dist/skills/media-use/scripts/resolve.mjs +11 -5
- package/dist/{skills-JLNDM2KP.js → skills-CW23U675.js} +6 -6
- package/dist/{skillsUpdateCheck-WS5M25TN.js → skillsUpdateCheck-LGBNNYLI.js} +3 -3
- package/dist/{snapshot-VPN6GA7U.js → snapshot-RK7ED6DW.js} +47 -38
- package/dist/{src-AP7B27MZ.js → src-KORQVG7O.js} +10 -6
- package/dist/{src-RGQFYVHO.js → src-ZDLQFZ4B.js} +9 -9
- package/dist/{staticProjectServer-YA6XOSFY.js → staticProjectServer-TFWT5G2L.js} +18 -18
- package/dist/{status-Y5ZBFJ53.js → status-6WAZ5EBM.js} +5 -5
- package/dist/studio/assets/{hyperframes-player-Do2ZF6Lp.js → hyperframes-player-qeY0knUZ.js} +3 -3
- package/dist/studio/assets/{index-CK4_IJ8G.js → index-B9O4nOYD.js} +1 -1
- package/dist/studio/assets/{index-Dxb7fTWf.js → index-BhZkOhf2.js} +174 -174
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-57E36S5N.js → studio-api-OIZEPWHS.js} +10 -10
- package/dist/{studioServer-EVMF3HHL.js → studioServer-62MG7LJR.js} +50 -49
- package/dist/{sync-ASUBSVGQ.js → sync-Q3XYLXTX.js} +12 -12
- package/dist/{telemetry-YON45KT4.js → telemetry-3YDPEGQK.js} +4 -4
- package/dist/{timeline-OQWDGV7L.js → timeline-VDLKFZZ7.js} +19 -19
- package/dist/{tokens-NMPY673W.js → tokens-ZZ4G2VKC.js} +2 -2
- package/dist/{transcribe-HSYXT5TZ.js → transcribe-2D6UIVAE.js} +10 -10
- package/dist/{transcribe-C6FKVSRR.js → transcribe-OYRCZUZM.js} +22 -22
- package/dist/{updateCheck-B7PAAPCJ.js → updateCheck-ZRG5DR74.js} +2 -2
- package/dist/{upgrade-BOECDD5S.js → upgrade-ZU6BHCTC.js} +2 -2
- package/dist/{urlDownloader-KC2SS457.js → urlDownloader-5WPUC6C6.js} +6 -6
- package/dist/{validate-LEEBUIIH.js → validate-OZRPF6YZ.js} +25 -24
- package/dist/{video-JJAEISDH.js → video-N2KXXYS3.js} +8 -8
- package/dist/warmCheck.js +39 -38
- package/package.json +1 -1
- package/dist/chunk-6UWSEXQ3.js +0 -5030
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
Semaphore,
|
|
9
9
|
prepareHeifImageInputs,
|
|
10
10
|
withMediaProbeSlot
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CRIVUWLA.js";
|
|
12
12
|
import {
|
|
13
13
|
EncoderInterruptedError,
|
|
14
14
|
encoderFailureError,
|
|
15
15
|
prepareAnimatedGifInputs
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WGVREWKN.js";
|
|
17
17
|
import {
|
|
18
18
|
GENERIC_FAMILIES,
|
|
19
19
|
collectFontFamilyCustomProperties,
|
|
@@ -61,6 +61,7 @@ import {
|
|
|
61
61
|
blitRgb48leAffine,
|
|
62
62
|
blitRgb48leRegion,
|
|
63
63
|
blitRgba8OverRgb48le,
|
|
64
|
+
buildVideoLayerInput,
|
|
64
65
|
calculateOptimalWorkers,
|
|
65
66
|
captureAlphaPng,
|
|
66
67
|
captureFrame,
|
|
@@ -148,8 +149,10 @@ import {
|
|
|
148
149
|
probeMediaProfile,
|
|
149
150
|
processCompositionAudio,
|
|
150
151
|
psnrDb,
|
|
152
|
+
qualifyVideoLayer,
|
|
151
153
|
queryElementStacking,
|
|
152
154
|
readWebGlVendorInfoFromCanvas,
|
|
155
|
+
rebaseVideoToWindow,
|
|
153
156
|
recaptureDrawElementFrameForVerify,
|
|
154
157
|
removeDomLayerMask,
|
|
155
158
|
resampleRgb48leObjectFit,
|
|
@@ -176,7 +179,7 @@ import {
|
|
|
176
179
|
videoAudioId,
|
|
177
180
|
videoStartOnMediaTimeline,
|
|
178
181
|
writeCapturedFrame
|
|
179
|
-
} from "./chunk-
|
|
182
|
+
} from "./chunk-7UKRCWBO.js";
|
|
180
183
|
import {
|
|
181
184
|
assignBundledRuntimeCompositionIds,
|
|
182
185
|
emitMountedModuleScripts,
|
|
@@ -188,7 +191,7 @@ import {
|
|
|
188
191
|
parsesAsScript,
|
|
189
192
|
prepareFlattenedInnerRoot,
|
|
190
193
|
stripSdrPngColourTags
|
|
191
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-3XYDZQJF.js";
|
|
192
195
|
import {
|
|
193
196
|
collectScratchLeftovers,
|
|
194
197
|
removeScratch,
|
|
@@ -207,7 +210,7 @@ import {
|
|
|
207
210
|
parseVfxChain,
|
|
208
211
|
resolveAuthoredTimingWindow,
|
|
209
212
|
toFps
|
|
210
|
-
} from "./chunk-
|
|
213
|
+
} from "./chunk-XCGPPU32.js";
|
|
211
214
|
import {
|
|
212
215
|
gsapCdnDist,
|
|
213
216
|
normalizeGsapBaseUrl
|
|
@@ -246,7 +249,7 @@ import {
|
|
|
246
249
|
sourceTimeAt,
|
|
247
250
|
styleElementsFor,
|
|
248
251
|
timeAtSourceTime
|
|
249
|
-
} from "./chunk-
|
|
252
|
+
} from "./chunk-XINVBLXA.js";
|
|
250
253
|
import {
|
|
251
254
|
TRANSITIONS,
|
|
252
255
|
convertTransfer,
|
|
@@ -262,12 +265,13 @@ import {
|
|
|
262
265
|
import {
|
|
263
266
|
lintHyperframeHtml,
|
|
264
267
|
resolveReferencedStart
|
|
265
|
-
} from "./chunk-
|
|
268
|
+
} from "./chunk-GR2T3BOX.js";
|
|
266
269
|
import {
|
|
267
270
|
isUnresolvedAssetPlaceholder,
|
|
268
271
|
readProjectFile,
|
|
272
|
+
readTextFile,
|
|
269
273
|
resolveProjectRelativeSrc
|
|
270
|
-
} from "./chunk-
|
|
274
|
+
} from "./chunk-2GTFW4MK.js";
|
|
271
275
|
import {
|
|
272
276
|
CSS_URL_RE,
|
|
273
277
|
MEDIA_START_BASIS_ATTR,
|
|
@@ -307,9 +311,8 @@ import {
|
|
|
307
311
|
|
|
308
312
|
// ../producer/src/services/renderOrchestrator.ts
|
|
309
313
|
import {
|
|
310
|
-
existsSync as
|
|
314
|
+
existsSync as existsSync16,
|
|
311
315
|
mkdirSync as mkdirSync8,
|
|
312
|
-
readFileSync as readFileSync7,
|
|
313
316
|
readdirSync as readdirSync5,
|
|
314
317
|
rmSync as rmSync8,
|
|
315
318
|
statSync as statSync6,
|
|
@@ -2334,6 +2337,14 @@ function pushWorkerDedupPerfs(results, sink) {
|
|
|
2334
2337
|
if (r.perf) sink.push(r.perf);
|
|
2335
2338
|
}
|
|
2336
2339
|
}
|
|
2340
|
+
function capturedBeyondViewport(perfs, fallback) {
|
|
2341
|
+
const used = perfs.flatMap((perf) => perf.captureBeyondViewport ?? []);
|
|
2342
|
+
return used.length > 0 ? used.includes(true) : fallback;
|
|
2343
|
+
}
|
|
2344
|
+
function withCapturedBeyondViewport(capture, perfs) {
|
|
2345
|
+
const used = capturedBeyondViewport(perfs, capture.captureBeyondViewport);
|
|
2346
|
+
return used === void 0 ? capture : { ...capture, captureBeyondViewport: used };
|
|
2347
|
+
}
|
|
2337
2348
|
function pushWorkerPageErrors(results, sink) {
|
|
2338
2349
|
for (const result of results) {
|
|
2339
2350
|
for (const line of result.pageErrorLines ?? []) if (!sink.includes(line)) sink.push(line);
|
|
@@ -5875,7 +5886,7 @@ import { join as join14 } from "path";
|
|
|
5875
5886
|
|
|
5876
5887
|
// ../producer/src/services/htmlCompiler.ts
|
|
5877
5888
|
import { createHash as createHash4 } from "crypto";
|
|
5878
|
-
import { createReadStream as createReadStream2, existsSync as existsSync9, mkdirSync as mkdirSync5
|
|
5889
|
+
import { createReadStream as createReadStream2, existsSync as existsSync9, mkdirSync as mkdirSync5 } from "fs";
|
|
5879
5890
|
import { join as join13, dirname as dirname5, resolve as resolve5, basename as basename4, relative as relative2 } from "path";
|
|
5880
5891
|
|
|
5881
5892
|
// ../producer/src/services/renderMediaCollector.ts
|
|
@@ -7279,11 +7290,7 @@ function rebaseDirectEntryAssetPaths(html, projectDir, htmlPath) {
|
|
|
7279
7290
|
return document2.toString();
|
|
7280
7291
|
}
|
|
7281
7292
|
async function compileForRender(projectDir, htmlPath, downloadDir, options = {}) {
|
|
7282
|
-
const entryHtml = rebaseDirectEntryAssetPaths(
|
|
7283
|
-
readFileSync5(htmlPath, "utf-8"),
|
|
7284
|
-
projectDir,
|
|
7285
|
-
htmlPath
|
|
7286
|
-
);
|
|
7293
|
+
const entryHtml = rebaseDirectEntryAssetPaths(readTextFile(htmlPath), projectDir, htmlPath);
|
|
7287
7294
|
const rawHtml = rewriteUnresolvableGsapToCdn(entryHtml, projectDir);
|
|
7288
7295
|
assertSubCompositionsUsable(rawHtml, projectDir);
|
|
7289
7296
|
const probes = /* @__PURE__ */ new Map();
|
|
@@ -8110,7 +8117,7 @@ async function runProbeStage(input) {
|
|
|
8110
8117
|
);
|
|
8111
8118
|
const hasVariableMedia = hasVariableBoundMedia(compiled.html, job.config.variables);
|
|
8112
8119
|
const hasInsertedMedia = hasRuntimeMediaChanges(compiled.html);
|
|
8113
|
-
const needsBrowser = probeRequiresBrowser({
|
|
8120
|
+
const needsBrowser = cfg.videoLayerPassthrough || probeRequiresBrowser({
|
|
8114
8121
|
durationSeconds: composition.duration,
|
|
8115
8122
|
unresolvedCompositionCount: compiled.unresolvedCompositions.length,
|
|
8116
8123
|
hasAutoStart,
|
|
@@ -8715,17 +8722,23 @@ function resolveVideoExtractionPolicy(env = process.env) {
|
|
|
8715
8722
|
const maxTransientRetries = failureMode !== "off" && env.HF_VIDEO_EXTRACTION_MAX_RETRIES?.trim() === "1" ? 1 : 0;
|
|
8716
8723
|
return { failureMode, maxTransientRetries };
|
|
8717
8724
|
}
|
|
8725
|
+
var MAX_NAMED_SOURCES = 5;
|
|
8718
8726
|
var VideoExtractionStageError = class extends Error {
|
|
8719
8727
|
constructor(code, retryable, failures, extractionFailure = buildExtractionFailureMetadata(
|
|
8720
8728
|
failures.map((failure) => ({
|
|
8721
8729
|
kind: failure.kind,
|
|
8722
8730
|
affectedElementCount: failure.count
|
|
8723
8731
|
}))
|
|
8724
|
-
), ffmpegReason) {
|
|
8732
|
+
), ffmpegReason, sources = []) {
|
|
8725
8733
|
const total = failures.reduce((sum2, failure) => sum2 + failure.count, 0);
|
|
8726
8734
|
const breakdown = failures.map((failure) => `${failure.kind}=${failure.count}`).join(",");
|
|
8727
8735
|
const reason = ffmpegReason ? `: ffmpeg said: ${ffmpegReason}` : "";
|
|
8728
|
-
|
|
8736
|
+
const shown = sources.slice(0, MAX_NAMED_SOURCES).join(", ");
|
|
8737
|
+
const more = sources.length > MAX_NAMED_SOURCES ? ` and ${sources.length - MAX_NAMED_SOURCES} more` : "";
|
|
8738
|
+
const files = sources.length > 0 ? ` (${shown}${more})` : "";
|
|
8739
|
+
super(
|
|
8740
|
+
`Video extraction failed for ${total} source(s) [${code}; ${breakdown}]${files}${reason}`
|
|
8741
|
+
);
|
|
8729
8742
|
this.code = code;
|
|
8730
8743
|
this.retryable = retryable;
|
|
8731
8744
|
this.failures = failures;
|
|
@@ -8773,7 +8786,10 @@ function buildVideoExtractionStageError(result) {
|
|
|
8773
8786
|
retryable,
|
|
8774
8787
|
failures,
|
|
8775
8788
|
extractionFailureMetadataFromResult(result),
|
|
8776
|
-
result.errors.find((failure) => failure.ffmpegReason)?.ffmpegReason
|
|
8789
|
+
result.errors.find((failure) => failure.ffmpegReason)?.ffmpegReason,
|
|
8790
|
+
[
|
|
8791
|
+
...new Set(result.errors.flatMap((failure) => failure.source ? [failure.source] : []))
|
|
8792
|
+
].sort()
|
|
8777
8793
|
);
|
|
8778
8794
|
}
|
|
8779
8795
|
function buildHdrProbeStageError(failures) {
|
|
@@ -8852,7 +8868,8 @@ async function runExtractVideosStage(input) {
|
|
|
8852
8868
|
assertNotAborted,
|
|
8853
8869
|
materializeSymlinks,
|
|
8854
8870
|
deferRangeExtraction,
|
|
8855
|
-
urlByAbsentLocalPath
|
|
8871
|
+
urlByAbsentLocalPath,
|
|
8872
|
+
skipFrameExtractionIds = []
|
|
8856
8873
|
} = input;
|
|
8857
8874
|
const stage2Start = Date.now();
|
|
8858
8875
|
const extractionPolicy = resolveVideoExtractionPolicy();
|
|
@@ -8923,7 +8940,10 @@ async function runExtractVideosStage(input) {
|
|
|
8923
8940
|
);
|
|
8924
8941
|
imageColorSpaces.push(...probed);
|
|
8925
8942
|
}
|
|
8926
|
-
if (
|
|
8943
|
+
if (skipFrameExtractionIds.length > 0) {
|
|
8944
|
+
await appendVideoAudioFromProbe({ projectDir, compiledDir, composition, urlByAbsentLocalPath });
|
|
8945
|
+
videoReadinessSkipIds = [...skipFrameExtractionIds];
|
|
8946
|
+
} else if (composition.videos.length > 0) {
|
|
8927
8947
|
const totalVideos = composition.videos.length;
|
|
8928
8948
|
for (let i = 0; i < totalVideos; i++) {
|
|
8929
8949
|
const v = composition.videos[i];
|
|
@@ -9019,6 +9039,110 @@ function appendAutoDetectedVideoAudio(composition, extracted) {
|
|
|
9019
9039
|
existingAudioSrcs.add(video.src);
|
|
9020
9040
|
}
|
|
9021
9041
|
}
|
|
9042
|
+
async function appendVideoAudioFromProbe(input) {
|
|
9043
|
+
const { projectDir, compiledDir, composition, urlByAbsentLocalPath } = input;
|
|
9044
|
+
const videos = composition.videos.filter(
|
|
9045
|
+
(video) => !isVideoPastTimelineEnd(video, composition.duration)
|
|
9046
|
+
);
|
|
9047
|
+
const probed = await Promise.all(
|
|
9048
|
+
videos.map(async (video) => {
|
|
9049
|
+
const path = isHttpUrl(video.src) ? video.src : resolveProjectRelativeSrc(video.src, projectDir, compiledDir);
|
|
9050
|
+
const readFrom = urlByAbsentLocalPath?.get(path) ?? path;
|
|
9051
|
+
if (!isHttpUrl(readFrom) && !existsSync10(readFrom)) return null;
|
|
9052
|
+
const metadata = await extractMediaMetadata(readFrom);
|
|
9053
|
+
const window2 = await resolveFinalFrameExtractionWindow(
|
|
9054
|
+
readFrom,
|
|
9055
|
+
video,
|
|
9056
|
+
metadata,
|
|
9057
|
+
resolveVideoExtractionWindow(video, metadata, composition.duration)
|
|
9058
|
+
);
|
|
9059
|
+
if (window2.durationSeconds <= 0) return null;
|
|
9060
|
+
rebaseVideoToWindow(video, window2);
|
|
9061
|
+
return { videoId: video.id, metadata };
|
|
9062
|
+
})
|
|
9063
|
+
);
|
|
9064
|
+
appendAutoDetectedVideoAudio(
|
|
9065
|
+
composition,
|
|
9066
|
+
probed.filter((entry) => entry !== null)
|
|
9067
|
+
);
|
|
9068
|
+
}
|
|
9069
|
+
|
|
9070
|
+
// ../producer/src/services/render/videoLayerPassthroughPlan.ts
|
|
9071
|
+
import { existsSync as existsSync11 } from "fs";
|
|
9072
|
+
var SAMPLES = 9;
|
|
9073
|
+
function inspectVideoLayout(id, w, h, time) {
|
|
9074
|
+
window.__hf?.seek?.(time);
|
|
9075
|
+
const video = document.getElementById(id);
|
|
9076
|
+
if (!video) return { reason: "video_missing" };
|
|
9077
|
+
const r = video.getBoundingClientRect();
|
|
9078
|
+
if (Math.abs(r.left) > 0.5 || Math.abs(r.top) > 0.5) return { reason: "not_full_canvas" };
|
|
9079
|
+
if (Math.abs(r.width - w) > 0.5 || Math.abs(r.height - h) > 0.5) {
|
|
9080
|
+
return { reason: "not_full_canvas" };
|
|
9081
|
+
}
|
|
9082
|
+
const painted = (s) => s.backgroundColor !== "" && s.backgroundColor !== "transparent" && s.backgroundColor !== "rgba(0, 0, 0, 0)" || s.backgroundImage !== "" && s.backgroundImage !== "none";
|
|
9083
|
+
for (let e = video; e && e !== document.documentElement; ) {
|
|
9084
|
+
const s = getComputedStyle(e);
|
|
9085
|
+
if (s.opacity !== "1") return { reason: "opacity" };
|
|
9086
|
+
if (s.transform !== "none" || s.filter !== "none") return { reason: "transform_or_filter" };
|
|
9087
|
+
if (s.clipPath !== "none" || s.maskImage !== "none") return { reason: "clip_or_mask" };
|
|
9088
|
+
if (s.mixBlendMode !== "normal") return { reason: "blend_mode" };
|
|
9089
|
+
if (s.visibility !== "visible" || s.display === "none") return { reason: "not_shown" };
|
|
9090
|
+
const cleared = e === document.body || e.hasAttribute("data-composition-id");
|
|
9091
|
+
if (e !== video && painted(s) && !cleared) return { reason: "ancestor_background" };
|
|
9092
|
+
e = e.parentElement;
|
|
9093
|
+
}
|
|
9094
|
+
for (const root of Array.from(document.querySelectorAll("[data-composition-id]"))) {
|
|
9095
|
+
if (root.parentElement?.closest("[data-composition-id]") && painted(getComputedStyle(root))) {
|
|
9096
|
+
return { reason: "subcomposition_background" };
|
|
9097
|
+
}
|
|
9098
|
+
}
|
|
9099
|
+
const fitStyle = getComputedStyle(video).objectFit;
|
|
9100
|
+
if (fitStyle !== "fill" && fitStyle !== "cover") return { reason: "object_fit" };
|
|
9101
|
+
const own = Number.parseInt(getComputedStyle(video).zIndex, 10) || 0;
|
|
9102
|
+
for (const other of Array.from(document.body.querySelectorAll("*"))) {
|
|
9103
|
+
if (other === video || other.contains(video) || video.contains(other)) continue;
|
|
9104
|
+
if (other.tagName === "SCRIPT" || other.tagName === "STYLE") continue;
|
|
9105
|
+
const z = Number.parseInt(getComputedStyle(other).zIndex, 10) || 0;
|
|
9106
|
+
const before = video.compareDocumentPosition(other) & Node.DOCUMENT_POSITION_PRECEDING;
|
|
9107
|
+
if (z < own || z === own && before) {
|
|
9108
|
+
const box2 = other.getBoundingClientRect();
|
|
9109
|
+
if (box2.width > 0 && box2.height > 0) return { reason: "paints_under" };
|
|
9110
|
+
}
|
|
9111
|
+
}
|
|
9112
|
+
return { fit: fitStyle === "cover" ? "cover" : "fill" };
|
|
9113
|
+
}
|
|
9114
|
+
async function probeVideoLayout(page, videoId, canvas, duration) {
|
|
9115
|
+
let fit = "fill";
|
|
9116
|
+
for (let i = 0; i < SAMPLES; i++) {
|
|
9117
|
+
const t = duration * i / SAMPLES;
|
|
9118
|
+
const seen = await page.evaluate(inspectVideoLayout, videoId, canvas.width, canvas.height, t);
|
|
9119
|
+
if ("reason" in seen) return seen;
|
|
9120
|
+
if (seen.fit === "cover") fit = "cover";
|
|
9121
|
+
}
|
|
9122
|
+
await page.evaluate(
|
|
9123
|
+
() => window.__hf?.seek?.(0)
|
|
9124
|
+
);
|
|
9125
|
+
return { fit };
|
|
9126
|
+
}
|
|
9127
|
+
async function planVideoLayerPassthrough(input) {
|
|
9128
|
+
const q = qualifyVideoLayer(input.videos, input.duration);
|
|
9129
|
+
if (!q.qualifies) return { reason: q.reason };
|
|
9130
|
+
const { video } = q;
|
|
9131
|
+
if (isHttpUrl(video.src)) return { reason: "remote_source" };
|
|
9132
|
+
const path = resolveProjectRelativeSrc(video.src, input.projectDir, input.compiledDir);
|
|
9133
|
+
if (!existsSync11(path)) return { reason: "source_missing" };
|
|
9134
|
+
const layout = await probeVideoLayout(input.page, video.id, input.canvas, input.duration);
|
|
9135
|
+
if ("reason" in layout) return layout;
|
|
9136
|
+
const layer = await buildVideoLayerInput(
|
|
9137
|
+
path,
|
|
9138
|
+
video.mediaStart,
|
|
9139
|
+
input.duration,
|
|
9140
|
+
input.fps,
|
|
9141
|
+
input.canvas,
|
|
9142
|
+
layout.fit
|
|
9143
|
+
);
|
|
9144
|
+
return layer ? { videoId: video.id, layer } : { reason: "source_unsupported" };
|
|
9145
|
+
}
|
|
9022
9146
|
|
|
9023
9147
|
// ../producer/src/services/render/stages/audioStage.ts
|
|
9024
9148
|
import { join as join18 } from "path";
|
|
@@ -9604,7 +9728,7 @@ async function mixAudioForDelivery(input, duration, pcmSourcePath) {
|
|
|
9604
9728
|
}
|
|
9605
9729
|
|
|
9606
9730
|
// ../producer/src/services/render/stages/captureStage.ts
|
|
9607
|
-
import { existsSync as
|
|
9731
|
+
import { existsSync as existsSync12, readdirSync as readdirSync3, statfsSync as statfsSync2 } from "fs";
|
|
9608
9732
|
import { join as join19 } from "path";
|
|
9609
9733
|
function shouldAllowAdaptiveCaptureRetry(workerCount, _explicitlyConfigured) {
|
|
9610
9734
|
return workerCount > 1;
|
|
@@ -9661,7 +9785,7 @@ function diskCaptureShortfallError(needBytes, freeBytes, framesDir, basis, remed
|
|
|
9661
9785
|
}
|
|
9662
9786
|
function measureCaptureFrameBytes(workDir, framesDir) {
|
|
9663
9787
|
let total = sampleDirectoryBytes(framesDir);
|
|
9664
|
-
if (!
|
|
9788
|
+
if (!existsSync12(workDir)) return total;
|
|
9665
9789
|
for (const attempt of readdirSync3(workDir)) {
|
|
9666
9790
|
if (/^retry-\d+-batch-\d+-worker-\d+$/.test(attempt)) {
|
|
9667
9791
|
total += sampleDirectoryBytes(join19(workDir, attempt));
|
|
@@ -9964,7 +10088,7 @@ async function captureSessionFrames(session, { input, rangeStart, rangeEnd, resu
|
|
|
9964
10088
|
}
|
|
9965
10089
|
|
|
9966
10090
|
// ../producer/src/services/render/stages/captureHdrStage.ts
|
|
9967
|
-
import { existsSync as
|
|
10091
|
+
import { existsSync as existsSync14, mkdirSync as mkdirSync6 } from "fs";
|
|
9968
10092
|
import { join as join23 } from "path";
|
|
9969
10093
|
|
|
9970
10094
|
// ../producer/src/services/hdrImageTransferCache.ts
|
|
@@ -10187,7 +10311,7 @@ import { Worker } from "worker_threads";
|
|
|
10187
10311
|
import { fileURLToPath as fileURLToPath3, pathToFileURL } from "url";
|
|
10188
10312
|
import { dirname as dirname7, join as join21 } from "path";
|
|
10189
10313
|
import { createRequire } from "module";
|
|
10190
|
-
import { existsSync as
|
|
10314
|
+
import { existsSync as existsSync13 } from "fs";
|
|
10191
10315
|
import { cpus as cpus2 } from "os";
|
|
10192
10316
|
function resolveWorkerEntry(explicit) {
|
|
10193
10317
|
if (explicit && explicit.length > 0) {
|
|
@@ -10200,7 +10324,7 @@ function resolveWorkerEntry(explicit) {
|
|
|
10200
10324
|
}
|
|
10201
10325
|
const moduleDir = dirname7(fileURLToPath3(import.meta.url));
|
|
10202
10326
|
const jsPath = join21(moduleDir, "shaderTransitionWorker.js");
|
|
10203
|
-
if (
|
|
10327
|
+
if (existsSync13(jsPath)) return { path: jsPath, isTs: false };
|
|
10204
10328
|
const tsPath = join21(moduleDir, "shaderTransitionWorker.ts");
|
|
10205
10329
|
return { path: tsPath, isTs: true };
|
|
10206
10330
|
}
|
|
@@ -10761,7 +10885,7 @@ async function runCaptureHdrStage(input) {
|
|
|
10761
10885
|
}
|
|
10762
10886
|
const debugDumpEnabled = process.env.KEEP_TEMP === "1";
|
|
10763
10887
|
const debugDumpDir = debugDumpEnabled ? join23(framesDir, "debug-composite") : null;
|
|
10764
|
-
if (debugDumpDir && !
|
|
10888
|
+
if (debugDumpDir && !existsSync14(debugDumpDir)) {
|
|
10765
10889
|
mkdirSync6(debugDumpDir, { recursive: true });
|
|
10766
10890
|
}
|
|
10767
10891
|
const compositeTransfer = resolveCompositeTransfer(hasHdrContent, effectiveHdr);
|
|
@@ -10918,10 +11042,10 @@ async function runCaptureHdrStage(input) {
|
|
|
10918
11042
|
// ../producer/src/services/render/stages/encodeStage.ts
|
|
10919
11043
|
import {
|
|
10920
11044
|
copyFileSync as copyFileSync2,
|
|
10921
|
-
existsSync as
|
|
11045
|
+
existsSync as existsSync15,
|
|
10922
11046
|
mkdirSync as mkdirSync7,
|
|
10923
11047
|
readdirSync as readdirSync4,
|
|
10924
|
-
readFileSync as
|
|
11048
|
+
readFileSync as readFileSync5,
|
|
10925
11049
|
rmSync as rmSync7,
|
|
10926
11050
|
statSync as statSync5,
|
|
10927
11051
|
writeFileSync as writeFileSync4
|
|
@@ -11000,7 +11124,7 @@ async function reencodeWithClearedWholeFrames(argsInput, run, startTime) {
|
|
|
11000
11124
|
const error = formatFfmpegError(result.exitCode, result.stderr);
|
|
11001
11125
|
return gifEncodeFailure(startTime, outputPath, error, result.failureReason);
|
|
11002
11126
|
}
|
|
11003
|
-
const gif =
|
|
11127
|
+
const gif = readFileSync5(outputPath);
|
|
11004
11128
|
if (!clearGifFramesBeforeNext(gif)) {
|
|
11005
11129
|
const error = "[FFmpeg] GIF output could not be parsed to clear its frames";
|
|
11006
11130
|
return gifEncodeFailure(startTime, outputPath, error);
|
|
@@ -11033,11 +11157,11 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
|
|
|
11033
11157
|
return gifEncodeFailure(startTime, outputPath, error, result.failureReason);
|
|
11034
11158
|
}
|
|
11035
11159
|
}
|
|
11036
|
-
if (input.preserveAlpha && gifClearsAfterLeavingFrameInPlace(
|
|
11160
|
+
if (input.preserveAlpha && gifClearsAfterLeavingFrameInPlace(readFileSync5(outputPath)) !== false) {
|
|
11037
11161
|
const failure = await reencodeWithClearedWholeFrames(argsInput, run, startTime);
|
|
11038
11162
|
if (failure) return failure;
|
|
11039
11163
|
}
|
|
11040
|
-
const fileSize =
|
|
11164
|
+
const fileSize = existsSync15(outputPath) ? statSync5(outputPath).size : 0;
|
|
11041
11165
|
return {
|
|
11042
11166
|
success: true,
|
|
11043
11167
|
outputPath,
|
|
@@ -11198,7 +11322,7 @@ async function runEncodeStage(input) {
|
|
|
11198
11322
|
const stage5Start = Date.now();
|
|
11199
11323
|
if (isPngSequence) {
|
|
11200
11324
|
const encoded = startEncodeProgress(job, "Writing PNG sequence", onProgress);
|
|
11201
|
-
if (!
|
|
11325
|
+
if (!existsSync15(outputPath)) mkdirSync7(outputPath, { recursive: true });
|
|
11202
11326
|
const captured = readdirSync4(framesDir).filter((name) => name.endsWith(".png")).sort();
|
|
11203
11327
|
if (captured.length === 0) {
|
|
11204
11328
|
throw new Error(
|
|
@@ -11209,7 +11333,7 @@ async function runEncodeStage(input) {
|
|
|
11209
11333
|
const dst = join24(outputPath, formatExportFrameName(i, "png"));
|
|
11210
11334
|
copyFileSync2(join24(framesDir, name), dst);
|
|
11211
11335
|
});
|
|
11212
|
-
if (hasAudio && audioOutputPath &&
|
|
11336
|
+
if (hasAudio && audioOutputPath && existsSync15(audioOutputPath)) {
|
|
11213
11337
|
copyFileSync2(audioOutputPath, join24(outputPath, MIXED_AUDIO_FILENAME));
|
|
11214
11338
|
log.info(
|
|
11215
11339
|
`[Render] png-sequence: ${MIXED_AUDIO_FILENAME} sidecar written to ${outputPath}/${MIXED_AUDIO_FILENAME}`
|
|
@@ -11589,7 +11713,7 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
|
|
|
11589
11713
|
let rangeStart = null;
|
|
11590
11714
|
for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
|
|
11591
11715
|
const framePath = join25(framesDir, formatCaptureFrameName(frameIndex, frameExt));
|
|
11592
|
-
const missing = !
|
|
11716
|
+
const missing = !existsSync16(framePath) || statSync6(framePath).size <= 8;
|
|
11593
11717
|
if (missing && rangeStart === null) {
|
|
11594
11718
|
rangeStart = frameIndex;
|
|
11595
11719
|
} else if (!missing && rangeStart !== null) {
|
|
@@ -11714,7 +11838,7 @@ function countCapturedFrames(totalFrames, framesDir, frameExt) {
|
|
|
11714
11838
|
let captured = 0;
|
|
11715
11839
|
for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
|
|
11716
11840
|
const framePath = join25(framesDir, formatCaptureFrameName(frameIndex, frameExt));
|
|
11717
|
-
if (
|
|
11841
|
+
if (existsSync16(framePath)) captured++;
|
|
11718
11842
|
}
|
|
11719
11843
|
return captured;
|
|
11720
11844
|
}
|
|
@@ -12377,7 +12501,7 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
|
|
|
12377
12501
|
validateDeliveryEncoderConfig(job.config);
|
|
12378
12502
|
const debugDir = resolveRenderDebugDir();
|
|
12379
12503
|
const outputDir = dirname9(outputPath);
|
|
12380
|
-
if (!
|
|
12504
|
+
if (!existsSync16(outputDir)) mkdirSync8(outputDir, { recursive: true });
|
|
12381
12505
|
const workDir = job.config.debug ? join25(debugDir, job.id) : createRenderWorkDir(resolveRenderWorkDirPrefix(outputPath, job.id), outputDir);
|
|
12382
12506
|
const pipelineStart = Date.now();
|
|
12383
12507
|
const baseLog = job.config.logger ?? defaultLogger;
|
|
@@ -12518,7 +12642,7 @@ async function executeRenderPipeline(input) {
|
|
|
12518
12642
|
job.startedAt = /* @__PURE__ */ new Date();
|
|
12519
12643
|
assertNotAborted();
|
|
12520
12644
|
assertConfiguredFfmpegBinariesExist();
|
|
12521
|
-
if (!
|
|
12645
|
+
if (!existsSync16(workDir)) mkdirSync8(workDir, { recursive: true });
|
|
12522
12646
|
if (job.config.debug) {
|
|
12523
12647
|
log.info("[Render] Debug artifacts enabled", { workDir, logPath });
|
|
12524
12648
|
}
|
|
@@ -12548,21 +12672,21 @@ async function executeRenderPipeline(input) {
|
|
|
12548
12672
|
});
|
|
12549
12673
|
const entryFile = job.config.entryFile || "index.html";
|
|
12550
12674
|
let htmlPath = join25(projectDir, entryFile);
|
|
12551
|
-
if (!
|
|
12675
|
+
if (!existsSync16(htmlPath)) {
|
|
12552
12676
|
throw new Error(`Entry file not found: ${htmlPath}`);
|
|
12553
12677
|
}
|
|
12554
12678
|
assertNotAborted();
|
|
12555
|
-
const rawEntry =
|
|
12679
|
+
const rawEntry = readTextFile(htmlPath);
|
|
12556
12680
|
if (entryFile !== "index.html" && isTemplateEntry(rawEntry)) {
|
|
12557
12681
|
const wrapperPath = join25(workDir, "standalone-entry.html");
|
|
12558
12682
|
const projectIndexPath = join25(projectDir, "index.html");
|
|
12559
|
-
if (!
|
|
12683
|
+
if (!existsSync16(projectIndexPath)) {
|
|
12560
12684
|
throw new Error(
|
|
12561
12685
|
`Template entry file "${entryFile}" requires a project index.html to extract its render shell.`
|
|
12562
12686
|
);
|
|
12563
12687
|
}
|
|
12564
12688
|
const standaloneHtml = extractStandaloneEntryFromIndex(
|
|
12565
|
-
|
|
12689
|
+
readTextFile(projectIndexPath),
|
|
12566
12690
|
entryFile,
|
|
12567
12691
|
rawEntry
|
|
12568
12692
|
);
|
|
@@ -12725,6 +12849,42 @@ async function executeRenderPipeline(input) {
|
|
|
12725
12849
|
compositionHash,
|
|
12726
12850
|
beginFrameStalled: probeResult.beginFrameStalled
|
|
12727
12851
|
});
|
|
12852
|
+
let videoLayerPlan;
|
|
12853
|
+
if (cfg.videoLayerPassthrough) {
|
|
12854
|
+
const gates = {
|
|
12855
|
+
mp4: outputFormat === "mp4",
|
|
12856
|
+
software_encode: !job.config.useGpu,
|
|
12857
|
+
opaque_output: !needsAlpha,
|
|
12858
|
+
sdr: rendersSdrOnly(job.config, composition) || (job.config.hdrMode === void 0 || job.config.hdrMode === "auto") && composition.images.length === 0,
|
|
12859
|
+
streaming: shouldUseStreamingEncode(cfg, outputFormat, 1, probeResult.duration),
|
|
12860
|
+
probe_page: probeSession?.isInitialized === true
|
|
12861
|
+
};
|
|
12862
|
+
const failed = Object.entries(gates).find(([, ok]) => !ok)?.[0];
|
|
12863
|
+
if (failed || !probeSession) {
|
|
12864
|
+
log.info(`[Render] Video layer passthrough off: ${failed ?? "probe_page"}`);
|
|
12865
|
+
} else {
|
|
12866
|
+
videoLayerPlan = await planVideoLayerPassthrough({
|
|
12867
|
+
videos: composition.videos,
|
|
12868
|
+
duration: probeResult.duration,
|
|
12869
|
+
fps: job.config.fps,
|
|
12870
|
+
canvas: { width, height },
|
|
12871
|
+
page: probeSession.page,
|
|
12872
|
+
projectDir,
|
|
12873
|
+
compiledDir: join25(workDir, "compiled")
|
|
12874
|
+
});
|
|
12875
|
+
if (videoLayerPlan.videoId === void 0) {
|
|
12876
|
+
log.info(`[Render] Video layer passthrough off: ${videoLayerPlan.reason}`);
|
|
12877
|
+
} else {
|
|
12878
|
+
cfg.useDrawElement = false;
|
|
12879
|
+
cfg.forceScreenshot = true;
|
|
12880
|
+
captureForceScreenshot = true;
|
|
12881
|
+
const opened = probeSession;
|
|
12882
|
+
probeSession = null;
|
|
12883
|
+
await closeCaptureSession(opened);
|
|
12884
|
+
}
|
|
12885
|
+
}
|
|
12886
|
+
}
|
|
12887
|
+
const videoLayer = videoLayerPlan?.videoId === void 0 ? void 0 : videoLayerPlan;
|
|
12728
12888
|
updateJobStatus(job, "preprocessing", "Extracting video frames", 10, onProgress, {
|
|
12729
12889
|
code: "extract_video"
|
|
12730
12890
|
});
|
|
@@ -12740,6 +12900,7 @@ async function executeRenderPipeline(input) {
|
|
|
12740
12900
|
cfg,
|
|
12741
12901
|
log,
|
|
12742
12902
|
composition,
|
|
12903
|
+
skipFrameExtractionIds: videoLayer ? [videoLayer.videoId] : [],
|
|
12743
12904
|
abortSignal: executionSignal,
|
|
12744
12905
|
assertNotAborted,
|
|
12745
12906
|
// Local staging can use links; distributed plan() alone requires real copies.
|
|
@@ -12858,7 +13019,7 @@ async function executeRenderPipeline(input) {
|
|
|
12858
13019
|
throw new Error("File server failed to initialize before frame capture");
|
|
12859
13020
|
}
|
|
12860
13021
|
const framesDir = join25(workDir, "captured-frames");
|
|
12861
|
-
if (!
|
|
13022
|
+
if (!existsSync16(framesDir)) mkdirSync8(framesDir, { recursive: true });
|
|
12862
13023
|
updateJobStatus(job, "rendering", "Checking browser GPU", 25, onProgress, {
|
|
12863
13024
|
code: "start_browsers"
|
|
12864
13025
|
});
|
|
@@ -12884,8 +13045,9 @@ async function executeRenderPipeline(input) {
|
|
|
12884
13045
|
width,
|
|
12885
13046
|
height,
|
|
12886
13047
|
fps: job.config.fps,
|
|
12887
|
-
format: captureImageFormat,
|
|
12888
|
-
transparent: needsAlpha,
|
|
13048
|
+
format: videoLayer ? "png" : captureImageFormat,
|
|
13049
|
+
transparent: needsAlpha || videoLayer !== void 0,
|
|
13050
|
+
...videoLayer ? { hiddenElementIds: [videoLayer.videoId] } : {},
|
|
12889
13051
|
quality: captureImageFormat === "png" ? void 0 : resolveCaptureJpegQuality(job.config.quality),
|
|
12890
13052
|
variables: job.config.variables,
|
|
12891
13053
|
deviceScaleFactor,
|
|
@@ -13182,6 +13344,7 @@ async function executeRenderPipeline(input) {
|
|
|
13182
13344
|
}
|
|
13183
13345
|
}
|
|
13184
13346
|
);
|
|
13347
|
+
if (videoLayer) workerCount = 1;
|
|
13185
13348
|
const preRoutingWorkerCount = workerCount;
|
|
13186
13349
|
if (deParallelRouterEligible && workerCount > 1) {
|
|
13187
13350
|
deParallelRouter = "routed";
|
|
@@ -13847,6 +14010,7 @@ async function executeRenderPipeline(input) {
|
|
|
13847
14010
|
vp9CpuUsed: cfg.vp9CpuUsed,
|
|
13848
14011
|
useGpu: job.config.useGpu,
|
|
13849
14012
|
imageFormat: captureOptions.format || "jpeg",
|
|
14013
|
+
...videoLayer ? { videoLayer: videoLayer.layer } : {},
|
|
13850
14014
|
hdr: preset.hdr,
|
|
13851
14015
|
// HLS only: force an IDR every `gopSize` frames so the
|
|
13852
14016
|
// assemble stage's `-c copy` segmentation cuts exactly on
|
|
@@ -14177,12 +14341,12 @@ async function executeRenderPipeline(input) {
|
|
|
14177
14341
|
})
|
|
14178
14342
|
);
|
|
14179
14343
|
const totalElapsed = Date.now() - pipelineStart;
|
|
14180
|
-
const tmpPeakBytes =
|
|
14344
|
+
const tmpPeakBytes = existsSync16(workDir) ? sampleDirectoryBytes(workDir) : 0;
|
|
14181
14345
|
recordTransientRetryObservability();
|
|
14182
14346
|
observability.checkpoint("pipeline", "artifact validated", { totalElapsedMs: totalElapsed });
|
|
14183
14347
|
const observabilitySummary = observability.summary({
|
|
14184
14348
|
lastBrowserConsole,
|
|
14185
|
-
capture: captureObservability,
|
|
14349
|
+
capture: withCapturedBeyondViewport(captureObservability, dedupPerfs),
|
|
14186
14350
|
initFallback: mergeWorkerInitObservability(dedupPerfs),
|
|
14187
14351
|
extraction: extractionObservability,
|
|
14188
14352
|
compositionHash
|
|
@@ -14258,7 +14422,7 @@ async function executeRenderPipeline(input) {
|
|
|
14258
14422
|
}
|
|
14259
14423
|
}
|
|
14260
14424
|
if (job.config.debug) {
|
|
14261
|
-
if (!isPngSequence && !isHls &&
|
|
14425
|
+
if (!isPngSequence && !isHls && existsSync16(stagedOutputPath)) {
|
|
14262
14426
|
const debugOutput = join25(workDir, `output${videoExt}`);
|
|
14263
14427
|
copyFileSync3(stagedOutputPath, debugOutput);
|
|
14264
14428
|
}
|
|
@@ -14318,7 +14482,7 @@ async function executeRenderPipeline(input) {
|
|
|
14318
14482
|
const failedStage = job.currentStage || "pipeline";
|
|
14319
14483
|
const observabilitySummary = observability.summary({
|
|
14320
14484
|
lastBrowserConsole,
|
|
14321
|
-
capture: captureObservability,
|
|
14485
|
+
capture: withCapturedBeyondViewport(captureObservability, dedupPerfs),
|
|
14322
14486
|
initFallback: mergeWorkerInitObservability(dedupPerfs),
|
|
14323
14487
|
extraction: extractionObservability,
|
|
14324
14488
|
compositionHash
|
|
@@ -14364,7 +14528,7 @@ async function executeRenderPipeline(input) {
|
|
|
14364
14528
|
}
|
|
14365
14529
|
|
|
14366
14530
|
// ../producer/src/services/distributed/renderSpan.ts
|
|
14367
|
-
import { mkdirSync as mkdirSync16, mkdtempSync as mkdtempSync7, readFileSync as
|
|
14531
|
+
import { mkdirSync as mkdirSync16, mkdtempSync as mkdtempSync7, readFileSync as readFileSync11, rmSync as rmSync14 } from "fs";
|
|
14368
14532
|
import { join as join38 } from "path";
|
|
14369
14533
|
import { tmpdir as tmpdir4 } from "os";
|
|
14370
14534
|
|
|
@@ -14754,7 +14918,7 @@ async function writeStitchedMp4(chunkPaths, outputPath, audioPath) {
|
|
|
14754
14918
|
import {
|
|
14755
14919
|
copyFileSync as copyFileSync4,
|
|
14756
14920
|
cpSync as cpSync2,
|
|
14757
|
-
existsSync as
|
|
14921
|
+
existsSync as existsSync21,
|
|
14758
14922
|
linkSync,
|
|
14759
14923
|
mkdirSync as mkdirSync12,
|
|
14760
14924
|
rmSync as rmSync10,
|
|
@@ -14766,13 +14930,13 @@ import { extname as extname6, isAbsolute as isAbsolute2, join as join33, relativ
|
|
|
14766
14930
|
import { join as join29 } from "path";
|
|
14767
14931
|
|
|
14768
14932
|
// ../producer/src/services/distributed/chunkFrames.ts
|
|
14769
|
-
import { existsSync as
|
|
14933
|
+
import { existsSync as existsSync18, readdirSync as readdirSync6 } from "fs";
|
|
14770
14934
|
import { extname as extname4, join as join28 } from "path";
|
|
14771
14935
|
|
|
14772
14936
|
// ../producer/src/services/distributed/shared.ts
|
|
14773
14937
|
import { execFile as execFileCallback } from "child_process";
|
|
14774
14938
|
import { dirname as dirname11, join as join27 } from "path";
|
|
14775
|
-
import { existsSync as
|
|
14939
|
+
import { existsSync as existsSync17, readFileSync as readFileSync6 } from "fs";
|
|
14776
14940
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
14777
14941
|
import { promisify as promisify2 } from "util";
|
|
14778
14942
|
var PLAN_VIDEOS_META_RELATIVE_PATH = "meta/videos.json";
|
|
@@ -14784,7 +14948,7 @@ function isPlanAudioArtifactPath(path) {
|
|
|
14784
14948
|
function resolvePlanAudioPath(planDir) {
|
|
14785
14949
|
for (const name of [PLAN_AUDIO_RELATIVE_PATH, PLAN_AUDIO_LEGACY_RELATIVE_PATH]) {
|
|
14786
14950
|
const candidate = join27(planDir, name);
|
|
14787
|
-
if (
|
|
14951
|
+
if (existsSync17(candidate)) return candidate;
|
|
14788
14952
|
}
|
|
14789
14953
|
return null;
|
|
14790
14954
|
}
|
|
@@ -15045,9 +15209,9 @@ function readProducerVersion() {
|
|
|
15045
15209
|
let current = startDir;
|
|
15046
15210
|
for (let i = 0; i < 10; i++) {
|
|
15047
15211
|
const candidate = join27(current, "package.json");
|
|
15048
|
-
if (
|
|
15212
|
+
if (existsSync17(candidate)) {
|
|
15049
15213
|
try {
|
|
15050
|
-
const pkg = JSON.parse(
|
|
15214
|
+
const pkg = JSON.parse(readFileSync6(candidate, "utf-8"));
|
|
15051
15215
|
if (pkg.name === "@hyperframes/producer" && typeof pkg.version === "string") {
|
|
15052
15216
|
cachedProducerVersion = pkg.version;
|
|
15053
15217
|
return pkg.version;
|
|
@@ -15099,7 +15263,7 @@ function rebuildExtractedFramesFromPlanDir(planDir, videos, indexMode = "dense-v
|
|
|
15099
15263
|
const result = [];
|
|
15100
15264
|
for (const v of videos) {
|
|
15101
15265
|
const outputDir = join28(planDir, "video-frames", v.videoId);
|
|
15102
|
-
if (!
|
|
15266
|
+
if (!existsSync18(outputDir)) {
|
|
15103
15267
|
throw new Error(
|
|
15104
15268
|
`[renderChunk] planDir missing extracted video frames for ${JSON.stringify(v.videoId)}: ${outputDir} not present. plan() should have written frames here; the planDir is malformed.`
|
|
15105
15269
|
);
|
|
@@ -15215,7 +15379,7 @@ async function extractDeferredVideoFramesForChunk(input) {
|
|
|
15215
15379
|
const range = video.deferredRange;
|
|
15216
15380
|
const remoteUrl = remoteSources[range.sourcePath];
|
|
15217
15381
|
const sourcePath = remoteUrl ?? join28(input.planDir, ...range.sourcePath.split("/"));
|
|
15218
|
-
if (remoteUrl === void 0 && !
|
|
15382
|
+
if (remoteUrl === void 0 && !existsSync18(sourcePath)) {
|
|
15219
15383
|
throw new RenderChunkValidationError(
|
|
15220
15384
|
MISSING_PLAN_ARTIFACT,
|
|
15221
15385
|
`[renderChunk] planDir is missing the source for video ${JSON.stringify(video.videoId)}: ${range.sourcePath}`
|
|
@@ -15376,7 +15540,7 @@ function buildWeightedChunkSlices(weights, chunkCount, minFrames, maxFrames) {
|
|
|
15376
15540
|
}
|
|
15377
15541
|
|
|
15378
15542
|
// ../producer/src/services/render/stages/freezePlan.ts
|
|
15379
|
-
import { existsSync as
|
|
15543
|
+
import { existsSync as existsSync19, mkdirSync as mkdirSync10, readFileSync as readFileSync7, readdirSync as readdirSync7, writeFileSync as writeFileSync6 } from "fs";
|
|
15380
15544
|
import { join as join30, relative as relative3, resolve as resolve7 } from "path";
|
|
15381
15545
|
|
|
15382
15546
|
// ../producer/src/services/distributed/planProtocol.ts
|
|
@@ -15570,7 +15734,7 @@ function planFileSha256(absolutePath, digests) {
|
|
|
15570
15734
|
return sha256;
|
|
15571
15735
|
}
|
|
15572
15736
|
async function prehashPlanFiles(dir, digests) {
|
|
15573
|
-
if (!
|
|
15737
|
+
if (!existsSync19(dir)) return;
|
|
15574
15738
|
for (const { absolutePath } of listPlanFiles(dir)) {
|
|
15575
15739
|
if (!digests.has(absolutePath)) digests.set(absolutePath, await sha256FileAsync(absolutePath));
|
|
15576
15740
|
}
|
|
@@ -15616,7 +15780,7 @@ function collectPlanAssetShas(planDir, digests) {
|
|
|
15616
15780
|
const assets = [];
|
|
15617
15781
|
for (const file of files) {
|
|
15618
15782
|
if (file.planRelativePath === COMPILED_INDEX_RELATIVE_PATH) {
|
|
15619
|
-
compositionHtml =
|
|
15783
|
+
compositionHtml = readFileSync7(file.absolutePath);
|
|
15620
15784
|
continue;
|
|
15621
15785
|
}
|
|
15622
15786
|
if (HASH_EXCLUDED_PLAN_FILES.has(file.planRelativePath)) continue;
|
|
@@ -15640,19 +15804,19 @@ function writePlanRemoteFiles(planDir, files) {
|
|
|
15640
15804
|
}
|
|
15641
15805
|
function readPlanRemoteFiles(planDir) {
|
|
15642
15806
|
const path = join30(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH);
|
|
15643
|
-
return
|
|
15807
|
+
return existsSync19(path) ? JSON.parse(readFileSync7(path, "utf-8")) : [];
|
|
15644
15808
|
}
|
|
15645
15809
|
function recomputePlanHashFromPlanDir(planDir, digests) {
|
|
15646
15810
|
const planJsonPath = join30(planDir, "plan.json");
|
|
15647
15811
|
const encoderJsonPath = join30(planDir, "meta", "encoder.json");
|
|
15648
|
-
if (!
|
|
15812
|
+
if (!existsSync19(planJsonPath)) {
|
|
15649
15813
|
throw new Error(`[freezePlan] plan.json missing: ${planJsonPath}`);
|
|
15650
15814
|
}
|
|
15651
|
-
if (!
|
|
15815
|
+
if (!existsSync19(encoderJsonPath)) {
|
|
15652
15816
|
throw new Error(`[freezePlan] meta/encoder.json missing: ${encoderJsonPath}`);
|
|
15653
15817
|
}
|
|
15654
|
-
const planJson = JSON.parse(
|
|
15655
|
-
const encoderConfigCanonicalJson =
|
|
15818
|
+
const planJson = JSON.parse(readFileSync7(planJsonPath, "utf-8"));
|
|
15819
|
+
const encoderConfigCanonicalJson = readFileSync7(encoderJsonPath, "utf-8");
|
|
15656
15820
|
const { compositionHtml, assets } = collectPlanAssetShas(planDir, digests);
|
|
15657
15821
|
return computePlanHash({
|
|
15658
15822
|
compositionHtml,
|
|
@@ -15678,11 +15842,11 @@ async function freezePlan(input) {
|
|
|
15678
15842
|
hasAudio,
|
|
15679
15843
|
digests
|
|
15680
15844
|
} = input;
|
|
15681
|
-
if (!
|
|
15845
|
+
if (!existsSync19(planDir)) {
|
|
15682
15846
|
throw new Error(`[freezePlan] planDir does not exist: ${planDir}`);
|
|
15683
15847
|
}
|
|
15684
15848
|
const metaDir = join30(planDir, "meta");
|
|
15685
|
-
if (!
|
|
15849
|
+
if (!existsSync19(metaDir)) mkdirSync10(metaDir, { recursive: true });
|
|
15686
15850
|
writeFileSync6(
|
|
15687
15851
|
join30(metaDir, "composition.json"),
|
|
15688
15852
|
`${JSON.stringify(composition, null, 2)}
|
|
@@ -15758,7 +15922,7 @@ function applyRuntimeEnvSnapshot(snapshot, env = process.env) {
|
|
|
15758
15922
|
}
|
|
15759
15923
|
|
|
15760
15924
|
// ../producer/src/services/distributed/chunkAudio.ts
|
|
15761
|
-
import { closeSync as closeSync5, existsSync as
|
|
15925
|
+
import { closeSync as closeSync5, existsSync as existsSync20, ftruncateSync, mkdirSync as mkdirSync11, openSync as openSync5, readFileSync as readFileSync8 } from "fs";
|
|
15762
15926
|
import { writeFileSync as writeFileSync7, writeSync } from "fs";
|
|
15763
15927
|
import { join as join31 } from "path";
|
|
15764
15928
|
function audioCutForChunk(grid, chunks, index, fps) {
|
|
@@ -15845,7 +16009,7 @@ async function writeChunkAudioSlices(input) {
|
|
|
15845
16009
|
offset += track.sizes[offsets.length - 1];
|
|
15846
16010
|
}
|
|
15847
16011
|
});
|
|
15848
|
-
const bytes =
|
|
16012
|
+
const bytes = readFileSync8(input.audioPath);
|
|
15849
16013
|
const layout = { sizeBytes: bytes.length, payloadStart, payloadEnd, partStarts: {} };
|
|
15850
16014
|
mkdirSync11(join31(input.planDir, SLICE_DIR), { recursive: true });
|
|
15851
16015
|
input.chunks.forEach((_, index) => {
|
|
@@ -15863,9 +16027,9 @@ async function writeChunkAudioSlices(input) {
|
|
|
15863
16027
|
}
|
|
15864
16028
|
function chunkAudioSource(planDir, chunkIndex, scratchPath) {
|
|
15865
16029
|
const layoutPath = join31(planDir, SLICE_LAYOUT);
|
|
15866
|
-
if (!
|
|
15867
|
-
const layout = JSON.parse(
|
|
15868
|
-
const frame =
|
|
16030
|
+
if (!existsSync20(layoutPath)) return resolvePlanAudioPath(planDir);
|
|
16031
|
+
const layout = JSON.parse(readFileSync8(layoutPath, "utf-8"));
|
|
16032
|
+
const frame = readFileSync8(join31(planDir, SLICE_FRAME));
|
|
15869
16033
|
const fd = openSync5(scratchPath, "w");
|
|
15870
16034
|
try {
|
|
15871
16035
|
writeSync(fd, frame, 0, layout.payloadStart, 0);
|
|
@@ -15878,7 +16042,7 @@ function chunkAudioSource(planDir, chunkIndex, scratchPath) {
|
|
|
15878
16042
|
);
|
|
15879
16043
|
const start = layout.partStarts[chunkIndex];
|
|
15880
16044
|
if (start !== void 0) {
|
|
15881
|
-
const part =
|
|
16045
|
+
const part = readFileSync8(join31(planDir, chunkAudioSlicePath(chunkIndex)));
|
|
15882
16046
|
writeSync(fd, part, 0, part.length, start);
|
|
15883
16047
|
}
|
|
15884
16048
|
ftruncateSync(fd, layout.sizeBytes);
|
|
@@ -16423,7 +16587,7 @@ function createVideoSourceShipper(input) {
|
|
|
16423
16587
|
let result = null;
|
|
16424
16588
|
for (const root of stagedRel === null ? [input.workCompiledDir, input.projectDir] : []) {
|
|
16425
16589
|
const rel = pathInside(root, srcPath);
|
|
16426
|
-
if (rel !== null && (
|
|
16590
|
+
if (rel !== null && (existsSync21(join33(input.planDir, "compiled", rel)) || input.isRemote(srcPath))) {
|
|
16427
16591
|
result = ["compiled", ...rel.split(sep2)].join("/");
|
|
16428
16592
|
break;
|
|
16429
16593
|
}
|
|
@@ -16451,7 +16615,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
|
|
|
16451
16615
|
useGpu: false,
|
|
16452
16616
|
browserGpuMode: "software"
|
|
16453
16617
|
});
|
|
16454
|
-
if (!
|
|
16618
|
+
if (!existsSync21(planDir)) mkdirSync12(planDir, { recursive: true });
|
|
16455
16619
|
const log = config.logger ?? defaultLogger;
|
|
16456
16620
|
const sizeLimitBytes = options.executionPlanSizeLimitBytes ?? config.planDirSizeLimitBytes ?? PLAN_DIR_SIZE_LIMIT_BYTES;
|
|
16457
16621
|
const abortSignal = config.abortSignal;
|
|
@@ -16481,7 +16645,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
|
|
|
16481
16645
|
});
|
|
16482
16646
|
const entryFile = config.entryFile ?? "index.html";
|
|
16483
16647
|
const htmlPath = join33(projectDir, entryFile);
|
|
16484
|
-
if (!
|
|
16648
|
+
if (!existsSync21(htmlPath)) {
|
|
16485
16649
|
throw new Error(`[plan] entry file not found: ${htmlPath}`);
|
|
16486
16650
|
}
|
|
16487
16651
|
const workDir = join33(planDir, ".plan-work");
|
|
@@ -16583,7 +16747,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
|
|
|
16583
16747
|
if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
|
|
16584
16748
|
if (probeResult.probeSession) {
|
|
16585
16749
|
try {
|
|
16586
|
-
const { closeCaptureSession: closeCaptureSession2 } = await import("./src-
|
|
16750
|
+
const { closeCaptureSession: closeCaptureSession2 } = await import("./src-KORQVG7O.js");
|
|
16587
16751
|
await closeCaptureSession2(probeResult.probeSession);
|
|
16588
16752
|
} catch (err) {
|
|
16589
16753
|
log.warn("[plan] probe session close failed", {
|
|
@@ -16692,15 +16856,15 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
|
|
|
16692
16856
|
logPlanStage(log, "extract", stageStarted);
|
|
16693
16857
|
const stagedVideoFrames = join33(compiledDir, "__hyperframes_video_frames");
|
|
16694
16858
|
const videoFramesDst = join33(planDir, "video-frames");
|
|
16695
|
-
if (
|
|
16859
|
+
if (existsSync21(videoFramesDst)) rmSync10(videoFramesDst, { recursive: true, force: true });
|
|
16696
16860
|
const videoSourcesDir = join33(planDir, "video-sources");
|
|
16697
16861
|
rmSync10(videoSourcesDir, { recursive: true, force: true });
|
|
16698
|
-
if (
|
|
16862
|
+
if (existsSync21(stagedVideoFrames)) {
|
|
16699
16863
|
renameWithRetry(stagedVideoFrames, videoFramesDst);
|
|
16700
16864
|
} else {
|
|
16701
16865
|
mkdirSync12(videoFramesDst, { recursive: true });
|
|
16702
16866
|
}
|
|
16703
|
-
if (
|
|
16867
|
+
if (existsSync21(finalCompiledDir)) rmSync10(finalCompiledDir, { recursive: true, force: true });
|
|
16704
16868
|
renameWithRetry(compiledDir, finalCompiledDir);
|
|
16705
16869
|
const shipVideoSource = createVideoSourceShipper({
|
|
16706
16870
|
planDir,
|
|
@@ -16820,10 +16984,10 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
|
|
|
16820
16984
|
applyDistributedAudioWarningPolicy(job, audioResult.audioError, audioResult.audioFailures, log);
|
|
16821
16985
|
}
|
|
16822
16986
|
const planAudioPath = join33(planDir, PLAN_AUDIO_RELATIVE_PATH);
|
|
16823
|
-
if (audioResult?.hasAudio &&
|
|
16987
|
+
if (audioResult?.hasAudio && existsSync21(audioResult.audioOutputPath)) {
|
|
16824
16988
|
renameWithRetry(audioResult.audioOutputPath, planAudioPath);
|
|
16825
16989
|
}
|
|
16826
|
-
if (chunksCarryAudio &&
|
|
16990
|
+
if (chunksCarryAudio && existsSync21(planAudioPath)) {
|
|
16827
16991
|
if (options.sliceChunkAudio) {
|
|
16828
16992
|
stageStarted = Date.now();
|
|
16829
16993
|
await writeChunkAudioSlices({
|
|
@@ -16938,18 +17102,18 @@ async function plan(projectDir, config, planDir, options = {}) {
|
|
|
16938
17102
|
|
|
16939
17103
|
// ../producer/src/services/distributed/renderChunk.ts
|
|
16940
17104
|
import { randomBytes } from "crypto";
|
|
16941
|
-
import { existsSync as
|
|
17105
|
+
import { existsSync as existsSync24, mkdirSync as mkdirSync15, readFileSync as readFileSync10, readdirSync as readdirSync10, rmSync as rmSync13, writeFileSync as writeFileSync11 } from "fs";
|
|
16942
17106
|
import { cpus as cpus3 } from "os";
|
|
16943
17107
|
import { join as join37 } from "path";
|
|
16944
17108
|
|
|
16945
17109
|
// ../producer/src/services/distributed/planV2.ts
|
|
16946
17110
|
import {
|
|
16947
17111
|
copyFileSync as copyFileSync6,
|
|
16948
|
-
existsSync as
|
|
17112
|
+
existsSync as existsSync23,
|
|
16949
17113
|
lstatSync as lstatSync3,
|
|
16950
17114
|
mkdirSync as mkdirSync14,
|
|
16951
17115
|
mkdtempSync as mkdtempSync6,
|
|
16952
|
-
readFileSync as
|
|
17116
|
+
readFileSync as readFileSync9,
|
|
16953
17117
|
readdirSync as readdirSync9,
|
|
16954
17118
|
rmSync as rmSync12,
|
|
16955
17119
|
statSync as statSync8,
|
|
@@ -16961,7 +17125,7 @@ import { dirname as dirname13, isAbsolute as isAbsolute3, join as join36, relati
|
|
|
16961
17125
|
// ../producer/src/services/distributed/planV2Publisher.ts
|
|
16962
17126
|
import {
|
|
16963
17127
|
copyFileSync as copyFileSync5,
|
|
16964
|
-
existsSync as
|
|
17128
|
+
existsSync as existsSync22,
|
|
16965
17129
|
linkSync as linkSync2,
|
|
16966
17130
|
mkdirSync as mkdirSync13,
|
|
16967
17131
|
mkdtempSync as mkdtempSync5,
|
|
@@ -17029,7 +17193,7 @@ var LocalPlanV2ArtifactPublisher = class {
|
|
|
17029
17193
|
#linkFile;
|
|
17030
17194
|
#committed = false;
|
|
17031
17195
|
constructor(destinationDir, options = {}) {
|
|
17032
|
-
if (
|
|
17196
|
+
if (existsSync22(destinationDir)) {
|
|
17033
17197
|
throw new PlanV2IntegrityError(`output directory already exists: ${destinationDir}`);
|
|
17034
17198
|
}
|
|
17035
17199
|
this.destinationDir = destinationDir;
|
|
@@ -17046,7 +17210,7 @@ var LocalPlanV2ArtifactPublisher = class {
|
|
|
17046
17210
|
);
|
|
17047
17211
|
}
|
|
17048
17212
|
const destinationPath = planV2BlobPath(this.temporaryDir, digest);
|
|
17049
|
-
if (
|
|
17213
|
+
if (existsSync22(destinationPath)) return;
|
|
17050
17214
|
mkdirSync13(dirname12(destinationPath), { recursive: true });
|
|
17051
17215
|
const stagingDir = mkdtempSync5(join35(dirname12(destinationPath), ".plan-v2-blob-"));
|
|
17052
17216
|
const temporaryPath = join35(stagingDir, "blob");
|
|
@@ -17064,7 +17228,7 @@ var LocalPlanV2ArtifactPublisher = class {
|
|
|
17064
17228
|
}
|
|
17065
17229
|
async commitManifest(manifestBytes) {
|
|
17066
17230
|
for (const digest of new Set(manifestDigests(manifestBytes))) {
|
|
17067
|
-
if (!
|
|
17231
|
+
if (!existsSync22(planV2BlobPath(this.temporaryDir, digest))) {
|
|
17068
17232
|
throw new PlanV2IntegrityError(
|
|
17069
17233
|
`cannot commit manifest before referenced blob is durable: ${digest}`
|
|
17070
17234
|
);
|
|
@@ -17095,7 +17259,7 @@ function isNonNegativeIntegerArray(value) {
|
|
|
17095
17259
|
return Array.isArray(value) && value.every((item) => typeof item === "number" && Number.isInteger(item) && item >= 0);
|
|
17096
17260
|
}
|
|
17097
17261
|
function readJsonFile(path, label) {
|
|
17098
|
-
const contents =
|
|
17262
|
+
const contents = readFileSync9(path, "utf-8");
|
|
17099
17263
|
try {
|
|
17100
17264
|
const parsed = JSON.parse(contents);
|
|
17101
17265
|
return parsed;
|
|
@@ -17143,7 +17307,7 @@ function assertValidExtractionCacheCompleteSentinel(path) {
|
|
|
17143
17307
|
}
|
|
17144
17308
|
function validateExtractionCacheCompleteSentinels(executionPlanDir) {
|
|
17145
17309
|
const videoRoot = join36(executionPlanDir, "video-frames");
|
|
17146
|
-
if (!
|
|
17310
|
+
if (!existsSync23(videoRoot)) return;
|
|
17147
17311
|
for (const videoEntry of readdirSync9(videoRoot, { withFileTypes: true })) {
|
|
17148
17312
|
if (!videoEntry.isDirectory()) continue;
|
|
17149
17313
|
const videoDir = join36(videoRoot, videoEntry.name);
|
|
@@ -17244,7 +17408,7 @@ function parsePlanVideosJson2(value) {
|
|
|
17244
17408
|
}
|
|
17245
17409
|
function materializeExtractedVideoDirectories(planDir) {
|
|
17246
17410
|
const videosPath = join36(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
|
|
17247
|
-
if (!
|
|
17411
|
+
if (!existsSync23(videosPath)) return;
|
|
17248
17412
|
const videos = parsePlanVideosJson2(readJsonFile(videosPath, PLAN_VIDEOS_META_RELATIVE_PATH));
|
|
17249
17413
|
for (const video of videos.extracted) {
|
|
17250
17414
|
mkdirSync14(resolveExtractedVideoOutputDir(planDir, video.videoId), { recursive: true });
|
|
@@ -17278,9 +17442,9 @@ function parseChunkSlices(value) {
|
|
|
17278
17442
|
}
|
|
17279
17443
|
function buildVideoChunkDependencies(executionPlanDir, dimensions) {
|
|
17280
17444
|
const videoRoot = join36(executionPlanDir, "video-frames");
|
|
17281
|
-
const hasExtractedFrames =
|
|
17445
|
+
const hasExtractedFrames = existsSync23(videoRoot) && listFiles(videoRoot).length > 0;
|
|
17282
17446
|
const videosPath = join36(executionPlanDir, PLAN_VIDEOS_META_RELATIVE_PATH);
|
|
17283
|
-
if (!
|
|
17447
|
+
if (!existsSync23(videosPath)) {
|
|
17284
17448
|
return hasExtractedFrames ? { mode: "full-source-pack", dependencies: null } : { mode: "exact-rendered-frames", dependencies: /* @__PURE__ */ new Map() };
|
|
17285
17449
|
}
|
|
17286
17450
|
const chunksPath = join36(executionPlanDir, "meta", "chunks.json");
|
|
@@ -17337,7 +17501,7 @@ function computeManifestHash(manifest) {
|
|
|
17337
17501
|
return sha256Hex(`${PLAN_V2_HASH_PREFIX}${canonicalJsonStringify(manifestPayload(manifest))}`);
|
|
17338
17502
|
}
|
|
17339
17503
|
function writeBlob(sourcePath, destinationPath) {
|
|
17340
|
-
if (
|
|
17504
|
+
if (existsSync23(destinationPath)) return;
|
|
17341
17505
|
mkdirSync14(dirname13(destinationPath), { recursive: true });
|
|
17342
17506
|
const temporaryDir = mkdtempSync6(join36(dirname13(destinationPath), ".plan-v2-blob-"));
|
|
17343
17507
|
const temporaryPath = join36(temporaryDir, "blob");
|
|
@@ -17377,7 +17541,7 @@ async function putTasks(tasks) {
|
|
|
17377
17541
|
}
|
|
17378
17542
|
function buildPlanV2Publication(executionPlanDir, digests) {
|
|
17379
17543
|
const executionPlanPath = join36(executionPlanDir, "plan.json");
|
|
17380
|
-
if (!
|
|
17544
|
+
if (!existsSync23(executionPlanPath)) {
|
|
17381
17545
|
throw new PlanV2IntegrityError(`execution plan is missing plan.json: ${executionPlanPath}`);
|
|
17382
17546
|
}
|
|
17383
17547
|
const executionPlanValue = readJsonFile(executionPlanPath, "execution plan.json");
|
|
@@ -17457,7 +17621,7 @@ function buildPlanV2Publication(executionPlanDir, digests) {
|
|
|
17457
17621
|
};
|
|
17458
17622
|
}
|
|
17459
17623
|
function createPlanV2FromExecutionPlan(executionPlanDir, planV2Dir) {
|
|
17460
|
-
if (
|
|
17624
|
+
if (existsSync23(planV2Dir)) {
|
|
17461
17625
|
throw new PlanV2IntegrityError(`output directory already exists: ${planV2Dir}`);
|
|
17462
17626
|
}
|
|
17463
17627
|
const publication = buildPlanV2Publication(executionPlanDir);
|
|
@@ -17549,7 +17713,7 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
|
|
|
17549
17713
|
}
|
|
17550
17714
|
}
|
|
17551
17715
|
async function planV2(projectDir, config, planV2Dir) {
|
|
17552
|
-
if (
|
|
17716
|
+
if (existsSync23(planV2Dir)) {
|
|
17553
17717
|
throw new PlanV2IntegrityError(`output directory already exists: ${planV2Dir}`);
|
|
17554
17718
|
}
|
|
17555
17719
|
const publisher = new LocalPlanV2ArtifactPublisher(planV2Dir);
|
|
@@ -17698,7 +17862,7 @@ function parsePlanV2Manifest(value) {
|
|
|
17698
17862
|
}
|
|
17699
17863
|
function readPlanV2Manifest(planV2Dir) {
|
|
17700
17864
|
const manifestPath = join36(planV2Dir, "plan.json");
|
|
17701
|
-
if (!
|
|
17865
|
+
if (!existsSync23(manifestPath)) {
|
|
17702
17866
|
throw new PlanV2IntegrityError(`missing v2 manifest: ${manifestPath}`);
|
|
17703
17867
|
}
|
|
17704
17868
|
const value = readJsonFile(manifestPath, "v2 manifest");
|
|
@@ -17717,7 +17881,7 @@ function listPlanV2ArtifactsForTarget(manifest, target) {
|
|
|
17717
17881
|
}
|
|
17718
17882
|
function verifyBlob(planV2Dir, artifact) {
|
|
17719
17883
|
const sourcePath = planV2BlobPath(planV2Dir, artifact.sha256);
|
|
17720
|
-
if (!
|
|
17884
|
+
if (!existsSync23(sourcePath)) {
|
|
17721
17885
|
throw new PlanV2IntegrityError(`missing content-addressed artifact ${artifact.sha256}`);
|
|
17722
17886
|
}
|
|
17723
17887
|
const stats = statSync8(sourcePath);
|
|
@@ -17730,7 +17894,7 @@ function verifyBlob(planV2Dir, artifact) {
|
|
|
17730
17894
|
return sourcePath;
|
|
17731
17895
|
}
|
|
17732
17896
|
function materializePlanV2Target(planV2Dir, target, destinationDir, options = {}) {
|
|
17733
|
-
if (
|
|
17897
|
+
if (existsSync23(destinationDir)) {
|
|
17734
17898
|
throw new PlanV2IntegrityError(`materialization destination already exists: ${destinationDir}`);
|
|
17735
17899
|
}
|
|
17736
17900
|
const manifest = readPlanV2Manifest(planV2Dir);
|
|
@@ -17795,7 +17959,7 @@ function validatePlanV2MaterializedTarget(planDir, expectedTarget) {
|
|
|
17795
17959
|
}
|
|
17796
17960
|
function readValidatedPlanV2Materialization(planDir, expectedTarget) {
|
|
17797
17961
|
const markerPath = join36(planDir, PLAN_V2_MATERIALIZATION_MARKER);
|
|
17798
|
-
if (!
|
|
17962
|
+
if (!existsSync23(markerPath)) return null;
|
|
17799
17963
|
const marker = readJsonFile(markerPath, "materialization marker");
|
|
17800
17964
|
if (!isRecord3(marker) || !isRecord3(marker.manifest) || !isRecord3(marker.target)) {
|
|
17801
17965
|
throw new PlanV2IntegrityError("malformed materialization marker");
|
|
@@ -17813,7 +17977,7 @@ function readValidatedPlanV2Materialization(planDir, expectedTarget) {
|
|
|
17813
17977
|
for (const artifact of required) {
|
|
17814
17978
|
if (Object.hasOwn(remoteSources, artifact.path)) continue;
|
|
17815
17979
|
const path = join36(planDir, ...artifact.path.split("/"));
|
|
17816
|
-
if (!
|
|
17980
|
+
if (!existsSync23(path) || statSync8(path).size !== artifact.sizeBytes) {
|
|
17817
17981
|
throw new PlanV2IntegrityError(
|
|
17818
17982
|
`materialized artifact missing or truncated: ${artifact.path}`
|
|
17819
17983
|
);
|
|
@@ -17929,10 +18093,10 @@ async function beginFrameSessionNeedsScreenshotFallback(session, probe = probeBe
|
|
|
17929
18093
|
return !await probe(session.page, timeoutMs, probeTick, session.beginFrameIntervalMs);
|
|
17930
18094
|
}
|
|
17931
18095
|
function hashChunkOutput(outputPath, kind) {
|
|
17932
|
-
if (kind === "file") return sha256Hex(
|
|
18096
|
+
if (kind === "file") return sha256Hex(readFileSync10(outputPath));
|
|
17933
18097
|
const entries = readdirSync10(outputPath).filter((name) => /\.(png|jpg|jpeg)$/i.test(name)).sort();
|
|
17934
18098
|
const lines = entries.map(
|
|
17935
|
-
(name) => `${name}\0${sha256Hex(
|
|
18099
|
+
(name) => `${name}\0${sha256Hex(readFileSync10(join37(outputPath, name)))}`
|
|
17936
18100
|
);
|
|
17937
18101
|
return sha256Hex(lines.join("\0"));
|
|
17938
18102
|
}
|
|
@@ -17952,13 +18116,13 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
|
|
|
17952
18116
|
const planJsonPath = join37(planDir, "plan.json");
|
|
17953
18117
|
const encoderJsonPath = join37(planDir, "meta", "encoder.json");
|
|
17954
18118
|
const chunksJsonPath = join37(planDir, "meta", "chunks.json");
|
|
17955
|
-
if (!
|
|
18119
|
+
if (!existsSync24(planJsonPath)) {
|
|
17956
18120
|
throw new RenderChunkValidationError(
|
|
17957
18121
|
MISSING_PLAN_ARTIFACT,
|
|
17958
18122
|
`[renderChunk] planDir is missing required artifact: ${planJsonPath}`
|
|
17959
18123
|
);
|
|
17960
18124
|
}
|
|
17961
|
-
const plan2 = JSON.parse(
|
|
18125
|
+
const plan2 = JSON.parse(readFileSync10(planJsonPath, "utf-8"));
|
|
17962
18126
|
readPlanProtocolV1(plan2, DISTRIBUTED_RENDER_CAPABILITIES.roles.chunk);
|
|
17963
18127
|
const planHashStarted = Date.now();
|
|
17964
18128
|
const v2Materialization = readValidatedPlanV2Materialization(planDir, {
|
|
@@ -17968,20 +18132,20 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
|
|
|
17968
18132
|
const v2Manifest = v2Materialization?.manifest ?? null;
|
|
17969
18133
|
const remoteSources = v2Materialization?.remoteSources ?? {};
|
|
17970
18134
|
for (const required of [encoderJsonPath, chunksJsonPath]) {
|
|
17971
|
-
if (!
|
|
18135
|
+
if (!existsSync24(required)) {
|
|
17972
18136
|
throw new RenderChunkValidationError(
|
|
17973
18137
|
MISSING_PLAN_ARTIFACT,
|
|
17974
18138
|
`[renderChunk] planDir is missing required artifact: ${required}`
|
|
17975
18139
|
);
|
|
17976
18140
|
}
|
|
17977
18141
|
}
|
|
17978
|
-
const encoder = JSON.parse(
|
|
17979
|
-
const chunks = JSON.parse(
|
|
18142
|
+
const encoder = JSON.parse(readFileSync10(encoderJsonPath, "utf-8"));
|
|
18143
|
+
const chunks = JSON.parse(readFileSync10(chunksJsonPath, "utf-8"));
|
|
17980
18144
|
const videosJsonPath = join37(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
|
|
17981
18145
|
let planVideos = null;
|
|
17982
|
-
if (
|
|
18146
|
+
if (existsSync24(videosJsonPath)) {
|
|
17983
18147
|
try {
|
|
17984
|
-
planVideos = validatePlanVideosForChunk(JSON.parse(
|
|
18148
|
+
planVideos = validatePlanVideosForChunk(JSON.parse(readFileSync10(videosJsonPath, "utf-8")));
|
|
17985
18149
|
} catch (err) {
|
|
17986
18150
|
if (err instanceof RenderChunkValidationError) throw err;
|
|
17987
18151
|
throw new RenderChunkValidationError(
|
|
@@ -18010,7 +18174,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
|
|
|
18010
18174
|
const range = resolveChunkFrameRange(slice, chunkIndex, options?.frameRange);
|
|
18011
18175
|
const framesInChunk = range.endFrame - range.startFrame;
|
|
18012
18176
|
const compiledDir = join37(planDir, "compiled");
|
|
18013
|
-
if (!
|
|
18177
|
+
if (!existsSync24(compiledDir)) {
|
|
18014
18178
|
throw new RenderChunkValidationError(
|
|
18015
18179
|
MISSING_PLAN_ARTIFACT,
|
|
18016
18180
|
`[renderChunk] planDir missing compiled/ directory: ${compiledDir}`
|
|
@@ -18092,7 +18256,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
|
|
|
18092
18256
|
dimensions: plan2.dimensions,
|
|
18093
18257
|
encoder,
|
|
18094
18258
|
videoCount: planVideos?.videos.length ?? 0,
|
|
18095
|
-
html:
|
|
18259
|
+
html: readFileSync10(join37(compiledDir, "index.html"), "utf-8"),
|
|
18096
18260
|
// The plan ships a deferred source only to chunks that show it; don't wait on the rest.
|
|
18097
18261
|
skipReadinessVideoIds: deferredVideos.filter(
|
|
18098
18262
|
(video) => !shownFrames.get(video.videoId)?.size || remoteVideoIds.has(video.videoId)
|
|
@@ -18260,10 +18424,10 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
|
|
|
18260
18424
|
const effectiveBitrate = encoder.crf != null ? void 0 : encoder.bitrate;
|
|
18261
18425
|
const videoOnlyPath = encoder.chunksCarryAudio ? `${outputChunkPath}.video.mp4` : outputChunkPath;
|
|
18262
18426
|
if (isPngSequence) {
|
|
18263
|
-
if (!
|
|
18427
|
+
if (!existsSync24(outputChunkPath)) mkdirSync15(outputChunkPath, { recursive: true });
|
|
18264
18428
|
} else {
|
|
18265
18429
|
const outDir = join37(outputChunkPath, "..");
|
|
18266
|
-
if (!
|
|
18430
|
+
if (!existsSync24(outDir)) mkdirSync15(outDir, { recursive: true });
|
|
18267
18431
|
}
|
|
18268
18432
|
const encodeInput = {
|
|
18269
18433
|
job,
|
|
@@ -18554,7 +18718,7 @@ async function renderSpan(projectDir, config, span, outputPath) {
|
|
|
18554
18718
|
planned.totalFrames
|
|
18555
18719
|
);
|
|
18556
18720
|
const slices = JSON.parse(
|
|
18557
|
-
|
|
18721
|
+
readFileSync11(join38(planDir, "meta", "chunks.json"), "utf-8")
|
|
18558
18722
|
);
|
|
18559
18723
|
const parts = [];
|
|
18560
18724
|
for (const slice of slices) {
|
|
@@ -19117,7 +19281,7 @@ function renderRequestFromDistributedConfig(input) {
|
|
|
19117
19281
|
|
|
19118
19282
|
// ../producer/src/server.ts
|
|
19119
19283
|
import {
|
|
19120
|
-
existsSync as
|
|
19284
|
+
existsSync as existsSync27,
|
|
19121
19285
|
mkdirSync as mkdirSync17,
|
|
19122
19286
|
statSync as statSync10,
|
|
19123
19287
|
mkdtempSync as mkdtempSync8,
|
|
@@ -19135,8 +19299,8 @@ import { serve as serve2 } from "@hono/node-server";
|
|
|
19135
19299
|
|
|
19136
19300
|
// ../producer/src/services/hyperframeLint.ts
|
|
19137
19301
|
import {
|
|
19138
|
-
existsSync as
|
|
19139
|
-
readFileSync as
|
|
19302
|
+
existsSync as existsSync25,
|
|
19303
|
+
readFileSync as readFileSync12,
|
|
19140
19304
|
statSync as statSync9,
|
|
19141
19305
|
openSync as openSync6,
|
|
19142
19306
|
fstatSync as fstatSync3,
|
|
@@ -19181,14 +19345,14 @@ function readEntryHtml(filePath) {
|
|
|
19181
19345
|
}
|
|
19182
19346
|
try {
|
|
19183
19347
|
if (!fstatSync3(fd).isFile()) return null;
|
|
19184
|
-
return
|
|
19348
|
+
return readFileSync12(fd, "utf-8");
|
|
19185
19349
|
} finally {
|
|
19186
19350
|
closeSync6(fd);
|
|
19187
19351
|
}
|
|
19188
19352
|
}
|
|
19189
19353
|
function readProjectEntryFile(projectDir, preferredEntryFile) {
|
|
19190
19354
|
const absProjectDir = resolve9(projectDir);
|
|
19191
|
-
if (!
|
|
19355
|
+
if (!existsSync25(absProjectDir) || !statSync9(absProjectDir).isDirectory()) {
|
|
19192
19356
|
return { error: `Project directory not found: ${absProjectDir}` };
|
|
19193
19357
|
}
|
|
19194
19358
|
const entryCandidates = [preferredEntryFile, "index.html", "src/index.html"].filter(
|
|
@@ -19257,7 +19421,7 @@ async function runHyperframeLint(prepared) {
|
|
|
19257
19421
|
import { Worker as Worker2 } from "worker_threads";
|
|
19258
19422
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
19259
19423
|
import { dirname as dirname14, join as join40 } from "path";
|
|
19260
|
-
import { existsSync as
|
|
19424
|
+
import { existsSync as existsSync26 } from "fs";
|
|
19261
19425
|
var DEFAULT_HEALTH_PORT = 9848;
|
|
19262
19426
|
async function startHealthWorker(options = {}) {
|
|
19263
19427
|
const log = options.logger ?? defaultLogger2();
|
|
@@ -19334,7 +19498,7 @@ function resolveWorkerEntry2() {
|
|
|
19334
19498
|
const here = dirname14(fileURLToPath6(import.meta.url));
|
|
19335
19499
|
const candidates = [join40(here, "healthWorkerThread.js"), join40(here, "healthWorkerThread.ts")];
|
|
19336
19500
|
for (const candidate of candidates) {
|
|
19337
|
-
if (
|
|
19501
|
+
if (existsSync26(candidate)) return candidate;
|
|
19338
19502
|
}
|
|
19339
19503
|
return void 0;
|
|
19340
19504
|
}
|
|
@@ -19471,7 +19635,7 @@ function resolvePreparedRenderOutput(prepared, rendersDir, log) {
|
|
|
19471
19635
|
const { input, cleanupProjectDir } = prepared;
|
|
19472
19636
|
const absoluteOutputPath = resolveOutputPath(input.projectDir, input.outputPath, rendersDir, log);
|
|
19473
19637
|
const outputDir = dirname15(absoluteOutputPath);
|
|
19474
|
-
if (!
|
|
19638
|
+
if (!existsSync27(outputDir)) mkdirSync17(outputDir, { recursive: true });
|
|
19475
19639
|
return { input, cleanupProjectDir, absoluteOutputPath };
|
|
19476
19640
|
}
|
|
19477
19641
|
function validateRenderOverrides(body) {
|
|
@@ -19512,11 +19676,11 @@ function prepareProjectDirectory(projectDir, options) {
|
|
|
19512
19676
|
const candidate = nonEmptyString(projectDir);
|
|
19513
19677
|
if (!candidate) return null;
|
|
19514
19678
|
const absProjectDir = resolve10(candidate);
|
|
19515
|
-
if (!
|
|
19679
|
+
if (!existsSync27(absProjectDir) || !statSync10(absProjectDir).isDirectory()) {
|
|
19516
19680
|
return { error: `Project directory not found: ${absProjectDir}` };
|
|
19517
19681
|
}
|
|
19518
19682
|
const entry = options.entryFile || "index.html";
|
|
19519
|
-
if (!
|
|
19683
|
+
if (!existsSync27(resolve10(absProjectDir, entry))) {
|
|
19520
19684
|
return { error: `Entry file "${entry}" not found in project directory: ${absProjectDir}` };
|
|
19521
19685
|
}
|
|
19522
19686
|
return { prepared: { input: { projectDir: absProjectDir, ...options } } };
|
|
@@ -19608,7 +19772,7 @@ function cleanupTempDir(dir, log) {
|
|
|
19608
19772
|
}
|
|
19609
19773
|
}
|
|
19610
19774
|
function outputFileSize(path) {
|
|
19611
|
-
return
|
|
19775
|
+
return existsSync27(path) ? statSync10(path).size : 0;
|
|
19612
19776
|
}
|
|
19613
19777
|
function createBlockingProgressReporter(log, requestId) {
|
|
19614
19778
|
let lastLoggedPct = -10;
|
|
@@ -19910,7 +20074,7 @@ function createRenderHandlers(options = {}) {
|
|
|
19910
20074
|
if (!artifact) {
|
|
19911
20075
|
return c.json({ success: false, error: "Output artifact not found or expired" }, 404);
|
|
19912
20076
|
}
|
|
19913
|
-
if (!
|
|
20077
|
+
if (!existsSync27(artifact.path)) {
|
|
19914
20078
|
store.delete(token);
|
|
19915
20079
|
return c.json({ success: false, error: "Output artifact file missing" }, 404);
|
|
19916
20080
|
}
|
|
@@ -19957,7 +20121,7 @@ function startServer(options = {}) {
|
|
|
19957
20121
|
});
|
|
19958
20122
|
async function shutdown(signal) {
|
|
19959
20123
|
log.info(`Received ${signal}, shutting down`);
|
|
19960
|
-
const { drainBrowserPool } = await import("./src-
|
|
20124
|
+
const { drainBrowserPool } = await import("./src-KORQVG7O.js");
|
|
19961
20125
|
await drainBrowserPool().catch(() => {
|
|
19962
20126
|
});
|
|
19963
20127
|
const handle = await Promise.race([
|
|
@@ -20000,10 +20164,10 @@ import { join as join43 } from "path";
|
|
|
20000
20164
|
// ../producer/src/services/distributed/assemble.ts
|
|
20001
20165
|
import {
|
|
20002
20166
|
cpSync as cpSync3,
|
|
20003
|
-
existsSync as
|
|
20167
|
+
existsSync as existsSync28,
|
|
20004
20168
|
mkdirSync as mkdirSync18,
|
|
20005
20169
|
mkdtempSync as mkdtempSync9,
|
|
20006
|
-
readFileSync as
|
|
20170
|
+
readFileSync as readFileSync13,
|
|
20007
20171
|
readdirSync as readdirSync11,
|
|
20008
20172
|
rmSync as rmSync16,
|
|
20009
20173
|
statSync as statSync11,
|
|
@@ -20038,7 +20202,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
|
|
|
20038
20202
|
}
|
|
20039
20203
|
const format = plan2.dimensions.format;
|
|
20040
20204
|
const cfrEncoder = cfr ? readCfrEncoder(planDir, format) : null;
|
|
20041
|
-
if (!
|
|
20205
|
+
if (!existsSync28(dirname16(outputPath))) {
|
|
20042
20206
|
mkdirSync18(dirname16(outputPath), { recursive: true });
|
|
20043
20207
|
}
|
|
20044
20208
|
const workDir = mkdtempSync9(`${outputPath}.assemble-work-`);
|
|
@@ -20062,7 +20226,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
|
|
|
20062
20226
|
try {
|
|
20063
20227
|
const videoSources = cfrEncoder ? [await reencodeCfr(ctx, chunkPaths, cfrEncoder)] : chunkPaths;
|
|
20064
20228
|
const finalPath = join42(workDir, `output.${format}`);
|
|
20065
|
-
const audio = audioPath !== null &&
|
|
20229
|
+
const audio = audioPath !== null && existsSync28(audioPath) ? audioPath : null;
|
|
20066
20230
|
await writeJoined(ctx, videoSources, audio, finalPath);
|
|
20067
20231
|
renameWithRetry(finalPath, outputPath);
|
|
20068
20232
|
log.info("[assemble] stage timings", {
|
|
@@ -20080,7 +20244,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
|
|
|
20080
20244
|
});
|
|
20081
20245
|
}
|
|
20082
20246
|
}
|
|
20083
|
-
const fileSize =
|
|
20247
|
+
const fileSize = existsSync28(outputPath) ? statSync11(outputPath).size : 0;
|
|
20084
20248
|
return {
|
|
20085
20249
|
outputPath,
|
|
20086
20250
|
durationMs: Date.now() - start,
|
|
@@ -20091,16 +20255,16 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
|
|
|
20091
20255
|
function readAssemblePlan(planDir, chunkPaths) {
|
|
20092
20256
|
const planJsonPath = join42(planDir, "plan.json");
|
|
20093
20257
|
const chunksJsonPath = join42(planDir, "meta", "chunks.json");
|
|
20094
|
-
if (!
|
|
20258
|
+
if (!existsSync28(planJsonPath)) {
|
|
20095
20259
|
throw new Error(`[assemble] planDir missing plan.json: ${planJsonPath}`);
|
|
20096
20260
|
}
|
|
20097
|
-
const plan2 = JSON.parse(
|
|
20261
|
+
const plan2 = JSON.parse(readFileSync13(planJsonPath, "utf-8"));
|
|
20098
20262
|
readPlanProtocolV1(plan2, DISTRIBUTED_RENDER_CAPABILITIES.roles.assembler);
|
|
20099
20263
|
validatePlanV2MaterializedTarget(planDir, { role: "assembler" });
|
|
20100
|
-
if (!
|
|
20264
|
+
if (!existsSync28(chunksJsonPath)) {
|
|
20101
20265
|
throw new Error(`[assemble] planDir missing meta/chunks.json: ${chunksJsonPath}`);
|
|
20102
20266
|
}
|
|
20103
|
-
const chunks = JSON.parse(
|
|
20267
|
+
const chunks = JSON.parse(readFileSync13(chunksJsonPath, "utf-8"));
|
|
20104
20268
|
if (chunkPaths.length !== chunks.length) {
|
|
20105
20269
|
throw new Error(
|
|
20106
20270
|
`[assemble] chunkPaths length (${chunkPaths.length}) does not match chunks.json length (${chunks.length}). Adapters must pass one path per chunk, ordered by index.`
|
|
@@ -20112,7 +20276,7 @@ function readAssemblePlan(planDir, chunkPaths) {
|
|
|
20112
20276
|
}
|
|
20113
20277
|
}
|
|
20114
20278
|
for (const path of chunkPaths.flat()) {
|
|
20115
|
-
if (!
|
|
20279
|
+
if (!existsSync28(path)) {
|
|
20116
20280
|
throw new Error(`[assemble] chunk path does not exist: ${path}`);
|
|
20117
20281
|
}
|
|
20118
20282
|
}
|
|
@@ -20246,13 +20410,13 @@ function stitchesSeparateAudio(planDir) {
|
|
|
20246
20410
|
return lockedAudio(planDir).separateAudio === true;
|
|
20247
20411
|
}
|
|
20248
20412
|
function planFormat(planDir) {
|
|
20249
|
-
const plan2 = JSON.parse(
|
|
20413
|
+
const plan2 = JSON.parse(readFileSync13(join42(planDir, "plan.json"), "utf-8"));
|
|
20250
20414
|
return plan2.dimensions.format;
|
|
20251
20415
|
}
|
|
20252
20416
|
function lockedAudio(planDir) {
|
|
20253
20417
|
const encoderJsonPath = join42(planDir, "meta", "encoder.json");
|
|
20254
|
-
if (!
|
|
20255
|
-
return JSON.parse(
|
|
20418
|
+
if (!existsSync28(encoderJsonPath)) return {};
|
|
20419
|
+
return JSON.parse(readFileSync13(encoderJsonPath, "utf-8"));
|
|
20256
20420
|
}
|
|
20257
20421
|
function readCfrEncoder(planDir, format) {
|
|
20258
20422
|
if (format !== "mp4") {
|
|
@@ -20261,10 +20425,10 @@ function readCfrEncoder(planDir, format) {
|
|
|
20261
20425
|
);
|
|
20262
20426
|
}
|
|
20263
20427
|
const encoderJsonPath = join42(planDir, "meta", "encoder.json");
|
|
20264
|
-
if (!
|
|
20428
|
+
if (!existsSync28(encoderJsonPath)) {
|
|
20265
20429
|
throw new Error(`[assemble] planDir missing meta/encoder.json: ${encoderJsonPath}`);
|
|
20266
20430
|
}
|
|
20267
|
-
const encoderJson = JSON.parse(
|
|
20431
|
+
const encoderJson = JSON.parse(readFileSync13(encoderJsonPath, "utf-8"));
|
|
20268
20432
|
if (encoderJson.encoder === "libx265-software") {
|
|
20269
20433
|
throw new Error(
|
|
20270
20434
|
`[assemble] cfr=true is not yet supported with codec: "h265". The cfr re-encode pass uses libx264 and would silently transcode the h265 chunks. Either disable cfr or render with codec: "h264".`
|
|
@@ -20273,7 +20437,7 @@ function readCfrEncoder(planDir, format) {
|
|
|
20273
20437
|
return encoderJson;
|
|
20274
20438
|
}
|
|
20275
20439
|
function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, startTimeMs) {
|
|
20276
|
-
if (
|
|
20440
|
+
if (existsSync28(outputPath)) rmSync16(outputPath, { recursive: true, force: true });
|
|
20277
20441
|
mkdirSync18(outputPath, { recursive: true });
|
|
20278
20442
|
let globalIdx = 0;
|
|
20279
20443
|
for (const chunkDir of chunkPaths) {
|
|
@@ -20297,7 +20461,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
|
|
|
20297
20461
|
`[assemble] png-sequence frame count mismatch: merged ${globalIdx} frames vs plan.totalFrames=${totalFrames}. Using on-disk count.`
|
|
20298
20462
|
);
|
|
20299
20463
|
}
|
|
20300
|
-
if (audioPath !== null &&
|
|
20464
|
+
if (audioPath !== null && existsSync28(audioPath)) {
|
|
20301
20465
|
const sidecar = join42(outputPath, MIXED_AUDIO_FILENAME);
|
|
20302
20466
|
cpSync3(audioPath, sidecar);
|
|
20303
20467
|
}
|