Add Windows support; parameterize hwaccel, python and whisper backend - #4
Open
WjRKO wants to merge 1 commit into
Open
Add Windows support; parameterize hwaccel, python and whisper backend#4WjRKO wants to merge 1 commit into
WjRKO wants to merge 1 commit into
Conversation
The workflow assumed macOS throughout. Rather than fork the commands per platform, the three things that actually differ are lifted into variables set once in a new "Platform notes" section: $HWACCEL, $PY and $WHISPER. macOS behaviour is unchanged. Windows fixes, each verified end-to-end with ffmpeg 8.1.2 and Python 3.10: - hwaccel: d3d11va, tested against the crop+scale filter chains. - python3 -> $PY. On Windows `python3` usually resolves to the Microsoft Store app-execution alias, which prints a message and exits 0, so a script invoked that way fails silently rather than erroring. - subtitles= filter: cd into the working dir and pass a bare filename. An absolute path breaks because MSYS rewrites /tmp/... to C:/Users/... and libavfilter parses the drive-letter colon as an option separator (Unable to parse "original_size"). Harmless on the other platforms. - Step 6 now gives open / xdg-open / start for the three platforms. - minimal caption preset: Helvetica -> Arial. Helvetica is absent on Windows and libass silently falls back; Arial ships on both. $WHISPER also makes whisper-ctranslate2 (faster-whisper/CTranslate2) a first-class alternative to openai-whisper. It takes the same arguments and emits the same JSON, so build_ass.py reads it unchanged, it is several times faster, and it avoids a ~2.5 GB PyTorch install. Documented alongside it: --device cuda needs cuBLAS 12 and cuDNN 9, which ship with neither package, and CPU int8 already runs around 9x realtime on tiny.en. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The workflow currently assumes macOS. I went through it on Windows and hit five
things that break, some of them silently. Rather than fork the commands per
platform, I lifted the three things that actually differ into variables set once
in a new Platform notes section —
$HWACCEL,$PY,$WHISPER. macOSbehaviour is unchanged.
What breaks on Windows
-hwaccel videotoolboxdoesn't exist. Now$HWACCEL, set per platform(
videotoolbox/vaapi/d3d11va), with a note that leaving it empty isfine since the x264 encode dominates anyway.
python3usually resolves to the Microsoft Store app-execution alias,which prints a message and exits 0. Scripts invoked that way fail silently
rather than erroring, which took me a while to spot. Now
$PY.subtitles=with an absolute path. This was the nastiest one. MSYSrewrites
/tmp/...toC:/Users/..., and libavfilter then reads thedrive-letter colon as an option separator:
Fixed by
cd-ing into the working dir and passing a bare filename — harmlesson macOS and Linux.
minimalcaption preset used Helvetica, which isn't on Windows, so libasssilently substituted something else. Switched to Arial, which ships on both.
open <path>in Step 6 — now listsopen/xdg-open/start.Whisper backend
$WHISPERalso makes whisper-ctranslate2a first-class alternative to openai-whisper. It takes the same arguments and
emits the same JSON, so
build_ass.pyreads it unchanged — I verified thesegments[].words[]schema matches exactly. It's several times faster and skipsthe ~2.5 GB PyTorch dependency. Documented alongside it:
--device cudaneedscuBLAS 12 and cuDNN 9, which ship with neither package, and CPU int8 already runs
around 9× realtime on
tiny.en.Testing
Ran both modes end to end on Windows 11, ffmpeg 8.1.2, Python 3.10:
detect_transients.pyfound all four at the right timestamps
→ ASS → burn, output 1080×1920 with the word highlight landing correctly
build_pan.pyhard-cut expression rendering without filter errorsI have not tested this on macOS — I don't have a machine to check on. The
macOS path should be untouched (the variables just restore the original flags),
but the
$HWACCEL/$PYindirection is worth a second pair of eyes beforemerging.
Happy to adjust the approach if you'd rather keep the commands literal and put
the platform differences somewhere else.
🤖 Generated with Claude Code