Repository navigation
fix: register every DLL-carrying ffmpeg directory, not the first PATH match (#279) - #286
Merged
Merged
Conversation
… match (#279) _register_ffmpeg_dll_directory took shutil.which's first PATH match, so a Windows host that installed both README builds — Gyan.FFmpeg (static) for the pipeline adapters and Gyan.FFmpeg.Shared for [pyannote] — still failed to decode when winget put the static build first: its directory holds no DLLs, and the failure surfaced as a bare libtorchcodec DLL-loading error naming neither ffmpeg nor PATH. Every ffmpeg directory on PATH is now inspected, the ones carrying the av*.dll shared libraries are registered, and a host where no ffmpeg directory carries them keeps the old behaviour plus a warning naming the shared build. README now states both builds may coexist in either PATH order.
RN0311
force-pushed
the
fix/279-ffmpeg-dll-scan-all-path
branch
from
September 16, 2026 06:28
8c41b45 to
16d77bb
Compare
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.
Summary
Fixes #279 — the residual case of #254.
_register_ffmpeg_dll_directoryregistered the directory of whicheverffmpegwas first onPATH. The README tells a Windows reader to install two builds (Gyan.FFmpegfor the pipeline adapters,Gyan.FFmpeg.Sharedfor[pyannote]), and only the second carries the DLLs torchcodec loads — so when winget ordered the static build first, following both README lines as written still ended inCould not find module 'libtorchcodec_core9.dll', an error naming neither ffmpeg norPATH.The registration now:
PATH(shutil.whichper entry, deduplicated case-insensitively),av*.dllshared libraries — so the static build shadowing the shared one no longer matters, in either order,winget install Gyan.FFmpeg.Shared), instead of leaving the user with the bare DLL error later,The README ffmpeg paragraph now states both builds can coexist in either
PATHorder.Testing
TestFfmpegDllRegistrationextended from 3 to 6 tests, all host-independent (platform pinned,whichfaked per PATH entry, real temp directories for the DLL check): the issue's exact host state (static first, shared second → shared registered, no warning), static-only (registered + warning namingGyan.FFmpeg.Sharedand the inspected directory), two shared builds (both registered), duplicate/empty PATH entries (registered once), plus the original register/no-ffmpeg cases updated to the scan.tests/unit/test_pyannote_utils.py: 21 passed. Smoke:test_preprocessing.py+test_preprocessing_selector.py: 83 passed.ruff check,ruff format --check,ty checkall clean.Note:
test_noop_on_posixis deliberately untouched here — its missing platform pin is #278, fixed separately in #285.