VTuber_Unity
VTuber_Unity copied to clipboard
issue on Ubuntu 20.04
$ python3 demo.py --debug
[ WARN:0] global /tmp/pip-req-build-ms668fyv/opencv/modules/videoio/src/cap_v4l.cpp (893) open VIDEOIO(V4L2:/dev/video0): can't open camera by index
Traceback (most recent call last):
File "demo.py", line 219, in
@Divanchik
I run into the same issue as well. It looks like it isn't able to read the frame correctly for the first time.
My workaround is to check if the frame is read correctly, if it is not, read again.
What I did is to replace this line, https://github.com/kwea123/VTuber_Unity/blob/ff5e1457d76d00f96eeb9c2ec9cf872f5ed43d0f/demo.py#L58
with
ret, sample_frame = cap.read()
while not ret:
ret, sample_frame = cap.read()
Hope this helps.