Bocce: il clic fissa la mira come al biliardo, così andando verso la forza o «Lancia» il puntatore non la sposta più (scoperto girando il video: la boccia partiva a due passi). Copioni dei video «Come si gioca» di scopa, tressette, bocce e biliardo, e video/sovrapposte.py per controllare che il narratore non parli sopra i personaggi

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1dxvtsZx8NE9fwjXUNDBr
This commit is contained in:
2026-10-26 21:23:23 +01:00
co-authored by Claude Opus 5.5
parent 111b892916
commit 3019a6e32f
7 changed files with 376 additions and 4 deletions
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env python3
"""Controlla che nel video «Come si gioca» il narratore non parli sopra i personaggi del gioco.
python3 video/sovrapposte.py tutorial-briscola (dopo la ripresa: cues.json, registro audio, narrazione)
"""
import json
import sys
from pathlib import Path
VIDEO = Path(__file__).resolve().parent
clip = sys.argv[1]
cues = json.loads((Path.home() / "Workspaces/qemu/qemu-iso-lab/artifacts/tour/out" / clip / "cues.json").read_text())["cues"]
narr = {v["id"]: v["sec"] for v in json.loads((VIDEO / "out" / f"{clip}-narrazione.json").read_text())["voci"]}
voci, aperta = [], None
for e in json.loads((VIDEO / "out" / f"{clip}-audio.json").read_text())["eventi"]:
if "voice" in e:
aperta = [e["t"], None, e["voice"]]
voci.append(aperta)
elif "voiceEnd" in e and aperta:
aperta[1], aperta = e["t"], None
male = [(c["id"], v[2]) for c in cues for v in voci if v[1] and v[0] < c["start"] + narr[c["id"]] and v[1] > c["start"]]
for id_, voce in male:
print(f"✗ «{id_}» sopra {voce}")
print(f"{clip}: {len(voci)} voci del gioco, {len(cues)} frasi del narratore, {len(male)} sovrapposte")
sys.exit(1 if male else 0)