Closed hackermondev closed 1 year ago
@umlaeute Any chance you know what's going on here?
The issue was with the size of the image I was sending with ffmpeg (87x87). I'm assuming there's a minimum webcam frame size in Chromium and I wasn't aware of it. I started sending a larger image with ffmpeg (2880x1800) and it no longer logs that error and the webcam works.
Depending on the colour encoding, odd-sized frames can be problematic (eg YUV420p requires that the U and V planes are downsampled by a factor of 2, which works best if the width and height can be divided by 2)
@umlaeute Yep, looks like that was the issue. Maybe add that to the wiki?
Sure, please go ahead!
I installed the v4l2loopback kernel module on my machine and ran it with
sudo modprobe v4l2loopback exclusive_caps=1
.I created a camera on
/dev/video0
with the rust bindings and starting piping a static image to the camera (command from the wiki):I'm running this on a VPS with no desktop environment so I quickly spun up a Docker container with noVNC and a desktop environment to test everything (
sudo docker run --rm -it --device /dev/video0 --privileged -p 8090:8080 theasp/novnc
). Everything looks fine and if i runffplay /dev/video0
, I can successfully view the image in the camera. The problem now is with other applicationsCheese doesn't even detect the camera. Chromium detects the camera but cannot use it:
Not sure what I'm doing wrong and why Chromium cannot read from the camera.
FFmpeg pipe logs: