Closed mchoccac closed 3 years ago
99% sure that you just mixed up your video devices, try ./deepseg -d -d -c /dev/video1 -v /dev/video2 -b Green_Leafs_1920x1200.jpg
99% sure that you just mixed up your video devices, ACK. I guess, the webcam probably is
/dev/video0
though. The virtual cam (-v
) is/dev/video2
AFAIC.
./deepseg -d -d -c /dev/video0 -v /dev/video2 -b Green_Leafs_1920x1200.jpg
You may also check things with qv4l2
to test things, while deepseg
is not running.
I did everything mentioned above, but it keeps giving me the same error.
Warning: could not load background image, defaulting to green /home/user/backscrub/loopback.cc:66(loopback_init): Failed to set device video format: Invalid argument Failed to initialize vcam device.
Warning: could not load background image, defaulting to green
It's possible OpenCV cannot load your image - can you share the file with us here? Was it from here (this one works for me)? https://www.turboimagehost.com/p/14362654/Green_Leafs_1920x1200.jpg.html
You may also want to try one of the provided images in the images
folder, those are all known to work. Please remember to prepend any path to the image if it isn't in your working current folder.
/home/user/backscrub/loopback.cc:66(loopback_init): Failed to set device video format: Invalid argument
Is the output from v4l2ctl --list-devices
the same as you have provided above? Please double check you are specifying the Integrated Webcam (/dev/video0
) as the capture device (-c
), and your VirtualCam (/dev/video2
) as the virtual camera (-v
).
Other thoughts - your kernel and loopback driver is very different to ours - please share your kernel version (uname -a
).
Any updates? I'll close this for now, please re-open if further info is available.
I just built this on Ubuntu 21.04. The first time I run this program it works as intended, but if I stop the process and run it again I get this error:
./backscrub -d -d -c /dev/video0 -v /dev/video10 -b images/background_bauhaus.png
backscrub version heads/main-0-gdb918ea-dirty
(c) 2021 by floe@butterbrot.org & contributors
https://github.com/floe/backscrub
debug: 2
ccam: /dev/video0
vcam: /dev/video10
width: 640
height: 480
flip_h: no
flip_v: no
threads:2
back: images/background_bauhaus.png
model: models/selfiesegmentation_mlkit-256x256-2021_01_19-v1215.f16.tflite
/home/user/bin/backscrub/videoio/loopback.cc:69(loopback_init): Failed to set device video format: Invalid argument
Failed to initialize vcam device.
After rebooting my laptop, it worked on first run again but started giving this error when I tried to restart the process.
@TheLtDan Please don't hijack issue reports by others. Given by the description alone your problem seems caused by something else than what the OP reported. If necessary issues still can be aggregated if we find things to work out to have a common cause.
Apart from this: Can you check backscrub isn't running when you try to start it a second time (not even in the background)?
Apologies, I didn’t mean to hijack anything, my issue felt similar enough so I just thought the devs should know. In any case I ended up not needing this project, so I’ve already uninstalled it and I don’t have time to rebuild it and do further testing right now. What I can tell you is that the light on my webcam turned off when I closed backscrub so I don’t think it had a process running in the background, but you would know more since you know this project better Have a nice day.
Hello, I follow the steps of the compilation but I can't execute anything, I always get this.
sudo modprobe v4l2loopback devices=1 max_buffers=2 exclusive_caps=1 card_label="VirtualCam" -V
out: kmod version 27 +XZ -ZLIB +LIBCRYPTO -EXPERIMENTAL
./deepseg -d -d -c /dev/video0 -v /dev/video1 -b Green_Leafs_1920x1200.jpg
out:
deepseg v0.2.0 (c) 2021 by floe@butterbrot.org https://github.com/floe/deepbacksub debug: 2 ccam: /dev/video0 vcam: /dev/video1 width: 640 height: 480 flip_h: no flip_v: no threads:2 back: Green_Leafs_1920x1200.jpg model: segm_full_v679.tflite
Warning: could not load background image, defaulting to green /home/user/backscrub/loopback.cc:66(loopback_init): Failed to set device video format: Invalid argument Failed to initialize vcam device.
v4l2-ctl --list-device
VirtualCam (platform:v4l2loopback-000): /dev/video2
Integrated_Webcam_HD: Integrate (usb): /dev/video0 /dev/video1