fangfufu / Linux-Fake-Background-Webcam

Faking your webcam background under GNU/Linux, now supports background blurring, animated background, colour map effect, hologram effect and on-demand processing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Camera Properties Set to Zeros

dashdrum opened this issue · comments

Similar to closed issue #89, I'm having trouble setting camera properties.

The program seems to be working OK with my inbuilt webcam, but I'm trying to use an external Logitech C290. Its specs include 1080P and 720P, plus I have software that uses 640x480. There is no special driver software for the camera, as Ubuntu 20.04 supports it directly.

Here is the error I get when I try to use the C290:

python3 fake.py --no-background --no-foreground -w /dev/video1
Real camera original values are set as: 0x0 with 0 FPS and video codec 0
Cannot set camera property 6 to 1196444237. Defaulting to auto-detected property set by opencv
Cannot set camera property 3 to 1280. Defaulting to auto-detected property set by opencv
Cannot set camera property 4 to 720. Defaulting to auto-detected property set by opencv
Cannot set camera property 5 to 30. Defaulting to auto-detected property set by opencv
Real camera new values are set as: 0x0 with 0 FPS and video codec 0
Running...
Please CTRL-C to pause and reload the background / foreground images
Please CTRL-\ to exit
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Traceback (most recent call last):
  File "fake.py", line 458, in <module>
    main()
  File "fake.py", line 455, in main
    cam.run()
  File "fake.py", line 306, in run
    self.load_images()
  File "fake.py", line 188, in load_images
    background = self.resize_image(background,
  File "fake.py", line 167, in resize_image
    raise RuntimeError("Camera dimensions error w={} h={}".format(
RuntimeError: Camera dimensions error w=0 h=0

I have tried various heights and widths without any change. I even attempted changing the codec to H264. Same errors (with a different value for property 6 for H264).

Any help would be appreciated. I'm looking forward to using this tool.

Maybe your C290 is on /dev/video2? Webcam seems to occupy two video devices nowadays.

Yes! This was the issue. Both the internal and external webcams have double entries in /dev/video*, so I found it on /dev/video3. I understand that these assignments can change with reboots and connections of other peripherals.

Thanks for the help!

(typed while viewing myself on camera with a Mars mountain range in the background)

Have you got the link to the background? I kind of want it too.

Thanks!

Thanks! :)