mcp-demo/check切割.py
GoMrStone 1a7567231a feat: 录音素材管理系统 - 完整功能
- 视频分析: MiMo 2.5 大模型直接分析
- 场景检测: AI 视觉模型识别分镜头
- 语音识别: 每个场景单独 ASR
- 语音克隆: MiMo TTS 语音克隆
- 下载功能: 单文件/批量 ZIP 下载
- 系统设置: API 密钥配置
- 文件夹管理: 创建/移动/筛选
- 扁平化 UI: 简约按钮样式
2026-07-10 17:26:53 +08:00

54 lines
2.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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