Skip to main content

Send frames to a virtual camera

Project description

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.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pyvirtualcam-0.5.0-cp39-cp39-win_amd64.whl (74.2 kB view details)

Uploaded CPython 3.9Windows x86-64

pyvirtualcam-0.5.0-cp39-cp39-manylinux2014_x86_64.whl (979.1 kB view details)

Uploaded CPython 3.9

pyvirtualcam-0.5.0-cp39-cp39-macosx_10_9_x86_64.whl (82.3 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pyvirtualcam-0.5.0-cp38-cp38-win_amd64.whl (74.1 kB view details)

Uploaded CPython 3.8Windows x86-64

pyvirtualcam-0.5.0-cp38-cp38-manylinux2014_x86_64.whl (984.0 kB view details)

Uploaded CPython 3.8

pyvirtualcam-0.5.0-cp38-cp38-macosx_10_9_x86_64.whl (82.1 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

pyvirtualcam-0.5.0-cp37-cp37m-win_amd64.whl (74.8 kB view details)

Uploaded CPython 3.7mWindows x86-64

pyvirtualcam-0.5.0-cp37-cp37m-manylinux2014_x86_64.whl (997.7 kB view details)

Uploaded CPython 3.7m

pyvirtualcam-0.5.0-cp37-cp37m-macosx_10_9_x86_64.whl (81.3 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

pyvirtualcam-0.5.0-cp36-cp36m-win_amd64.whl (74.8 kB view details)

Uploaded CPython 3.6mWindows x86-64

pyvirtualcam-0.5.0-cp36-cp36m-manylinux2014_x86_64.whl (996.8 kB view details)

Uploaded CPython 3.6m

pyvirtualcam-0.5.0-cp36-cp36m-macosx_10_9_x86_64.whl (81.2 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

Details for the file pyvirtualcam-0.5.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyvirtualcam-0.5.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 74.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using 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

File hashes

Hashes for pyvirtualcam-0.5.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e665f108b8d4ebb899f8b24c263c33b225c120df863e63c4bfc911c68d5705dd
MD5 d522ea54ffc1ec18fc07d940d64d0835
BLAKE2b-256 450ca9477c23001ddb41daa41346c251c0358ac4ca1ab885eeeff05c40777da5

See more details on using hashes here.

File details

Details for the file pyvirtualcam-0.5.0-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

  • Download URL: pyvirtualcam-0.5.0-cp39-cp39-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 979.1 kB
  • Tags: CPython 3.9
  • Uploaded using 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

File hashes

Hashes for pyvirtualcam-0.5.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f66236c2adf6b17c35b11f1290869477fe85d5b55526eceb8d54d4b95f3c888c
MD5 d25ad3904bc4bea1c9c3d90d5e120625
BLAKE2b-256 14fb1d09e58ae9d4b236cd93a0de0d73e6521242e91541f5ddd61a9655b4525c

See more details on using hashes here.

File details

Details for the file pyvirtualcam-0.5.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: pyvirtualcam-0.5.0-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 82.3 kB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using 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

File hashes

Hashes for pyvirtualcam-0.5.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 21484ccc29ec433f6c8c8e4336287d41d0cd41791901dcbada482d874efac769
MD5 a58d0143dd96d83d7f953ddfc2956da8
BLAKE2b-256 660ca4c127f1307aedc6ce08ead6c98cd441f39af53440d51a5281fdc93e4e2b

See more details on using hashes here.

File details

Details for the file pyvirtualcam-0.5.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pyvirtualcam-0.5.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 74.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using 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

File hashes

Hashes for pyvirtualcam-0.5.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 de577dfb7d84f31c9526adf911fb09ebc2efebbf4e47c7781c7fa85dcef6b8b7
MD5 6b5181c2cc7186290e6f8dcad75d70d6
BLAKE2b-256 22e8060ab595f92a743656731eff413864203e8b9e83e43807006a71f3fa534c

See more details on using hashes here.

File details

Details for the file pyvirtualcam-0.5.0-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: pyvirtualcam-0.5.0-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 984.0 kB
  • Tags: CPython 3.8
  • Uploaded using 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

File hashes

Hashes for pyvirtualcam-0.5.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e40d54dd38a28f12796a11c1f2c1770859b908f0bbeabb81b93c79a4e83eb33c
MD5 837321f20769bb4b92a48d3766355ff6
BLAKE2b-256 1135e16fbcc32b015efb520badb064e0d192719a17fffb20b19b4a6b5b9231b3

See more details on using hashes here.

File details

Details for the file pyvirtualcam-0.5.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: pyvirtualcam-0.5.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 82.1 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using 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

File hashes

Hashes for pyvirtualcam-0.5.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1e2bc1ad0a60cf32a361c5e87f46abae2236678254da49e7e6b0da04c12ad419
MD5 720f8e4e82e88c6b143a379b42cf9d08
BLAKE2b-256 90ab70ecc0c683b9849996ffca2d31cbe484810d78defbe11035e4634dde3143

See more details on using hashes here.

File details

Details for the file pyvirtualcam-0.5.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pyvirtualcam-0.5.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 74.8 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using 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

File hashes

Hashes for pyvirtualcam-0.5.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e049fa89407a928827b4fbe9e15ad2c83c8b718adc68c66ed2a1fa408e2c8599
MD5 85ac0b2ad5b93976980af99e08647129
BLAKE2b-256 0a9d641a39ecf6923248825e3409bbda172cf54cee076d703a20f9892e8c6642

See more details on using hashes here.

File details

Details for the file pyvirtualcam-0.5.0-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: pyvirtualcam-0.5.0-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 997.7 kB
  • Tags: CPython 3.7m
  • Uploaded using 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

File hashes

Hashes for pyvirtualcam-0.5.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a51a4caf48803c8a3684e665796c8b4ced73046457da3183c008076c65c52967
MD5 2b78a1d6f060dfbb108df57186fcd736
BLAKE2b-256 82a69ba619323d22b71e5a2208a7bf935708658970398c0f483f77142576fdc3

See more details on using hashes here.

File details

Details for the file pyvirtualcam-0.5.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: pyvirtualcam-0.5.0-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 81.3 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using 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

File hashes

Hashes for pyvirtualcam-0.5.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b36b1548ad1c540c27dc781315d9b702f7e88800c38a1997e062ece25eb814d0
MD5 251e18a2397618aecc4083d6d4c78e04
BLAKE2b-256 a2a835ca7b3c5def2262f834634b28041982138d63fb759cf15e2225015aa0af

See more details on using hashes here.

File details

Details for the file pyvirtualcam-0.5.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pyvirtualcam-0.5.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 74.8 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using 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

File hashes

Hashes for pyvirtualcam-0.5.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 b243a3290df84dc4f92280660f89413fd4078356f6b11c284e0c3612ac81b93f
MD5 3bb591f120197278728c4cc81abaaa07
BLAKE2b-256 4e223fbc780ac851bb9f69266d2963e696c2821c63297d9639d374717b94168b

See more details on using hashes here.

File details

Details for the file pyvirtualcam-0.5.0-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: pyvirtualcam-0.5.0-cp36-cp36m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 996.8 kB
  • Tags: CPython 3.6m
  • Uploaded using 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

File hashes

Hashes for pyvirtualcam-0.5.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5a3a5fee93ae4f289513a5de2ab45b799d46d1d10397d6f0cb24424368129694
MD5 c1b6a689ff205c62987989ffeeedb540
BLAKE2b-256 68493290b6217e60f3740925d5ab5cc92b5749e7845fc03cf02624b920786768

See more details on using hashes here.

File details

Details for the file pyvirtualcam-0.5.0-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: pyvirtualcam-0.5.0-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 81.2 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using 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

File hashes

Hashes for pyvirtualcam-0.5.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bfc5d65657c710f34f1bdc76618532500da39bead0573c686449469024f6a352
MD5 e24c685dffd72c2dc4c989c3806eb84e
BLAKE2b-256 fe1a95558745b548e203251549b24beb6a512fb16a84cb266850f9b062b16bc7

See more details on using hashes here.

Supported by

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