Closed AwesomeKenP closed 3 years ago
Did you load the v4l2loopback module first (see https://github.com/floe/deepbacksub#usage )?
Or maybe you have more than one physical video device, in that case, the virtual cam device might get a higher number?
Same problem here, trying different devices. My computer has right now builtin webcam and extra usb webcam (logitech c922). Logitech is video1 and supports 960x720. I try running the app like and get this:
kpoman@kpoman-T460s:~/Downloads/deepbacksub/deepbacksub-master$ ./deepseg -d -c /dev/video1 -v /dev/video5 -w 960 -h 720
deepseg v0.1.0
(c) 2020 by floe@butterbrot.org
https://github.com/floe/deepseg
debug: 1
ccam: /dev/video1
vcam: /dev/video5
width: 960
height: 720
back: background.png
threads:2
deepseg: loopback.cc:37: int loopback_init(const char*, int, int, int): Assertion `fdwr >= 0' failed.
Aborted (core dumped)
(base) kpoman@kpoman-T460s:~/Downloads/deepbacksub/deepbacksub-master$
v4l2loopback is loaded
base) kpoman@kpoman-T460s:~/Downloads/deepbacksub/deepbacksub-master$ lsmod | grep v4l
v4l2loopback 40960 0
videobuf2_v4l2 24576 1 uvcvideo
videobuf2_common 49152 2 videobuf2_v4l2,uvcvideo
videodev 225280 4 videobuf2_v4l2,v4l2loopback,uvcvideo,videobuf2_common
mc 53248 5 videodev,snd_usb_audio,videobuf2_v4l2,uvcvideo,videobuf2_common
(base) kpoman@kpoman-T460s:~/Downloads/deepbacksub/deepbacksub-master$
Mmh. If it already errors out at fwdr >= 0
, then it can't even open the loopback device, so I would assume some sort of permission or devicename issue here?
Hi floe, I tried now without setting the width and it fails on line 57:
(base) kpoman@kpoman-T460s:~/Downloads/deepbacksub/deepbacksub-master$ ./deepseg -d -c /dev/video1 -v /dev/video2
deepseg v0.1.0
(c) 2020 by floe@butterbrot.org
https://github.com/floe/deepseg
debug: 1
ccam: /dev/video1
vcam: /dev/video2
width: 640
height: 480
back: background.png
threads:2
deepseg: loopback.cc:57: int loopback_init(const char*, int, int, int): Assertion `ret_code != -1' failed.
Aborted (core dumped)
(base) kpoman@kpoman-T460s:~/Downloads/deepbacksub/deepbacksub-master$
Is there a simple way to dump the query caps picked here ret_code = ioctl(fdwr, VIDIOC_QUERYCAP, &vid_caps); ? Maybe that would help in debugging.
Try to comment out line 57, then it should print the format and IIRC you should be able to see which part of the video format caused the error.
Ok, I now got this:
(base) kpoman@kpoman-T460s:~/Downloads/deepbacksub/deepbacksub-master$ ./deepseg -d -c /dev/video1 -v /dev/video2
deepseg v0.1.0
(c) 2020 by floe@butterbrot.org
https://github.com/floe/deepseg
debug: 1
ccam: /dev/video1
vcam: /dev/video2
width: 640
height: 480
back: background.png
threads:2
vid_format->type = 2
vid_format->fmt.pix.width = 640
vid_format->fmt.pix.height = 480
vid_format->fmt.pix.pixelformat = 1448695129
vid_format->fmt.pix.sizeimage = 614400
vid_format->fmt.pix.field = 1
vid_format->fmt.pix.bytesperline= 1280
vid_format->fmt.pix.colorspace = 8
Error at deepseg.cc:164
(base) kpoman@kpoman-T460s:~/Downloads/deepbacksub/deepbacksub-master$
this was on my video1 (c922) cam, trying it on my video0, I got a fake device working:
(base) kpoman@kpoman-T460s:~/Downloads/deepbacksub/deepbacksub-master$ ./deepseg -d -c /dev/video0 -v /dev/video4
deepseg v0.1.0
(c) 2020 by floe@butterbrot.org
https://github.com/floe/deepseg
debug: 1
ccam: /dev/video0
vcam: /dev/video4
width: 640
height: 480
back: background.png
threads:2
vid_format->type = 2
vid_format->fmt.pix.width = 640
vid_format->fmt.pix.height = 480
vid_format->fmt.pix.pixelformat = 1448695129
vid_format->fmt.pix.sizeimage = 614400
vid_format->fmt.pix.field = 1
vid_format->fmt.pix.bytesperline= 1280
vid_format->fmt.pix.colorspace = 8
tensor #183: 1
tensor #183: 257
tensor #183: 257
tensor #183: 3
tensor #168: 1
tensor #168: 257
tensor #168: 257
tensor #168: 21
FPS: 9.54
and using Cheese app, I can see the removal working ! Any clues if there is something to tweak for video1 ?
What does v4l2-ctl --list-formats-ext -d /dev/video1
show?
Any news here?
Improved error messages being merged in #36.
Complied successfully after setting TFBASE=../tensorflow but following error greets me when starting it:
`./deepseg -d -c /dev/video0 -v /dev/video1
deepseg v0.1.0 (c) 2020 by floe@butterbrot.org https://github.com/floe/deepseg debug: 1 ccam: /dev/video0 vcam: /dev/video1 width: 640 height: 480 back: background.png threads:2 deepseg: loopback.cc:57: int loopback_init(const char*, int, int, int): Assertion `ret_code != -1' failed.
Aborted `