Skip to content

VLC Python bindings missing from Windows installer #49

@thegregariousdragon

Description

@thegregariousdragon

Summary

On Windows, VLC_AVAILABLE is always False despite VLC being installed, because the python-vlc bindings package (vlc.py) is not included in the PyInstaller bundle. This causes YouTube audio playback to silently fall back to BASS (sound_lib), which cannot handle WebM/Opus stream URLs returned by yt-dlp's bestaudio/best selector, resulting in BASS error code 41 (BASS_ERROR_FILEFORM — unsupported file format).

Root Cause

In sound.py, the VLC availability check is:

try:
    import vlc
    _test_instance = vlc.Instance('--quiet')
    ...
    VLC_AVAILABLE = True
except Exception:
    VLC_AVAILABLE = False

The import vlc fails silently because vlc.py (from the python-vlc package) is not present in _internal/ in the Windows PyInstaller build. All exceptions are swallowed, so there is no indication to the user or developer that VLC detection failed for this reason rather than VLC not being installed.

Steps to Reproduce

  1. Install FastSM on Windows using the official installer
  2. Ensure VLC is installed at the standard path (C:\Program Files\VideoLAN\VLC)
  3. Attempt to play a YouTube link from a post in FastSM
  4. Observe error 41 / no audio playback

Workaround

Manually installing the python-vlc bindings into _internal resolves the issue completely:

pip install python-vlc --target <any folder>
copy vlc.py "C:\Program Files\FastSM\_internal\"

After restarting FastSM, VLC_AVAILABLE becomes True and YouTube audio plays correctly via VLC.

Suggested Fix

Add python-vlc to the Windows PyInstaller build dependencies so that vlc.py is included in _internal/ automatically. Since python-vlc is a pure Python package (py3-none-any), it has no compiled components and should bundle without issues.

In build.py, this likely means adding python-vlc to the Windows requirements or adding an explicit --collect-submodules / --hidden-import vlc entry in the PyInstaller spec for the Windows build path.

The version used in testing and confirmed working: python-vlc 3.0.21203 with VLC 3.0.23.

Environment

  • OS: Windows 11 25H2
  • FastSM version: 0.5.0
  • VLC version: 3.0.23 (installed at default path)
  • python-vlc version that resolves the issue: 3.0.21203

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions