feat: mvp

This commit is contained in:
h
2026-02-01 16:07:59 +01:00
commit 4ef769597a
20 changed files with 3566 additions and 0 deletions

44
dubbing/steps/finalize.py Normal file
View File

@@ -0,0 +1,44 @@
import subprocess
from rich.console import Console
from dubbing.steps.base import PipelineStep
console = Console()
class FinalizeStep(PipelineStep):
name = "Finalize"
def is_cached(self) -> bool:
return self.paths.result_video.exists()
def clean(self) -> None:
if self.paths.result_video.exists():
self.paths.result_video.unlink()
async def run(self) -> None:
console.print("[cyan]Creating final video...[/]")
subprocess.run(
[
"ffmpeg",
"-y",
"-i",
str(self.paths.source_video),
"-i",
str(self.paths.dubbed_audio),
"-map",
"0:v",
"-map",
"1:a",
"-c:v",
"copy",
"-c:a",
"copy",
"-shortest",
str(self.paths.result_video),
],
capture_output=True,
check=True,
)
console.print(f"[green]✓ Created {self.paths.result_video}[/]")