完成视频复刻和优化

This commit is contained in:
Azmat@qq.com
2026-08-27 11:54:47 +08:00
parent c25060c6c6
commit 51620bf25b
46 changed files with 2575 additions and 663 deletions
+9
View File
@@ -8,6 +8,15 @@ import tempfile
from pathlib import Path
# 参考视频/音频对外仍写「2-15 秒」。15 秒成片常被探测成 15.01–15.04(帧率取整 / AAC 对齐),给半秒容差。
REF_DURATION_MIN = 1.95
REF_DURATION_MAX = 15.5
def duration_in_ref_range(seconds: float) -> bool:
return REF_DURATION_MIN <= seconds <= REF_DURATION_MAX
def probe_duration(file_path: str) -> float | None:
"""ffprobe 取媒体时长(秒)。失败返回 None。"""
try: