diddlesnaps / fakecam

Virtual Backgrounds for your video conferences and streaming presentations
Other
47 stars 11 forks source link

no output to virtual device #4

Open timrichardson opened 4 years ago

timrichardson commented 4 years ago

I have installed the snap on pop!os and connected the camera as suggested when Fakecam first starts. In Zoom, selecting the virtual camera presents a black image, as if the output from Fakecam is not sent to the output side of the virtualcamera.

lucyllewy commented 4 years ago

Sometimes it requires a second attempt at starting the camera. Turn the fakecam off and then back on again to see if that fixes it when you encounter this. If it still fails, there might be a DENIED message relating to the problem from AppArmor in the system log. You can get a dump of the Denials by running:

sudo journalctl -e --no-pager | grep DENIED
timrichardson commented 4 years ago

This is what I see

Aug 02 18:03:12 keynes audit[83851]: AVC apparmor="DENIED" operation="open" profile="/snap/snapd/8542/usr/lib/snapd/snap-confine" name="/etc/pop-os/os-release" pid=83851 comm="snap-confine" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Aug 02 18:03:12 keynes kernel: audit: type=1400 audit(1596355392.255:165): apparmor="DENIED" operation="open" profile="/snap/snapd/8542/usr/lib/snapd/snap-confine" name="/etc/pop-os/os-release" pid=83851 comm="snap-confine" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Aug 02 18:03:12 keynes audit[83898]: AVC apparmor="DENIED" operation="open" profile="snap-update-ns.fakecam" name="/etc/pop-os/os-release" pid=83898 comm="5" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Aug 02 18:03:12 keynes kernel: audit: type=1400 audit(1596355392.259:166): apparmor="DENIED" operation="open" profile="snap-update-ns.fakecam" name="/etc/pop-os/os-release" pid=83898 comm="5" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Aug 02 18:03:12 keynes audit[83851]: AVC apparmor="DENIED" operation="open" profile="snap.fakecam.fakecam" name="/etc/pop-os/os-release" pid=83851 comm="snap-exec" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Aug 02 18:03:12 keynes kernel: audit: type=1400 audit(1596355392.263:167): apparmor="DENIED" operation="open" profile="snap.fakecam.fakecam" name="/etc/pop-os/os-release" pid=83851 comm="snap-exec" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Aug 02 18:03:12 keynes audit[83851]: AVC apparmor="DENIED" operation="open" profile="snap.fakecam.fakecam" name="/proc/83851/mounts" pid=83851 comm="python3" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
Aug 02 18:03:12 keynes kernel: audit: type=1400 audit(1596355392.647:168): apparmor="DENIED" operation="open" profile="snap.fakecam.fakecam" name="/proc/83851/mounts" pid=83851 comm="python3" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
tim@keynes:/opt$ 
jpenguin commented 4 years ago

Try to open /dev/video20 in VLC or OBS to see if it really is outputting, I couldn't get zoom to recognize this either. I had luck with the script at https://www.virtual-webcam.com/ though, same virtual device too.

mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video20

tassoman commented 4 years ago

Hello there, I'm trying to use it inside the browser, but without output. I have a blank box. If I try to open the device by using VLC, the video colors are screwed like in a solarized mode. I've successfully tried to detect the fakecam inside Chromium browser by using ffmpeg and an image as input, using this command ffmpeg -loop 1 -re -i ~/bgr.jpg -f v4l2 -vcodec rawvideo -pix_fmt yuv420p /dev/video20

tartifola commented 3 years ago

Hi, just installed it on a fresh Mint 20. I confirm that the app works but it is recognized only by VLC device=/dev/video20 but not in Zoom. Actually, Zoom sees fakecam as alternative to my standard webcam, but then black screen with the usual msg='apparmor="DENIED". Any new thoughts on where to start to debug?

Thanks

jpenguin commented 3 years ago
sudo modprobe v4l2loopback exclusive_caps=1 video_nr=20,21,22 devices=3
fakecam --input=/dev/video6 --background=greenscreen

Zoom sees cam, displays black. I open webcamoid, it report the vcam is only exporting BGR, I set webcamoids virtual output to /dev/video21 New cam works fine in zoom

~$ v4l2-ctl -d /dev/video20 --list-formats
ioctl: VIDIOC_ENUM_FMT
    Type: Video Capture
    [0]: 'BGR3' (24-bit BGR 8-8-8)
~$ v4l2-ctl -d /dev/video21 --list-formats
ioctl: VIDIOC_ENUM_FMT
    Type: Video Capture
    [0]: 'RGB3' (24-bit RGB 8-8-8)

Seem to be no permission problem for me, Zoom just doesn't like BGR

EDIT: without webcamoid, just ffmpeg; both ffmpeg -f v4l2 -i /dev/video20 -pix_fmt rgb24 -f v4l2 /dev/video22 and ffmpeg -f v4l2 -i /dev/video20 -pix_fmt yuv420p -f v4l2 /dev/video22 work

lucyllewy commented 3 years ago

Thanks for that, @jpenguin , it's an interesting discovery! I'll see about flipping BGR to RGB.

tartifola commented 3 years ago

Hi, thanks. With the 2.2.0 now in zoom the fakecam channel shows images but with colors mixed up. Here the info jpenguin provided in my case

   v4l2-ctl -d /dev/video0 --list-formats
          ioctl: VIDIOC_ENUM_FMT
     Type: Video Capture

     [0]: 'YUYV' (YUYV 4:2:2)
     [1]: 'MJPG' (Motion-JPEG, compressed)

  v4l2-ctl -d /dev/video20 --list-formats
         ioctl: VIDIOC_ENUM_FMT
     Type: Video Capture

    [0]: 'BGR3' (24-bit BGR 8-8-8)

  v4l2-ctl -d /dev/video21 --list-formats
         ioctl: VIDIOC_ENUM_FMT
    Type: Video Capture

   [0]: 'RGB3' (24-bit RGB 8-8-8)

Not an expert on this stuff, sorry if my comment is useless.

jpenguin commented 3 years ago

Running the edge snap, after a snap refresh

$ v4l2-ctl -d /dev/video20 --list-formats
ioctl: VIDIOC_ENUM_FMT
    Type: Video Capture
    [0]: 'RGB3' (24-bit RGB 8-8-8)

Works in Zoom & OBS, colors have a purple hue in VLC

lucyllewy commented 3 years ago

colors have a purple hue

I made a mistake in the conversion process. I think this purpleness should be fixed now

acheronfail commented 3 years ago

I'm using 2.2.0 and Zoom still doesn't recognise it for me :slightly_frowning_face:

I can view the output with mpv though, so it's working:

mpv av://v4l2:/dev/video20

And it's also outputting RGB:

❯ v4l2-ctl -d 20 --list-formats
ioctl: VIDIOC_ENUM_FMT
    Type: Video Capture

    [0]: 'RGB3' (24-bit RGB 8-8-8)

I wonder why Zoom is having trouble. :man_shrugging:

jpenguin commented 3 years ago

I can't be sure, but it appears that zoom has changed

ffmpeg -f v4l2 -i /dev/video20 -pix_fmt yuyv422 -f v4l2 /dev/video21

Boifuba commented 1 year ago

I have no output when i try to open with discord, fakecam show image correctly.