When using ffmpeg as producer I cannot see v4l2loopback device in chrome

679 views Asked by At

I am able to see my v4l2loopback video device in chrome when using this command to produce a video stream:

gst-launch-0.10 -v videotestsrc ! "video/x-raw-yuv,width=640,height=360,framerate=30/1,format=(fourcc)I420" ! v4l2sink device=/dev/video0

But I am attempting to use ffmpeg to take an NDI stream and output it to a v4l2loopback device with a command like this:

ffmpeg -f libndi_newtek -extra_ips "10.4.0.86" -i "ME-NDI002 (TEST)" -f v4l2 /dev/video0

When I am using ffmpeg as a producer I am able to see the device in Firefox and Zoom but not in Chrome. Is there something I need to do to get ffmpeg to play nice with the exclusive_caps option?

I am using v4l2loopback driver version 0.12.5

Linux kernel is: Linux dva 3.10.0-1062.1.2.el7.x86_64 #1 SMP Mon Sep 30 14:19:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

And Release information is: LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 7.7.1908 (Core) Release: 7.7.1908 Codename: Core

1

There are 1 answers

1
umläute On BEST ANSWER

the problem is most likely, that some software (probably including chrome) is a bit picky about the supported colour format.

your ffmpeg command doesn't specify any colour format, so I guess it will take one that is easiest to convert to from the NDI stream. NDI supports a number of different formats (including rather exotic ones like P216) and it might well be that it picks an output format that is not usable by chrome.

otoh, your gstreamer-pipeline uses a very specific format (I420). try enforcing the same format when using ffmpeg, e.g. using something like -vf format=pix_fmts=yuv420p

see also https://github.com/umlaeute/v4l2loopback/wiki/Colorspace-Issues