param( [Parameter(Mandatory=$true)][string]$Video, [string]$Output = ".\wordbeat-output", [double]$Fps = 0 ) $ErrorActionPreference = "Stop" if (-not (Test-Path ".\.venv\Scripts\python.exe")) { throw "Run install-windows.ps1 first." } $args = @( "-m", "wordbeat.cli", "process", $Video, "--output", $Output, "--device", "cuda", "--compute-type", "float16", "--model", "large-v3" ) if ($Fps -gt 0) { $args += @("--fps", "$Fps") } & .\.venv\Scripts\python.exe @args if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } & .\.venv\Scripts\python.exe -m wordbeat.cli render $Video "$Output\wordbeat.ass" --output "$Output\preview.mp4"