-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chromium cannot detect v4l2loopback device using exclusive_caps=1 #274
Comments
do you have a producer running that sends data to the device? |
Yes, I am using OBS with |
Me too! uname -a: Compiled from the most recent commit of v4l2loopback; 0569340 I get a traceback from my kernel when I |
I had the same issue. I couldn't get the device detected by either Chrome or Slack. EDIT: I got it to work fine with the HEAD commit 0569340 sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="LoopbackCam" exclusive_caps=1 |
You can also try it with this one:
and ffmpeg:
It works for me in both chrome and firefox. Check it with https://webcamtests.com/ |
My experience so far . When i use a general mp4 video it does works even in electron apps. However i used gphoto2 to stream dslr feed over usb as a v4l2 device no chrome/electron based application could access it. OBS , vlc ,firefox works like a charm. I would suspect , that there is a specific format which causing the trouble |
@takov751 most likely it's some specific video-format (like BGRA) that is not liked. try to find out which one. |
Case solved options v4l2loopback devices=1 video_nr=10 card_label="VirtCam" exclusive_caps=1 max_buffers=2 with this it did worked, however some extra workaround for gphoto2 i used this script to make output more generic format: #/bin/bash
gphoto2 --stdout --capture-movie | ffmpeg -i - -f rawvideo -pix_fmt yuv420p -threads 0 -s:v 1280x720 -r 25 -f v4l2 /dev/video10 |
Chrome is very picky about which formats it wants to support. It supports (from v4l2_capture_delegate.cc):
|
On 14.04.2020, Steinar H. Gunderson wrote:
Chrome is very picky about which formats it wants to support. It supports (from v4l2_capture_delegate.cc):
V4L2_PIX_FMT_YUV420,
V4L2_PIX_FMT_Y16,
V4L2_PIX_FMT_Z16,
V4L2_PIX_FMT_INVZ,
V4L2_PIX_FMT_YUYV,
V4L2_PIX_FMT_RGB24,
V4L2_PIX_FMT_MJPEG,
V4L2_PIX_FMT_JPEG
Ok thats interesting. This could solve my problems with gstreamer and
chromium in the past.
… --
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#274 (comment)
|
I'm having the same issue with OBS + Chrome. Module is loaded with these parameters:
OBS is configured to stream content to v4l2sink /dev/video10 with format YUV420 (it should be supported by chrome) When the streaming starts, these lines appear in kernel log:
If I open the loopback device with mplayer, it shows as expected.
Chrome is correctly listing the device on camera setting screen: When I start using the camera (e.g. with webcamtoy.com) the camera does not appear as available. I can use the loopback device with Discord. In Microsoft Teams for Linux, it appears as available, but the preview is black. Firefox has the same behavior as Chrome. I think it is Chrome/Firefox fault, but is there any trick to make it working? |
I'm getting this too. I was suspecting colourspace but I'm using V4L2_PIX_FMT_RGB24 so it seems from @sesse's info that should work. I'll dig a little further in and try other colourspaces just to make sure. edit: It turns out Chromium wasn't detecting the video devices after I set exclusive caps until I restarted my machine. Now it's working as expected. |
|
Maybe you would like to update the v4l2loopback wiki on github with these
informations. It would help other people a lot.
|
PRs welcome (github doesn't really supports PRs on wikis though; so sending a |
I was able to get v4l2loopback to operate ok in non-Chromium apps, e.g. (g)uvcview, firefox, teams, with the v4l2loopback-dkms (version 0.10.0-1ubuntu1.2) via
I had no luck with Chromium (with or without Build and install from source did eventually work (but complain about signing, and it would cause I should add this is on Ubuntu 18.04, with Linux 4.15.0-99-generic x86_64 |
I'm going to add the following: I was experiencing similar symptoms. OBS + obs-v4l2sink by @CatxFish + v4l2loopback would work just fine in Firefox, Microsoft Teams and Zoom. It would not work in Chromium, Chrome or Slack. I would not even see the option for the Dummy Video device. The I then started playing with resolution in OBS, eventually taking Settings | Video | Base (Canvas) Resolution down to 640x480. At that point the Dummy Video Device did appear in Slack, Chrome and Chromium as well. After that I was able to take it back up to my regular resolution in OBS: Base (Canvas) Resolution of 1920x1080 and Output (Scaled) Resolution of 1280x720. It still worked. I did successive Occasionally on the first time I make a call in Slack I will see the option for the Dummy Video Device but it will be black -- whether I'm running the desktop app or running Slack in Chrome. If I hang up the call and immediately call back, I then see the video. I have not had to take the resolution back down again. I don't know if this will help. I'm half doubting my own trouble-shooting, but this has not worked for me for a long time and suddenly it does. In any case, if someone else is up against the same thing, try changing resolutions in the OBS video settings. My configuration is bog standard if a little dated:
|
I wanted to know if it is possible to enable exclusive caps on 1 device, but disable it on another device. So that way I can have |
@CMCDragonkai this seems to be a new question (even if it is somewhat related to the issue at hand), so it shouldn't be a follow up here. also, this issue tracker is not a support-forum. please use stackoverflow for such kind of questions. |
I have the same issue, I tried running |
I found during my testing of this feature that Chromium didn't pick up
changed v4l2loopback config without a restart of the machine. Also you
might want to set a scale factor on the seekviewer I've found some apps
like Zoom ignore devices smaller than QVGA. Best of luck!
|
@xslendix your second device lacks the |
so like this? sudo modprobe v4l2loopback devices=2 video_nr=0,10 card_label="Webcam","OBS" exclusive_caps=1,1 |
yes |
I was experiencing similar symptoms on Ubuntu Studio 20.04 linux with OBS Studio 26.0.2: Discord and MPlayer are viewing the stream from virtual camera as expected. Within Firefox (e.g. WebEx or webcamtest) and Zoom the virtual camera can't even be selected. Both applications have been working for a while before. As far as I can see, after an update by apt, the described behavior started. So what happened? After fiddling around with video device numbers, user rights, app-armor etc. no success with firefox nor zoom. Shortly before reinstalling the whole system (because starting an ubuntu from a live stick where everthings works fine), I found this thread. Thus, I saw the option I did a make and make install on my system. The command After using the dkms commands as mentioned in the readme firefox and zoom are working like a charm. Thus, make sure the loaded kernel module is the right one (0.12.5 or later). Unfortunately, chromium browser still doesn't work on my system. |
I am having this issue too, but I am not having the problem consistently between applications. It works with Discord and chrome, but it does not work with firefox, cheese, skype and zoom. I've tried what folks are suggesting here and get the same applications that work and don't work. I am on Linux Mint 20, let me know what else I can provide. |
@Samurai336 if some applications don't work, then it's likely an issue with the capabilities of these applications. @juerg-altwegg |
@umlaeute To clarify, they were previously working and I haven't changed any settings in OBS, but I'll play around and see if that changes anything. |
@Samurai336 to clarify: what did you change to make them work no longer? |
@umlaeute nothing explicit. Initially I used modprobe v4l2loopback video_nr=5 card_label="Virtualcam" then it stopped showing up in any applications, then I did some homework and changed it to modprobe v4l2loopback video_nr=5 devices=1 max_buffers=2 exclusive_caps=1 card_label="VirtualCam" and it started working in some applications as mentioned above. |
I am having a very similar issue. I was having and issue with my pipeline that seems to be solved with |
Older versions of Chromium did not work.
Turns out
|
YUYV is an option, but UYVY (Decklink's native format) is not. Converting to YUYV is cheaper and gives better quality than converting to I420. |
Excellent! I guess I'm slightly dyslexic - I totally missed the difference in YUYV<=>UYUV. I'll update my pipeline as 4:2:2 is desirable. |
Searching the GStreamer documentation for
|
fourCC-names are not exactly standardized, so there are a couple of duplicates. |
Thanks, @umlaeute
I will look into debugging gst-launch-1.0. |
@cupofnestor your pipeline doesn't make sense.
apart from that: this seems very off-topic for the issue at hand. |
You are correct, that is a copy/paste error. [Edit] System rebooted at some point, this pipeline works. Agreed that is off-topic but with your permission I would post a follow up if/when I find a working solution for chromium. |
My problem is that skype sees the test image from gstreamer but not any image from any other source (black window). So the gstreamer test src is the format that works - at least with skype. does the gstreamer test src also work for chrome/chromium maybe? so what works in skype is
it also works without conversion
what only works in vlc - player is
gstream complains about pipeline not beeing initialized or stuff when using rtsp source or http source, it never works, what is a video4linux problem as it works when using i.e. a file output sink:
i have paket 12.03 installed and
...i think the problem is somewhat more subtle than wrong colour space? |
On 12/12/20 10:33 AM, peter wrote:
...i think the problem is somewhat more subtle than wrong colour space?
why do you think so?
in your examples, there's a single (known) working colourspace.
please try forcing the *working* colourspace to YUY2.
your 2nd pipeline (that runs "without conversion") obviously just
happens to use a colourspace that works, because both `videotestsrc` and
`v4l2sink` negotiated a colourspace that happens to also work with skype.
the `souphttpsrc` source will support (and prefer) different
colourspaces than `videotestsrc`, so the used colourspace will be different.
also note, that some applications are picky about the actual video
resolution. `videotestsrc` will (by default) pick a standard resolution.
but `souphttpsrc` will use the resolution from it's source.
|
hy, thanks, but ffmpeg -i http://192.168.1.174:8080/video -pix_fmt yuv422p -c:v huffyuv -f v4l2 /dev/video1 "V4L2 output device supports only a single raw video stream yuy2: is there a list of supported formats for v4l2? |
Am 12. Dezember 2020 14:20:05 MEZ schrieb peter <notifications@github.com>:
hy, thanks, but
sorry, but this seems to be a documentation problem of ffmpeg (if at all), rather than a bug in v4l2loopback.
|
why? just guessing? |
no. here's what i understand of your problem:
this brings me to the conclusion that so far you haven't been able to tell since the original answer was "most likely a colourspace problem" and you haven't come up with any evidence that this is not the case (as in: create a video in https://github.com/umlaeute/v4l2loopback/#seeking-help |
ok, thanks for our elaboration, i understand, but which colorspaces are supported by v4l2? huffyuf is supposed to output 422 |
On Sat, Dec 12, 2020 at 10:21:47AM -0800, peter wrote:
ok , i understand, but which colorspaces are supported by v4l2? huffyuf is supposed to output 422
There are many different ways to encode 4:2:2 Y'CbCr (in particular: planar, UYVY,
YUYV). V4L2 supports a bunch of them, but not all V4L2-using applications do.
/* Steinar */
--
Homepage: https://www.sesse.net/
|
good, but how to find out which are supported? |
On Sat, Dec 12, 2020 at 11:12:44AM -0800, peter wrote:
good, but how to find out which are supported?
1. Trial and failure
2. Consult the program's documentation, if any
3. Read the fine source
/* Steinar */
--
Homepage: https://www.sesse.net/
|
for firefox and skype the following works, chrome doesnt detect nothing: ffmpeg -i http://192.168.1.174:8080/video -pix_fmt yuv422p -threads 4 -vf scale=640:-1 -c:v rawvideo -r:v 25 -pix_fmt yuv420p -f v4l2 /dev/video0 for skype and firefox a higher resolution results in a greenish mess of a picture, something there doesnt fit to v4l2. |
probably. i honestly believe the issue is there rather than with v4l2 (or |
I am able to detect and capture the virtual device on Chromium 89, Firefox 84 throws |
As a complementary solution for people having trouble with Chromium, the following may be of interest: https://www.scs.stanford.edu/~dm/blog/hide-webcam.html This post suggests to hide other webcams (the source webcams that are used by OBS for instance to create the new virtual camera) so that Chromium doesn't try to use it and fail. Then, it will find the virtual camera. Personally, I had issues and at first I did solve it with
about an
I'm not sure all of those options are necessary, but the naming as Hope this will help some. |
Hi, thanks for your work. I installed v4l2loopback via apt. After running
sudo modprobe v4l2loopback exclusive_caps=1
Chromium (version 80.0.3987.162 snap) does not detect the loopback device. I have also tried to set a name for my interface withcard_label="Test"
but nothing changes.0.12.2
5.3.0-45-generic
Distributor ID: Ubuntu
Description: Ubuntu 19.10
Release: 19.10
Codename: eoan
The text was updated successfully, but these errors were encountered: