Skip to main content

pyvirtualcam

pyvirtualcam sends frames to a virtual camera from Python.

Usage

import pyvirtualcam
import numpy as np

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:
        frame[:] = cam.frames_sent % 255  # grayscale animation
        cam.send(frame)
        cam.sleep_until_next_frame()

For more examples, check out the samples/ folder.

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, capture the camera in OBS, mix it with other content, and output it again as virtual camera.

macOS: OBS

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

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.

pyvirtualcam uses the first available v4l2loopback virtual camera it finds. The camera device name can be accessed with cam.device.

Release files for pyvirtualcam 0.5.0

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.5.0
File
pyvirtualcam-0.5.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
pyvirtualcam-0.5.0-cp39-cp39-manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
pyvirtualcam-0.5.0-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
pyvirtualcam-0.5.0-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
pyvirtualcam-0.5.0-cp38-cp38-manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
pyvirtualcam-0.5.0-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
pyvirtualcam-0.5.0-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
pyvirtualcam-0.5.0-cp37-cp37m-manylinux2014_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 Details
pyvirtualcam-0.5.0-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details
pyvirtualcam-0.5.0-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
pyvirtualcam-0.5.0-cp36-cp36m-manylinux2014_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ x86-64 Details
pyvirtualcam-0.5.0-cp36-cp36m-macosx_10_9_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64 Details

Total release size:4.6 MB

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

Download URL pyvirtualcam-0.5.0-cp39-cp39-win_amd64.whl
Size 74.2 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
e665f108b8d4ebb899f8b24c263c33b225c120df863e63c4bfc911c68d5705dd
BLAKE2b-256 checksum
How to use checksums
450ca9477c23001ddb41daa41346c251c0358ac4ca1ab885eeeff05c40777da5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release files / pyvirtualcam-0.5.0-cp39-cp39-manylinux2014_x86_64.whl

Download URL pyvirtualcam-0.5.0-cp39-cp39-manylinux2014_x86_64.whl
Size 979.1 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
f66236c2adf6b17c35b11f1290869477fe85d5b55526eceb8d54d4b95f3c888c
BLAKE2b-256 checksum
How to use checksums
14fb1d09e58ae9d4b236cd93a0de0d73e6521242e91541f5ddd61a9655b4525c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

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

Download URL pyvirtualcam-0.5.0-cp39-cp39-macosx_10_9_x86_64.whl
Size 82.3 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
21484ccc29ec433f6c8c8e4336287d41d0cd41791901dcbada482d874efac769
BLAKE2b-256 checksum
How to use checksums
660ca4c127f1307aedc6ce08ead6c98cd441f39af53440d51a5281fdc93e4e2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

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

Download URL pyvirtualcam-0.5.0-cp38-cp38-win_amd64.whl
Size 74.1 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
de577dfb7d84f31c9526adf911fb09ebc2efebbf4e47c7781c7fa85dcef6b8b7
BLAKE2b-256 checksum
How to use checksums
22e8060ab595f92a743656731eff413864203e8b9e83e43807006a71f3fa534c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release files / pyvirtualcam-0.5.0-cp38-cp38-manylinux2014_x86_64.whl

Download URL pyvirtualcam-0.5.0-cp38-cp38-manylinux2014_x86_64.whl
Size 984.0 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e40d54dd38a28f12796a11c1f2c1770859b908f0bbeabb81b93c79a4e83eb33c
BLAKE2b-256 checksum
How to use checksums
1135e16fbcc32b015efb520badb064e0d192719a17fffb20b19b4a6b5b9231b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

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

Download URL pyvirtualcam-0.5.0-cp38-cp38-macosx_10_9_x86_64.whl
Size 82.1 kB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
1e2bc1ad0a60cf32a361c5e87f46abae2236678254da49e7e6b0da04c12ad419
BLAKE2b-256 checksum
How to use checksums
90ab70ecc0c683b9849996ffca2d31cbe484810d78defbe11035e4634dde3143
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release files / pyvirtualcam-0.5.0-cp37-cp37m-win_amd64.whl

Download URL pyvirtualcam-0.5.0-cp37-cp37m-win_amd64.whl
Size 74.8 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
e049fa89407a928827b4fbe9e15ad2c83c8b718adc68c66ed2a1fa408e2c8599
BLAKE2b-256 checksum
How to use checksums
0a9d641a39ecf6923248825e3409bbda172cf54cee076d703a20f9892e8c6642
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release files / pyvirtualcam-0.5.0-cp37-cp37m-manylinux2014_x86_64.whl

Download URL pyvirtualcam-0.5.0-cp37-cp37m-manylinux2014_x86_64.whl
Size 997.7 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a51a4caf48803c8a3684e665796c8b4ced73046457da3183c008076c65c52967
BLAKE2b-256 checksum
How to use checksums
82a69ba619323d22b71e5a2208a7bf935708658970398c0f483f77142576fdc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release files / pyvirtualcam-0.5.0-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL pyvirtualcam-0.5.0-cp37-cp37m-macosx_10_9_x86_64.whl
Size 81.3 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
b36b1548ad1c540c27dc781315d9b702f7e88800c38a1997e062ece25eb814d0
BLAKE2b-256 checksum
How to use checksums
a2a835ca7b3c5def2262f834634b28041982138d63fb759cf15e2225015aa0af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release files / pyvirtualcam-0.5.0-cp36-cp36m-win_amd64.whl

Download URL pyvirtualcam-0.5.0-cp36-cp36m-win_amd64.whl
Size 74.8 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
b243a3290df84dc4f92280660f89413fd4078356f6b11c284e0c3612ac81b93f
BLAKE2b-256 checksum
How to use checksums
4e223fbc780ac851bb9f69266d2963e696c2821c63297d9639d374717b94168b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release files / pyvirtualcam-0.5.0-cp36-cp36m-manylinux2014_x86_64.whl

Download URL pyvirtualcam-0.5.0-cp36-cp36m-manylinux2014_x86_64.whl
Size 996.8 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
5a3a5fee93ae4f289513a5de2ab45b799d46d1d10397d6f0cb24424368129694
BLAKE2b-256 checksum
How to use checksums
68493290b6217e60f3740925d5ab5cc92b5749e7845fc03cf02624b920786768
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release files / pyvirtualcam-0.5.0-cp36-cp36m-macosx_10_9_x86_64.whl

Download URL pyvirtualcam-0.5.0-cp36-cp36m-macosx_10_9_x86_64.whl
Size 81.2 kB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
bfc5d65657c710f34f1bdc76618532500da39bead0573c686449469024f6a352
BLAKE2b-256 checksum
How to use checksums
fe1a95558745b548e203251549b24beb6a512fb16a84cb266850f9b062b16bc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release history Release notifications | RSS feed

0.9.1

12 release files

0.9.0

11 release files

0.8.0

12 release files

0.7.0

12 release files

0.6.0

12 release files

This release

0.5.0 This release

12 release files

0.3.2

4 release files

0.3.1

4 release files

0.2.0

4 release files

0.1.0

4 release files

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