Skip to content

Add Windows support; parameterize hwaccel, python and whisper backend - #4

Open
WjRKO wants to merge 1 commit into
louisedesadeleer:mainfrom
WjRKO:windows-port
Open

Add Windows support; parameterize hwaccel, python and whisper backend#4
WjRKO wants to merge 1 commit into
louisedesadeleer:mainfrom
WjRKO:windows-port

Conversation

@WjRKO

@WjRKO WjRKO commented Sep 6, 2026

Copy link
Copy Markdown

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. macOS
behaviour is unchanged.

What breaks on Windows

  • -hwaccel videotoolbox doesn't exist. Now $HWACCEL, set per platform
    (videotoolbox / vaapi / d3d11va), with a note that leaving it empty is
    fine since the x264 encode dominates anyway.

  • python3 usually 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. MSYS
    rewrites /tmp/... to C:/Users/..., and libavfilter then reads the
    drive-letter colon as an option separator:

    Unable to parse "original_size" option value "/Users/.../captions.ass" as image size
    

    Fixed by cd-ing into the working dir and passing a bare filename — harmless
    on macOS and Linux.

  • minimal caption preset used Helvetica, which isn't on Windows, so libass
    silently substituted something else. Switched to Arial, which ships on both.

  • open <path> in Step 6 — now lists open / xdg-open / start.

Whisper backend

$WHISPER also makes 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 — I verified the
segments[].words[] schema matches exactly. It's several times faster and skips
the ~2.5 GB PyTorch dependency. Documented alongside it: --device cuda needs
cuBLAS 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:

  • action mode — synthetic source with four known impacts; detect_transients.py
    found all four at the right timestamps
  • dialogue mode — real speech, transcribe → trim → 16:9→9:16 crop → re-transcribe
    → ASS → burn, output 1080×1920 with the word highlight landing correctly
  • build_pan.py hard-cut expression rendering without filter errors

I 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/$PY indirection is worth a second pair of eyes before
merging.

Happy to adjust the approach if you'd rather keep the commands literal and put
the platform differences somewhere else.

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant