hyperframes 0.8.149 → 0.8.151
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-MG53577L.js → add-QKZZG7A2.js} +12 -12
- package/dist/{animatedGifPrep-HV4ZFVPV.js → animatedGifPrep-YQDPYGOD.js} +7 -7
- package/dist/api.js +17 -17
- package/dist/{asset-3GIBXLLL.js → asset-3Q737Y4H.js} +2 -2
- package/dist/{assetCataloger-JJQ4JW2P.js → assetCataloger-BTHEBJJB.js} +3 -3
- package/dist/{auth-XQMT727H.js → auth-XL7EU3SO.js} +1 -1
- package/dist/{autoUpdate-CREZJGMU.js → autoUpdate-PJFLTQ3U.js} +2 -2
- package/dist/{backgroundChecks-K3S5QKR3.js → backgroundChecks-T5TIR5WK.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-42AKNX73.js → batchRender-NFLVIDB4.js} +4 -4
- package/dist/{beats-Y7IKETUS.js → beats-JU4GZ26R.js} +13 -13
- package/dist/{benchmark-22SAXSO5.js → benchmark-7U2YWLTW.js} +9 -9
- package/dist/{browser-ABNISCC3.js → browser-D57UPYDA.js} +5 -5
- package/dist/{bundleWithLocalizedFonts-OE5ZI4JE.js → bundleWithLocalizedFonts-26MXQOZG.js} +2 -2
- package/dist/{capture-DBNHO4WJ.js → capture-47BV25G3.js} +2 -2
- package/dist/{capture-HQG5W42I.js → capture-LT252COQ.js} +11 -11
- package/dist/{catalog-KICZFIDX.js → catalog-BEZXOV4O.js} +12 -12
- package/dist/{catch-up-ZCQUCI45.js → catch-up-KVV5X6BF.js} +4 -4
- package/dist/{check-TGXIICEF.js → check-6KQ433E6.js} +191 -55
- package/dist/{checkBrowser-3N23I56J.js → checkBrowser-PRDR6XBY.js} +172 -30
- package/dist/{chunk-GESJSXFH.js → chunk-35PWWBGZ.js} +1 -1
- package/dist/{chunk-62RUQJ5J.js → chunk-3SVC7SW4.js} +47 -21
- package/dist/{chunk-KMJLHHBF.js → chunk-3ZPFRDEJ.js} +1 -1
- package/dist/{chunk-XHBX7QN6.js → chunk-4LE27ST4.js} +1 -1
- package/dist/{chunk-DUUFDLC4.js → chunk-4MLYMDQ4.js} +1 -1
- package/dist/{chunk-WX7VCRM7.js → chunk-4PKQEKAI.js} +2 -2
- package/dist/{chunk-ZKDKFJCK.js → chunk-4YZYYP7V.js} +5 -5
- package/dist/{chunk-XPQSL5VS.js → chunk-54DMWFQZ.js} +8 -1
- package/dist/{chunk-NKM53WMI.js → chunk-BRF3O35X.js} +7 -7
- package/dist/chunk-DHPFXAUF.js +165 -0
- package/dist/{chunk-CT6ZQRLD.js → chunk-DIOBKUBV.js} +2 -2
- package/dist/{chunk-SP6XL3NP.js → chunk-FAIYEIZ4.js} +1 -1
- package/dist/{chunk-CYFFYK2F.js → chunk-FLVI7FHU.js} +1 -1
- package/dist/{chunk-JDB65PPT.js → chunk-GNTVYF7E.js} +8 -7
- package/dist/{chunk-KQHJKJ3V.js → chunk-HVXRYMGQ.js} +1 -1
- package/dist/{chunk-CNPJHUOX.js → chunk-IP73NMQT.js} +11 -11
- package/dist/{chunk-VX4AL2FQ.js → chunk-IPDS2SWI.js} +1 -1
- package/dist/{chunk-LACFOFWX.js → chunk-IZ7L6V76.js} +1 -1
- package/dist/{chunk-VC7JBNPS.js → chunk-IZPN423R.js} +481 -68
- package/dist/{chunk-P7NTODQE.js → chunk-KQGWP4KH.js} +2 -2
- package/dist/{chunk-SFUBSJFP.js → chunk-KXX6NLOT.js} +1 -1
- package/dist/{chunk-K44HCHZN.js → chunk-L3N7RJHS.js} +3 -3
- package/dist/{chunk-MI6U3OIN.js → chunk-L6RIMCMG.js} +3 -3
- package/dist/{chunk-7IEGPJ4P.js → chunk-LBT4AMSF.js} +1 -1
- package/dist/{chunk-AY2BONTF.js → chunk-LKQS72D5.js} +1 -1
- package/dist/{chunk-VXM4BH23.js → chunk-N3I6RAOR.js} +136 -54
- package/dist/{chunk-Q2Y5OZCY.js → chunk-N4IXP3MY.js} +2 -2
- package/dist/{chunk-LCILS4AF.js → chunk-O3DUX6P2.js} +5 -5
- package/dist/{chunk-MXB6CWVH.js → chunk-OSAH7S5M.js} +1 -1
- package/dist/{chunk-YDRX42P3.js → chunk-OZ4K46OV.js} +3 -3
- package/dist/{chunk-ZK3BQXHC.js → chunk-POEEDPJI.js} +1 -1
- package/dist/{chunk-LTJDUBSQ.js → chunk-PUIELIFA.js} +1 -1
- package/dist/chunk-QBYHNRHU.js +3795 -0
- package/dist/{chunk-KUTT3JXL.js → chunk-QF7AE3DB.js} +3 -3
- package/dist/{chunk-BNYRD7PQ.js → chunk-QLGBNGXC.js} +2 -2
- package/dist/{chunk-U7SASZC5.js → chunk-RJRGR5KF.js} +10 -10
- package/dist/{chunk-4S4VUXW3.js → chunk-RRBKEHST.js} +1 -1
- package/dist/{chunk-TPIG7ZBX.js → chunk-RYL6ZIJP.js} +6 -6
- package/dist/{chunk-L274XRWA.js → chunk-S22FKF6G.js} +6 -3
- package/dist/{chunk-OMBSUO4T.js → chunk-TCWMDCBX.js} +2 -2
- package/dist/{chunk-YA62XGXS.js → chunk-UJKQWGFF.js} +1 -1
- package/dist/{chunk-M5B42RL5.js → chunk-WUUOFMHU.js} +3 -3
- package/dist/{chunk-PR7QQBSC.js → chunk-XGLNQDLN.js} +1 -1
- package/dist/{chunk-VGCEMOQA.js → chunk-XKKBIFE5.js} +7 -7
- package/dist/{chunk-2HWB4TCI.js → chunk-XNDXENJQ.js} +27 -12
- package/dist/{chunk-AHBYQRGI.js → chunk-XQKVEQNY.js} +2 -2
- package/dist/{chunk-ZFN6GQU4.js → chunk-XXPYZBZ3.js} +1 -1
- package/dist/{chunk-K4RIT6PX.js → chunk-XYHBVSWD.js} +2 -2
- package/dist/{chunk-RMIFSBRV.js → chunk-YEBKEWKB.js} +1 -1
- package/dist/{chunk-CZQLCBWY.js → chunk-YG2Y55KF.js} +1 -1
- package/dist/{chunk-B3XLIBFL.js → chunk-YIJMVFEJ.js} +1 -1
- package/dist/{chunk-K35E45SI.js → chunk-YZTVHRJ2.js} +1 -1
- package/dist/{chunk-Y475GD4L.js → chunk-ZD3RDNZI.js} +1 -1
- package/dist/{chunk-QIJLIULK.js → chunk-ZGCRVM5M.js} +2 -2
- package/dist/{clean-6QP7VAV4.js → clean-RLTHFTQA.js} +18 -18
- package/dist/cli.js +52 -52
- package/dist/{cloud-5TME5ROM.js → cloud-Q5TGBTW3.js} +4 -4
- package/dist/{cloudrun-F5VVCVF5.js → cloudrun-4UZF74MV.js} +4 -4
- package/dist/{compare-XPY2EXX6.js → compare-Q5UNR2V4.js} +25 -25
- package/dist/{compiler-NPD3MYMO.js → compiler-ZXT27Z62.js} +4 -4
- package/dist/{component-OPVL3PUX.js → component-H734P32V.js} +3 -3
- package/dist/{compositions-WSEOI454.js → compositions-YEHDSTDR.js} +11 -11
- package/dist/{delete-SLMH57VH.js → delete-LDBMPWRT.js} +2 -2
- package/dist/{dist-CUIR3GFX.js → dist-7JXLFD6U.js} +3 -3
- package/dist/{dist-HUMFCJ6T.js → dist-RGE4QASU.js} +1 -1
- package/dist/{doctor-QZW3EKIH.js → doctor-XNJFIWJ7.js} +13 -13
- package/dist/{events-FIFWFRGC.js → events-G6UFLNXR.js} +2 -2
- package/dist/{events-6C3ZG7LS.js → events-UKCPUWMH.js} +3 -3
- package/dist/{feedback-VKXM7YJ5.js → feedback-CK3KZ7DE.js} +7 -7
- package/dist/{ffmpeg-TZB5WAYE.js → ffmpeg-MJFMBBSF.js} +2 -2
- package/dist/{figma-3UYNADNA.js → figma-3D5C737B.js} +3 -3
- package/dist/fontLocalizeCli.js +9 -9
- package/dist/{get-VH7VMRVX.js → get-QGTQUWFT.js} +2 -2
- package/dist/{gpuPolicy-M2JZGGVW.js → gpuPolicy-G5QAQDYF.js} +7 -7
- package/dist/{grade-compare-OSC2YQWN.js → grade-compare-XIHOM62P.js} +27 -27
- package/dist/{help-DCBFEZPT.js → help-U5UBXT52.js} +1 -1
- package/dist/{history-XYJMQE26.js → history-5J73QZSA.js} +5 -5
- package/dist/hyperframe-runtime.js +65 -58
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +65 -58
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/{info-YEHGENAH.js → info-RJHQQQUP.js} +8 -8
- package/dist/{init-64SML7PY.js → init-M6UQOYYC.js} +29 -29
- package/dist/{inspect-GFOQKRJI.js → inspect-PRQWDBTP.js} +26 -26
- package/dist/{installer-Q4MMZKLA.js → installer-ZL7UKYK5.js} +5 -5
- package/dist/{keyframes-ORYFWKBZ.js → keyframes-VMUJYTCQ.js} +6 -6
- package/dist/{lambda-DRMOJGTC.js → lambda-ON42DRQD.js} +5 -5
- package/dist/{layout-ZEQBE6UQ.js → layout-QKBFVDVY.js} +26 -26
- package/dist/{lint-67KGFY63.js → lint-ZQHHL2SV.js} +7 -7
- package/dist/{lintProject-SSEXWCH6.js → lintProject-3Z6OJCSO.js} +1 -1
- package/dist/{list-T6OU5ARJ.js → list-YBRKIWGF.js} +2 -2
- package/dist/{login-2PXIGDP7.js → login-4B2YXGLB.js} +4 -4
- package/dist/{manager-ES2UFT4X.js → manager-X44GKUEL.js} +3 -3
- package/dist/{manager-GWU5J6RJ.js → manager-ZLJD3EAY.js} +2 -2
- package/dist/{media-treatment-NAAHID6M.js → media-treatment-5C5EJAAP.js} +12 -12
- package/dist/{models-P6XB6RWK.js → models-R7ZDWBJ6.js} +13 -13
- package/dist/{motionShot-7MHRIV6V.js → motionShot-ZHESZNUL.js} +14 -14
- package/dist/{normalize-audio-LWNFYR2F.js → normalize-audio-EVWZVTBM.js} +6 -6
- package/dist/{open-DAP5C7UD.js → open-TV6HT4UT.js} +4 -4
- package/dist/{parakeetRunner-3ZVFPOD4.js → parakeetRunner-YVVF4CG6.js} +14 -14
- package/dist/{pipeline-V4YJCPUX.js → pipeline-ETR5SEBS.js} +9 -9
- package/dist/{play-UDCESJO3.js → play-C6WONRZV.js} +19 -19
- package/dist/{preflight-JOD4OXGC.js → preflight-JYOX64YP.js} +4 -4
- package/dist/{present-DXTHBH3F.js → present-RANXTVPA.js} +15 -15
- package/dist/{preview-YHXKRXKB.js → preview-KF6UMBT2.js} +19 -19
- package/dist/{producer-343ENLAM.js → producer-CY2GXBWN.js} +1 -1
- package/dist/{projectConfig-YXKU3CTB.js → projectConfig-KPXCNMBM.js} +7 -7
- package/dist/{publication-ODXP3JI7.js → publication-Y36N4A7E.js} +3 -3
- package/dist/{publish-UEFBFGV3.js → publish-RCQJO35C.js} +9 -9
- package/dist/{remove-background-FMV6IDOH.js → remove-background-3ZMXVWLB.js} +10 -10
- package/dist/{render-ZTXNPRGF.js → render-FKVRCDT2.js} +58 -35
- package/dist/{render-N7QGX6RJ.js → render-PTNEFO5U.js} +9 -9
- package/dist/{render-SYC4RPGT.js → render-WUSTRMUD.js} +4 -4
- package/dist/{render-batch-SZRPCRUJ.js → render-batch-AQHU2JWZ.js} +4 -4
- package/dist/renderSetupWorker.js +4 -4
- package/dist/{resolver-7MYXNEAX.js → resolver-L5BDZJKU.js} +5 -5
- package/dist/{sherpa-M4Z2Q5Y2.js → sherpa-3S3ISG7G.js} +13 -13
- package/dist/skills/hyperframes/references/frame-worker-core.md +11 -9
- package/dist/skills/hyperframes/references/subagent-dispatch.md +1 -1
- package/dist/skills/media-use/audio/scripts/lib/tts.cleanup.test.mjs +175 -0
- package/dist/skills/media-use/audio/scripts/lib/tts.mjs +24 -19
- package/dist/skills/media-use/references/grading.md +1 -2
- package/dist/skills/media-use/references/meta.md +17 -17
- package/dist/skills/media-use/references/operations.md +6 -6
- package/dist/skills/media-use/references/setup-providers.md +3 -4
- package/dist/skills/media-use/scripts/lib/cutlist.mjs +9 -2
- package/dist/skills/media-use/scripts/lib/cutlist.test.mjs +12 -0
- package/dist/skills/media-use/scripts/lib/telemetry.mjs +4 -1
- package/dist/skills/media-use/scripts/lib/telemetry.test.mjs +20 -0
- package/dist/skills/media-use/scripts/transcript-cut.mjs +23 -4
- package/dist/skills/media-use/scripts/transcript-cut.test.mjs +224 -0
- package/dist/{skills-NEHNSHZK.js → skills-X4WQEKNF.js} +5 -5
- package/dist/{skillsUpdateCheck-O77QR72A.js → skillsUpdateCheck-UYCVHDZ6.js} +3 -3
- package/dist/{snapshot-GDVXFBVY.js → snapshot-YEYHQEZQ.js} +252 -141
- package/dist/{src-VMTHSARJ.js → src-2NN2WB6X.js} +10 -6
- package/dist/{src-PTIV7IVV.js → src-OLBDPEG6.js} +8 -8
- package/dist/{staticProjectServer-3D2NXQ6W.js → staticProjectServer-7H35NMWB.js} +15 -15
- package/dist/studio/assets/{hyperframes-player-C-2YwYre.js → hyperframes-player-DJt8E7k4.js} +1 -1
- package/dist/studio/assets/{index-ByJU5J6n.js → index-BGks9KLI.js} +131 -131
- package/dist/studio/assets/{index-BybGk67U.js → index-DWIHrAY2.js} +1 -1
- package/dist/studio/assets/{index-Cfs2r3fz.js → index-DgbLblGR.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-XIBDLRHB.js → studio-api-HGM2A5I3.js} +9 -9
- package/dist/{studioServer-QIQK47UN.js → studioServer-M6XFL7N6.js} +45 -45
- package/dist/{telemetry-565KDZUW.js → telemetry-KVCZKVTE.js} +3 -3
- package/dist/{timeline-E6XB7I6W.js → timeline-VYYKZR4V.js} +68 -15
- package/dist/{tokens-3ZAJENSE.js → tokens-B5NFFL55.js} +2 -2
- package/dist/{transcribe-XWQQCCBG.js → transcribe-SBETOIWI.js} +12 -12
- package/dist/{transcribe-WODP3T77.js → transcribe-WNFRYZAC.js} +18 -18
- package/dist/{updateCheck-QPYU4GRL.js → updateCheck-5MM2DFUC.js} +2 -2
- package/dist/{upgrade-2FJ5ZEN6.js → upgrade-LWID54R3.js} +2 -2
- package/dist/{urlDownloader-352AY25I.js → urlDownloader-CVLNXFDG.js} +6 -6
- package/dist/{validate-SP2VGNEI.js → validate-V4CGQ6OF.js} +20 -20
- package/dist/{video-RVNPFEA6.js → video-VJB2KRSS.js} +7 -7
- package/package.json +1 -1
- package/dist/chunk-3WD4JNMU.js +0 -3795
|
@@ -47,6 +47,155 @@ function readPcm(filePath) {
|
|
|
47
47
|
return samples;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
// Three kept ranges, none starting or ending on a frame boundary of any rate below.
|
|
51
|
+
const UNALIGNED_KEEP = "0.137-1.913,2.845-4.111,4.9-5.47";
|
|
52
|
+
const UNALIGNED_KEPT_SECONDS = 1.776 + 1.266 + 0.57;
|
|
53
|
+
|
|
54
|
+
function cutVideo(t, rate, keep = UNALIGNED_KEEP) {
|
|
55
|
+
const { dir, cleanup } = fixture();
|
|
56
|
+
t.after(cleanup);
|
|
57
|
+
|
|
58
|
+
const source = join(dir, "source.mp4");
|
|
59
|
+
execFileSync("ffmpeg", [
|
|
60
|
+
"-y",
|
|
61
|
+
"-hide_banner",
|
|
62
|
+
"-loglevel",
|
|
63
|
+
"error",
|
|
64
|
+
"-f",
|
|
65
|
+
"lavfi",
|
|
66
|
+
"-i",
|
|
67
|
+
`testsrc2=size=160x90:rate=${rate}:duration=6`,
|
|
68
|
+
"-f",
|
|
69
|
+
"lavfi",
|
|
70
|
+
"-i",
|
|
71
|
+
`sine=frequency=440:duration=6:sample_rate=${SAMPLE_RATE}`,
|
|
72
|
+
"-c:v",
|
|
73
|
+
"libx264",
|
|
74
|
+
"-preset",
|
|
75
|
+
"ultrafast",
|
|
76
|
+
"-pix_fmt",
|
|
77
|
+
"yuv420p",
|
|
78
|
+
"-c:a",
|
|
79
|
+
"aac",
|
|
80
|
+
source,
|
|
81
|
+
]);
|
|
82
|
+
|
|
83
|
+
const transcriptPath = join(dir, "transcript.json");
|
|
84
|
+
writeFileSync(transcriptPath, JSON.stringify({ words: [{ text: "tone", start: 0, end: 6 }] }));
|
|
85
|
+
|
|
86
|
+
const output = join(dir, "out.mp4");
|
|
87
|
+
const result = run([
|
|
88
|
+
"--input",
|
|
89
|
+
source,
|
|
90
|
+
"--transcript",
|
|
91
|
+
transcriptPath,
|
|
92
|
+
"--keep",
|
|
93
|
+
keep,
|
|
94
|
+
"--out",
|
|
95
|
+
output,
|
|
96
|
+
"--json",
|
|
97
|
+
]);
|
|
98
|
+
assert.equal(result.status, 0, result.stderr || result.stdout);
|
|
99
|
+
return output;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function readVideoTimestamps(filePath) {
|
|
103
|
+
const probe = JSON.parse(
|
|
104
|
+
execFileSync(
|
|
105
|
+
"ffprobe",
|
|
106
|
+
[
|
|
107
|
+
"-v",
|
|
108
|
+
"error",
|
|
109
|
+
"-select_streams",
|
|
110
|
+
"v:0",
|
|
111
|
+
"-show_entries",
|
|
112
|
+
"stream=time_base:packet=pts",
|
|
113
|
+
"-of",
|
|
114
|
+
"json",
|
|
115
|
+
"--",
|
|
116
|
+
filePath,
|
|
117
|
+
],
|
|
118
|
+
{ encoding: "utf8" },
|
|
119
|
+
),
|
|
120
|
+
);
|
|
121
|
+
const [tickNum, tickDen] = probe.streams[0].time_base.split("/").map(Number);
|
|
122
|
+
// Packets come in decode order; B-frames put that out of presentation order.
|
|
123
|
+
const pts = probe.packets.map((packet) => Number(packet.pts)).sort((a, b) => a - b);
|
|
124
|
+
return { tickNum, tickDen, pts };
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
for (const rate of ["30", "30000/1001", "60"]) {
|
|
128
|
+
test(
|
|
129
|
+
`puts every frame of a ${rate} fps video cut on the frame grid, with no gaps`,
|
|
130
|
+
{ skip: !HAS_FFMPEG },
|
|
131
|
+
(t) => {
|
|
132
|
+
const [rateNum, rateDen = 1] = rate.split("/").map(Number);
|
|
133
|
+
const { tickNum, tickDen, pts } = readVideoTimestamps(cutVideo(t, rate));
|
|
134
|
+
assert.ok(pts.length > rateNum / rateDen, "expected several seconds of video");
|
|
135
|
+
|
|
136
|
+
// Frame i belongs at exactly i / rate seconds. Compared as integers, so a
|
|
137
|
+
// timestamp rounded to the millisecond (0.067 for 2/30) cannot pass.
|
|
138
|
+
const offGrid = pts.filter(
|
|
139
|
+
(value, index) => value * tickNum * rateNum !== index * rateDen * tickDen,
|
|
140
|
+
);
|
|
141
|
+
assert.equal(
|
|
142
|
+
offGrid.length,
|
|
143
|
+
0,
|
|
144
|
+
`${offGrid.length} of ${pts.length} frames are off the ${rate} fps grid (timestamps in units of ${tickNum}/${tickDen} s)`,
|
|
145
|
+
);
|
|
146
|
+
},
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
test(
|
|
151
|
+
"keeps the keyframes of a video cut no more than a second apart",
|
|
152
|
+
{ skip: !HAS_FFMPEG },
|
|
153
|
+
(t) => {
|
|
154
|
+
// One kept range of almost four seconds, so only the encoder decides where keyframes go.
|
|
155
|
+
const output = cutVideo(t, "30", "0.137-4.111,4.9-5.47");
|
|
156
|
+
const probe = JSON.parse(
|
|
157
|
+
execFileSync(
|
|
158
|
+
"ffprobe",
|
|
159
|
+
[
|
|
160
|
+
"-v",
|
|
161
|
+
"error",
|
|
162
|
+
"-select_streams",
|
|
163
|
+
"v:0",
|
|
164
|
+
"-show_entries",
|
|
165
|
+
"packet=pts_time,flags",
|
|
166
|
+
"-of",
|
|
167
|
+
"json",
|
|
168
|
+
"--",
|
|
169
|
+
output,
|
|
170
|
+
],
|
|
171
|
+
{ encoding: "utf8" },
|
|
172
|
+
),
|
|
173
|
+
);
|
|
174
|
+
const keyframes = probe.packets
|
|
175
|
+
.filter((packet) => packet.flags.startsWith("K"))
|
|
176
|
+
.map((packet) => Number(packet.pts_time))
|
|
177
|
+
.sort((a, b) => a - b);
|
|
178
|
+
const gaps = keyframes.slice(1).map((time, index) => time - keyframes[index]);
|
|
179
|
+
const widest = Math.max(...gaps);
|
|
180
|
+
// A frame of slack: the forced keyframe is the first frame at or after each second.
|
|
181
|
+
assert.ok(widest < 1.05, `keyframes are up to ${widest.toFixed(3)}s apart`);
|
|
182
|
+
},
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
test(
|
|
186
|
+
"does not pad the audio of a video cut with encoder priming at each splice",
|
|
187
|
+
{ skip: !HAS_FFMPEG },
|
|
188
|
+
(t) => {
|
|
189
|
+
const seconds = readPcm(cutVideo(t, "30")).length / SAMPLE_RATE;
|
|
190
|
+
// The single AAC encode may round the end up by a frame or two (23 ms each).
|
|
191
|
+
// Encoding every segment separately instead adds about 25 ms per splice on top.
|
|
192
|
+
assert.ok(
|
|
193
|
+
Math.abs(seconds - UNALIGNED_KEPT_SECONDS) < 0.05,
|
|
194
|
+
`audio runs ${seconds.toFixed(3)}s for ${UNALIGNED_KEPT_SECONDS.toFixed(3)}s kept`,
|
|
195
|
+
);
|
|
196
|
+
},
|
|
197
|
+
);
|
|
198
|
+
|
|
50
199
|
test(
|
|
51
200
|
"keeps a spliced tone continuous at every cut, with no raw phase jump or silence gap",
|
|
52
201
|
{ skip: !HAS_FFMPEG },
|
|
@@ -115,3 +264,78 @@ test(
|
|
|
115
264
|
);
|
|
116
265
|
},
|
|
117
266
|
);
|
|
267
|
+
|
|
268
|
+
// Frame 32 at 30 fps sits at 1.0666666 s. A -ss rounded to 1.067 lands just past
|
|
269
|
+
// it, so ffmpeg's accurate seek starts that segment on frame 33 and the cut comes
|
|
270
|
+
// out a frame short from the join on.
|
|
271
|
+
const THIRTY_FPS_FRAME_32 = 32 / 30;
|
|
272
|
+
|
|
273
|
+
test("a kept range starting on a 30 fps frame keeps that frame", { skip: !HAS_FFMPEG }, (t) => {
|
|
274
|
+
const { dir, cleanup } = fixture();
|
|
275
|
+
t.after(cleanup);
|
|
276
|
+
|
|
277
|
+
const source = join(dir, "src.mp4");
|
|
278
|
+
execFileSync("ffmpeg", [
|
|
279
|
+
"-y",
|
|
280
|
+
"-hide_banner",
|
|
281
|
+
"-loglevel",
|
|
282
|
+
"error",
|
|
283
|
+
"-f",
|
|
284
|
+
"lavfi",
|
|
285
|
+
"-i",
|
|
286
|
+
"testsrc2=size=320x180:rate=30",
|
|
287
|
+
"-f",
|
|
288
|
+
"lavfi",
|
|
289
|
+
"-i",
|
|
290
|
+
`sine=frequency=440:sample_rate=${SAMPLE_RATE}`,
|
|
291
|
+
"-t",
|
|
292
|
+
"4",
|
|
293
|
+
"-c:v",
|
|
294
|
+
"libx264",
|
|
295
|
+
"-pix_fmt",
|
|
296
|
+
"yuv420p",
|
|
297
|
+
"-c:a",
|
|
298
|
+
"aac",
|
|
299
|
+
source,
|
|
300
|
+
]);
|
|
301
|
+
|
|
302
|
+
const transcriptPath = join(dir, "transcript.json");
|
|
303
|
+
writeFileSync(transcriptPath, JSON.stringify([{ text: "a", start: 0.1, end: 3.9 }]));
|
|
304
|
+
|
|
305
|
+
const output = join(dir, "out.mp4");
|
|
306
|
+
const result = run([
|
|
307
|
+
"--input",
|
|
308
|
+
source,
|
|
309
|
+
"--transcript",
|
|
310
|
+
transcriptPath,
|
|
311
|
+
"--keep",
|
|
312
|
+
`0-1,${THIRTY_FPS_FRAME_32}-3`,
|
|
313
|
+
"--out",
|
|
314
|
+
output,
|
|
315
|
+
"--json",
|
|
316
|
+
]);
|
|
317
|
+
assert.equal(result.status, 0, result.stderr || result.stdout);
|
|
318
|
+
|
|
319
|
+
// Frames 0-29 for 0-1s, then frames 32-89 for the second segment. Rounding
|
|
320
|
+
// -ss to the millisecond drops frame 32 and yields 87.
|
|
321
|
+
const frames = Number(
|
|
322
|
+
execFileSync(
|
|
323
|
+
"ffprobe",
|
|
324
|
+
[
|
|
325
|
+
"-v",
|
|
326
|
+
"error",
|
|
327
|
+
"-select_streams",
|
|
328
|
+
"v",
|
|
329
|
+
"-count_packets",
|
|
330
|
+
"-show_entries",
|
|
331
|
+
"stream=nb_read_packets",
|
|
332
|
+
"-of",
|
|
333
|
+
"csv=p=0",
|
|
334
|
+
"--",
|
|
335
|
+
output,
|
|
336
|
+
],
|
|
337
|
+
{ encoding: "utf8" },
|
|
338
|
+
).trim(),
|
|
339
|
+
);
|
|
340
|
+
assert.equal(frames, 88, `expected 88 frames, got ${frames}`);
|
|
341
|
+
});
|
|
@@ -6,8 +6,8 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
trackSkillsInstallSkipped
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-ZD3RDNZI.js";
|
|
10
|
+
import "./chunk-IZ7L6V76.js";
|
|
11
11
|
import {
|
|
12
12
|
diag
|
|
13
13
|
} from "./chunk-VWG7OQKU.js";
|
|
@@ -35,15 +35,15 @@ import {
|
|
|
35
35
|
isCoreSkill,
|
|
36
36
|
presentSkills,
|
|
37
37
|
pruneOrphanedLockEntries
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-OSAH7S5M.js";
|
|
39
39
|
import {
|
|
40
40
|
withMeta
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-35PWWBGZ.js";
|
|
42
42
|
import "./chunk-K4WIOZFP.js";
|
|
43
43
|
import "./chunk-XUXGIA7H.js";
|
|
44
44
|
import "./chunk-WERLJGIC.js";
|
|
45
45
|
import "./chunk-ISN5GRYI.js";
|
|
46
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-TCWMDCBX.js";
|
|
47
47
|
import {
|
|
48
48
|
buildNpxCommand
|
|
49
49
|
} from "./chunk-6BEFEWFB.js";
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
printSkillsUpdateNotice,
|
|
10
10
|
refreshSkillsCache,
|
|
11
11
|
skillsCheckDue
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-OSAH7S5M.js";
|
|
13
|
+
import "./chunk-35PWWBGZ.js";
|
|
14
14
|
import "./chunk-K4WIOZFP.js";
|
|
15
15
|
import "./chunk-XUXGIA7H.js";
|
|
16
16
|
import "./chunk-WERLJGIC.js";
|
|
17
17
|
import "./chunk-ISN5GRYI.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-TCWMDCBX.js";
|
|
19
19
|
import "./chunk-KNU5COPB.js";
|
|
20
20
|
import "./chunk-M2WBOQ2Q.js";
|
|
21
21
|
export {
|