fix(tools): a negative lip-sync offset shortens the audio track by design

The length check called -74 ms of audio a clock problem on a clip recorded with the global
offset at -100. Trimming the stream head to advance the mix removes exactly that much track,
so the mismatch is the feature working. The verdict now says so instead of sending the next
hour after a clock that is fine.

Same clip: correlation +30 ms (two windows above 0.55), clap contact +34 ms — the two methods
agree, so the offset needs -130 rather than -100.
This commit is contained in:
2026-11-12 14:09:55 -08:00
parent 1abc86358a
commit af6210082c
+5 -2
View File
@@ -219,8 +219,11 @@ def main() -> int:
print(f"video {video:8.3f} s")
print(f"audio {audio:8.3f} s")
print(f"delta {diff:+8.3f} s ({pct:+.2f}% of the video length)")
verdict = "lengths match" if abs(diff) < 0.05 else "LENGTH MISMATCH — a clock problem"
print(f" {verdict}")
if abs(diff) < 0.05:
print(" lengths match")
else:
print(" LENGTH MISMATCH — a clock problem, UNLESS a negative lip-sync offset is set:")
print(f" trimming the stream head by N ms makes the audio track N ms shorter by design")
for start, wlag, wcorr in windows:
mark = "*" if wcorr >= 0.35 else " "
print(f" {start:5.1f}s {wlag:+7.0f} ms corr {wcorr:.2f} {mark}")