Skip to content

fix: launch without system FFmpeg (torchcodec stub) + release 0.8.33 - #96

Merged
ljchang merged 2 commits into
mainfrom
fix/torchcodec-stub-without-ffmpeg
Sep 13, 2026
Merged

ljchang merged 2 commits into
mainfrom
fix/torchcodec-stub-without-ffmpeg

Conversation

@ljchang

@ljchang ljchang commented Sep 13, 2026

Copy link
Copy Markdown
Member

Third finding from the post-release smoke test (v0.8.32 run), macOS leg:

feat/utils/io.py, line 30: from torchcodec.decoders import VideoDecoder
OSError: dlopen(.../torchcodec/libtorchcodec_core8.dylib): Library not loaded: @rpath/libavutil.60.dylib
  Reason: tried: '/opt/homebrew/opt/ffmpeg/lib/libavutil.60.dylib' (no such file)

py-feat ≥ 2.1 imports torchcodec at module top level, and torchcodec's macOS/Windows wheels only link FFmpeg from a system install (Homebrew on macOS, PATH on Windows). On a clean machine import feat therefore fails on both OSes. Same class as the libomp bug (#93), second organ.

Fix: Py-feat Live never uses torchcodec — every frame is decoded by PyAV and fed to detect_faces + forward directly. So, only when the real torchcodec can't load, the sidecar registers a stub torchcodec.decoders.VideoDecoder that raises a clear RuntimeError on construction, and prints a startup warning. Unit-tested. The proper fix is upstream: lazy-import torchcodec in py-feat.

Also: the Windows smoke step read $INSTDIR from the NSIS Uninstall key with its literal quotes and threw before trying fallback paths. Trimmed. (The install location is now confirmed: %LOCALAPPDATA%\\Py-feat Live.)

Also: bumps to 0.8.33 in the same PR to save a CI cycle; v0.8.31 and v0.8.32 drafts stay unpublished.

…e: trim NSIS quotes

macOS (v0.8.32 smoke, clean macos-14 runner): past libomp, the sidecar
died on `feat/utils/io.py: from torchcodec.decoders import VideoDecoder`
— torchcodec's wheels link FFmpeg only from a system install
(/opt/homebrew/opt/ffmpeg on macOS; PATH on Windows), so on a clean
machine `import torchcodec` raises and py-feat's top-level import takes
the sidecar down. Same class as the libomp failure, second organ.

Py-feat Live never uses that path: frames are decoded by PyAV and go to
detect_faces + forward directly (pyfeatlive_core/detect.py). So, only
when the real torchcodec cannot load, register a stub `torchcodec` /
`torchcodec.decoders` whose VideoDecoder raises a clear RuntimeError on
construction, and print a warning at startup. Proper fix is upstream
(lazy import in py-feat); this keeps the app launching until then.

Windows smoke: the NSIS Uninstall key stores $INSTDIR with literal
quotes; Join-Path threw ("Cannot find drive '\"C'") before the fallback
paths were tried. Trim them.
@ljchang
ljchang merged commit 684cf8b into main Sep 13, 2026
4 checks passed
@ljchang
ljchang deleted the fix/torchcodec-stub-without-ffmpeg branch September 13, 2026 21:22
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