google-chromev4l2v4l2loopback

Google chrome cannot detect v4l2loopback device


I'm trying to transmit my screen using ffmpeg and v4l2loopback, more when running the commands:

sudo modprobe v4l2loopback devices=1 video_nr=2 card_label="Camera Loopback"

and

ffmpeg -f x11grab -framerate 30 -video_size 1366x768 -i :0.0 -f v4l2 /dev/video2

chrome does not detect the device in: /dev/video2, I tried everything to make it work, but chrome does not detect it, I tried to add the filter:

-vf format=pix_fmts=yuv420p

but still nothing.

Chrome: 87.0.4280.66 (64bit)
OS: LinuxMint 19.3
v4l2loopback: 0.12.3

If anyone can help me, thank you in advance!.


Solution

  • Load videodev module:

    sudo modprobe videodev

    Load v4l2 loopback:

    sudo modprobe v4l2loopback devices=1 video_nr=2 exclusive_caps=1 card_label="ExternalWebCam"

    Important Details: Chrome, only accepts buffers in yuv420p pixel format, which makes a lot of sense, since the cameras have this pixel format as standard.

    Use example:

    ffmpeg -f x11grab -r 30 -s 1366x768 -i :0.0+0,0 -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video2

    This command, stream the screen to /dev/video2 device, created by v4l2loopback