Linux-Fake-Background-Webcam
Linux-Fake-Background-Webcam copied to clipboard
OSError: [Errno 22] Invalid argument
I'm having this error when running the command below, any ideas?
$ python3 fake.py -c ./config-example.ini
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Real camera original values are set as: 640x480 with 30 FPS and video codec 1448695129
Real camera new values are set as: 1280x720 with 30 FPS and video codec 1196444237
Traceback (most recent call last):
File "/home/bruno/Downloads/fakecam/fake.py", line 495, in <module>
main()
File "/home/bruno/Downloads/fakecam/fake.py", line 484, in main
cam = FakeCam(args)
File "/home/bruno/Downloads/fakecam/fake.py", line 120, in __init__
self.fake_cam = pyfakewebcam.FakeWebcam(self.v4l2loopback_path, self.width,
File "/home/bruno/.local/lib/python3.10/site-packages/pyfakewebcam/pyfakewebcam.py", line 54, in __init__
fcntl.ioctl(self._video_device, _v4l2.VIDIOC_S_FMT, self._settings)
OSError: [Errno 22] Invalid argument
My config file:
width = 1280
height = 720
fps = 30
; no-background = yes
background-keep-aspect = yes
no-foreground = yes
webcam-path = /dev/video0
threshold = 50
v4l2loopback
cat /proc/modules | grep -i v4l2loopback
v4l2loopback 49152 0 - Live 0x0000000000000000 (O)
videodev 258048 5 akvcam,v4l2loopback,uvcvideo,videobuf2_v4l2,videobuf2_common, Live 0x0000000000000000
My devices:
$ v4l2-ctl --list-devices
fake-cam (platform:v4l2loopback-000):
/dev/video2
Integrated_Webcam_HD: Integrate (usb-0000:00:14.0-6):
/dev/video0
/dev/video1
/dev/media0
Hardware/OS:
Have you try to resolve this issue with answers from https://github.com/fangfufu/Linux-Fake-Background-Webcam/issues/170 ? I've also had this issue and in my case this command do the job:
python3 fake.py --webcam-path /dev/video2 --v4l2loopback-path /dev/video4
so if you adjusted this to your configuration it would look like this python3 fake.py --webcam-path /dev/video0 --v4l2loopback-path /dev/video2