Skip to main content

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:

  1. Verify installation: qvac status
  2. Restart the application
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qvac-1.0.1.tar.gz (40.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qvac-1.0.1-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file qvac-1.0.1.tar.gz.

File metadata

  • Download URL: qvac-1.0.1.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

Hashes for qvac-1.0.1.tar.gz
Algorithm Hash digest
SHA256 bf938f559eef4cdd8b6f85134ddee6d908d05935362ccf6f20693a761e2f5ff3
MD5 4c515a7855fd325096d2d04ba9ceccc4
BLAKE2b-256 f74a817f71956d1a8f773e0a7447d31568a2bbc7731d107886803558f94f26c9

See more details on using hashes here.

File details

Details for the file qvac-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: qvac-1.0.1-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

Hashes for qvac-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5a3444b7db9f5c60a9f7f4027318d212a0f998e42b93fdad8262e6bc67f02564
MD5 1370be4cbba5f7da75499f2bf1b045a5
BLAKE2b-256 dd3b5d16bc13f6be1c450c66d5acc32def7b59ac0717f040c5b4d12d3b8cf803

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page