完成视频复刻和优化
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user