DirectShow virtual camera with Python API for Windows
Project description
QVAC Virtual Camera
DirectShow virtual camera with Python API for Windows. Send custom video frames from Python to any application that supports webcams (OBS Studio, Zoom, Microsoft Teams, Discord, etc.).
Features
- DirectShow Virtual Camera: Works with all DirectShow-compatible applications
- Easy Python API: Simple interface for sending frames
- Automatic Installation: Install/uninstall virtual camera from Python
- Frame Conversion: Automatic RGB/BGR/RGBA/BGRA conversion and resizing
- Production Ready: Fully tested and documented
Installation
pip install qvac
Quick Start
1. Install the Virtual Camera
import qvac
# Requires administrator privileges
qvac.install()
Or from command line:
# Windows (run as administrator)
qvac install
2. Send Frames
from qvac import QVACCamera
import numpy as np
# Create a red frame
frame = np.zeros((720, 1280, 3), dtype=np.uint8)
frame[:, :] = [255, 0, 0]
# Send to virtual camera
with QVACCamera() as cam:
cam.send_frame(frame)
3. Use in Applications
The virtual camera appears as "QVAC Virtual Camera" in:
- OBS Studio
- Zoom
- Microsoft Teams
- Discord
- Any DirectShow-compatible application
Usage Examples
Webcam Relay
from qvac import QVACCamera
import cv2
cap = cv2.VideoCapture(0)
with QVACCamera() as cam:
while True:
ret, frame = cap.read()
if ret:
cam.send_frame(frame)
Screen Capture
from qvac import QVACCamera
from PIL import ImageGrab
import numpy as np
import time
with QVACCamera() as cam:
while True:
screen = np.array(ImageGrab.grab())
cam.send_frame(screen)
time.sleep(1/30)
Video File Playback
from qvac import QVACCamera
import cv2
cap = cv2.VideoCapture('video.mp4')
with QVACCamera() as cam:
while True:
ret, frame = cap.read()
if not ret:
break
cam.send_frame(frame)
API Reference
Installation Functions
import qvac
# Install virtual camera (requires admin)
qvac.install()
# Uninstall virtual camera (requires admin)
qvac.uninstall()
# Check if installed
if qvac.is_installed():
print("Virtual camera is installed")
QVACCamera Class
from qvac import QVACCamera
# Create camera instance
cam = QVACCamera(width=1280, height=720)
# Open connection
cam.open()
# Send frame (numpy array)
frame = np.zeros((720, 1280, 3), dtype=np.uint8)
cam.send_frame(frame)
# Close connection
cam.close()
# Or use context manager (recommended)
with QVACCamera() as cam:
cam.send_frame(frame)
Command Line Interface
# Install virtual camera
qvac install
# Uninstall virtual camera
qvac uninstall
# Check installation status
qvac status
Requirements
- Windows 7 or later
- Python 3.6+
- NumPy
- OpenCV (for frame resizing/conversion)
- Administrator privileges (for install/uninstall)
Frame Format
- Resolution: 1280x720 (default, configurable)
- Color Format: RGB, BGR, RGBA, or BGRA (automatically converted)
- Data Type: numpy.ndarray with dtype=uint8
- Shape: (height, width, 3) or (height, width, 4)
Frames are automatically:
- Resized if dimensions don't match
- Converted from grayscale to RGB if needed
- Converted to BGRA format for the virtual camera
Troubleshooting
Permission Error
If you get a permission error during installation:
# Run Python as administrator, then:
import qvac
qvac.install()
Camera Not Found
If the camera doesn't appear in applications:
- Verify installation:
qvac status - Restart the application
- Try reinstalling:
qvac.install(force=True)
Import Error
If you get "ModuleNotFoundError":
pip install numpy opencv-python
License
MIT License - see LICENSE file for details.
Support
For issues and questions, please visit the GitHub repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qvac-1.0.0.tar.gz.
File metadata
- Download URL: qvac-1.0.0.tar.gz
- Upload date:
- Size: 40.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f1540de2bbf075310313137f9fc26e6cf52aaa11b409044b763c4de05b0635c
|
|
| MD5 |
03ba10c1b05de4fbd4f9ea8a9ac376d7
|
|
| BLAKE2b-256 |
5d3d89963a00c39f669e4a0e78e7214712adb2534e1a0f34d2f7f2ad4b2aa375
|
File details
Details for the file qvac-1.0.0-py3-none-any.whl.
File metadata
- Download URL: qvac-1.0.0-py3-none-any.whl
- Upload date:
- Size: 36.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e760ec5b8ae45745b99b7ca4fafdd22999fc91518271372f86f97c5adcd6a743
|
|
| MD5 |
d15fc2b0c98323471786b401e9adf4ab
|
|
| BLAKE2b-256 |
e93fe1dcea7007e9a49c9f4adb439875ae4ba941284e4bd94bea8823deccd803
|