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.
GNU General Public License v3.0
1.6k stars 160 forks source link

OSError: [Errno 22] Invalid argument #68

Closed HughPH closed 3 years ago

HughPH commented 3 years ago
$ python3 fake.py 
Cannot set camera property 3 to 1280, used value: 0.0
Cannot set camera property 4 to 720, used value: 0.0
Cannot set camera property 5 to 30, used value: 0.0
Traceback (most recent call last):
  File "fake.py", line 397, in <module>
    main()
  File "fake.py", line 368, in main
    cam = FakeCam(
  File "fake.py", line 118, in __init__
    self.fake_cam = pyfakewebcam.FakeWebcam(v4l2loopback_path, self.width, self.height)
  File "/home/hugh/.local/lib/python3.8/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
fangfufu commented 3 years ago

You should really include more details on how you set everything up. Your real webcam wasn't even opened properly.

HughPH commented 3 years ago

Can you include something in your readme.md to indicate a minimum required version of v4l2loopback? I prefer not to build from source where possible, because sometimes that causes problems when the package manager wants to update. I have v4l2loopback 0.12.5 but I have no idea if that is too old, or if there's some other issue.

Looking at v4l2loopback on github, 0.12.5 appears to be the latest released version 6 months ago.

fangfufu commented 3 years ago

This has got nothing to do with v4l2loopback, you actual webcam hasn't been opened properly, as indicated by

Cannot set camera property 3 to 1280, used value: 0.0
Cannot set camera property 4 to 720, used value: 0.0
Cannot set camera property 5 to 30, used value: 0.0
HughPH commented 3 years ago

OK, well your readme.md says the following:

If you get an error like

OSError: [Errno 22] Invalid argument when opening the webcam from Python, please try the latest version of v4l2loopback from the its Github repository, as the version from your package manager may be too old.

So I'm sure you can understand why that would be confusing.

Your readme.md also goes on to say...

You need to open two terminal windows. In one terminal window, do the following:

cd bodypix
node app.js

In the other terminal window, do the following:

cd fakecam
python3 fake.py

Which I've done, but I then receive the error. At this point there is no mention of any requirement to set a path for the camera so I have to expect - bearing in mind there's no output - that the first available camera device would be opened.

I'm still getting the error when I pass a path to the webcam. I have tried the following paths (which do all exist): /dev/video1 /dev/video2 /dev/v4l/by-path/pci-0000:00:14.0-usb-0:2.4:1.0-video-index0 /dev/v4l/by-path/pci-0000:00:14.0-usb-0:2.4:1.0-video-index1 /dev/v4l/by-id/usb-Sonix_Technology_Co.Ltd._USB_2.0_Camera_SN0001-video-index0 /dev/v4l/by-id/usb-Sonix_Technology_Co.Ltd._USB_2.0_Camera_SN0001-video-index1

And every time I get similar errors - this time property 4 is omitted.

$ python3 ./fake.py -w "/dev/video1"
Cannot set camera property 3 to 1280, used value: 640.0
Cannot set camera property 5 to 30, used value: 10.0
Traceback (most recent call last):
  File "./fake.py", line 397, in <module>
    main()
  File "./fake.py", line 368, in main
    cam = FakeCam(
  File "./fake.py", line 118, in __init__
    self.fake_cam = pyfakewebcam.FakeWebcam(v4l2loopback_path, self.width, self.height)
  File "/home/hugh/.local/lib/python3.8/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
fangfufu commented 3 years ago

Okay, now you have provided me with enough details. I will reopen the issue. What is your operating system? Which version of v4l2loopback are you using? Have you tried akvcam?

HughPH commented 3 years ago

Thank you, I appreciate your help.

This is on Ubuntu 20.10 v4l2loopback version is 0.5.12 (as above, this appears to be the latest release according to the v4l2loopback github) I have not tried akvcam. I already had v4l2loopback installed, and there are complexities with the physical setup of my machine that mean I try to reboot as infrequently as possible (so I try not to install new dkms modules if possible!)

soner89 commented 3 years ago

Hi @HughPH

do you mean v4l2loopback version 0.12.5? v0.5 was release in 2011

By the way, I'm having the same issue. I'm on ArchLinux and am getting the following error:

$ python3 fake.py 
Cannot set camera property 3 to 1280, used value: 640.0
Cannot set camera property 5 to 30, used value: 10.0
Traceback (most recent call last):
  File "fake.py", line 397, in <module>
    main()
  File "fake.py", line 368, in main
    cam = FakeCam(
  File "fake.py", line 118, in __init__
    self.fake_cam = pyfakewebcam.FakeWebcam(v4l2loopback_path, self.width, self.height)
  File "/home/user/.local/lib/python3.8/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

In Arch, I tried running it in Docker with the same result. Without Docker, I used the packages "v4l2loopback-dkms" in version 0.12.5-1, "v4l2loopback-dkms-git" in version 0.12.5.r27.g6225222-1 and compiled it with the latest version as of 2020-11-10 (yyyy-mm-dd) but i'm getting the same error message. Of course I do reboots after switching the v4l2loopback package.

Would appreciate any help!

jakesmolka commented 3 years ago

Hey everyone! I just had the same error on my Arch system trying to run this project through docker. But I never tinkered with my web cam before, so I just had to realize how to use v4l2loopback and which device to give to fake.py (again, via docker in my case).

After I created a virtual cam (see https://github.com/umlaeute/v4l2loopback#run) and used that new /dev/videoX device as output device everything worked. This seems obvious to me now, but at the moment this information wasn't directly available to me in the documentation here. So maybe it can be added to both the main and docker readmes.

Thanks @fangfufu for you work here!

Sopamo commented 3 years ago

I'm having the same issue on Ubuntu 20.04 without docker:

python3 fake.py
Cannot set camera property 3 to 1280, used value: 640.0
Cannot set camera property 5 to 30, used value: 10.0
Traceback (most recent call last):
  File "fake.py", line 397, in <module>
    main()
  File "fake.py", line 368, in main
    cam = FakeCam(
  File "fake.py", line 118, in __init__
    self.fake_cam = pyfakewebcam.FakeWebcam(v4l2loopback_path, self.width, self.height)
  File "/home/paul/.local/lib/python3.8/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

I set it up with Akvcam using the current master branch.

fangfufu commented 3 years ago

@Sopamo , could you try and run the Docker version?

Sopamo commented 3 years ago

I actually realized what the problem was: I had more than one webcam connected and had to specify the real /dev/videoX path to the python command. The background removal still didn't work, but I think that's a different problem.

HughPH commented 3 years ago

Hi @HughPH

do you mean v4l2loopback version 0.12.5? v0.5 was release in 2011

Sorry I missed this. I'm pretty sure I would have meant 0.12.5! I'm running Ubuntu 20.10 so it must have been a typo.

davidnuzik commented 3 years ago

Interesting that setting the real /dev/videoX path worked for Sopamo (https://github.com/fangfufu/Linux-Fake-Background-Webcam/issues/68#issuecomment-744066523) This did not work for me and I get the precisely the same error as Sopamo indicated early above (https://github.com/fangfufu/Linux-Fake-Background-Webcam/issues/68#issuecomment-743742315)

Details: I'm on openSUSE Tumbleweed. I tried specifying the correct /dev/videoX path and still get the error.

user@box:~/dev/Linux-Fake-Background-Webcam/fakecam> python3 fake.py -w "/dev/video1"
Cannot set camera property 3 to 1280, used value: 640.0
Cannot set camera property 5 to 30, used value: 10.0
Traceback (most recent call last):
  File "fake.py", line 397, in <module>
    main()
  File "fake.py", line 368, in main
    cam = FakeCam(
  File "fake.py", line 118, in __init__
    self.fake_cam = pyfakewebcam.FakeWebcam(v4l2loopback_path, self.width, self.height)
  File "/home/user/.local/lib/python3.8/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

Perhaps if there is a dependency on the bodypix app.js and it is not working correctly this might cause the issue? See below:

user@box:~/dev/Linux-Fake-Background-Webcam/bodypix> node app.js 
Found a GPU at /dev/nvidia0
2021-01-30 11:16:29.350810: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2021-01-30 11:16:29.387599: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3393475000 Hz
2021-01-30 11:16:29.388318: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x561957a4a7d0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2021-01-30 11:16:29.388352: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2021-01-30 11:16:29.394887: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2021-01-30 11:16:29.418875: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-01-30 11:16:29.419223: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties: 
name: GeForce GTX 1650 SUPER major: 7 minor: 5 memoryClockRate(GHz): 1.77
pciBusID: 0000:09:00.0
2021-01-30 11:16:29.419309: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudart.so.10.0'; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory
2021-01-30 11:16:29.419351: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcublas.so.10.0'; dlerror: libcublas.so.10.0: cannot open shared object file: No such file or directory
2021-01-30 11:16:29.419391: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcufft.so.10.0'; dlerror: libcufft.so.10.0: cannot open shared object file: No such file or directory
2021-01-30 11:16:29.419433: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcurand.so.10.0'; dlerror: libcurand.so.10.0: cannot open shared object file: No such file or directory
2021-01-30 11:16:29.419472: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusolver.so.10.0'; dlerror: libcusolver.so.10.0: cannot open shared object file: No such file or directory
2021-01-30 11:16:29.419520: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusparse.so.10.0'; dlerror: libcusparse.so.10.0: cannot open shared object file: No such file or directory
2021-01-30 11:16:29.419558: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudnn.so.7'; dlerror: libcudnn.so.7: cannot open shared object file: No such file or directory
2021-01-30 11:16:29.419569: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1641] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2021-01-30 11:16:29.490173: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-01-30 11:16:29.490208: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165]      0 
2021-01-30 11:16:29.490218: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0:   N 

Thank you for your time and for the project.

RoadRunnr commented 3 years ago

I've got the same problem, the v4l2 ioctl to set the video format returns with EINVAL.

Log:

$ ./fake.py --akvcam -w /dev/video2
Cannot set camera property 3 to 1280, used value: 640.0
Cannot set camera property 5 to 30, used value: 10.0
Traceback (most recent call last):
  File "/usr/src/components/Linux-Fake-Background-Webcam/fakecam/./fake.py", line 425, in <module>
    main()
  File "/usr/src/components/Linux-Fake-Background-Webcam/fakecam/./fake.py", line 395, in main
    cam = FakeCam(
  File "/usr/src/components/Linux-Fake-Background-Webcam/fakecam/./fake.py", line 122, in __init__
    self.fake_cam = AkvCameraWriter(v4l2loopback_path, self.width, self.height)
  File "/usr/src/components/Linux-Fake-Background-Webcam/fakecam/akvcam.py", line 14, in __init__
    self.d = self.open_camera()
  File "/usr/src/components/Linux-Fake-Background-Webcam/fakecam/akvcam.py", line 30, in open_camera
    ioctl(d, v4l2.VIDIOC_S_FMT, vid_format)
OSError: [Errno 22] Invalid argument
Exception ignored in: <function AkvCameraWriter.__del__ at 0x7fcd7f07ad30>
Traceback (most recent call last):
  File "/usr/src/components/Linux-Fake-Background-Webcam/fakecam/akvcam.py", line 48, in __del__
    self.queue.put(None)
AttributeError: 'AkvCameraWriter' object has no attribute 'queue'

strace output:

77448 ioctl(4, VIDIOC_S_FMT, {type=V4L2_BUF_TYPE_VIDEO_OUTPUT, fmt.pix={width=640, height=480, pixelformat=v4l2_fourcc('R', 'G', 'B', '3') /* V4L2_PIX_FMT_RGB24 */, field=V4L2_FIELD_NONE, bytesperline=0, sizeimage=0, colorspace=V4L2_COLORSPACE_SRGB}}) = -1 EINVAL (Invalid argument)

The reported capabilities of my webcam:

$ v4l2-ctl --all -d /dev/video2 
Driver Info:
    Driver name      : uvcvideo
    Card type        : Microsoft® LifeCam HD-3000: Mi
    Bus info         : usb-0000:0a:00.0-1.3.2
    Driver version   : 5.8.18
    Capabilities     : 0x84a00001
        Video Capture
        Metadata Capture
        Streaming
        Extended Pix Format
        Device Capabilities
    Device Caps      : 0x04200001
        Video Capture
        Streaming
        Extended Pix Format
Media Driver Info:
    Driver name      : uvcvideo
    Model            : Microsoft® LifeCam HD-3000: Mi
    Serial           : 
    Bus info         : usb-0000:0a:00.0-1.3.2
    Media version    : 5.8.18
    Hardware revision: 0x00000106 (262)
    Driver version   : 5.8.18
Interface Info:
    ID               : 0x03000002
    Type             : V4L Video
Entity Info:
    ID               : 0x00000001 (1)
    Name             : Microsoft® LifeCam HD-3000: Mi
    Function         : V4L2 I/O
    Flags         : default
    Pad 0x01000007   : 0: Sink
      Link 0x02000013: from remote pad 0x100000a of entity 'Extension 5': Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
    Width/Height      : 1280/720
    Pixel Format      : 'YUYV' (YUYV 4:2:2)
    Field             : None
    Bytes per Line    : 2560
    Size Image        : 1843200
    Colorspace        : sRGB
    Transfer Function : Default (maps to sRGB)
    YCbCr/HSV Encoding: Default (maps to ITU-R 601)
    Quantization      : Default (maps to Limited Range)
    Flags             : 
Crop Capability Video Capture:
    Bounds      : Left 0, Top 0, Width 1280, Height 720
    Default     : Left 0, Top 0, Width 1280, Height 720
    Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 1280, Height 720, Flags: 
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1280, Height 720, Flags: 
Streaming Parameters Video Capture:
    Capabilities     : timeperframe
    Frames per second: 10.000 (10/1)
    Read buffers     : 0
                     brightness 0x00980900 (int)    : min=30 max=255 step=1 default=133 value=133
                       contrast 0x00980901 (int)    : min=0 max=10 step=1 default=5 value=5
                     saturation 0x00980902 (int)    : min=0 max=200 step=1 default=83 value=83
 white_balance_temperature_auto 0x0098090c (bool)   : default=1 value=1
           power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=2 value=1
                0: Disabled
                1: 50 Hz
                2: 60 Hz
      white_balance_temperature 0x0098091a (int)    : min=2800 max=10000 step=1 default=4500 value=4500 flags=inactive
                      sharpness 0x0098091b (int)    : min=0 max=50 step=1 default=25 value=25
         backlight_compensation 0x0098091c (int)    : min=0 max=10 step=1 default=0 value=0
                  exposure_auto 0x009a0901 (menu)   : min=0 max=3 default=1 value=3
                1: Manual Mode
                3: Aperture Priority Mode
              exposure_absolute 0x009a0902 (int)    : min=5 max=20000 step=1 default=156 value=156 flags=inactive
                   pan_absolute 0x009a0908 (int)    : min=-201600 max=201600 step=3600 default=0 value=0
                  tilt_absolute 0x009a0909 (int)    : min=-201600 max=201600 step=3600 default=0 value=0
                  zoom_absolute 0x009a090d (int)    : min=0 max=10 step=1 default=0 value=0

OS: Ubuntu 21.04 Kernel: Linux zeus 5.8.0-36-generic #40+21.04.1-Ubuntu SMP Thu Jan 7 11:35:09 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux akvcam: build from git repo master branch

Same problem happens with my build in HP webcam.

Do you need anything else?

fangfufu commented 3 years ago

I am not sure if people have managed to sort out their problem, but either way, I cannot really help with the issue described - I am running Debian Buster, everything works fine. I don't have the time and resources to try out different Ubuntu versions.

Anyway, I have just pushed in an update which switches from Bodypix network to Mediapipe selfie segmentation. The performance massively improved. Please try it out.

eduncan911 commented 3 years ago

For the record, running into the same problem here installing it all today.

Pop_OS 20.10 (Ubuntu 20.10 + Nvidia + w/tensorflow built-in) Installed Cuda10 via System76's repos. Activated Akvcam

Note: I have three (3) webcams connected. Laptop's built-in 720p, the IR camera for face recognition, and a Logitech 920 1080p camera. I have no idea which camera is which in /dev/videoX, and have tried them all without success here.

$ ./fake.py --akvcam --bodypix-url=9222 --webcam-path=/dev/video0
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 "./fake.py", line 468, in <module>
    main()
  File "./fake.py", line 437, in main
    cam = FakeCam(
  File "./fake.py", line 162, in __init__
    self.fake_cam = AkvCameraWriter(v4l2loopback_path, self.width, self.height)
  File "/home/eric/code/fakecam/Linux-Fake-Background-Webcam/fakecam/akvcam.py", line 14, in __init__
    self.d = self.open_camera()
  File "/home/eric/code/fakecam/Linux-Fake-Background-Webcam/fakecam/akvcam.py", line 30, in open_camera
    ioctl(d, v4l2.VIDIOC_S_FMT, vid_format)
OSError: [Errno 22] Invalid argument
Exception ignored in: <function AkvCameraWriter.__del__ at 0x7fd53bbb2430>

Traceback (most recent call last):
  File "/home/eric/code/fakecam/Linux-Fake-Background-Webcam/fakecam/akvcam.py", line 48, in __del__
    self.queue.put(None)
AttributeError: 'AkvCameraWriter' object has no attribute 'queue'

I put a newline between the two, as I think there are two errors being emitted here.

fangfufu commented 3 years ago

@eduncan911 , you need to pull a newer version. You are running an old version. You can use tools like kamerka to figure out which path is the correct one.

eduncan911 commented 3 years ago

@fangfufu thanks, but, pull a newer version of... what exactly? :)

fangfufu commented 3 years ago

@eduncan911 of this repository. The new version of akvcam.py isn't even 48 lines long...

eduncan911 commented 3 years ago

Yikes, MAJOR UPDATES!

Yeah, I pulled it down hours ago - and have been fighting it ever since. Let me run through this install... (and the dropping of Docker)

eduncan911 commented 3 years ago

@fangfufu can you enable Discussions for this repo? I don't want to flood this thread with questions/comments.


So you've dropped support for bodypix, the nodejs app? More specifically, did this just drop Tensorflow and Nvidia GPU support?


Still getting Invalid argument, but a different secondary error, with the latest changes and running fake.py from the root of the repo now.

$ ./fake.py --akvcam --webcam-path=/dev/video0
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 "./fake.py", line 421, in <module>
    main()
  File "./fake.py", line 393, in main
    cam = FakeCam(
  File "./fake.py", line 155, in __init__
    self.fake_cam = AkvCameraWriter(v4l2loopback_path, self.width, self.height)
  File "/home/eric/code/fakecam/Linux-Fake-Background-Webcam/akvcam.py", line 11, in __init__
    self.d = self.open_camera()
  File "/home/eric/code/fakecam/Linux-Fake-Background-Webcam/akvcam.py", line 24, in open_camera
    ioctl(d, v4l2.VIDIOC_S_FMT, vid_format)
OSError: [Errno 22] Invalid argument

Exception ignored in: <function AkvCameraWriter.__del__ at 0x7f03db7080d0>
Traceback (most recent call last):
  File "/home/eric/code/fakecam/Linux-Fake-Background-Webcam/akvcam.py", line 32, in __del__
    os.close(self.d)
AttributeError: 'AkvCameraWriter' object has no attribute 'd'

I basically just wiped the git repo and pulled down a fresh version. Copied over the /etc/akvcam/ files, ran the ./install.sh, and that's the error above.

Tried all /dev/videoX cameras as well to no avail.

fangfufu commented 3 years ago

@eduncan911 , Discussion is now enabled.

I dropped Tensorflow.js, it now runs on Tensorflow Lite. However I believe it is spawned by the underlying Tensorflow framework. I believe you should still be able to run Tensorflow with GPU. However I haven't tried it. My laptop is from 2014, and it does have GPU support. I feel the performance of this set up is adequate.

Based on your error message, I think you need to specify the --v4l2loopback-path

eduncan911 commented 3 years ago

What do I set --v4l2loopback-path to?

I'm using akvcam.

fangfufu commented 3 years ago

akvcam and v4l2loopback normally creates virtual devices after your real webcam.

Please refer to their documentation: https://github.com/umlaeute/v4l2loopback and https://github.com/webcamoid/akvcam/wiki/Configure-the-cameras

fangfufu commented 3 years ago

Also, @eduncan911, just a gentle reminder, I think what you are posting is totally unrelated to this "OSError: [Errno 22] Invalid argument" issue, may I suggest we continue our discussion elsewhere? I don't think the configuration of v4l2loopback or akvcam is a bug, so I recommend you open a new discussion.

eduncan911 commented 3 years ago

I think what you are posting is totally unrelated to this "OSError: [Errno 22] Invalid argument" issue, may I suggest we continue our discussion elsewhere? I don't think the configuration of v4l2loopback or akvcam is a bug, so I recommend you open a new discussion.

If you scroll up, we are all reporting (including myself), OSError: [Errno 22] Invalid argument in my error list.

How is that unrelated to this thread?

Also, your README states this error is handled under the v4l2l section - not in the akvcam section. You may want to update that to apply to both.


As far as Akvcam goes...

Yes, I saw the docs and have set cameras/X/videonr = Y on both in my config.

Shouldn't the parameter be --akvcamloopback-path then?

Hopefully you can see the confusion in your documentation and parameter naming conventions.

fangfufu commented 3 years ago

If you scroll up, we are all reporting (including myself), OSError: [Errno 22] Invalid argument in my error list.

Ah yes, you are right, apologies. Some people had problem with opening their real webcam, and it had the same error message. I was confused.

Shouldn't the parameter be --akvcamloopback-path then?

No, because whether or not you use the AkvCameraWriter, it uses a very similar code execution path.

fangfufu commented 3 years ago

To everyone following this thread, please give the latest commit a go. Please reconfigure Akvcam based on the README.

fangfufu commented 3 years ago

By the way, --akvcam is no longer required as an option to use Akvcam.

fangfufu commented 3 years ago

Closing this ticket as there has been no update for 2 weeks. If this happens again, I will re-open the ticket.

eduncan911 commented 3 years ago

Yeah, I got it working with the info above and masks and such (need more documentation around those btw). However, performance was horrible at just a few frames a second - if that much. The real kicker was the delay between movement and rendering to the output. I even put it at the lowest res the camera supported (640x480).

My hardware is pretty high-end (for a laptop). Intel 9th gen 6-core Xeon (largest they made at the time), 32GB ECC DDR4, Nvidia Quadro 2000M (which I wanted to use with tensorflow here, but has been removed).

In the end, I had to abandon it because of the above issues. It's a nice concept, but just unusable for business meetings.

fangfufu commented 3 years ago

@eduncan911 , locally I am on Debian stable. I use v4l2loopback. I have a i7-4900MQ and 16GB of ram. I get about 28 FPS if I disable foreground replacement...