Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend is generally available but can't be used to capture by name #207

Open
ufechner7 opened this issue May 25, 2024 · 2 comments
Open

Comments

@ufechner7
Copy link

ufechner7 commented May 25, 2024

I try to run:

lfbw --no-ondemand -v /dev/video2

and get the output:

WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1716634070.527626   12896 gl_context_egl.cc:85] Successfully initialized EGL. Major : 1 Minor: 5
I0000 00:00:1716634070.574726   12958 gl_context.cc:357] GL version: 3.2 (OpenGL ES 3.2 NVIDIA 535.171.04), renderer: NVIDIA GeForce RTX 3060/PCIe/SSE2
[ WARN:0@0.386] global cap.cpp:204 open VIDEOIO(V4L2): backend is generally available but can't be used to capture by name
Failed to open camera: /dev/video0. retrying...
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
[ WARN:0@1.388] global cap.cpp:204 open VIDEOIO(V4L2): backend is generally available but can't be used to capture by name
Failed to open camera: /dev/video0. retrying...
^CTraceback (most recent call last):
  File "/home/ufechner/.local/bin/lfbw", line 8, in <module>
    sys.exit(main())
  File "/home/ufechner/.local/lib/python3.10/site-packages/lfbw/lfbw.py", line 547, in main
    cam = FakeCam(args)
  File "/home/ufechner/.local/lib/python3.10/site-packages/lfbw/lfbw.py", line 123, in __init__
    self.real_cam = RealCam(self.webcam_path,
  File "/home/ufechner/.local/lib/python3.10/site-packages/lfbw/lfbw.py", line 24, in __init__
    time.sleep(1)
KeyboardInterrupt

My video devices:

ufechner@ufryzen:~/repos/Linux-Fake-Background-Webcam$ ls -l /dev/video*
crw-rw----+ 1 root video 81, 0 mei 25 11:41 /dev/video0
crw-rw----+ 1 root video 81, 1 mei 25 11:41 /dev/video1
crw-rw----+ 1 root video 81, 2 mei 25 11:41 /dev/video2
crw-rw----+ 1 root video 81, 3 mei 25 11:41 /dev/video3

Any ideas how to debug this issue?

Using:

ffplay /dev/video2

shows the webcam content on the screen...

@fangfufu
Copy link
Owner

Have you tried running this without the on-demand mode?

@gchamon
Copy link

gchamon commented Dec 3, 2024

This happened to me because I wasn't loading the kernel modules. In your case it seems that video2 is already tied to a physical camera so you should execute sudo modprobe v4l2loopback devices=1 exclusive_caps=1 video_nr=2 card_label="fake-cam" changing video_nr to something that is available and use that as argument for the -v flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants