Comments (4)
Does it happen reproducibly? It looks like an issue with v4l2loopback. Maybe you started the script twice somehow? Or another software is writing to the camera as well and has re-configured it after starting the Python script. The error message doesn't say much, so it's hard to tell.
from pyvirtualcam.
Does it happen reproducibly? It looks like an issue with v4l2loopback. Maybe you started the script twice somehow? Or another software is writing to the camera as well and has re-configured it after starting the Python script. The error message doesn't say much, so it's hard to tell.
ok, thanks for your reply, I will try to reinstall v4l2loopback.
from pyvirtualcam.
Does it happen reproducibly? It looks like an issue with v4l2loopback. Maybe you started the script twice somehow? Or another software is writing to the camera as well and has re-configured it after starting the Python script. The error message doesn't say much, so it's hard to tell.
Sorry to bother you again, I am having some problems with pyvituralcam.
when I with pyvirtualcam.Camera(width=1920, height=1080, fps=30) as cam
and cam.send(frame)
, can I use cv2.VideoCapture(0)
to get the frame? My computer has only one camera created by v4l2loopback, '/dev/video0'.
this is my code:
import os
import sys
import cv2
import numpy as np
import pyvirtualcam
if __name__ == "__main__":
video_path = '/workspace/test_virtual_camera/demo_video/demo.mp4'
video_capture = cv2.VideoCapture(video_path)
frame_height = video_capture.get(cv2.CAP_PROP_FRAME_HEIGHT)
frame_width = video_capture.get(cv2.CAP_PROP_FRAME_WIDTH)
frame_count = video_capture.get(cv2.CAP_PROP_FRAME_COUNT)
fps = video_capture.get(cv2.CAP_PROP_FPS)
frame_rgb_list = []
for frame_idx in range(int(frame_count)):
_, frame = video_capture.read()
frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
frame_rgb_list.append(frame_rgb)
with pyvirtualcam.Camera(width=int(frame_width),
height=int(frame_height),
fps=int(fps)) as cam:
print(f'Using virtual camera: {cam.device}')
video_capture_virtualcam = cv2.VideoCapture(0)
n = 0
while True:
frame = frame_rgb_list[n]
cam.send(frame)
cam.sleep_until_next_frame()
ret, frame_from_virtualcam = video_capture_virtualcam.read()
cv2.imshow("frame_from_virtualcam", frame_from_virtualcam)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
if n == 10:
break
print('==>>', n)
n += 1
video_capture_virtualcam.release()
cv2.destroyAllWindows()
sys.exit()
from pyvirtualcam.
Can you confirm whether you fixed your original issue? If so, please close this github issue. You can use the Discussions to ask further questions.
from pyvirtualcam.
Related Issues (20)
- OBS plugin used from local folder HOT 1
- failed to import on arm64 HOT 2
- 854 * 480 resolution causes "pixel buffer size mismatch" on macOS HOT 9
- pyvirtualcam does not detect OBS on macOS 14: 'obs' backend: OBS Virtual Camera is not installed HOT 25
- 有可能加入声音也一起推送吗? HOT 2
- ERROR: No matching distribution found for pyvirtualcam HOT 1
- Issue with Selecting Specific UnityCapture Devices in pyvirtualcam HOT 1
- Feature Request: Build for Linux aarch64/arm64 on PyPI HOT 5
- Numpy 2.0 is out, pyvirtualcam doesn't work with it HOT 4
- No video signals from OBS/UnityCapture HOT 1
- Package not installing HOT 8
- macOS 11: test captures in CI are darker than in 10.15 HOT 3
- Alpha channel supported now? HOT 1
- Ability to select a particular virtual camera from a list of virtual camera devices HOT 1
- No Video in output file, always 1kb in size.
- macOS: OBS 18 support
- Wheels for macOS ARM64 HOT 8
- ImportError: cannot import name '_native_macos_obs' from partially initialized module 'pyvirtualcam' on macOS HOT 1
- Performance drop on M1 Mac HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyvirtualcam.