import json import urllib.request resp = urllib.request.urlopen("http://localhost:5001/api/footage?per_page=60") data = json.loads(resp.read().decode()) items = data.get("items", []) # Find the target video for item in items: if "763456798450254550912" in item.get("filename", ""): screener = item.get("screener", {}) scenes = screener.get("scenes", []) transcription = screener.get("transcription", "") print(f"Video: {item['filename']}") print(f"Duration: {item.get('duration', 'N/A')}s") print(f"Total scenes: {len(scenes)}") print() # Check scene timing print("=== Scene Timing Analysis ===") total_scene_duration = 0 for i, scene in enumerate(scenes): start = scene.get("start_time", 0) end = scene.get("end_time", 0) duration = scene.get("duration", 0) total_scene_duration += duration # Check if duration matches end - start calculated_duration = end - start match = abs(duration - calculated_duration) < 0.1 print(f"Scene {scene.get('shot_index')}: {start}s - {end}s ({duration}s) {'✅' if match else '❌ MISMATCH'}") print(f"\nTotal scene duration: {total_scene_duration}s") print(f"Video duration: {item.get('duration', 'N/A')}s") # Check speech alignment print("\n=== Speech Alignment ===") all_dialogue = " ".join([s.get("dialogue", "") for s in scenes if s.get("dialogue")]) print(f"Total dialogue length: {len(all_dialogue)} chars") print(f"Transcription length: {len(transcription)} chars") # Check if dialogue matches transcription if transcription: # Simple check: see if dialogue words appear in transcription dialogue_words = set(all_dialogue.replace(",", "").replace("。", "").replace("!", "")) trans_words = set(transcription.replace(",", "").replace("。", "").replace("!", "")) overlap = dialogue_words & trans_words print(f"Dialogue words overlap with transcription: {len(overlap)} chars") break