auto-save 2026-05-14 10:25 (~13)

This commit is contained in:
2026-05-14 10:25:50 +08:00
parent be1ae80750
commit 7bfbb38289
13 changed files with 118 additions and 52 deletions

View File

@@ -104,7 +104,7 @@ JobStatus = Literal[
"transcribing", "transcribed", "failed",
]
KEYFRAME_COUNT = int(os.getenv("KEYFRAME_COUNT", "5"))
KEYFRAME_COUNT = int(os.getenv("KEYFRAME_COUNT", "12"))
FrameExtractTarget = Literal["transparent_human", "balanced", "subject", "transition", "expression", "motion"]
FrameExtractMode = Literal["replace", "append"]
FrameExtractQuality = Literal["auto", "fast", "accurate", "ultra"]
@@ -1327,7 +1327,7 @@ async def analyze_queue_worker() -> None:
ANALYZE_WORKER_RUNNING = False
# ---------- Gemini ASR + 翻译 ----------
# ---------- 音频转写 + 翻译 + SKG 改写 + MiniMax 配音 ----------
def _transcribe_sync(wav: Path) -> list[dict]:
"""whisper-1 verbose_json → segments[{start, end, text}]"""
@@ -1347,7 +1347,7 @@ def _transcribe_sync(wav: Path) -> list[dict]:
def _translate_sync(segments: list[dict]) -> list[str]:
"""gemini-2.5-flash 批量翻译为中文,按段返回"""
"""批量翻译为中文,按段返回"""
payload = [{"i": i, "en": s.get("text", "").strip()} for i, s in enumerate(segments)]
prompt = (
"你是字幕翻译。把下列英文字幕段翻译为简体中文,保持原意、口语化、自然流畅。"