pyvirtualcam
NOTE: This package is a work-in-progress. No support is provided, use at own risk.
Usage
import pyvirtualcam
import numpy as np
with pyvirtualcam.Camera(width=1280, height=720, fps=30) as cam:
while True:
frame = np.zeros((cam.height, cam.width, 4), np.uint8) # RGBA
frame[:,:,:3] = cam.frames_sent % 255 # grayscale animation
frame[:,:,3] = 255
cam.send(frame)
cam.sleep_until_next_frame()
Installation
This package is Windows-only for now. Binary wheels are provided on PyPI. Check out pyfakewebcam for something that works on Linux.
pip install pyvirtualcam
The package uses obs-virtual-cam which has to be installed separately. Note that the obs-virtual-cam installer assumes an OBS Studio installation and will fail otherwise. You can also download the obs-virtual-cam zip package from https://github.com/CatxFish/obs-virtual-cam/releases without installing OBS Studio. After unzipping, from an admin command prompt, run:
regsvr32 /n /i:1 "obs-virtualcam\bin\32bit\obs-virtualsource.dll"
regsvr32 /n /i:1 "obs-virtualcam\bin\64bit\obs-virtualsource.dll"
To uninstall, run:
regsvr32 /u "obs-virtualcam\bin\32bit\obs-virtualsource.dll"
regsvr32 /u "obs-virtualcam\bin\64bit\obs-virtualsource.dll"
Contributions
The most useful contributions would be to add support for macOS or Linux.
Similar to Windows, it may be possible in macOS to piggyback on https://github.com/johnboiles/obs-mac-virtualcam.
For Linux, it seems like https://github.com/umlaeute/v4l2loopback is the right dependency. Code from https://github.com/CatxFish/obs-v4l2sink may be useful as inspiration on how to send frames to the loopback device. Also, there is https://github.com/jremmons/pyfakewebcam which may be a good candidate.
Metadata
Release files for pyvirtualcam 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pyvirtualcam-0.3.1-cp39-cp39-win_amd64.whl | CPython 3.9 | CPython 3.9 | Windows x86-64 | Details |
| pyvirtualcam-0.3.1-cp38-cp38-win_amd64.whl | CPython 3.8 | CPython 3.8 | Windows x86-64 | Details |
| pyvirtualcam-0.3.1-cp37-cp37m-win_amd64.whl | CPython 3.7 | CPython 3.7 pymalloc | Windows x86-64 | Details |
| pyvirtualcam-0.3.1-cp36-cp36m-win_amd64.whl | CPython 3.6 | CPython 3.6 pymalloc | Windows x86-64 | Details |
Total release size: 250.8 kB
Release files / pyvirtualcam-0.3.1-cp39-cp39-win_amd64.whl
| Download URL | pyvirtualcam-0.3.1-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 62.7 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a41f1ebfa9d47ddf0b63c68ba124547511942926fff98d3041ceaf11ef47c23f
|
|
BLAKE2b-256 checksum How to use checksums |
49295934501efd13da58b631a05734cfa423af33b2adf4932ce10e894a8de555
|
| 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.56.0 CPython/3.9.1
|
Release files / pyvirtualcam-0.3.1-cp38-cp38-win_amd64.whl
| Download URL | pyvirtualcam-0.3.1-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 62.6 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
365062f55073c8afea6a64ae464d7ec51e7a65efd1e6598dc0f14a0bb0c18516
|
|
BLAKE2b-256 checksum How to use checksums |
4af853c691eca9b7b42538f26f9422cee3c51f55443d29e942a1ce200a898b5f
|
| 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.56.0 CPython/3.9.1
|
Release files / pyvirtualcam-0.3.1-cp37-cp37m-win_amd64.whl
| Download URL | pyvirtualcam-0.3.1-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 62.8 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
672b8a670259d8fc92cdb475c7fde2c39c393cb92b911bbf2dd1dd6b5b45f975
|
|
BLAKE2b-256 checksum How to use checksums |
1cc6d663e19d2b8d52dbfa0933b65464f96eac937472fe585cda27d50fc11e8a
|
| 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.56.0 CPython/3.9.1
|
Release files / pyvirtualcam-0.3.1-cp36-cp36m-win_amd64.whl
| Download URL | pyvirtualcam-0.3.1-cp36-cp36m-win_amd64.whl |
|---|---|
| Size | 62.8 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
db9b184d0e198086bf0f7c68366b9945bd5c2af748cee250552a0c71d107f85e
|
|
BLAKE2b-256 checksum How to use checksums |
e1219074d519f1a299a007189602c83b45e3536990418463e01ee31f06f38af5
|
| 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.56.0 CPython/3.9.1
|