Skip to main content

pyvirtualcam

pyvirtualcam sends frames to a virtual camera from Python.

Usage

import colorsys
import numpy as np
import pyvirtualcam

with pyvirtualcam.Camera(width=1280, height=720, fps=20) as cam:
    print(f'Using virtual camera: {cam.device}')
    frame = np.zeros((cam.height, cam.width, 3), np.uint8)  # RGB
    while True:
        h, s, v = (cam.frames_sent % 100) / 100, 1.0, 1.0
        r, g, b = colorsys.hsv_to_rgb(h, s, v)
        frame[:] = (r * 255, g * 255, b * 255)
        cam.send(frame)
        cam.sleep_until_next_frame()

pyvirtualcam uses the first available virtual camera it finds (see later section).

For more examples, including using different pixel formats like BGR, or selecting a specific camera device, check out the examples/ folder.

See also the API Documentation.

Installation

This package works on Windows, macOS, and Linux. Install it from PyPI with:

pip install pyvirtualcam

pyvirtualcam relies on existing virtual cameras which have to be installed first. See the next section for details.

Supported virtual cameras

Windows: OBS

OBS includes a built-in virtual camera for Windows (since 26.0).

To use the OBS virtual camera, simply install OBS.

Note that OBS provides a single camera instance only, so it is not possible to send frames from Python to the built-in OBS virtual camera, capture the camera in OBS, mix it with other content, and output it again to OBS' built-in virtual camera. To achieve such a workflow, use another virtual camera from Python (like Unity Capture) so that OBS' built-in virtual camera is free for use in OBS.

Windows: Unity Capture

Unity Capture provides a virtual camera originally meant for streaming Unity games. Compared to most other virtual cameras it supports RGBA frames (frames with transparency) which in turn can be captured in OBS for further processing.

To use the Unity Capture virtual camera, follow the installation instructions on the project site.

macOS: OBS

OBS includes a built-in virtual camera for macOS (since 26.1).

NOTE: Starting with pyvirtualcam 0.10, only OBS 28 or higher is supported. Install an older version if you need OBS 26 / 27 support.

HELP WANTED: pyvirtualcam requires code updates to run on macOS 14 and higher. If you own a Mac, consider contributing: https://github.com/letmaik/pyvirtualcam/issues/111#issuecomment-1763398540.

To use the OBS virtual camera, follow these one-time setup steps:

  • Install OBS.
  • Start OBS.
  • Click "Start Virtual Camera" (bottom right), then "Stop Virtual Camera".
  • Close OBS.

Note that OBS provides a single camera instance only, so it is not possible to send frames from Python, capture the camera in OBS, mix it with other content, and output it again as virtual camera.

Linux: v4l2loopback

pyvirtualcam uses v4l2loopback virtual cameras on Linux.

To create a v4l2loopback virtual camera on Ubuntu, run the following:

sudo apt install v4l2loopback-dkms
sudo modprobe v4l2loopback devices=1

For further information, see the v4l2loopback documentation.

Build from source

Linux/macOS

git clone https://github.com/letmaik/pyvirtualcam --recursive
cd pyvirtualcam
pip install .

Windows

These instructions are experimental and support is not provided for them. Typically, there should be no need to build manually since wheels are hosted on PyPI.

You need to have Visual Studio installed to build pyvirtualcam.

In a PowerShell window:

$env:USE_CONDA = '1'
$env:PYTHON_VERSION = '3.7'
$env:PYTHON_ARCH = '64'
$env:NUMPY_VERSION = '1.14'
git clone https://github.com/letmaik/pyvirtualcam --recursive
cd pyvirtualcam
powershell .github/scripts/build-windows.ps1

The above will download all build dependencies (including a Python installation) and is fully configured through the four environment variables. Set USE_CONDA = '0' to build within an existing Python environment.

Metadata

Release files for pyvirtualcam 0.11.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pyvirtualcam 0.11.1
File
pyvirtualcam-0.11.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pyvirtualcam-0.11.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
pyvirtualcam-0.11.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
pyvirtualcam-0.11.1-cp312-cp312-macosx_10_9_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.9+ x86-64 Details
pyvirtualcam-0.11.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pyvirtualcam-0.11.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
pyvirtualcam-0.11.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
pyvirtualcam-0.11.1-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
pyvirtualcam-0.11.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
pyvirtualcam-0.11.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
pyvirtualcam-0.11.1-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
pyvirtualcam-0.11.1-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
pyvirtualcam-0.11.1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
pyvirtualcam-0.11.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
pyvirtualcam-0.11.1-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
pyvirtualcam-0.11.1-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
pyvirtualcam-0.11.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
pyvirtualcam-0.11.1-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details

Total release size: 3.5 MB

Release files / pyvirtualcam-0.11.1-cp312-cp312-win_amd64.whl

Download URL pyvirtualcam-0.11.1-cp312-cp312-win_amd64.whl
Size 162.5 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
33369930327ab83a9a637f561011feff9280f2d14aa9e306e7870e57472eaaef
BLAKE2b-256 checksum
How to use checksums
33d1691ebc2872ab1973925e4ec97c416acdb3df0a62fd16d6fbbba267a2c16f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyvirtualcam-0.11.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 142.0 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
87791638e308b07bf612464c200fb49e71efbc1347feba762711b300ac53ec91
BLAKE2b-256 checksum
How to use checksums
6a866aa0b320ac3bbd6cb6000f39de86e32714019a561be7a6edb79a49e55f5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL pyvirtualcam-0.11.1-cp312-cp312-macosx_11_0_arm64.whl
Size 224.6 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
63b4dd02bc0885067d590d06e03042b1a4237939e48a84f12fc2c170afeb2af8
BLAKE2b-256 checksum
How to use checksums
5ab9efa22dd6231cca67b8369d41bad72bb1e6f67be25022f2596ff5bea061ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp312-cp312-macosx_10_9_x86_64.whl

Download URL pyvirtualcam-0.11.1-cp312-cp312-macosx_10_9_x86_64.whl
Size 258.2 kB
Tags CPython 3.12 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
5fe999ef554129886fffffafc385020610c25ff577f37fc36128036a6bc69a72
BLAKE2b-256 checksum
How to use checksums
cf62d693e5f289a16bba7b7896346c77dbae03e43f0f169b9e2cdfe27a237791
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp311-cp311-win_amd64.whl

Download URL pyvirtualcam-0.11.1-cp311-cp311-win_amd64.whl
Size 163.6 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
55d7de9cae396fae6a4ac35d318d971a9b0144faa2f0bb678f59dfc935571e79
BLAKE2b-256 checksum
How to use checksums
087f47ea70174b9d199c44ef42585c1a9f132cd30ce688717cee9e860ced1887
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyvirtualcam-0.11.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 142.9 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
cbb0aaefc5112ac0eb0f1125b3979387f0da02d3f21ada5c70b15ae5b4719cf2
BLAKE2b-256 checksum
How to use checksums
4eb725d4c47cc2dbc63ca0f13bee968ec5cf3aa06514ff5511810539dabeda81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL pyvirtualcam-0.11.1-cp311-cp311-macosx_11_0_arm64.whl
Size 226.0 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e01711354b75f89313f0c7794736dde72e34f7f0c1934f27149a193e753d7c62
BLAKE2b-256 checksum
How to use checksums
e44071ad5595d92ea7e0961b8baea826ed399028047ae076efc08a0cda8f6fbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp311-cp311-macosx_10_9_x86_64.whl

Download URL pyvirtualcam-0.11.1-cp311-cp311-macosx_10_9_x86_64.whl
Size 260.3 kB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
7cab6032e72de5a8346ad9b9f8d10f5d7cf8e5fce1535b5c98d21a25852a4c31
BLAKE2b-256 checksum
How to use checksums
ac3d36abfb8366eb937166953dd476d8c5a777031f1313599f4d086a1a900cea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp310-cp310-win_amd64.whl

Download URL pyvirtualcam-0.11.1-cp310-cp310-win_amd64.whl
Size 161.5 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
2ff726f963bd91de77587c0c44b628d887986a5d490193ae7101e54061205eaf
BLAKE2b-256 checksum
How to use checksums
24182f893ef93e0c339bb3c1aff42221d6a36cf02bfa4b5e53ba8de836eb759e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyvirtualcam-0.11.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 141.4 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
fceb0d2f6c1c8e0527d3e26ac849ab8407c60351b2044c7f1db5f5f3c9f5b972
BLAKE2b-256 checksum
How to use checksums
6c771023025097d878798ec2298f08e22a47b0edb8b2c75a71ae1e448a51d3dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp310-cp310-macosx_11_0_arm64.whl

Download URL pyvirtualcam-0.11.1-cp310-cp310-macosx_11_0_arm64.whl
Size 224.8 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cda11de8fb25dbeca06307ebe033778998e1b44161edbf139674a44331c1dabd
BLAKE2b-256 checksum
How to use checksums
ce703b37156ccf97716937b6539da27a50dbf657d4c0205005d6c4c70d75a62f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp310-cp310-macosx_10_9_x86_64.whl

Download URL pyvirtualcam-0.11.1-cp310-cp310-macosx_10_9_x86_64.whl
Size 259.0 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
ab7d18aee940bbdff34e9b943fb489ba824d75485060df90d9d0c41fe7485f29
BLAKE2b-256 checksum
How to use checksums
a6239e910a138aac2162135443c46324f452b5e4815248b5a2ffc8a449451cf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp39-cp39-win_amd64.whl

Download URL pyvirtualcam-0.11.1-cp39-cp39-win_amd64.whl
Size 160.8 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
66356f18c72549f1752f983407d989a617782439542035beb20793a105c3c8bf
BLAKE2b-256 checksum
How to use checksums
d266a38e07126e1a562ee69856c2b75e884abb04e86a5955aeffe9c01efafc65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyvirtualcam-0.11.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 141.8 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
61bf099e00e17d6c098134443b7291be7d93df6790c67217f2ae46556690f83c
BLAKE2b-256 checksum
How to use checksums
ec06b11f3ff4657860be085a4299c08308c156c0eb819ebd3a9bc793f4635900
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp39-cp39-macosx_10_9_x86_64.whl

Download URL pyvirtualcam-0.11.1-cp39-cp39-macosx_10_9_x86_64.whl
Size 259.2 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
0bbacd5b09c333a4c29609f2838f4ad1f11f265872459a405e6ea422af5e2d91
BLAKE2b-256 checksum
How to use checksums
00ca5c543a04fa5b2345e44a481d3055e34bfaddc02fdd8b082d2e1d2d0934d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp38-cp38-win_amd64.whl

Download URL pyvirtualcam-0.11.1-cp38-cp38-win_amd64.whl
Size 161.5 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
6ca7e6f306b2ffd4a0d3792089c5ba827737893f3ae8afcebc4f59264cf24844
BLAKE2b-256 checksum
How to use checksums
389aa98f6311ca65eca881ed228ded216b374ed1b47be34547eb49a92c8d0035
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyvirtualcam-0.11.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 141.3 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a599c66c37ff3b0c21626294a367571ff582f99e0cf7012c89ac2ea5c969614d
BLAKE2b-256 checksum
How to use checksums
fb75e33ff77c41cc71dea256c68a1fe8ce11e848f16aca6f0a51eb3fdb6fdca4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyvirtualcam-0.11.1-cp38-cp38-macosx_10_9_x86_64.whl

Download URL pyvirtualcam-0.11.1-cp38-cp38-macosx_10_9_x86_64.whl
Size 258.9 kB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
f7437e545cf4fd604bafa53969be14cac24ced43f329aaa9dc3631e7fac7308e
BLAKE2b-256 checksum
How to use checksums
3ea521d0dde3725f0a52d795026e4550cf5adfa7c7bf119c7878de626d1983a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Security for pyvirtualcam 0.11.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page