A Python application that creates a virtual camera from your physical webcam with real-time image processing capabilities.
- Captures video from your physical webcam
- Applies real-time image processing (currently grayscale conversion)
- Outputs to a virtual camera that can be used by other applications
- Cross-platform support with optimized Windows compatibility
This application requires a virtual camera backend to function. Choose one of the following:
- Download and install OBS Studio
- Start OBS Studio at least once to initialize the virtual camera
- The OBS Virtual Camera will be automatically available
- Download Unity Capture
- Run the installer as administrator
- Register the virtual camera device
-
Clone this repository:
git clone <repository-url> cd WebcamWrapper
-
Create a virtual environment (recommended):
python -m venv .venv .venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
-
Ensure your physical webcam is connected and working
-
Make sure you have installed a virtual camera backend (see Prerequisites)
-
Run the application:
python app.py
-
The application will:
- Display available virtual camera backends
- Initialize your physical webcam
- Create a virtual camera with the same resolution and FPS
- Show a preview window with the processed video
- Make the virtual camera available to other applications
-
Press 'q' in the preview window to exit
- Install OBS Studio or Unity Capture (see Prerequisites)
- Restart the application after installation
- Check that your webcam is connected and working
- Ensure no other applications are using the webcam
- Verify Windows has permission to access the camera
- Make sure you're in the correct virtual environment
- Run
pip install -r requirements.txtto install dependencies
The application currently applies a grayscale filter to the video feed. You can modify the image processing logic in the main() function to add different effects such as:
- Color filters
- Blur effects
- Edge detection
- Face detection and effects
- Background replacement
- Python 3.7+
- OpenCV (opencv-python)
- PyVirtualCam
- NumPy
- Windows 10/11 (optimized for Windows, but should work on other platforms)