winlivecam
A Python library to create a virtual camera on Windows and stream the content of a selected window (by PID or title) to it.
Features
- Windows 11 Native Support: Uses the new
MFCreateVirtualCameraAPI for seamless integration on Windows 11. - Windows 10 Compatibility: Falls back to a high-performance DirectShow filter.
- Stream any visible Windows application window to a virtual camera.
- Select windows by Process ID (PID) or window title.
- Leverages C++ for high-performance window capture and virtual camera implementation.
- Easy-to-use Python API.
Installation
Prerequisites
- Windows 10 or 11 (Windows 11 recommended for native Virtual Camera API support)
- Python 3.7+
- Visual Studio Build Tools (for C++ compilation, if building from source)
Install via pip (Coming Soon)
pip install winlivecam
Manual Installation (from source)
- Clone the repository:
</code></pre> </li> </ol> <p>git clone <a href="https://github.com/G3tFun/winlivecam.git">https://github.com/G3tFun/winlivecam.git</a> cd winlivecam ```</p> <ol start="2"> <li><strong>Build the C++ extension and virtual camera driver:</strong> <pre><code class="language-bash">
pip install pybind11 cmake pip install . ```
- Register the virtual camera driver:
After installation, you need to register the DirectShow filter DLL. This usually requires administrator privileges.
</code></pre> </li> </ol> <p>from winlivecam import LiveCam LiveCam.install() <code>To unregister:</code>python from winlivecam import LiveCam LiveCam.uninstall() ```</p> <h2 id="user-content-usage">Usage<a href="#user-content-usage" aria-label="Link to heading 'Usage'" data-heading-content="Usage" class="anchor"></a></h2> <p>Here's a simple example of how to use <code>winlivecam</code> to stream a window by its PID:</p> <pre><code class="language-python">from winlivecam import LiveCam import time # Replace with the actual PID of the window you want to stream # You can find the PID using Task Manager or other tools. TARGET_PID = 12345 cam = LiveCam() try: print(f"Starting virtual camera stream for PID: {TARGET_PID}") cam.start_by_pid(TARGET_PID) print("Streaming... Press Ctrl+C to stop.") while True: time.sleep(1) # Keep the script running except KeyboardInterrupt: print("Stopping stream.") cam.stop() print("Stream stopped.")
Building from Source (Development)
If you want to contribute or modify the C++ code, follow these steps:
- Install CMake and Visual Studio Build Tools.
- Clone the repository.
- Build using CMake:
mkdir build cd build cmake .. cmake --build . ``` This will build
winlivecam_core.pyd(Python extension) and `vcam-filter.dll` (DirectShow filter).Contributing
Contributions are welcome! Please feel free to open issues or submit pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
- Inspired by
mycrl/vcamand OBS Virtual Camera implementations. - Uses
pybind11for Python-C++ interoperability.
Metadata
Release files for winlivecam 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| winlivecam-0.1.1.tar.gz | 4.2 kB | Without provenance | Details for winlivecam-0.1.1.tar.gz |
Release files / winlivecam-0.1.1.tar.gz
| Download URL | winlivecam-0.1.1.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1da6813a30055a5cd915307b093be53d4c24c0bdd066bfbc74185bb95644bb47
|
|
BLAKE2b-256 checksum How to use checksums |
19de43efa93543d5f10f0e71341a036a13185189f5c69f993bf0c9596bc950e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.0rc1
|
Security for winlivecam 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.