hyperframes 0.8.169 → 0.8.170
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-7GLP4BPM.js → add-KDCZCEMQ.js} +11 -11
- package/dist/{animatedGifPrep-NEBEGVSO.js → animatedGifPrep-MVP5LCEM.js} +5 -5
- package/dist/api.js +11 -11
- package/dist/{asset-RORTT5HS.js → asset-6VH3OCEC.js} +2 -2
- package/dist/{assetCataloger-RLJ6MDGF.js → assetCataloger-RN5A2SVA.js} +5 -5
- package/dist/{audio-OKDGU7TY.js → audio-636CQSXK.js} +11 -11
- package/dist/{auth-QWYNCU5U.js → auth-AHLKM4M2.js} +1 -1
- package/dist/{autoUpdate-EDJJPWAU.js → autoUpdate-5UA6TJW7.js} +2 -2
- package/dist/{backgroundChecks-KQR6FGVU.js → backgroundChecks-DP242536.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-YKTTAIHH.js → batchRender-KWBVAUE3.js} +3 -3
- package/dist/{beats-I6AGLTLW.js → beats-HKY5L463.js} +4 -4
- package/dist/{benchmark-NBSV7PNB.js → benchmark-4YQDVIO5.js} +8 -8
- package/dist/{browser-FPEL5FGW.js → browser-7ZPWXEYW.js} +3 -3
- package/dist/{bundleWithLocalizedFonts-TYQXMNSU.js → bundleWithLocalizedFonts-42V34HJF.js} +2 -2
- package/dist/{capture-FXGOI23U.js → capture-572X5NDD.js} +8 -8
- package/dist/{capture-5BRJJMZB.js → capture-VXMUZSBI.js} +2 -2
- package/dist/{catalog-SG3ZIS45.js → catalog-PUUTHPP7.js} +11 -11
- package/dist/{catch-up-ETXUT6Q5.js → catch-up-K6CV44WQ.js} +4 -4
- package/dist/{check-KXNNIEUR.js → check-MBDLSWCY.js} +32 -32
- package/dist/{checkBrowser-546UMI3N.js → checkBrowser-33UWWDZG.js} +29 -29
- package/dist/{chunk-EELTMBCC.js → chunk-2E7NDKTN.js} +1 -1
- package/dist/{chunk-DCG22HKT.js → chunk-2UD6O6QG.js} +6 -6
- package/dist/{chunk-5SQHHBAR.js → chunk-44GV6ZMC.js} +1 -1
- package/dist/{chunk-FQJDV2RI.js → chunk-4B6PUT4R.js} +1 -1
- package/dist/{chunk-UCNQE52B.js → chunk-4RXJG3SY.js} +197 -26
- package/dist/chunk-6M3IPJS6.js +3803 -0
- package/dist/{chunk-TJSTGSAW.js → chunk-7FMUTGOH.js} +2 -77
- package/dist/{chunk-T4HL3SZH.js → chunk-AGHHZIZN.js} +1 -1
- package/dist/{chunk-CNP6AMFM.js → chunk-AUMJ3QSO.js} +2 -2
- package/dist/{chunk-A6K7M46D.js → chunk-AWSVUIWG.js} +1 -1
- package/dist/{chunk-5ETJPA5Z.js → chunk-BAW7UNLK.js} +9 -9
- package/dist/{chunk-XK5SZNYE.js → chunk-CFBGKAKQ.js} +9 -9
- package/dist/{chunk-VCXVZRR2.js → chunk-EHDKCMKX.js} +1 -1
- package/dist/{chunk-AP5AVVAB.js → chunk-EJYBYR4C.js} +1 -1
- package/dist/{chunk-SJPNVLYS.js → chunk-ERJHLFPD.js} +2 -2
- package/dist/{chunk-P24X6CGY.js → chunk-FAORS3UR.js} +28 -13
- package/dist/{chunk-EEP5Y5IE.js → chunk-FE2XTCTM.js} +18 -1
- package/dist/{chunk-FSX7GTBB.js → chunk-FSP2JNAP.js} +1 -1
- package/dist/{chunk-ZFJ5RI7A.js → chunk-G6GKIAEM.js} +3 -3
- package/dist/{chunk-TVDXMJ43.js → chunk-GBWSBTEE.js} +1 -1
- package/dist/{chunk-K5PU5ISL.js → chunk-GG3V5BHG.js} +1 -1
- package/dist/{chunk-KA4LSAD5.js → chunk-GU5FLCZV.js} +1 -1
- package/dist/{chunk-EFP25BUY.js → chunk-JAERN4RH.js} +1 -1
- package/dist/{chunk-YT6TFGIS.js → chunk-KUFEPCR3.js} +1 -1
- package/dist/{chunk-S6U7YLPJ.js → chunk-KUW4LWY6.js} +1 -1
- package/dist/{chunk-TEFHMDVR.js → chunk-LMMFO5UV.js} +2 -2
- package/dist/{chunk-PVTHDNDZ.js → chunk-LWB3KZ5E.js} +1 -1
- package/dist/{chunk-QD5VJOQK.js → chunk-MSFON5DJ.js} +3 -3
- package/dist/{chunk-XJQ6NN2L.js → chunk-MXMIVNUE.js} +19 -23
- package/dist/{chunk-CESKA6VO.js → chunk-NSJLCWLG.js} +1 -1
- package/dist/{chunk-MCPDZWZY.js → chunk-NYCJCQNY.js} +4 -4
- package/dist/{chunk-RUYYAL3T.js → chunk-OGVQJHNM.js} +2 -2
- package/dist/{chunk-J5Z56PU3.js → chunk-PCX3YF2U.js} +1 -1
- package/dist/{chunk-U7P2XTRY.js → chunk-PECICVTJ.js} +2 -2
- package/dist/{chunk-GVX2443P.js → chunk-PH3RS5X4.js} +2 -2
- package/dist/{chunk-YZRS3COO.js → chunk-PP64Q43K.js} +1 -1
- package/dist/{chunk-Q5K73VW3.js → chunk-PXA4S6OE.js} +2 -2
- package/dist/{chunk-5FWVFCQM.js → chunk-QO3JEPEW.js} +2 -2
- package/dist/{chunk-O3J7BHBU.js → chunk-QZUVPWC4.js} +1 -1
- package/dist/{chunk-2F4HJFGW.js → chunk-T56MM7RC.js} +2 -2
- package/dist/{chunk-RZKQ3G6B.js → chunk-T5LGOTQR.js} +1 -1
- package/dist/{chunk-WAVFNZB7.js → chunk-UDDJQEGS.js} +1 -1
- package/dist/{chunk-BNEKKUPG.js → chunk-UQPH3Y45.js} +2 -2
- package/dist/{chunk-XZNHVWDD.js → chunk-UUP4KOMD.js} +4 -4
- package/dist/{chunk-UISU4SYG.js → chunk-V2T7FFPB.js} +1 -1
- package/dist/{chunk-7FHFPHEM.js → chunk-VKFYI7AQ.js} +182 -77
- package/dist/{chunk-JPN7SVWC.js → chunk-WLNNWLIE.js} +7 -7
- package/dist/{chunk-7635SDI5.js → chunk-WZQSL7UX.js} +2 -2
- package/dist/{chunk-YLAREDAU.js → chunk-X3U6KEID.js} +1 -1
- package/dist/{chunk-M4N6IHCQ.js → chunk-XRQBHOBT.js} +7 -1
- package/dist/{chunk-NKG3LTPI.js → chunk-YFGJVADL.js} +1 -1
- package/dist/{chunk-QLHXC4E6.js → chunk-ZINH7YA2.js} +1 -1
- package/dist/{clean-ARH23EGW.js → clean-5AXXHD45.js} +12 -12
- package/dist/cli.js +53 -53
- package/dist/{cloud-GBY7MRZM.js → cloud-DQCCYKOB.js} +4 -4
- package/dist/{cloudrun-HBVA5UZB.js → cloudrun-CDFL5JBL.js} +9 -11
- package/dist/{compare-Z4YNESYN.js → compare-6RB5X3SO.js} +24 -24
- package/dist/{compiler-6WJ5SVTD.js → compiler-GU5GPO5A.js} +2 -2
- package/dist/{component-AR4MS4R7.js → component-7RRNNC5F.js} +3 -3
- package/dist/{compositions-ERZVZBYW.js → compositions-CANET3EJ.js} +9 -9
- package/dist/{delete-NWSW3BET.js → delete-KEZJPDWJ.js} +2 -2
- package/dist/{deterministicFonts-KXVO7QEL.js → deterministicFonts-RWGQPEZU.js} +2 -2
- package/dist/{dist-VKLSNKRZ.js → dist-IDZRZHGE.js} +2 -2
- package/dist/{doctor-P4QZQRCB.js → doctor-5RAEGA6G.js} +7 -7
- package/dist/{events-F2UVJQIC.js → events-4ZJSJ76H.js} +2 -2
- package/dist/{events-SV46AWMI.js → events-SHOWEHI5.js} +3 -3
- package/dist/{feedback-XS4IK6SW.js → feedback-4IIGUUYZ.js} +6 -6
- package/dist/{figma-DELISEUP.js → figma-BFDECPE5.js} +3 -3
- package/dist/fontLocalizeCli.js +9 -9
- package/dist/{get-DNGXCEFB.js → get-BO32YZUQ.js} +2 -2
- package/dist/{gpuPolicy-JG5PUOJP.js → gpuPolicy-QWJYZLVJ.js} +5 -5
- package/dist/{grade-compare-F46JWE4O.js → grade-compare-SW4SAG5R.js} +24 -24
- package/dist/{help-XVEBMX3U.js → help-7AMSMPUF.js} +1 -1
- package/dist/{history-NS4PKG4S.js → history-VXAQFJJV.js} +6 -6
- package/dist/hyperframe-runtime.js +58 -57
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +58 -57
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/{info-DJ6VNESS.js → info-KN4TX6T5.js} +7 -7
- package/dist/{init-TSRTMVRN.js → init-7A2T7LDW.js} +20 -20
- package/dist/{inspect-VTZXXDJ4.js → inspect-CCCV6JFV.js} +25 -25
- package/dist/{installer-3ERHU4CD.js → installer-ZCCZUOPN.js} +4 -4
- package/dist/{keyframes-6DN7BOYJ.js → keyframes-K6XNZGK3.js} +6 -6
- package/dist/{lambda-RCOIEGL6.js → lambda-B2K237DX.js} +10 -12
- package/dist/{layout-FFGRLVK4.js → layout-HAPR5OV4.js} +25 -25
- package/dist/{lint-MBYIDFKS.js → lint-3COFAXAJ.js} +6 -6
- package/dist/{list-KEZDFW5R.js → list-QCNHO7DR.js} +2 -2
- package/dist/{login-7ZV374QL.js → login-BAFYZS6W.js} +4 -4
- package/dist/{media-treatment-LGWWRXAX.js → media-treatment-C53ZBW2B.js} +8 -8
- package/dist/{models-TC4K6UQP.js → models-INX67ETR.js} +8 -8
- package/dist/{motionShot-4E3RTV5O.js → motionShot-UOS26VLB.js} +12 -12
- package/dist/{normalize-audio-XCGB2IQP.js → normalize-audio-I7HGJGA5.js} +4 -4
- package/dist/{open-JNNJSNTH.js → open-RFXGV4RY.js} +4 -4
- package/dist/{parakeetRunner-S3DG4BJB.js → parakeetRunner-PCCBODBS.js} +8 -8
- package/dist/{pipeline-3SIYCBLU.js → pipeline-GDC7SL5N.js} +5 -5
- package/dist/{play-LBPOOD3V.js → play-DRCWK35L.js} +17 -17
- package/dist/{present-PWEN5SDL.js → present-HUJV553D.js} +13 -13
- package/dist/{preview-IS32RLKM.js → preview-CZENYIGN.js} +15 -15
- package/dist/{producer-4UUUEPPS.js → producer-23NJEJRO.js} +1 -1
- package/dist/{projectConfig-K347VIO3.js → projectConfig-R3FCIARW.js} +6 -6
- package/dist/{publication-4CQS532O.js → publication-GY3OJ6VH.js} +2 -2
- package/dist/{publish-OJYF37FY.js → publish-XBW4NVFY.js} +7 -7
- package/dist/{remove-background-HO6YL2HU.js → remove-background-Q7CQ3PJF.js} +6 -6
- package/dist/{render-L76SEAMC.js → render-24JWWXMA.js} +3 -3
- package/dist/{render-Q6QAXJCN.js → render-DOHHCT2G.js} +8 -8
- package/dist/{render-QBQYF2NC.js → render-WWAXTKYR.js} +22 -22
- package/dist/{render-batch-JLANN5Y2.js → render-batch-EK4ZBQHH.js} +3 -3
- package/dist/renderSetupWorker.js +9 -1
- package/dist/{resolver-EDUM4DHG.js → resolver-5Y6VNMTC.js} +4 -4
- package/dist/{sherpa-QEM5XYHD.js → sherpa-VMADZBF7.js} +7 -7
- package/dist/skills/media-use/SKILL.md +3 -3
- package/dist/skills/media-use/audio/references/requirements.md +7 -7
- package/dist/skills/media-use/audio/references/sfx.md +19 -13
- package/dist/skills/media-use/audio/scripts/audio.mjs +9 -9
- package/dist/skills/media-use/audio/scripts/audio.test.mjs +17 -10
- package/dist/skills/media-use/audio/scripts/lib/media-record.mjs +7 -3
- package/dist/skills/media-use/audio/scripts/lib/media-record.test.mjs +22 -3
- package/dist/skills/media-use/audio/scripts/lib/openverse.mjs +134 -0
- package/dist/skills/media-use/audio/scripts/lib/sfx.mjs +120 -89
- package/dist/skills/media-use/audio/scripts/lib/sfx.test.mjs +222 -12
- package/dist/skills/media-use/references/audio.md +1 -1
- package/dist/skills/media-use/references/resolve.md +1 -1
- package/dist/skills/media-use/references/setup-providers.md +13 -12
- package/dist/skills/media-use/scripts/lib/heygen-cli.mjs +4 -7
- package/dist/skills/media-use/scripts/lib/heygen-cli.test.mjs +5 -5
- package/dist/skills/media-use/scripts/lib/manifest.d.mts +1 -0
- package/dist/skills/media-use/scripts/lib/manifest.mjs +9 -6
- package/dist/skills/media-use/scripts/lib/openverse.mjs +134 -0
- package/dist/skills/media-use/scripts/lib/openverse.test.mjs +219 -0
- package/dist/skills/media-use/scripts/lib/registry.mjs +4 -2
- package/dist/skills/media-use/scripts/lib/registry.test.mjs +13 -13
- package/dist/skills/media-use/scripts/lib/sfx-provider.mjs +23 -13
- package/dist/skills/media-use/scripts/resolve.mjs +45 -55
- package/dist/{skills-FSZK6FIG.js → skills-ONFYYL6R.js} +5 -5
- package/dist/{skillsUpdateCheck-3354HXDJ.js → skillsUpdateCheck-JTHZOHRT.js} +3 -3
- package/dist/{snapshot-5VVMFEMM.js → snapshot-SUA62VQ2.js} +27 -27
- package/dist/{src-RYILCNU7.js → src-J6KABXGZ.js} +8 -8
- package/dist/{src-ZGMLMQ3B.js → src-VFTQPSQD.js} +4 -4
- package/dist/{staticProjectServer-PIVSGEAO.js → staticProjectServer-XQPUABYX.js} +13 -13
- package/dist/studio/assets/{hyperframes-player-B04Yx96S.js → hyperframes-player-Dsmhm7Q8.js} +1 -1
- package/dist/studio/assets/{index-D2e0J6kh.js → index-CV00F8qG.js} +4 -4
- package/dist/studio/assets/{index-D9CDX_Rr.js → index-DT1wigvW.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-PHADR6VB.js → studio-api-MBDDFEA2.js} +7 -7
- package/dist/{studioServer-5AVDKN5V.js → studioServer-7HWDCLKT.js} +37 -37
- package/dist/{telemetry-JCTHMPSB.js → telemetry-763NW3QF.js} +3 -3
- package/dist/{timeline-QU2F6R2M.js → timeline-ZLFPNI27.js} +15 -15
- package/dist/{tokens-YYK4G36C.js → tokens-RXJLVZKD.js} +2 -2
- package/dist/{transcribe-7ORH7R6O.js → transcribe-IM5UNBSH.js} +6 -6
- package/dist/{transcribe-PRG4FLLA.js → transcribe-UDISJXCZ.js} +12 -12
- package/dist/{updateCheck-NV7QNANK.js → updateCheck-V2RXHFQL.js} +2 -2
- package/dist/{upgrade-UZXN36J2.js → upgrade-MJI3EW3W.js} +2 -2
- package/dist/{urlDownloader-AW57H722.js → urlDownloader-BOLOMGC7.js} +4 -4
- package/dist/{validate-QD53ABUM.js → validate-IM5NPJHI.js} +19 -19
- package/dist/{video-VLVPYQQR.js → video-HUNOZDLT.js} +5 -5
- package/package.json +1 -1
- package/dist/chunk-BIV5HVTQ.js +0 -3803
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
renderFrameIdForRenderId,
|
|
32
32
|
resolveAuthoredTimingWindow,
|
|
33
33
|
toFps
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-QZUVPWC4.js";
|
|
35
35
|
import {
|
|
36
36
|
AUDIO_GROUP_RENDER_ID_ATTR,
|
|
37
37
|
COLOR_GRADING_SOURCE_HIDDEN_ATTR,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
shiftRateLane,
|
|
61
61
|
sourceTimeAt,
|
|
62
62
|
timeAtSourceTime
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-6M3IPJS6.js";
|
|
64
64
|
import {
|
|
65
65
|
clampAudioGain,
|
|
66
66
|
isAudibleVideoElement
|
|
@@ -5873,6 +5873,26 @@ async function decodeAllImages(page) {
|
|
|
5873
5873
|
);
|
|
5874
5874
|
});
|
|
5875
5875
|
}
|
|
5876
|
+
function releasableVideoIds(options) {
|
|
5877
|
+
const hinted = new Set((options.videoMetadataHints ?? []).map((hint) => hint.id));
|
|
5878
|
+
return (options.skipReadinessVideoIds ?? []).filter((id) => hinted.has(id));
|
|
5879
|
+
}
|
|
5880
|
+
async function releaseInjectedVideoMedia(page, videoIds) {
|
|
5881
|
+
if (videoIds.length === 0) return;
|
|
5882
|
+
await page.evaluate(
|
|
5883
|
+
(ids) => {
|
|
5884
|
+
for (const id of ids) {
|
|
5885
|
+
const video = window.__hfMediaEl?.(id) ?? document.getElementById(id);
|
|
5886
|
+
if (!(video instanceof HTMLVideoElement)) continue;
|
|
5887
|
+
video.pause();
|
|
5888
|
+
for (const source of video.querySelectorAll("source")) source.remove();
|
|
5889
|
+
video.removeAttribute("src");
|
|
5890
|
+
video.load();
|
|
5891
|
+
}
|
|
5892
|
+
},
|
|
5893
|
+
[...videoIds]
|
|
5894
|
+
);
|
|
5895
|
+
}
|
|
5876
5896
|
async function applyVideoMetadataHints(page, hints) {
|
|
5877
5897
|
if (!hints || hints.length === 0) return;
|
|
5878
5898
|
await page.evaluate(
|
|
@@ -6087,6 +6107,7 @@ async function initializeSession(session) {
|
|
|
6087
6107
|
assertVfxIntact(session);
|
|
6088
6108
|
recordSubTimelineWarning(session, pageReadyTimeout);
|
|
6089
6109
|
await applyVideoMetadataHints(page, session.options.videoMetadataHints);
|
|
6110
|
+
await releaseInjectedVideoMedia(page, releasableVideoIds(session.options));
|
|
6090
6111
|
logInitPhase("applyVideoMetadataHints complete");
|
|
6091
6112
|
const skipVideoIds = session.options.skipReadinessVideoIds ?? [];
|
|
6092
6113
|
const [videosReady] = await Promise.all([
|
|
@@ -6193,6 +6214,7 @@ async function initializeSession(session) {
|
|
|
6193
6214
|
assertVfxIntact(session);
|
|
6194
6215
|
recordSubTimelineWarning(session, pageReadyTimeout);
|
|
6195
6216
|
await applyVideoMetadataHints(page, session.options.videoMetadataHints);
|
|
6217
|
+
await releaseInjectedVideoMedia(page, releasableVideoIds(session.options));
|
|
6196
6218
|
logInitPhase("applyVideoMetadataHints complete");
|
|
6197
6219
|
const bfSkipVideoIds = session.options.skipReadinessVideoIds ?? [];
|
|
6198
6220
|
const [bfVideosReady] = await Promise.all([
|
|
@@ -6637,6 +6659,7 @@ async function createStaticVerificationPage(session) {
|
|
|
6637
6659
|
knownUnregisteredIds: session.subTimelineWaitMemo.unregisteredIds
|
|
6638
6660
|
});
|
|
6639
6661
|
await applyVideoMetadataHints(page, session.options.videoMetadataHints);
|
|
6662
|
+
await releaseInjectedVideoMedia(page, releasableVideoIds(session.options));
|
|
6640
6663
|
const skipVideoIds = session.options.skipReadinessVideoIds ?? [];
|
|
6641
6664
|
await Promise.all([
|
|
6642
6665
|
pollVideosReady(page, skipVideoIds, pageReadyTimeout),
|
|
@@ -13659,8 +13682,8 @@ async function queryElementStacking(page, nativeHdrIds) {
|
|
|
13659
13682
|
}
|
|
13660
13683
|
|
|
13661
13684
|
// ../engine/src/services/audioMixer.ts
|
|
13662
|
-
import { closeSync as closeSync4, existsSync as existsSync10, mkdirSync as mkdirSync7, mkdtempSync as
|
|
13663
|
-
import { join as
|
|
13685
|
+
import { closeSync as closeSync4, existsSync as existsSync10, mkdirSync as mkdirSync7, mkdtempSync as mkdtempSync7, openSync as openSync4, rmSync as rmSync8, writeFileSync as writeFileSync7 } from "fs";
|
|
13686
|
+
import { join as join14, dirname as dirname7, isAbsolute, relative } from "path";
|
|
13664
13687
|
|
|
13665
13688
|
// ../engine/src/utils/notMediaPayload.ts
|
|
13666
13689
|
import { createHash as createHash3 } from "crypto";
|
|
@@ -13774,6 +13797,99 @@ function clampFadesToDuration(fades, duration) {
|
|
|
13774
13797
|
return { fadeIn: fadeIn * scale, fadeOut: fadeOut * scale };
|
|
13775
13798
|
}
|
|
13776
13799
|
|
|
13800
|
+
// ../engine/src/services/aacEncode.ts
|
|
13801
|
+
import { mkdtempSync as mkdtempSync4, readFileSync as readFileSync5, rmSync as rmSync5, writeFileSync as writeFileSync4 } from "fs";
|
|
13802
|
+
import { dirname as dirname5, join as join11 } from "path";
|
|
13803
|
+
var SAMPLE_RATE = 48e3;
|
|
13804
|
+
var FRAME_SAMPLES = 1024;
|
|
13805
|
+
var MIN_SEGMENT_SECONDS = 60;
|
|
13806
|
+
var MAX_SEGMENTS = 8;
|
|
13807
|
+
var PRE_ROLL_FRAMES = 469;
|
|
13808
|
+
var POST_ROLL_FRAMES = 8;
|
|
13809
|
+
var AAC_ARGS = ["-acodec", "aac", "-b:a", "192k"];
|
|
13810
|
+
function aacSegmentCount(totalDuration) {
|
|
13811
|
+
return Math.max(1, Math.min(MAX_SEGMENTS, Math.floor(totalDuration / MIN_SEGMENT_SECONDS)));
|
|
13812
|
+
}
|
|
13813
|
+
function splitAdtsFrames(bytes) {
|
|
13814
|
+
const frames = [];
|
|
13815
|
+
for (let at = 0; at < bytes.length; ) {
|
|
13816
|
+
const length = (bytes[at + 3] & 3) << 11 | bytes[at + 4] << 3 | bytes[at + 5] >> 5;
|
|
13817
|
+
if (bytes[at] !== 255 || (bytes[at + 1] & 240) !== 240 || length < 7) {
|
|
13818
|
+
throw new Error(`Not an ADTS frame at byte ${at}`);
|
|
13819
|
+
}
|
|
13820
|
+
frames.push(bytes.subarray(at, at + length));
|
|
13821
|
+
at += length;
|
|
13822
|
+
}
|
|
13823
|
+
return frames;
|
|
13824
|
+
}
|
|
13825
|
+
function planSegments(totalDuration, count) {
|
|
13826
|
+
const packets = Math.ceil(Math.round(totalDuration * SAMPLE_RATE) / FRAME_SAMPLES) + 1;
|
|
13827
|
+
const cuts = Array.from({ length: count + 1 }, (_, k) => Math.round(k * packets / count));
|
|
13828
|
+
return cuts.slice(0, -1).map((cut, k) => {
|
|
13829
|
+
const next = cuts[k + 1];
|
|
13830
|
+
const firstFrame = Math.max(0, cut - PRE_ROLL_FRAMES);
|
|
13831
|
+
const end = k === count - 1 ? "" : `:end_sample=${(next + POST_ROLL_FRAMES) * FRAME_SAMPLES}`;
|
|
13832
|
+
const trim = `atrim=start_sample=${firstFrame * FRAME_SAMPLES}${end}`;
|
|
13833
|
+
return { trim, keepFrom: cut - firstFrame, keepTo: next - firstFrame };
|
|
13834
|
+
});
|
|
13835
|
+
}
|
|
13836
|
+
async function encodeAac(input, outputPath, totalDuration, { signal, timeout }) {
|
|
13837
|
+
const count = aacSegmentCount(totalDuration);
|
|
13838
|
+
if (count === 1) {
|
|
13839
|
+
const args = ["-i", input, "-t", String(totalDuration), ...AAC_ARGS, "-y", outputPath];
|
|
13840
|
+
return runFfmpeg(args, { signal, timeout });
|
|
13841
|
+
}
|
|
13842
|
+
const dir = mkdtempSync4(join11(dirname5(outputPath), ".aac-segments-"));
|
|
13843
|
+
try {
|
|
13844
|
+
const segments = planSegments(totalDuration, count).map((segment, k) => ({
|
|
13845
|
+
...segment,
|
|
13846
|
+
path: join11(dir, `${k}.aac`)
|
|
13847
|
+
}));
|
|
13848
|
+
const results = await Promise.all(
|
|
13849
|
+
segments.map(
|
|
13850
|
+
({ trim, path }) => runFfmpeg(["-i", input, "-af", trim, ...AAC_ARGS, "-f", "adts", "-y", path], {
|
|
13851
|
+
signal,
|
|
13852
|
+
timeout
|
|
13853
|
+
})
|
|
13854
|
+
)
|
|
13855
|
+
);
|
|
13856
|
+
const failed = results.find((result) => !result.success);
|
|
13857
|
+
if (failed) return failed;
|
|
13858
|
+
const joined = join11(dir, "joined.aac");
|
|
13859
|
+
const frames = segments.flatMap(({ path, keepFrom, keepTo }) => {
|
|
13860
|
+
const segmentFrames = splitAdtsFrames(readFileSync5(path));
|
|
13861
|
+
if (segmentFrames.length < keepTo) {
|
|
13862
|
+
throw new Error(`AAC segment ${path} has ${segmentFrames.length} frames, needs ${keepTo}`);
|
|
13863
|
+
}
|
|
13864
|
+
return segmentFrames.slice(keepFrom, keepTo);
|
|
13865
|
+
});
|
|
13866
|
+
writeFileSync4(joined, Buffer.concat(frames));
|
|
13867
|
+
const offset = String(-FRAME_SAMPLES / SAMPLE_RATE);
|
|
13868
|
+
const end = `setts=duration='if(gte((PTS+DURATION)*TB,${totalDuration}),round(${totalDuration}/TB-PTS),DURATION)'`;
|
|
13869
|
+
const muxed = await runFfmpeg(
|
|
13870
|
+
[
|
|
13871
|
+
"-itsoffset",
|
|
13872
|
+
offset,
|
|
13873
|
+
"-f",
|
|
13874
|
+
"aac",
|
|
13875
|
+
"-i",
|
|
13876
|
+
joined,
|
|
13877
|
+
"-c",
|
|
13878
|
+
"copy",
|
|
13879
|
+
"-bsf:a",
|
|
13880
|
+
end,
|
|
13881
|
+
"-y",
|
|
13882
|
+
outputPath
|
|
13883
|
+
],
|
|
13884
|
+
{ signal, timeout }
|
|
13885
|
+
);
|
|
13886
|
+
const slowest = Math.max(...results.map((result) => result.durationMs));
|
|
13887
|
+
return { ...muxed, durationMs: slowest + muxed.durationMs };
|
|
13888
|
+
} finally {
|
|
13889
|
+
rmSync5(dir, { recursive: true, force: true });
|
|
13890
|
+
}
|
|
13891
|
+
}
|
|
13892
|
+
|
|
13777
13893
|
// ../engine/src/services/audioFailureDiagnostic.ts
|
|
13778
13894
|
var STAGES = /* @__PURE__ */ new Set([
|
|
13779
13895
|
"source",
|
|
@@ -13873,8 +13989,8 @@ function audioFailureDiagnostics(values) {
|
|
|
13873
13989
|
}
|
|
13874
13990
|
|
|
13875
13991
|
// ../engine/src/services/audioVolumeEnvelope.ts
|
|
13876
|
-
import { mkdtempSync as
|
|
13877
|
-
import { dirname as
|
|
13992
|
+
import { mkdtempSync as mkdtempSync5, readFileSync as readFileSync6, renameSync as renameSync2, rmSync as rmSync6, writeFileSync as writeFileSync5 } from "fs";
|
|
13993
|
+
import { dirname as dirname6, join as join12 } from "path";
|
|
13878
13994
|
|
|
13879
13995
|
// ../core/dist/runtime/mediaVolumeEnvelope.js
|
|
13880
13996
|
function normaliseEnvelope(keyframes, trackStart, baseVolume) {
|
|
@@ -13996,13 +14112,13 @@ function applyVolumeEnvelopeToWav(wavPath, keyframes, trackStart, baseVolume) {
|
|
|
13996
14112
|
if (!gainAt) return false;
|
|
13997
14113
|
let stagingDir;
|
|
13998
14114
|
try {
|
|
13999
|
-
const buffer =
|
|
14115
|
+
const buffer = readFileSync6(wavPath);
|
|
14000
14116
|
const layout = parseWavLayout(buffer);
|
|
14001
14117
|
if (!layout) return false;
|
|
14002
14118
|
scaleSamples(buffer, layout, gainAt);
|
|
14003
|
-
stagingDir =
|
|
14004
|
-
const tempPath =
|
|
14005
|
-
|
|
14119
|
+
stagingDir = mkdtempSync5(join12(dirname6(wavPath), ".hf-volume-"));
|
|
14120
|
+
const tempPath = join12(stagingDir, "audio.wav");
|
|
14121
|
+
writeFileSync5(tempPath, buffer, { flag: "wx" });
|
|
14006
14122
|
renameSync2(tempPath, wavPath);
|
|
14007
14123
|
return true;
|
|
14008
14124
|
} catch {
|
|
@@ -14010,7 +14126,7 @@ function applyVolumeEnvelopeToWav(wavPath, keyframes, trackStart, baseVolume) {
|
|
|
14010
14126
|
} finally {
|
|
14011
14127
|
if (stagingDir) {
|
|
14012
14128
|
try {
|
|
14013
|
-
|
|
14129
|
+
rmSync6(stagingDir, { recursive: true, force: true });
|
|
14014
14130
|
} catch {
|
|
14015
14131
|
}
|
|
14016
14132
|
}
|
|
@@ -14231,17 +14347,17 @@ function chainTailSeconds(chain, automation) {
|
|
|
14231
14347
|
import {
|
|
14232
14348
|
closeSync as closeSync3,
|
|
14233
14349
|
existsSync as existsSync9,
|
|
14234
|
-
mkdtempSync as
|
|
14350
|
+
mkdtempSync as mkdtempSync6,
|
|
14235
14351
|
openSync as openSync3,
|
|
14236
|
-
readFileSync as
|
|
14352
|
+
readFileSync as readFileSync7,
|
|
14237
14353
|
readSync,
|
|
14238
|
-
rmSync as
|
|
14354
|
+
rmSync as rmSync7,
|
|
14239
14355
|
statSync as statSync7,
|
|
14240
|
-
writeFileSync as
|
|
14356
|
+
writeFileSync as writeFileSync6,
|
|
14241
14357
|
writeSync as writeSync2
|
|
14242
14358
|
} from "fs";
|
|
14243
14359
|
import { tmpdir as tmpdir3 } from "os";
|
|
14244
|
-
import { join as
|
|
14360
|
+
import { join as join13 } from "path";
|
|
14245
14361
|
import { pathToFileURL } from "url";
|
|
14246
14362
|
|
|
14247
14363
|
// ../core/dist/generated/audio-fx-runtime-inline.js
|
|
@@ -14336,7 +14452,7 @@ function readWavHeader(path) {
|
|
|
14336
14452
|
}
|
|
14337
14453
|
}
|
|
14338
14454
|
function readWav(path) {
|
|
14339
|
-
const buf =
|
|
14455
|
+
const buf = readFileSync7(path);
|
|
14340
14456
|
if (buf.length < 44 || buf.toString("ascii", 0, 4) !== "RIFF") {
|
|
14341
14457
|
throw new AudioFxRenderError(`Not a WAV file: ${path}`);
|
|
14342
14458
|
}
|
|
@@ -14399,7 +14515,7 @@ function encodeSamples(samples, float) {
|
|
|
14399
14515
|
function writeWav(path, samples, sampleRate, channels = 1, float = false) {
|
|
14400
14516
|
const body = encodeSamples(samples, float);
|
|
14401
14517
|
const buf = Buffer.concat([wavHeader(body.length, sampleRate, channels, float), body]);
|
|
14402
|
-
|
|
14518
|
+
writeFileSync6(path, buf);
|
|
14403
14519
|
}
|
|
14404
14520
|
function deinterleave(samples, channels) {
|
|
14405
14521
|
if (channels <= 1) return [samples];
|
|
@@ -14525,7 +14641,7 @@ async function renderInSegments(openPage, inputWav, header, chain, outputWav, op
|
|
|
14525
14641
|
);
|
|
14526
14642
|
if (gainAt) applyEnvelopeToPlanes(kept, sampleRate, gainAt, seg.keepFrom);
|
|
14527
14643
|
const bytes = encodeSamples(interleave(kept), float);
|
|
14528
|
-
|
|
14644
|
+
writeFileSync6(outFd, bytes);
|
|
14529
14645
|
written += bytes.length;
|
|
14530
14646
|
}
|
|
14531
14647
|
writeSync2(outFd, wavHeader(written, sampleRate, channels, float), 0, 44, 0);
|
|
@@ -14588,7 +14704,7 @@ async function applyAudioFxChain(inputWav, chain, outputWav, options) {
|
|
|
14588
14704
|
});
|
|
14589
14705
|
}
|
|
14590
14706
|
async function withFxBrowser(options, body) {
|
|
14591
|
-
const hostDir =
|
|
14707
|
+
const hostDir = mkdtempSync6(join13(tmpdir3(), "hf-fx-host-"));
|
|
14592
14708
|
let lease = null;
|
|
14593
14709
|
try {
|
|
14594
14710
|
if (options.signal?.aborted) {
|
|
@@ -14603,15 +14719,15 @@ async function withFxBrowser(options, body) {
|
|
|
14603
14719
|
`Audio FX failed for track ${options.trackId}: ${err.message}`
|
|
14604
14720
|
);
|
|
14605
14721
|
} finally {
|
|
14606
|
-
|
|
14722
|
+
rmSync7(hostDir, { recursive: true, force: true });
|
|
14607
14723
|
await lease?.release().catch(() => void 0);
|
|
14608
14724
|
}
|
|
14609
14725
|
}
|
|
14610
14726
|
async function openFxPage(browser, hostDir) {
|
|
14611
14727
|
const page = await browser.newPage();
|
|
14612
14728
|
try {
|
|
14613
|
-
const hostPage =
|
|
14614
|
-
|
|
14729
|
+
const hostPage = join13(hostDir, "audio-fx.html");
|
|
14730
|
+
writeFileSync6(hostPage, "<!doctype html><meta charset=utf-8><title>audio fx</title>");
|
|
14615
14731
|
await page.goto(pathToFileURL(hostPage).href, {
|
|
14616
14732
|
waitUntil: "domcontentloaded"
|
|
14617
14733
|
});
|
|
@@ -15049,7 +15165,7 @@ function parseAudioElements(html) {
|
|
|
15049
15165
|
}
|
|
15050
15166
|
async function extractAudioSegment(srcPath, outputPath, stage, mediaStart, duration, playbackRate = 1, signal, config) {
|
|
15051
15167
|
const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
|
|
15052
|
-
const outputDir =
|
|
15168
|
+
const outputDir = dirname7(outputPath);
|
|
15053
15169
|
if (!existsSync10(outputDir)) mkdirSync7(outputDir, { recursive: true });
|
|
15054
15170
|
const normalizedPlaybackRate = normalizeRateSpec(playbackRate);
|
|
15055
15171
|
const sourceDuration = sourceTimeAt(normalizedPlaybackRate, duration);
|
|
@@ -15095,7 +15211,7 @@ async function extractAudioSegment(srcPath, outputPath, stage, mediaStart, durat
|
|
|
15095
15211
|
}
|
|
15096
15212
|
async function generateSilence(outputPath, duration, signal, config) {
|
|
15097
15213
|
const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
|
|
15098
|
-
const outputDir =
|
|
15214
|
+
const outputDir = dirname7(outputPath);
|
|
15099
15215
|
if (!existsSync10(outputDir)) mkdirSync7(outputDir, { recursive: true });
|
|
15100
15216
|
const args = [
|
|
15101
15217
|
"-f",
|
|
@@ -15149,7 +15265,7 @@ async function mixAudioTracks(tracks, outputPath, totalDuration, signal, config,
|
|
|
15149
15265
|
failures: result2.failure ? [result2.failure] : void 0
|
|
15150
15266
|
};
|
|
15151
15267
|
}
|
|
15152
|
-
const outputDir =
|
|
15268
|
+
const outputDir = dirname7(outputPath);
|
|
15153
15269
|
if (!existsSync10(outputDir)) mkdirSync7(outputDir, { recursive: true });
|
|
15154
15270
|
const buildFilterComplex = (ignoreAutomation, useNormalize2) => {
|
|
15155
15271
|
const filterParts = [];
|
|
@@ -15166,11 +15282,11 @@ async function mixAudioTracks(tracks, outputPath, totalDuration, signal, config,
|
|
|
15166
15282
|
const runMix = async (ignoreAutomation, useNormalize2) => {
|
|
15167
15283
|
const inputs = [];
|
|
15168
15284
|
tracks.forEach((track) => inputs.push("-i", track.srcPath));
|
|
15169
|
-
const scriptDir =
|
|
15170
|
-
const scriptPath =
|
|
15285
|
+
const scriptDir = mkdtempSync7(join14(outputDir, ".filter-complex-"));
|
|
15286
|
+
const scriptPath = join14(scriptDir, "graph.txt");
|
|
15171
15287
|
const fd = openSync4(scriptPath, "wx", 384);
|
|
15172
15288
|
try {
|
|
15173
|
-
|
|
15289
|
+
writeFileSync7(fd, buildFilterComplex(ignoreAutomation, useNormalize2));
|
|
15174
15290
|
} finally {
|
|
15175
15291
|
closeSync4(fd);
|
|
15176
15292
|
}
|
|
@@ -15180,7 +15296,7 @@ async function mixAudioTracks(tracks, outputPath, totalDuration, signal, config,
|
|
|
15180
15296
|
scriptPath,
|
|
15181
15297
|
"-map",
|
|
15182
15298
|
"[out]",
|
|
15183
|
-
...floatWav ? ["-acodec", "pcm_f32le", "-ar", "48000"] :
|
|
15299
|
+
...floatWav ? ["-acodec", "pcm_f32le", "-ar", "48000"] : AAC_ARGS,
|
|
15184
15300
|
"-t",
|
|
15185
15301
|
String(totalDuration),
|
|
15186
15302
|
"-y",
|
|
@@ -15195,7 +15311,7 @@ async function mixAudioTracks(tracks, outputPath, totalDuration, signal, config,
|
|
|
15195
15311
|
currentArgs[currentArgs.indexOf("-filter_complex_script")] = "-/filter_complex";
|
|
15196
15312
|
return await runFfmpeg(currentArgs, { signal, timeout: ffmpegProcessTimeout });
|
|
15197
15313
|
} finally {
|
|
15198
|
-
|
|
15314
|
+
rmSync8(scriptDir, { recursive: true, force: true });
|
|
15199
15315
|
}
|
|
15200
15316
|
};
|
|
15201
15317
|
let useNormalize = true;
|
|
@@ -15255,7 +15371,7 @@ function groupNormalizeOptionUnsupported(stderr) {
|
|
|
15255
15371
|
}
|
|
15256
15372
|
async function mixGroupMembers(memberTracks, outputPath, totalDuration, signal, config) {
|
|
15257
15373
|
const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
|
|
15258
|
-
const outputDir =
|
|
15374
|
+
const outputDir = dirname7(outputPath);
|
|
15259
15375
|
if (!existsSync10(outputDir)) mkdirSync7(outputDir, { recursive: true });
|
|
15260
15376
|
const buildInputFilters = (ignoreKeyframes) => memberTracks.map((track, i) => {
|
|
15261
15377
|
const volumeFilter = buildVolumeExpression(track, ignoreKeyframes);
|
|
@@ -15273,11 +15389,11 @@ async function mixGroupMembers(memberTracks, outputPath, totalDuration, signal,
|
|
|
15273
15389
|
`${mixInputs}amix=inputs=${memberTracks.length}:duration=longest:dropout_transition=0[mixed];[mixed]volume=${formatFilterNumber(memberTracks.length)}[out]`
|
|
15274
15390
|
);
|
|
15275
15391
|
const filterComplex = [...inputFilters, mixFilter].join(";");
|
|
15276
|
-
const scriptDir =
|
|
15277
|
-
const scriptPath =
|
|
15392
|
+
const scriptDir = mkdtempSync7(join14(outputDir, ".group-filter-complex-"));
|
|
15393
|
+
const scriptPath = join14(scriptDir, "graph.txt");
|
|
15278
15394
|
const fd = openSync4(scriptPath, "wx", 384);
|
|
15279
15395
|
try {
|
|
15280
|
-
|
|
15396
|
+
writeFileSync7(fd, filterComplex);
|
|
15281
15397
|
} finally {
|
|
15282
15398
|
closeSync4(fd);
|
|
15283
15399
|
}
|
|
@@ -15314,7 +15430,7 @@ async function mixGroupMembers(memberTracks, outputPath, totalDuration, signal,
|
|
|
15314
15430
|
currentArgs[currentArgs.indexOf("-filter_complex_script")] = "-/filter_complex";
|
|
15315
15431
|
return await runFfmpeg(currentArgs, { signal, timeout: ffmpegProcessTimeout });
|
|
15316
15432
|
} finally {
|
|
15317
|
-
|
|
15433
|
+
rmSync8(scriptDir, { recursive: true, force: true });
|
|
15318
15434
|
}
|
|
15319
15435
|
};
|
|
15320
15436
|
let useNormalize = true;
|
|
@@ -15338,29 +15454,18 @@ async function mixGroupMembers(memberTracks, outputPath, totalDuration, signal,
|
|
|
15338
15454
|
}
|
|
15339
15455
|
return { success: true, degradedAutomation };
|
|
15340
15456
|
}
|
|
15341
|
-
async function
|
|
15342
|
-
const sumPath =
|
|
15457
|
+
async function mixThroughFloatSum(tracks, masterChain, outputPath, workDir, totalDuration, signal, config) {
|
|
15458
|
+
const sumPath = join14(workDir, "master-sum.wav");
|
|
15343
15459
|
const sum = await mixAudioTracks(tracks, sumPath, totalDuration, signal, config, true);
|
|
15344
15460
|
if (!sum.success) return { ...sum, outputPath };
|
|
15345
|
-
const
|
|
15461
|
+
const encoderInput = masterChain ? (await applyAudioFxChain(sumPath, masterChain, join14(workDir, "master-fx.wav"), {
|
|
15346
15462
|
trackId: "master",
|
|
15347
15463
|
signal
|
|
15464
|
+
})).path : sumPath;
|
|
15465
|
+
const encoded = await encodeAac(encoderInput, outputPath, totalDuration, {
|
|
15466
|
+
signal,
|
|
15467
|
+
timeout: config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout
|
|
15348
15468
|
});
|
|
15349
|
-
const encoded = await runFfmpeg(
|
|
15350
|
-
[
|
|
15351
|
-
"-i",
|
|
15352
|
-
fx.path,
|
|
15353
|
-
"-t",
|
|
15354
|
-
String(totalDuration),
|
|
15355
|
-
"-acodec",
|
|
15356
|
-
"aac",
|
|
15357
|
-
"-b:a",
|
|
15358
|
-
"192k",
|
|
15359
|
-
"-y",
|
|
15360
|
-
outputPath
|
|
15361
|
-
],
|
|
15362
|
-
{ signal, timeout: config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout }
|
|
15363
|
-
);
|
|
15364
15469
|
if (!encoded.success) {
|
|
15365
15470
|
const failure = ffmpegFailure("mix", encoded);
|
|
15366
15471
|
return {
|
|
@@ -15465,7 +15570,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
|
|
|
15465
15570
|
}
|
|
15466
15571
|
let audioSrcPath = srcPath;
|
|
15467
15572
|
if (element.type === "video") {
|
|
15468
|
-
const extractedPath =
|
|
15573
|
+
const extractedPath = join14(workDir, `${element.id}-extracted.wav`);
|
|
15469
15574
|
const extractResult = await extractAudioSegment(
|
|
15470
15575
|
srcPath,
|
|
15471
15576
|
extractedPath,
|
|
@@ -15491,7 +15596,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
|
|
|
15491
15596
|
}
|
|
15492
15597
|
audioSrcPath = extractedPath;
|
|
15493
15598
|
} else {
|
|
15494
|
-
const trimmedPath =
|
|
15599
|
+
const trimmedPath = join14(workDir, `${element.id}-trimmed.wav`);
|
|
15495
15600
|
const prepResult = await extractAudioSegment(
|
|
15496
15601
|
srcPath,
|
|
15497
15602
|
trimmedPath,
|
|
@@ -15536,7 +15641,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
|
|
|
15536
15641
|
const fxResult = await applyAudioFxChain(
|
|
15537
15642
|
audioSrcPath,
|
|
15538
15643
|
chain,
|
|
15539
|
-
|
|
15644
|
+
join14(workDir, `${element.id}-fx.wav`),
|
|
15540
15645
|
{
|
|
15541
15646
|
trackId: element.id,
|
|
15542
15647
|
signal: effectiveSignal,
|
|
@@ -15587,7 +15692,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
|
|
|
15587
15692
|
).catch((err) => {
|
|
15588
15693
|
internalController.abort();
|
|
15589
15694
|
try {
|
|
15590
|
-
|
|
15695
|
+
rmSync8(workDir, { recursive: true, force: true });
|
|
15591
15696
|
} catch {
|
|
15592
15697
|
}
|
|
15593
15698
|
throw err;
|
|
@@ -15612,7 +15717,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
|
|
|
15612
15717
|
});
|
|
15613
15718
|
const removeWorkDir = () => {
|
|
15614
15719
|
try {
|
|
15615
|
-
|
|
15720
|
+
rmSync8(workDir, { recursive: true, force: true });
|
|
15616
15721
|
} catch {
|
|
15617
15722
|
}
|
|
15618
15723
|
};
|
|
@@ -15656,7 +15761,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
|
|
|
15656
15761
|
const meta = groupMeta.get(groupId);
|
|
15657
15762
|
if (!meta) continue;
|
|
15658
15763
|
const pathId = safePathSegment(groupId, groupIndex);
|
|
15659
|
-
const groupWavPath =
|
|
15764
|
+
const groupWavPath = join14(workDir, `group-${pathId}.wav`);
|
|
15660
15765
|
try {
|
|
15661
15766
|
const subMix = await mixGroupMembers(
|
|
15662
15767
|
memberTracks,
|
|
@@ -15689,7 +15794,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
|
|
|
15689
15794
|
const fxResult = await applyAudioFxChain(
|
|
15690
15795
|
groupSrcPath,
|
|
15691
15796
|
chain,
|
|
15692
|
-
|
|
15797
|
+
join14(workDir, `group-${pathId}-fx.wav`),
|
|
15693
15798
|
{
|
|
15694
15799
|
trackId: groupId,
|
|
15695
15800
|
signal: effectiveSignal,
|
|
@@ -15741,7 +15846,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
|
|
|
15741
15846
|
if (failures.length > 0) return bail();
|
|
15742
15847
|
let mixResult;
|
|
15743
15848
|
try {
|
|
15744
|
-
mixResult = masterChain && tracks.length > 0 ? await
|
|
15849
|
+
mixResult = (masterChain || aacSegmentCount(totalDuration) > 1) && tracks.length > 0 ? await mixThroughFloatSum(
|
|
15745
15850
|
tracks,
|
|
15746
15851
|
masterChain,
|
|
15747
15852
|
outputPath,
|
|
@@ -15769,21 +15874,21 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
|
|
|
15769
15874
|
import { cpus as cpus2, freemem } from "os";
|
|
15770
15875
|
import { existsSync as existsSync11, mkdirSync as mkdirSync8, readdirSync as readdirSync6 } from "fs";
|
|
15771
15876
|
import { copyFile, readFile as readFile2, rename } from "fs/promises";
|
|
15772
|
-
import { join as
|
|
15877
|
+
import { join as join16 } from "path";
|
|
15773
15878
|
import { getHeapStatistics } from "v8";
|
|
15774
15879
|
|
|
15775
15880
|
// ../engine/src/utils/psnr.ts
|
|
15776
15881
|
import { execFile as execFile3 } from "child_process";
|
|
15777
15882
|
import { mkdtemp, rm, writeFile } from "fs/promises";
|
|
15778
15883
|
import { tmpdir as tmpdir4 } from "os";
|
|
15779
|
-
import { join as
|
|
15884
|
+
import { join as join15 } from "path";
|
|
15780
15885
|
import { promisify as promisify3 } from "util";
|
|
15781
15886
|
async function psnrDb(a, b) {
|
|
15782
15887
|
const execFileP = promisify3(execFile3);
|
|
15783
|
-
const dir = await mkdtemp(
|
|
15888
|
+
const dir = await mkdtemp(join15(tmpdir4(), "hf-de-verify-"));
|
|
15784
15889
|
try {
|
|
15785
|
-
const pa =
|
|
15786
|
-
const pb =
|
|
15890
|
+
const pa = join15(dir, "a.jpg");
|
|
15891
|
+
const pb = join15(dir, "b.jpg");
|
|
15787
15892
|
await Promise.all([writeFile(pa, a), writeFile(pb, b)]);
|
|
15788
15893
|
const { stderr } = await execFileP(
|
|
15789
15894
|
getFfmpegBinary(),
|
|
@@ -16007,7 +16112,7 @@ function distributeFrames(totalFrames, workerCount, workDir, rangeStart = 0) {
|
|
|
16007
16112
|
workerId: i,
|
|
16008
16113
|
startFrame,
|
|
16009
16114
|
endFrame,
|
|
16010
|
-
outputDir:
|
|
16115
|
+
outputDir: join16(workDir, `worker-${i}`),
|
|
16011
16116
|
outputFrameOffset: rangeStart
|
|
16012
16117
|
});
|
|
16013
16118
|
}
|
|
@@ -16021,7 +16126,7 @@ function distributeFramesInterleaved(totalFrames, workerCount, workDir, rangeSta
|
|
|
16021
16126
|
startFrame: rangeStart + i,
|
|
16022
16127
|
endFrame: rangeStart + totalFrames,
|
|
16023
16128
|
frameStride: workerCount,
|
|
16024
|
-
outputDir:
|
|
16129
|
+
outputDir: join16(workDir, `worker-${i}`),
|
|
16025
16130
|
outputFrameOffset: rangeStart
|
|
16026
16131
|
});
|
|
16027
16132
|
}
|
|
@@ -16221,7 +16326,7 @@ async function verifyDiskDrawElementSamples(session, task, streaming) {
|
|
|
16221
16326
|
for (const idx of selectVerifySampleIndicesForTask(truths.keys(), task)) {
|
|
16222
16327
|
const truth = truths.get(idx);
|
|
16223
16328
|
if (!truth) continue;
|
|
16224
|
-
const framePath =
|
|
16329
|
+
const framePath = join16(task.outputDir, `frame_${String(idx - offset).padStart(6, "0")}.${ext}`);
|
|
16225
16330
|
const db = await psnrForDiskSample(framePath, truth, task.workerId, idx);
|
|
16226
16331
|
if (db === null) continue;
|
|
16227
16332
|
assertDiskSampleAboveFloor(db, verifyMinDb, idx, task.workerId);
|
|
@@ -16458,8 +16563,8 @@ async function mergeWorkerFrames(workDir, tasks, outputDir) {
|
|
|
16458
16563
|
}
|
|
16459
16564
|
const files = readdirSync6(task.outputDir).filter((f) => f.startsWith("frame_") && (f.endsWith(".jpg") || f.endsWith(".png"))).sort();
|
|
16460
16565
|
const copyTasks = files.map(async (file) => {
|
|
16461
|
-
const sourcePath =
|
|
16462
|
-
const targetPath =
|
|
16566
|
+
const sourcePath = join16(task.outputDir, file);
|
|
16567
|
+
const targetPath = join16(outputDir, file);
|
|
16463
16568
|
try {
|
|
16464
16569
|
await rename(sourcePath, targetPath);
|
|
16465
16570
|
} catch {
|
|
@@ -16483,8 +16588,8 @@ function getSystemResources() {
|
|
|
16483
16588
|
// ../engine/src/services/fileServer.ts
|
|
16484
16589
|
import { Hono } from "hono";
|
|
16485
16590
|
import { serve } from "@hono/node-server";
|
|
16486
|
-
import { readFileSync as
|
|
16487
|
-
import { join as
|
|
16591
|
+
import { readFileSync as readFileSync8, openSync as openSync5, fstatSync, closeSync as closeSync5, statSync as statSync8, constants } from "fs";
|
|
16592
|
+
import { join as join17, extname as extname3 } from "path";
|
|
16488
16593
|
var MIME_TYPES = {
|
|
16489
16594
|
".html": "text/html; charset=utf-8",
|
|
16490
16595
|
".css": "text/css; charset=utf-8",
|
|
@@ -16525,16 +16630,16 @@ function readRegularFile(filePath) {
|
|
|
16525
16630
|
}
|
|
16526
16631
|
try {
|
|
16527
16632
|
if (!fstatSync(fd).isFile()) return null;
|
|
16528
|
-
return
|
|
16633
|
+
return readFileSync8(fd);
|
|
16529
16634
|
} finally {
|
|
16530
16635
|
closeSync5(fd);
|
|
16531
16636
|
}
|
|
16532
16637
|
}
|
|
16533
16638
|
function resolveContainedPaths(projectDir, compiledDir, relativePath) {
|
|
16534
|
-
const projectPath =
|
|
16639
|
+
const projectPath = join17(projectDir, relativePath);
|
|
16535
16640
|
if (!isWithinProjectRoot(projectDir, projectPath)) return null;
|
|
16536
16641
|
if (!compiledDir) return { projectPath, compiledPath: null };
|
|
16537
|
-
const compiledPath =
|
|
16642
|
+
const compiledPath = join17(compiledDir, relativePath);
|
|
16538
16643
|
if (!isWithinProjectRoot(compiledDir, compiledPath)) return null;
|
|
16539
16644
|
return { projectPath, compiledPath };
|
|
16540
16645
|
}
|
|
@@ -7,29 +7,29 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
RegistryCompatibilityError,
|
|
9
9
|
gateRegistryItemsCompatibility
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PP64Q43K.js";
|
|
11
11
|
import {
|
|
12
12
|
DEFAULT_PROJECT_CONFIG,
|
|
13
13
|
createProjectConfig,
|
|
14
14
|
loadProjectConfig,
|
|
15
15
|
projectConfigPath,
|
|
16
16
|
recordProjectRegistryItems
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-PCX3YF2U.js";
|
|
18
18
|
import {
|
|
19
19
|
resolveItemWithDependencies,
|
|
20
20
|
resolveItemsByTag
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-44GV6ZMC.js";
|
|
22
22
|
import {
|
|
23
23
|
InvalidVariableValuesError,
|
|
24
24
|
prepareItem,
|
|
25
25
|
publishItem
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-QO3JEPEW.js";
|
|
27
27
|
import {
|
|
28
28
|
DEFAULT_REGISTRY_URL
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-2E7NDKTN.js";
|
|
30
30
|
import {
|
|
31
31
|
trackRegistryItemAdded
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-4B6PUT4R.js";
|
|
33
33
|
import {
|
|
34
34
|
defineCommand
|
|
35
35
|
} from "./chunk-S3S4TGEH.js";
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
} from "./chunk-ZTZA4UWZ.js";
|
|
42
42
|
import {
|
|
43
43
|
ITEM_TYPE_DIRS
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-QZUVPWC4.js";
|
|
45
45
|
import {
|
|
46
46
|
isProjectRootMissing,
|
|
47
47
|
realpath
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
typeDirPath,
|
|
21
21
|
updateRecord,
|
|
22
22
|
withFigmaErrors
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-LWB3KZ5E.js";
|
|
24
24
|
import {
|
|
25
25
|
defineCommand
|
|
26
26
|
} from "./chunk-S3S4TGEH.js";
|
|
@@ -229,7 +229,7 @@ var asset_default = defineCommand({
|
|
|
229
229
|
rendered > 0 ? `(${results.length} nodes, ${rendered} rendered in 1 figma request)` : `(${results.length} nodes, all reused from cache \u2014 no figma request)`
|
|
230
230
|
);
|
|
231
231
|
}
|
|
232
|
-
const { trackFigmaImport } = await import("./telemetry-
|
|
232
|
+
const { trackFigmaImport } = await import("./telemetry-763NW3QF.js");
|
|
233
233
|
trackFigmaImport({
|
|
234
234
|
phase: "asset",
|
|
235
235
|
reused: results.every((r) => r.reused),
|