hyperframes 0.8.107 → 0.8.108
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-DXZ3HNQI.js → add-OH75E7FX.js} +15 -15
- package/dist/{animatedGifPrep-2IQB4DGE.js → animatedGifPrep-ZDAWSJYL.js} +6 -6
- package/dist/{asset-KZIG3MZN.js → asset-BVDO4DEW.js} +2 -2
- package/dist/{assetCataloger-4GE6PIUA.js → assetCataloger-FXEHOUA3.js} +2 -2
- package/dist/{auth-5IYF3H67.js → auth-K5GUKO5S.js} +2 -2
- package/dist/{autoUpdate-5C3FXM6Y.js → autoUpdate-77ROWK5G.js} +2 -2
- package/dist/{backgroundChecks-75WGW4NB.js → backgroundChecks-3Q3D5WBJ.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-FKKS3YBX.js → batchRender-ZTHFMHZY.js} +3 -3
- package/dist/{beats-ISR36NSK.js → beats-HQZPR6KE.js} +18 -12
- package/dist/{benchmark-U6TQ6DS2.js → benchmark-BQOWARGU.js} +12 -12
- package/dist/{browser-VDS6QAVA.js → browser-45CK7HXI.js} +9 -9
- package/dist/{bundleWithLocalizedFonts-PMWWW5YG.js → bundleWithLocalizedFonts-3M2LKRHK.js} +2 -2
- package/dist/{capture-5KE34KCD.js → capture-6IVZXM7G.js} +2 -2
- package/dist/{capture-BKA3UCZS.js → capture-VGEUOP7N.js} +7 -7
- package/dist/{catalog-ZXOSU27O.js → catalog-VHD7B6FD.js} +15 -15
- package/dist/{check-MZMZCXPN.js → check-UPNZZJXV.js} +30 -29
- package/dist/{checkBrowser-UIZJXYCQ.js → checkBrowser-KWTHKOOP.js} +29 -28
- package/dist/{chunk-L7XDI3DT.js → chunk-5N4KKGSZ.js} +1 -1
- package/dist/{normalize-audio-J2PG6YXH.js → chunk-5ON5GH3X.js} +101 -209
- package/dist/{chunk-HGL4WJDI.js → chunk-5R5UHSXN.js} +9 -9
- package/dist/{chunk-AO4PBESP.js → chunk-AFGDOKRI.js} +7 -7
- package/dist/{chunk-NHTRUAMD.js → chunk-AWUZ3AUD.js} +1 -1
- package/dist/{chunk-VMDEGITC.js → chunk-B25H4M4V.js} +1 -1
- package/dist/{chunk-3WG63KFW.js → chunk-C6XQER6H.js} +25 -11
- package/dist/{chunk-FLUBCMNT.js → chunk-CFC3EEDQ.js} +1 -1
- package/dist/{chunk-6QWHIARJ.js → chunk-D7SCIX4D.js} +1 -1
- package/dist/{chunk-T4Z4UNSX.js → chunk-FZGUZIK5.js} +3 -3
- package/dist/{chunk-73VPF3SS.js → chunk-GYYFNAVA.js} +1 -1
- package/dist/{chunk-BRTGJ73L.js → chunk-HQGJLZB6.js} +2 -2
- package/dist/{chunk-3CYAZWF2.js → chunk-J7XPPADY.js} +3 -3
- package/dist/{chunk-4W4UDPCH.js → chunk-KVOWTRD5.js} +2 -2
- package/dist/{chunk-SKPL32FI.js → chunk-KZ5OSG4G.js} +1 -1
- package/dist/{chunk-TI5Z4SWP.js → chunk-KZJ6V7RT.js} +3 -3
- package/dist/{chunk-P7XRDAWU.js → chunk-LAQEZHOH.js} +1 -1
- package/dist/{chunk-HJCTKNXF.js → chunk-LPXM5L6S.js} +1 -1
- package/dist/{chunk-J6CSEDK7.js → chunk-LTYI4E42.js} +4 -4
- package/dist/{chunk-KTPQ67TX.js → chunk-LZPAZZZP.js} +1 -1
- package/dist/{chunk-GLTHJJIF.js → chunk-MGTECHI3.js} +2 -2
- package/dist/{chunk-ADP6TMYP.js → chunk-NGVH2QYT.js} +8 -8
- package/dist/{chunk-YY5J75H5.js → chunk-NJLFRKHX.js} +3 -3
- package/dist/{chunk-OGTR33KN.js → chunk-NROJESOK.js} +2 -2
- package/dist/{chunk-QM2NUN2B.js → chunk-ONY5CJXS.js} +2 -2
- package/dist/{chunk-PU2IOWX4.js → chunk-OVRFBUXU.js} +2 -2
- package/dist/{chunk-D5EJCP26.js → chunk-QB6OM2BP.js} +79 -64
- package/dist/{chunk-WBVPQC7J.js → chunk-QBHT234I.js} +1 -1
- package/dist/{chunk-3LBFLW7E.js → chunk-QRXICW5Q.js} +1 -1
- package/dist/{chunk-YVEZT6WT.js → chunk-RPMXMOFU.js} +1 -1
- package/dist/{chunk-QH6UFY2O.js → chunk-RSL3XFMO.js} +4 -4
- package/dist/{chunk-C3KEF3UA.js → chunk-SIVCJJHE.js} +1 -1
- package/dist/{chunk-4DJXCVQJ.js → chunk-SQ42NHXP.js} +574 -61
- package/dist/{chunk-SGBOZ2HF.js → chunk-THVNQFYG.js} +1 -1
- package/dist/{chunk-T3BOWXPX.js → chunk-TIZQC44K.js} +1 -1
- package/dist/{chunk-I73Z6OOE.js → chunk-US7SWKGC.js} +1 -1
- package/dist/{chunk-TPPIERG3.js → chunk-VBXJSCHR.js} +3 -3
- package/dist/{chunk-NX6G66F4.js → chunk-VLHN34SB.js} +2 -2
- package/dist/{chunk-R4IB642V.js → chunk-X763EUBO.js} +2 -2
- package/dist/{chunk-Z4UAXNWV.js → chunk-XIGK4LNU.js} +2 -2
- package/dist/{chunk-JNY3VJWB.js → chunk-XYVFPDNU.js} +1 -1
- package/dist/chunk-YLVI7VL5.js +3541 -0
- package/dist/{chunk-7BI5BYMQ.js → chunk-ZFL6FVQZ.js} +5 -5
- package/dist/{clean-46MZVA37.js → clean-LCRWNIWO.js} +15 -14
- package/dist/cli.js +50 -50
- package/dist/{cloud-GAZQGPCW.js → cloud-ITRFE5UN.js} +4 -4
- package/dist/{cloudrun-ZWL7SLDD.js → cloudrun-LVZ4OPPC.js} +3 -3
- package/dist/{compare-66AAJESM.js → compare-NPVMUILH.js} +24 -23
- package/dist/{compiler-3N7XQRH6.js → compiler-YYOV2BJ7.js} +3 -3
- package/dist/{component-3OCOHK2B.js → component-HJFMHPNW.js} +3 -3
- package/dist/{compositions-H2BP4N6F.js → compositions-I34RN5WD.js} +11 -11
- package/dist/{delete-WNJLVPGO.js → delete-WN3J74BD.js} +2 -2
- package/dist/{dist-AY2RBEXL.js → dist-WCMFH74H.js} +1 -1
- package/dist/{dist-HSEMXPG3.js → dist-YUIPB7OX.js} +8 -2
- package/dist/{doctor-IFOZS45N.js → doctor-MYC2S3J3.js} +10 -10
- package/dist/{events-6TH3FU3F.js → events-7JVV4746.js} +9 -9
- package/dist/{events-5EKFJCCZ.js → events-AEUV2JPA.js} +8 -8
- package/dist/{feedback-QRQNMORT.js → feedback-X7DDSZPU.js} +10 -10
- package/dist/{figma-WONEPLUQ.js → figma-ISI4PPTF.js} +3 -3
- package/dist/fontLocalizeCli.js +8 -8
- package/dist/{get-C7FCYNI2.js → get-IYALAE4I.js} +2 -2
- package/dist/{gpuPolicy-BXXQF3VC.js → gpuPolicy-KSWTVU5C.js} +6 -6
- package/dist/{grade-compare-SCCSZ5P3.js → grade-compare-YWPIWQLK.js} +24 -23
- package/dist/{help-FJOUNXVD.js → help-S2KJRMAJ.js} +1 -1
- package/dist/{history-OZY36NEC.js → history-CQDDCY4J.js} +15 -14
- package/dist/hyperframe-runtime.js +54 -54
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +54 -54
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/{info-RG4SZQ2C.js → info-4KFNUWYN.js} +11 -11
- package/dist/{init-YGZCDKSS.js → init-I7GMRHFW.js} +22 -22
- package/dist/{inspect-X547EZ4I.js → inspect-DUCLCHSD.js} +25 -24
- package/dist/{installer-6J24NTIV.js → installer-NBEN3ZIP.js} +4 -4
- package/dist/{keyframes-EIWEION2.js → keyframes-F3VDEN66.js} +12 -12
- package/dist/{lambda-DSZDMP7P.js → lambda-BFHJMMCG.js} +4 -4
- package/dist/{layout-B7KCBLBH.js → layout-RNCXJI6C.js} +25 -24
- package/dist/{lint-RBDG4ERJ.js → lint-3NKKYCMH.js} +12 -12
- package/dist/{lintProject-CMPAR7BS.js → lintProject-F2OTN2IR.js} +1 -1
- package/dist/{list-BPHPHLDJ.js → list-Q7SOE3NF.js} +2 -2
- package/dist/{login-HV7KBW2J.js → login-TGRGWS5E.js} +4 -4
- package/dist/{media-treatment-RS6BZSQC.js → media-treatment-5TUXWHWE.js} +12 -12
- package/dist/{models-K4U7GRXV.js → models-YJUTM6TH.js} +7 -7
- package/dist/{motionShot-5AI2DALY.js → motionShot-5QUMZ7J3.js} +10 -10
- package/dist/normalize-audio-63BI5BPL.js +276 -0
- package/dist/{pipeline-HIUESSET.js → pipeline-4NN5T7Q3.js} +6 -6
- package/dist/{play-TTLQXBAH.js → play-SRDESSZI.js} +20 -19
- package/dist/{preflight-63ODQ625.js → preflight-SVN4PSFO.js} +7 -7
- package/dist/{present-XKGZ26FQ.js → present-TDYR5LRW.js} +16 -15
- package/dist/{preview-O2YEKMYJ.js → preview-Z5MFRZUM.js} +17 -17
- package/dist/{producer-ZTQIJO7E.js → producer-RS7CB3XJ.js} +1 -1
- package/dist/{projectConfig-VVFH7XW5.js → projectConfig-JHEWPAA5.js} +6 -6
- package/dist/{publication-NALPAHDC.js → publication-7XA2H7UB.js} +2 -2
- package/dist/{publish-G7OL45EL.js → publish-2R22XX77.js} +8 -8
- package/dist/{remove-background-LOLKFKLT.js → remove-background-KT2SWYCC.js} +7 -7
- package/dist/{render-I65IU7RM.js → render-4C3YKVZI.js} +3 -3
- package/dist/{render-ULQLUIWD.js → render-7GDLEGXT.js} +12 -12
- package/dist/{render-EXSRG666.js → render-Y2Y7N5WD.js} +21 -21
- package/dist/{render-batch-RSNCREPB.js → render-batch-AFDBPDMM.js} +3 -3
- package/dist/{renderCancellation-2WB4SGXR.js → renderCancellation-RQ3UVNVJ.js} +6 -6
- package/dist/renderSetupWorker.js +1 -1
- package/dist/{resolver-CVN2IM2R.js → resolver-S72XBTEQ.js} +4 -4
- package/dist/{sherpa-OJUI54HG.js → sherpa-PR3I4KGM.js} +7 -7
- package/dist/{skills-CPS5E5YP.js → skills-BEYZZWY6.js} +11 -11
- package/dist/{skillsUpdateCheck-3IT5CJWU.js → skillsUpdateCheck-3USXDPWV.js} +3 -3
- package/dist/{snapshot-MSGC7HTA.js → snapshot-S77MQOV2.js} +25 -24
- package/dist/{src-SV7CNZXN.js → src-6R4DC2YI.js} +5 -5
- package/dist/{src-EZBJT4VH.js → src-IOJXK4VC.js} +7 -7
- package/dist/{staticProjectServer-5JAGMYT7.js → staticProjectServer-RXAFGDK7.js} +14 -13
- package/dist/{status-4W3EJYEH.js → status-CRS7H6FA.js} +6 -6
- package/dist/studio/assets/{hyperframes-player-h4mktSdm.js → hyperframes-player-BakGew45.js} +1 -1
- package/dist/studio/assets/{index-D8GKc2D9.js → index-C5dyUHwk.js} +1 -1
- package/dist/studio/assets/{index-CM1xA_jD.js → index-C842tcVa.js} +165 -165
- package/dist/studio/assets/{index-zoqPmBF6.js → index-CPe7d_wO.js} +1 -1
- package/dist/studio/assets/{index-lrT-gfHa.css → index-ncVJ5IVu.css} +1 -1
- package/dist/studio/chunk-6LUNLTHR.js +611 -0
- package/dist/studio/chunk-6LUNLTHR.js.map +1 -0
- package/dist/studio/{chunk-4OZC426H.js → chunk-AOWVEVEU.js} +3 -503
- package/dist/studio/chunk-AOWVEVEU.js.map +1 -0
- package/dist/studio/{chunk-46XP7J3B.js → chunk-PQFEBX32.js} +5 -3
- package/dist/studio/chunk-PQFEBX32.js.map +1 -0
- package/dist/studio/{domEditingLayers-AQBDFNUC.js → domEditingLayers-JQPQGGT7.js} +3 -3
- package/dist/studio/index.d.ts +11 -2
- package/dist/studio/index.html +2 -2
- package/dist/studio/index.js +12416 -11195
- package/dist/studio/index.js.map +1 -1
- package/dist/studio/player.js +2 -2
- package/dist/studio/styles.css +1 -1
- package/dist/{studio-api-L2TJ2JTK.js → studio-api-3FH7OSSS.js} +8 -7
- package/dist/{studioServer-UV7YRYWN.js → studioServer-4E5RRPU7.js} +44 -38
- package/dist/{system-OL4MXRPK.js → system-YMANAUAM.js} +6 -6
- package/dist/{telemetry-WRUU725E.js → telemetry-46XSB2VN.js} +9 -9
- package/dist/{timeline-P43A53BW.js → timeline-XKLKHGD2.js} +15 -14
- package/dist/{tokens-NUHTJM2V.js → tokens-JCZKPUPT.js} +2 -2
- package/dist/{transcribe-FSVNIFGF.js → transcribe-FIFJ3BBB.js} +12 -12
- package/dist/{transcribe-TRLZJK73.js → transcribe-FQ4YC2AS.js} +7 -7
- package/dist/{updateCheck-33TAG46I.js → updateCheck-PDIH4GZW.js} +2 -2
- package/dist/{upgrade-AJ6QBTH2.js → upgrade-TTGO6JCF.js} +2 -2
- package/dist/{urlDownloader-MP6GJIDV.js → urlDownloader-32JRHOPN.js} +5 -5
- package/dist/{validate-VL3A6VTJ.js → validate-G5F56ONL.js} +15 -15
- package/dist/{video-KO7VT63P.js → video-SGBEMEKA.js} +6 -6
- package/package.json +1 -1
- package/dist/chunk-PMLZPNIB.js +0 -3431
- package/dist/studio/chunk-46XP7J3B.js.map +0 -1
- package/dist/studio/chunk-4OZC426H.js.map +0 -1
- package/dist/studio/chunk-DI4LCJHL.js +0 -102
- package/dist/studio/chunk-DI4LCJHL.js.map +0 -1
- /package/dist/studio/{domEditingLayers-AQBDFNUC.js.map → domEditingLayers-JQPQGGT7.js.map} +0 -0
|
@@ -4,64 +4,21 @@ import { dirname as __hf_dirname } from "node:path";
|
|
|
4
4
|
var require = __hf_createRequire(import.meta.url);
|
|
5
5
|
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
|
-
import {
|
|
8
|
-
resolveProject
|
|
9
|
-
} from "./chunk-I73Z6OOE.js";
|
|
10
|
-
import "./chunk-IHFUKJOR.js";
|
|
11
|
-
import "./chunk-TPPIERG3.js";
|
|
12
|
-
import "./chunk-3CYAZWF2.js";
|
|
13
|
-
import "./chunk-VWG7OQKU.js";
|
|
14
|
-
import {
|
|
15
|
-
c
|
|
16
|
-
} from "./chunk-ZTZA4UWZ.js";
|
|
17
|
-
import "./chunk-C3KEF3UA.js";
|
|
18
|
-
import "./chunk-AMKC3AXA.js";
|
|
19
|
-
import {
|
|
20
|
-
defineCommand
|
|
21
|
-
} from "./chunk-S3S4TGEH.js";
|
|
22
|
-
import "./chunk-54HJ63Q2.js";
|
|
23
|
-
import {
|
|
24
|
-
failCommand
|
|
25
|
-
} from "./chunk-PBN6GBJE.js";
|
|
26
|
-
import "./chunk-D5EJCP26.js";
|
|
27
|
-
import "./chunk-VMDEGITC.js";
|
|
28
|
-
import "./chunk-UUDQD62L.js";
|
|
29
|
-
import "./chunk-DPVXBVLL.js";
|
|
30
|
-
import "./chunk-R4IB642V.js";
|
|
31
7
|
import {
|
|
32
8
|
MAX_AUDIO_GAIN_DB,
|
|
33
|
-
formatAudioGain
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
import "./chunk-OFQWTKPW.js";
|
|
37
|
-
import "./chunk-TWWSYAKJ.js";
|
|
38
|
-
import "./chunk-QM2NUN2B.js";
|
|
39
|
-
import "./chunk-HBBJFK6I.js";
|
|
9
|
+
formatAudioGain,
|
|
10
|
+
isAudibleVideoElement
|
|
11
|
+
} from "./chunk-YLVI7VL5.js";
|
|
40
12
|
import {
|
|
41
13
|
findFfBinary
|
|
42
14
|
} from "./chunk-PJ3HDUCY.js";
|
|
43
|
-
import "./chunk-TQFG7HTI.js";
|
|
44
|
-
import "./chunk-GK4AIFIH.js";
|
|
45
|
-
import "./chunk-2PSPARWP.js";
|
|
46
|
-
import "./chunk-K4WIOZFP.js";
|
|
47
|
-
import "./chunk-XUXGIA7H.js";
|
|
48
|
-
import "./chunk-WERLJGIC.js";
|
|
49
|
-
import "./chunk-ISN5GRYI.js";
|
|
50
|
-
import "./chunk-OGTR33KN.js";
|
|
51
|
-
import "./chunk-KNU5COPB.js";
|
|
52
|
-
import "./chunk-3GXQPCJC.js";
|
|
53
|
-
import "./chunk-RQVDTPGD.js";
|
|
54
|
-
import "./chunk-PMRBLBUP.js";
|
|
55
|
-
import "./chunk-M2WBOQ2Q.js";
|
|
56
15
|
|
|
57
|
-
//
|
|
16
|
+
// ../studio-server/dist/chunk-TEYDBVSK.js
|
|
58
17
|
import { execFile } from "child_process";
|
|
59
|
-
import { existsSync, readFileSync, renameSync, writeFileSync } from "fs";
|
|
60
18
|
import { isAbsolute, relative, resolve } from "path";
|
|
61
19
|
import { promisify } from "util";
|
|
62
20
|
var execFileAsync = promisify(execFile);
|
|
63
21
|
var FFMPEG_TIMEOUT_MS = 12e4;
|
|
64
|
-
var DEFAULT_TOLERANCE_LU = 0.5;
|
|
65
22
|
function authoredNumber(raw, fallback, attribute, id, strictlyPositive = false) {
|
|
66
23
|
if (raw === void 0) return fallback;
|
|
67
24
|
const value = Number(raw);
|
|
@@ -121,14 +78,28 @@ function commentEnd(html, start) {
|
|
|
121
78
|
if (end < 0) throw new Error("Unterminated HTML comment");
|
|
122
79
|
return end + 3;
|
|
123
80
|
}
|
|
81
|
+
var isSpaceAt = (html, index) => /\s/.test(html.charAt(index));
|
|
82
|
+
var isWordAt = (html, index) => /\w/.test(html.charAt(index));
|
|
83
|
+
function skipSpaces(html, index) {
|
|
84
|
+
let cursor = index;
|
|
85
|
+
while (cursor < html.length && isSpaceAt(html, cursor)) cursor++;
|
|
86
|
+
return cursor;
|
|
87
|
+
}
|
|
124
88
|
function parsedStartTag(html, start) {
|
|
125
|
-
|
|
126
|
-
|
|
89
|
+
let cursor = skipSpaces(html, start + 1);
|
|
90
|
+
const closing = html.charAt(cursor) === "/";
|
|
91
|
+
if (closing) cursor = skipSpaces(html, cursor + 1);
|
|
92
|
+
const nameStart = cursor;
|
|
93
|
+
if (!/[a-z]/i.test(html.charAt(cursor))) return null;
|
|
94
|
+
while (/[a-z\d:-]/i.test(html.charAt(cursor + 1))) cursor++;
|
|
95
|
+
let nameEnd = cursor + 1;
|
|
96
|
+
while (nameEnd > nameStart && isWordAt(html, nameEnd - 1) === isWordAt(html, nameEnd)) nameEnd--;
|
|
97
|
+
if (nameEnd === nameStart) return null;
|
|
127
98
|
return {
|
|
128
99
|
start,
|
|
129
100
|
end: startTagEnd(html, start),
|
|
130
|
-
closing
|
|
131
|
-
name:
|
|
101
|
+
closing,
|
|
102
|
+
name: html.slice(nameStart, nameEnd).toLowerCase()
|
|
132
103
|
};
|
|
133
104
|
}
|
|
134
105
|
function rawTextElementEnd(html, lower, tag) {
|
|
@@ -139,20 +110,26 @@ function rawTextElementEnd(html, lower, tag) {
|
|
|
139
110
|
}
|
|
140
111
|
function scanMarkup(html, lower, start) {
|
|
141
112
|
if (html.startsWith("<!--", start)) {
|
|
142
|
-
return { cursor: commentEnd(html, start),
|
|
113
|
+
return { cursor: commentEnd(html, start), mediaRange: null };
|
|
143
114
|
}
|
|
144
115
|
const tag = parsedStartTag(html, start);
|
|
145
116
|
if (!tag) {
|
|
146
117
|
const marker = html[start + 1];
|
|
147
118
|
const cursor = marker === "!" || marker === "?" ? startTagEnd(html, start) : start + 1;
|
|
148
|
-
return { cursor,
|
|
119
|
+
return { cursor, mediaRange: null };
|
|
149
120
|
}
|
|
150
121
|
const rawTextEnd = rawTextElementEnd(html, lower, tag);
|
|
151
|
-
if (rawTextEnd !== null) return { cursor: rawTextEnd,
|
|
152
|
-
|
|
153
|
-
return { cursor: tag.end, audioRange };
|
|
122
|
+
if (rawTextEnd !== null) return { cursor: rawTextEnd, mediaRange: null };
|
|
123
|
+
return { cursor: tag.end, mediaRange: mediaRangeOf(tag) };
|
|
154
124
|
}
|
|
155
|
-
function
|
|
125
|
+
function mediaRangeOf(tag) {
|
|
126
|
+
if (tag.closing) return null;
|
|
127
|
+
if (tag.name === "audio" || tag.name === "video") {
|
|
128
|
+
return { start: tag.start, end: tag.end, name: tag.name };
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
function mediaTagRanges(html) {
|
|
156
133
|
const lower = html.toLowerCase();
|
|
157
134
|
const ranges = [];
|
|
158
135
|
let cursor = 0;
|
|
@@ -160,7 +137,7 @@ function audioTagRanges(html) {
|
|
|
160
137
|
const start = html.indexOf("<", cursor);
|
|
161
138
|
if (start < 0) break;
|
|
162
139
|
const scanned = scanMarkup(html, lower, start);
|
|
163
|
-
if (scanned.
|
|
140
|
+
if (scanned.mediaRange) ranges.push(scanned.mediaRange);
|
|
164
141
|
cursor = scanned.cursor;
|
|
165
142
|
}
|
|
166
143
|
return ranges;
|
|
@@ -184,11 +161,27 @@ function requiredAudioIdentity(attributes) {
|
|
|
184
161
|
if (!src) throw new Error(`Audio #${id} has no src`);
|
|
185
162
|
return { id, src };
|
|
186
163
|
}
|
|
187
|
-
function
|
|
164
|
+
function hasBareAttribute(html, range, name) {
|
|
165
|
+
const unquoted = html.slice(range.start, range.end).replace(/"[^"]*"|'[^']*'/g, '""');
|
|
166
|
+
return new RegExp(`\\s${name}(?=[\\s/>=])`, "i").test(unquoted);
|
|
167
|
+
}
|
|
168
|
+
function isAudibleVideoTag(html, range, attributes) {
|
|
169
|
+
return isAudibleVideoElement({
|
|
170
|
+
tagName: "video",
|
|
171
|
+
hasAttribute: (name) => attributes.has(name) || hasBareAttribute(html, range, name),
|
|
172
|
+
getAttribute: (name) => attributes.get(name)?.value ?? null
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function inScopeVideo(html, range, attributes) {
|
|
176
|
+
return isAudibleVideoTag(html, range, attributes) && trimmedAttribute(attributes, "id") !== "" && trimmedAttribute(attributes, "src") !== "";
|
|
177
|
+
}
|
|
178
|
+
function mediaTagFromRange(html, range) {
|
|
188
179
|
const attributes = attributesInTag(html, range.start, range.end);
|
|
180
|
+
if (range.name === "video" && !inScopeVideo(html, range, attributes)) return null;
|
|
189
181
|
const { id, src } = requiredAudioIdentity(attributes);
|
|
190
182
|
const volumeAttribute = attributes.get("data-volume") ?? null;
|
|
191
183
|
return {
|
|
184
|
+
tag: range.name,
|
|
192
185
|
id,
|
|
193
186
|
src,
|
|
194
187
|
volume: authoredNumber(volumeAttribute?.value, 1, "data-volume", id),
|
|
@@ -199,6 +192,13 @@ function audioTagFromRange(html, range) {
|
|
|
199
192
|
id
|
|
200
193
|
),
|
|
201
194
|
duration: authoredDuration(attributes, id),
|
|
195
|
+
playbackRate: authoredNumber(
|
|
196
|
+
attributes.get("data-playback-rate")?.value,
|
|
197
|
+
1,
|
|
198
|
+
"data-playback-rate",
|
|
199
|
+
id,
|
|
200
|
+
true
|
|
201
|
+
),
|
|
202
202
|
start: range.start,
|
|
203
203
|
end: range.end,
|
|
204
204
|
volumeAttribute
|
|
@@ -207,8 +207,9 @@ function audioTagFromRange(html, range) {
|
|
|
207
207
|
function audioTags(html) {
|
|
208
208
|
const seen = /* @__PURE__ */ new Set();
|
|
209
209
|
const tags = [];
|
|
210
|
-
for (const range of
|
|
211
|
-
const tag =
|
|
210
|
+
for (const range of mediaTagRanges(html)) {
|
|
211
|
+
const tag = mediaTagFromRange(html, range);
|
|
212
|
+
if (!tag) continue;
|
|
212
213
|
if (seen.has(tag.id)) throw new Error(`Duplicate audio id "${tag.id}"`);
|
|
213
214
|
seen.add(tag.id);
|
|
214
215
|
tags.push(tag);
|
|
@@ -305,7 +306,8 @@ function updateAudioVolume(html, id, volume) {
|
|
|
305
306
|
function loudnessMeasureArgs(file, tag) {
|
|
306
307
|
const args = ["-hide_banner", "-nostats"];
|
|
307
308
|
if (tag.mediaStart > 0) args.push("-ss", String(tag.mediaStart));
|
|
308
|
-
|
|
309
|
+
const sourceSpan = tag.duration === null ? null : tag.duration * (tag.playbackRate ?? 1);
|
|
310
|
+
if (sourceSpan !== null && sourceSpan > 0) args.push("-t", String(sourceSpan));
|
|
309
311
|
args.push("-i", file, "-map", "0:a:0", "-vn", "-af", "ebur128=peak=true", "-f", "null", "-");
|
|
310
312
|
return args;
|
|
311
313
|
}
|
|
@@ -317,162 +319,52 @@ async function measureAudio(ffmpegPath, file, tag) {
|
|
|
317
319
|
});
|
|
318
320
|
return parseEbur128Summary(result.stderr);
|
|
319
321
|
}
|
|
320
|
-
function fail(message, json, cause) {
|
|
321
|
-
if (json) console.log(JSON.stringify({ ok: false, error: message }, null, 2));
|
|
322
|
-
else console.error(c.error(message));
|
|
323
|
-
failCommand(1, cause);
|
|
324
|
-
}
|
|
325
|
-
function byId(tags, rawId, role) {
|
|
326
|
-
const id = rawId.trim().replace(/^#/, "");
|
|
327
|
-
const tag = tags.find((candidate) => candidate.id === id);
|
|
328
|
-
if (!tag) throw new Error(`${role} audio #${id} was not found`);
|
|
329
|
-
return tag;
|
|
330
|
-
}
|
|
331
|
-
function selectedTags(html, referenceId, targetId) {
|
|
332
|
-
const tags = audioTags(html);
|
|
333
|
-
const referenceTag = byId(tags, referenceId, "Reference");
|
|
334
|
-
const targetTag = byId(tags, targetId, "Target");
|
|
335
|
-
if (referenceTag.id === targetTag.id) {
|
|
336
|
-
throw new Error("Reference and target must be different audio elements");
|
|
337
|
-
}
|
|
338
|
-
return { referenceTag, targetTag };
|
|
339
|
-
}
|
|
340
322
|
function requiredFfmpeg() {
|
|
341
323
|
const ffmpegPath = findFfBinary("ffmpeg", { configuredMustExist: true });
|
|
342
324
|
if (!ffmpegPath) throw new Error("FFmpeg is required to measure integrated loudness");
|
|
343
325
|
return ffmpegPath;
|
|
344
326
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
}
|
|
352
|
-
async function measuredPlan(projectDir, referenceTag, targetTag) {
|
|
353
|
-
const ffmpegPath = requiredFfmpeg();
|
|
354
|
-
const referenceFile = existingAudioFile(projectDir, referenceTag);
|
|
355
|
-
const targetFile = existingAudioFile(projectDir, targetTag);
|
|
356
|
-
const [referenceMeasurement, targetMeasurement] = await Promise.all([
|
|
357
|
-
measureAudio(ffmpegPath, referenceFile, referenceTag),
|
|
358
|
-
measureAudio(ffmpegPath, targetFile, targetTag)
|
|
359
|
-
]);
|
|
360
|
-
return audioNormalizationPlan(
|
|
361
|
-
{ id: referenceTag.id, volume: referenceTag.volume, ...referenceMeasurement },
|
|
362
|
-
{ id: targetTag.id, volume: targetTag.volume, ...targetMeasurement }
|
|
363
|
-
);
|
|
364
|
-
}
|
|
365
|
-
function writeAtomically(path, contents) {
|
|
366
|
-
const temporary = `${path}.hf-normalize-${process.pid}.tmp`;
|
|
367
|
-
writeFileSync(temporary, contents);
|
|
368
|
-
renameSync(temporary, path);
|
|
369
|
-
}
|
|
370
|
-
function parsedTolerance(raw) {
|
|
371
|
-
const tolerance = Number(raw);
|
|
372
|
-
if (!Number.isFinite(tolerance) || tolerance < 0) {
|
|
373
|
-
throw new Error("--tolerance must be a non-negative number");
|
|
374
|
-
}
|
|
375
|
-
return tolerance;
|
|
376
|
-
}
|
|
377
|
-
async function normalizeAudio(options) {
|
|
378
|
-
const project = resolveProject(options.dir);
|
|
379
|
-
const html = readFileSync(project.indexPath, "utf8");
|
|
380
|
-
const { referenceTag, targetTag } = selectedTags(html, options.reference, options.target);
|
|
381
|
-
const tolerance = parsedTolerance(options.tolerance);
|
|
382
|
-
const plan = await measuredPlan(project.dir, referenceTag, targetTag);
|
|
383
|
-
const withinTolerance = Math.abs(plan.referenceLufs - plan.targetLufs) <= tolerance;
|
|
384
|
-
const wrote = options.write && !withinTolerance;
|
|
385
|
-
if (wrote) {
|
|
386
|
-
writeAtomically(
|
|
387
|
-
project.indexPath,
|
|
388
|
-
updateAudioVolume(readFileSync(project.indexPath, "utf8"), targetTag.id, plan.volume)
|
|
389
|
-
);
|
|
327
|
+
var DEFAULT_TARGET_LUFS = -16;
|
|
328
|
+
var NORMALIZE_TRUE_PEAK_CEILING_DBFS = -1.5;
|
|
329
|
+
var SILENCE_LUFS = -70;
|
|
330
|
+
function absoluteLoudnessPlan(track, targetLufs = DEFAULT_TARGET_LUFS) {
|
|
331
|
+
if (track.integratedLufs <= SILENCE_LUFS) {
|
|
332
|
+
throw new Error(`#${track.id} is silent in the played window; there is nothing to normalize`);
|
|
390
333
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
);
|
|
401
|
-
return;
|
|
402
|
-
}
|
|
403
|
-
console.log(
|
|
404
|
-
`Set #${result.targetId} data-volume ${result.previousVolume.toFixed(3)} \u2192 ${result.volume.toFixed(6)} (${result.changeDb >= 0 ? "+" : ""}${result.changeDb.toFixed(1)} dB).`
|
|
405
|
-
);
|
|
406
|
-
console.log(
|
|
407
|
-
result.wrote ? c.success(`Updated ${relative(process.cwd(), result.indexPath) || "index.html"}.`) : c.dim("Dry run only. Pass --write to persist this gain.")
|
|
334
|
+
const wantedGainDb = targetLufs - track.integratedLufs;
|
|
335
|
+
const peakRoomDb = NORMALIZE_TRUE_PEAK_CEILING_DBFS - track.truePeakDbfs;
|
|
336
|
+
const limits = [
|
|
337
|
+
[null, wantedGainDb],
|
|
338
|
+
["gain-ceiling", MAX_AUDIO_GAIN_DB],
|
|
339
|
+
["true-peak", peakRoomDb]
|
|
340
|
+
];
|
|
341
|
+
const [limitedBy, appliedGainDb] = limits.reduce(
|
|
342
|
+
(lowest, candidate) => candidate[1] < lowest[1] - 1e-9 ? candidate : lowest
|
|
408
343
|
);
|
|
344
|
+
const previousGainDb = track.volume > 0 ? gainDb(track.volume) : 0;
|
|
345
|
+
return {
|
|
346
|
+
targetId: track.id,
|
|
347
|
+
targetLufs,
|
|
348
|
+
sourceLufs: track.integratedLufs,
|
|
349
|
+
previousVolume: track.volume,
|
|
350
|
+
volume: 10 ** (appliedGainDb / 20),
|
|
351
|
+
gainDb: appliedGainDb,
|
|
352
|
+
changeDb: appliedGainDb - previousGainDb,
|
|
353
|
+
projectedLufs: track.integratedLufs + appliedGainDb,
|
|
354
|
+
projectedTruePeakDbfs: track.truePeakDbfs + appliedGainDb,
|
|
355
|
+
limitedBy
|
|
356
|
+
};
|
|
409
357
|
}
|
|
410
|
-
|
|
411
|
-
[
|
|
412
|
-
"Measure two authored clips and preview the matching gain",
|
|
413
|
-
"hyperframes normalize-audio --reference target-audio --target user-audio"
|
|
414
|
-
],
|
|
415
|
-
[
|
|
416
|
-
"Persist the measured gain into index.html",
|
|
417
|
-
"hyperframes normalize-audio --reference target-audio --target user-audio --write"
|
|
418
|
-
]
|
|
419
|
-
];
|
|
420
|
-
var normalize_audio_default = defineCommand({
|
|
421
|
-
meta: {
|
|
422
|
-
name: "normalize-audio",
|
|
423
|
-
description: "Match one local audio clip to another using integrated LUFS"
|
|
424
|
-
},
|
|
425
|
-
args: {
|
|
426
|
-
dir: { type: "positional", description: "Project directory", required: false },
|
|
427
|
-
reference: {
|
|
428
|
-
type: "string",
|
|
429
|
-
description: "Audio element id whose effective loudness should be preserved",
|
|
430
|
-
required: true
|
|
431
|
-
},
|
|
432
|
-
target: {
|
|
433
|
-
type: "string",
|
|
434
|
-
description: "Audio element id whose data-volume should be matched",
|
|
435
|
-
required: true
|
|
436
|
-
},
|
|
437
|
-
write: {
|
|
438
|
-
type: "boolean",
|
|
439
|
-
description: "Persist the measured target gain into index.html",
|
|
440
|
-
default: false
|
|
441
|
-
},
|
|
442
|
-
tolerance: {
|
|
443
|
-
type: "string",
|
|
444
|
-
description: `Skip writes within this many LU (default ${DEFAULT_TOLERANCE_LU})`,
|
|
445
|
-
default: String(DEFAULT_TOLERANCE_LU)
|
|
446
|
-
},
|
|
447
|
-
json: { type: "boolean", description: "Print machine-readable output", default: false }
|
|
448
|
-
},
|
|
449
|
-
async run({ args }) {
|
|
450
|
-
try {
|
|
451
|
-
const result = await normalizeAudio({
|
|
452
|
-
dir: args.dir,
|
|
453
|
-
reference: args.reference,
|
|
454
|
-
target: args.target,
|
|
455
|
-
tolerance: args.tolerance,
|
|
456
|
-
write: args.write
|
|
457
|
-
});
|
|
458
|
-
if (args.json) {
|
|
459
|
-
const { indexPath: _, ...jsonResult } = result;
|
|
460
|
-
console.log(JSON.stringify(jsonResult, null, 2));
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
printHumanResult(result);
|
|
464
|
-
} catch (error) {
|
|
465
|
-
fail(error instanceof Error ? error.message : String(error), Boolean(args.json), error);
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
});
|
|
358
|
+
|
|
469
359
|
export {
|
|
470
|
-
audioNormalizationPlan,
|
|
471
360
|
audioTags,
|
|
472
|
-
normalize_audio_default as default,
|
|
473
|
-
examples,
|
|
474
|
-
loudnessMeasureArgs,
|
|
475
|
-
parseEbur128Summary,
|
|
476
361
|
resolveLocalAudioPath,
|
|
477
|
-
|
|
362
|
+
parseEbur128Summary,
|
|
363
|
+
audioNormalizationPlan,
|
|
364
|
+
updateAudioVolume,
|
|
365
|
+
loudnessMeasureArgs,
|
|
366
|
+
measureAudio,
|
|
367
|
+
requiredFfmpeg,
|
|
368
|
+
DEFAULT_TARGET_LUFS,
|
|
369
|
+
absoluteLoudnessPlan
|
|
478
370
|
};
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
installPageFunctionGuard,
|
|
9
9
|
resolveCliChromeGpuMode,
|
|
10
10
|
seekCompositionTimeline
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RSL3XFMO.js";
|
|
12
12
|
import {
|
|
13
13
|
resolveCompositionViewportFromHtml
|
|
14
14
|
} from "./chunk-5Z63TBTX.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveProject
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-US7SWKGC.js";
|
|
18
18
|
import {
|
|
19
19
|
c
|
|
20
20
|
} from "./chunk-ZTZA4UWZ.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import {
|
|
29
29
|
printDeprecationNotice,
|
|
30
30
|
withMeta
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-RPMXMOFU.js";
|
|
32
32
|
import {
|
|
33
33
|
normalizeErrorMessage
|
|
34
34
|
} from "./chunk-KNU5COPB.js";
|
|
@@ -217,7 +217,7 @@ function extractCompositionErrorsFromLint(lintResult) {
|
|
|
217
217
|
async function localizeRemoteAssets(html) {
|
|
218
218
|
let dir;
|
|
219
219
|
try {
|
|
220
|
-
const { loadProducer } = await import("./producer-
|
|
220
|
+
const { loadProducer } = await import("./producer-RS7CB3XJ.js");
|
|
221
221
|
const { localizeRemoteMediaSources, localizeRemoteImageSources, localizeRemoteFontFaces } = await loadProducer();
|
|
222
222
|
dir = mkdtempSync(join(tmpdir(), "hf-validate-assets-"));
|
|
223
223
|
const assetDir = dir;
|
|
@@ -238,10 +238,10 @@ async function localizeRemoteAssets(html) {
|
|
|
238
238
|
}
|
|
239
239
|
async function validateInBrowser(project, opts) {
|
|
240
240
|
const projectDir = project.dir;
|
|
241
|
-
const { bundleToSingleHtml } = await import("./compiler-
|
|
241
|
+
const { bundleToSingleHtml } = await import("./compiler-YYOV2BJ7.js");
|
|
242
242
|
const { ensureBrowser } = await import("./manager-NEVLEZK3.js");
|
|
243
|
-
const { serveStaticProjectHtml } = await import("./staticProjectServer-
|
|
244
|
-
const { lintProject } = await import("./lintProject-
|
|
243
|
+
const { serveStaticProjectHtml } = await import("./staticProjectServer-RXAFGDK7.js");
|
|
244
|
+
const { lintProject } = await import("./lintProject-F2OTN2IR.js");
|
|
245
245
|
const lintResult = await lintProject(projectDir);
|
|
246
246
|
const compositionErrors = extractCompositionErrorsFromLint(lintResult);
|
|
247
247
|
const html = await bundleToSingleHtml(projectDir);
|
|
@@ -262,13 +262,13 @@ async function validateInBrowser(project, opts) {
|
|
|
262
262
|
try {
|
|
263
263
|
const browser = await ensureBrowser();
|
|
264
264
|
const puppeteer = await import("puppeteer-core");
|
|
265
|
-
const { buildChromeArgs, analyzeClipMediaFit } = await import("./src-
|
|
265
|
+
const { buildChromeArgs, analyzeClipMediaFit } = await import("./src-6R4DC2YI.js");
|
|
266
266
|
const requestedGpuMode = resolveCliChromeGpuMode();
|
|
267
267
|
const {
|
|
268
268
|
assertWebGpuAdapterAvailable,
|
|
269
269
|
compositionRequiresWebGpu,
|
|
270
270
|
resolveCaptureBrowserGpuMode
|
|
271
|
-
} = await import("./gpuPolicy-
|
|
271
|
+
} = await import("./gpuPolicy-KSWTVU5C.js");
|
|
272
272
|
const resolvedGpuMode = await resolveCaptureBrowserGpuMode(
|
|
273
273
|
requestedGpuMode,
|
|
274
274
|
browser.executablePath
|
|
@@ -7,29 +7,29 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
RegistryCompatibilityError,
|
|
9
9
|
gateRegistryItemsCompatibility
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5N4KKGSZ.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-LAQEZHOH.js";
|
|
18
18
|
import {
|
|
19
19
|
resolveItemWithDependencies,
|
|
20
20
|
resolveItemsByTag
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-XYVFPDNU.js";
|
|
22
22
|
import {
|
|
23
23
|
InvalidVariableValuesError,
|
|
24
24
|
prepareItem,
|
|
25
25
|
publishItem
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-HQGJLZB6.js";
|
|
27
27
|
import {
|
|
28
28
|
DEFAULT_REGISTRY_URL
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-AWUZ3AUD.js";
|
|
30
30
|
import {
|
|
31
31
|
trackRegistryItemAdded
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-VBXJSCHR.js";
|
|
33
33
|
import {
|
|
34
34
|
c
|
|
35
35
|
} from "./chunk-ZTZA4UWZ.js";
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
} from "./chunk-PBN6GBJE.js";
|
|
42
42
|
import {
|
|
43
43
|
ITEM_TYPE_DIRS
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-B25H4M4V.js";
|
|
45
45
|
import {
|
|
46
46
|
isProjectRootMissing,
|
|
47
47
|
realpath
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
EncoderInterruptedError,
|
|
18
18
|
encoderFailureError,
|
|
19
19
|
prepareAnimatedGifInputs
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-XIGK4LNU.js";
|
|
21
21
|
import {
|
|
22
22
|
createStudioPositionSeekReapplyScript
|
|
23
23
|
} from "./chunk-KC5XXX3X.js";
|
|
@@ -145,7 +145,7 @@ import {
|
|
|
145
145
|
validateEngineConfigSnapshot,
|
|
146
146
|
verifyDiskDrawElementSamples,
|
|
147
147
|
writeCapturedFrame
|
|
148
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-QB6OM2BP.js";
|
|
149
149
|
import {
|
|
150
150
|
HF_VFX_ATTR,
|
|
151
151
|
MEDIA_START_BASIS_ATTR,
|
|
@@ -162,7 +162,7 @@ import {
|
|
|
162
162
|
resolveAbsoluteMediaStartSeconds,
|
|
163
163
|
resolveAuthoredTimingWindow,
|
|
164
164
|
toFps
|
|
165
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-B25H4M4V.js";
|
|
166
166
|
import {
|
|
167
167
|
CANVAS_DIMENSIONS,
|
|
168
168
|
HTML_BODY_CSS_HEIGHT_FIRST_RE,
|
|
@@ -186,7 +186,7 @@ import {
|
|
|
186
186
|
inlineSubCompositions,
|
|
187
187
|
prepareFlattenedInnerRoot,
|
|
188
188
|
styleElementsFor
|
|
189
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-X763EUBO.js";
|
|
190
190
|
import {
|
|
191
191
|
HF_COLOR_GRADING_ATTR,
|
|
192
192
|
MAX_AUDIO_GAIN,
|
|
@@ -207,7 +207,7 @@ import {
|
|
|
207
207
|
resolveNaturalMediaTimelineDurationFromValues,
|
|
208
208
|
shouldClampResolvedMediaDuration,
|
|
209
209
|
sourceTimeAt
|
|
210
|
-
} from "./chunk-
|
|
210
|
+
} from "./chunk-YLVI7VL5.js";
|
|
211
211
|
import {
|
|
212
212
|
chromeMajorCeiling
|
|
213
213
|
} from "./chunk-TWWSYAKJ.js";
|
|
@@ -216,7 +216,7 @@ import {
|
|
|
216
216
|
lintHyperframeHtml,
|
|
217
217
|
readProjectFile,
|
|
218
218
|
resolveProjectRelativeSrc
|
|
219
|
-
} from "./chunk-
|
|
219
|
+
} from "./chunk-ONY5CJXS.js";
|
|
220
220
|
import {
|
|
221
221
|
CSS_URL_RE,
|
|
222
222
|
checkSubCompositionUsability,
|
|
@@ -9850,6 +9850,7 @@ async function padOrTrimAudioToVideoFrameCount(input) {
|
|
|
9850
9850
|
} finally {
|
|
9851
9851
|
for (const path of plan2.cleanupPaths) rmSync7(path, { force: true });
|
|
9852
9852
|
}
|
|
9853
|
+
let loweredDb = 0;
|
|
9853
9854
|
if (probeTruePeak) {
|
|
9854
9855
|
const correction = await enforceAacTruePeak({
|
|
9855
9856
|
audioPath: input.outputPath,
|
|
@@ -9869,13 +9870,15 @@ async function padOrTrimAudioToVideoFrameCount(input) {
|
|
|
9869
9870
|
failureReason: correction.failureReason
|
|
9870
9871
|
};
|
|
9871
9872
|
}
|
|
9873
|
+
loweredDb = correction.loweredDb ?? 0;
|
|
9872
9874
|
}
|
|
9873
9875
|
return {
|
|
9874
9876
|
success: true,
|
|
9875
9877
|
outputPath: input.outputPath,
|
|
9876
9878
|
targetDurationSeconds,
|
|
9877
9879
|
sourceDurationSeconds: audioInfo.durationSeconds,
|
|
9878
|
-
operation: plan2.operation
|
|
9880
|
+
operation: plan2.operation,
|
|
9881
|
+
...loweredDb > 0 ? { audioLoweredDb: loweredDb } : {}
|
|
9879
9882
|
};
|
|
9880
9883
|
}
|
|
9881
9884
|
async function enforceAacTruePeak(input) {
|
|
@@ -9896,8 +9899,9 @@ async function enforceAacTruePeak(input) {
|
|
|
9896
9899
|
return { success: false, error: "audioPadTrim: FFmpeg reported an invalid true peak" };
|
|
9897
9900
|
}
|
|
9898
9901
|
if (truePeakDbfs <= AAC_DELIVERY_TRUE_PEAK_DBFS) {
|
|
9899
|
-
if (measuredPath
|
|
9900
|
-
|
|
9902
|
+
if (measuredPath !== correctedPath) return { success: true };
|
|
9903
|
+
renameSync3(correctedPath, input.audioPath);
|
|
9904
|
+
return { success: true, loweredDb: Number((-attenuationDb).toFixed(2)) };
|
|
9901
9905
|
}
|
|
9902
9906
|
if (pass === MAX_TRUE_PEAK_CORRECTION_PASSES) break;
|
|
9903
9907
|
attenuationDb += correctionTargetDbfs - truePeakDbfs;
|
|
@@ -10069,6 +10073,15 @@ async function runFfprobeJson(args, signal) {
|
|
|
10069
10073
|
}
|
|
10070
10074
|
|
|
10071
10075
|
// ../producer/src/services/render/stages/assembleStage.ts
|
|
10076
|
+
function recordLimiterAttenuation(job, audioLoweredDb) {
|
|
10077
|
+
if (audioLoweredDb === void 0) return;
|
|
10078
|
+
job.audioLoweredDb = audioLoweredDb;
|
|
10079
|
+
const ceiling = `\u2212${Math.abs(AAC_DELIVERY_TRUE_PEAK_DBFS)} dBTP`;
|
|
10080
|
+
(job.config.logger ?? defaultLogger).info(
|
|
10081
|
+
`Audio lowered by ${audioLoweredDb.toFixed(1)} dB to stay under ${ceiling}`,
|
|
10082
|
+
{ audioLoweredDb }
|
|
10083
|
+
);
|
|
10084
|
+
}
|
|
10072
10085
|
async function runAssembleStage(input) {
|
|
10073
10086
|
const {
|
|
10074
10087
|
job,
|
|
@@ -10098,6 +10111,7 @@ async function runAssembleStage(input) {
|
|
|
10098
10111
|
if (!normalizeResult.success) {
|
|
10099
10112
|
throw encoderFailureError("Audio duration normalization failed", normalizeResult);
|
|
10100
10113
|
}
|
|
10114
|
+
recordLimiterAttenuation(job, normalizeResult.audioLoweredDb);
|
|
10101
10115
|
if (isHls) {
|
|
10102
10116
|
await runHlsPackaging(input, normalizeResult.outputPath);
|
|
10103
10117
|
} else {
|
|
@@ -14130,7 +14144,7 @@ function startServer(options = {}) {
|
|
|
14130
14144
|
});
|
|
14131
14145
|
async function shutdown(signal) {
|
|
14132
14146
|
log.info(`Received ${signal}, shutting down`);
|
|
14133
|
-
const { drainBrowserPool } = await import("./src-
|
|
14147
|
+
const { drainBrowserPool } = await import("./src-6R4DC2YI.js");
|
|
14134
14148
|
await drainBrowserPool().catch(() => {
|
|
14135
14149
|
});
|
|
14136
14150
|
const handle = await Promise.race([
|
|
@@ -15253,7 +15267,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
|
|
|
15253
15267
|
if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
|
|
15254
15268
|
if (probeResult.probeSession) {
|
|
15255
15269
|
try {
|
|
15256
|
-
const { closeCaptureSession: closeCaptureSession2 } = await import("./src-
|
|
15270
|
+
const { closeCaptureSession: closeCaptureSession2 } = await import("./src-6R4DC2YI.js");
|
|
15257
15271
|
await closeCaptureSession2(probeResult.probeSession);
|
|
15258
15272
|
} catch (err) {
|
|
15259
15273
|
log.warn("[plan] probe session close failed", {
|