You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Getting error: frame height does not match the height of webcam device: 540!=480 #63
When i run ./virtual_webcam.py, I get the following error:
$ ./virtual_webcam.py
Reloading config.
Model: mobilenet (multiplier=0.5, stride=16)
Loading model...
done.
Traceback (most recent call last):
File "/home/ben/.local/src/virtual_webcam_background/./virtual_webcam.py", line 315, in <module>
mainloop()
File "/home/ben/.local/src/virtual_webcam_background/./virtual_webcam.py", line 309, in mainloop
fakewebcam.schedule_frame(frame)
File "/home/ben/.local/lib/python3.9/site-packages/pyfakewebcam/pyfakewebcam.py", line 68, in schedule_frame
raise Exception('frame height does not match the height of webcam device: {}!={}\n'.format(self._settings.fmt.pix.height, frame.shape[0]))
Exception: frame height does not match the height of webcam device: 540!=480
I've experienced a similar issue and was able to fix it for myself. It turns out after creating the v4l2loopback device and using it once, you can't change the resolution without hitting this error.
Activity
allo- commentedon Feb 24, 2021
What is the size of
background.jpg? Try to scale/crop it to the resolution of your webcam.allo- commentedon Feb 24, 2021
See also #62. Maybe you have the same issue?
z80z80z80 commentedon Apr 20, 2021
I've experienced a similar issue and was able to fix it for myself. It turns out after creating the v4l2loopback device and using it once, you can't change the resolution without hitting this error.
My process for resolution changes is:
sudo modprobe -r v4l2loopbacksudo modprobe v4l2loopback devices=1 max_buffers=2 exclusive_caps=1 card_label="VirtualCam"python virtual_webcam.py