Create a new camera source using OpenCV Python (Camera Driver Using Python) - Stack Overflow
How to create a virtual camera in python on windows?
check out this project: https://github.com/letmaik/pyvirtualcam
More on reddit.comopencv - How to make a virtual camera with python? - Stack Overflow
I created a self-hosted security camera system
With all of the pandemic stay at home stuff and the mess on my desk I decided I would my own opensource virtual background webcam with artificial intelligence utilizing tensorFlow and bodypix, hence why I'm utilizing python, is there any way to create a virtual webcam in windows from python? I can capture frames, mask them and... save them into a jpg, so far I haven't found any way to ouput them as a webcam feed, all the options I've found are for linux... If not, are there any alternatives?
thanks for your time!
This may be late but check this out pyvirtualcam
install it first:
pip install pyvirtualcam
You can make it like this:
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()
As mentioned in the earlier comment, pyvirtualcam should work, but it relies on an existing virtual camera software.
As for Jan 2024, supported software list consists of:
Windows: OBS, Unity Capture
macOS: OBS
Linux: v4l2loopback
