GNOME Bugzilla – Bug 584406
Expose exotic v4l controls (exposure, backlight compensation, etc...)
Last modified: 2020-11-12 07:12:46 UTC
Provide a dialog to set the V4L2 device controls like contrast, brightness, exposure, gamma, etc. The V4L2 controls are specific for a given device but can be queried to the driver using the ioctls VIDIOC_QUERYCTRL and VIDIOC_QUERYMENU. I use Ubuntu, and the only easy way I've found to change the V4L2 settings is closing Cheese, running VLC (opening the video device of the camera as capture device and then the Advanced Settings dialog, which has a tab named V4L2 controls), closing VLC and then going back to Cheese. Regards, MV
We already have brightness, contrast, saturation and hue controls in the preferences dialog. At the moment we don't use hardware controls because it was more painful to implement (basically it would have involved looking into the whole pipeline for elements supporting the ColorBalance interface and dynamically add widgets and gconf properties for supported ones). I don't exclude we will support hardware controls in the future but I didn't see any noticeable additional load with the current software implementation (videobalance element).
Aaah. I see now that those controls are in the 2.27.x version. My fault, as I made an incomplete search in Bugzilla (missed the solved/implemented requests). Anyway, my main interest in the V4L2 controls was because the default value of something named "Exposure" (automatic, manual, shutter priority, aperture priority) affects the frame rate of my webcam and I have to change it each time I boot my computer. I don't know if this should be tagged as a duplicate of Bug #558970, then. Regards, MV
There is a tool in v4l-dvb tree (http://linuxtv.org/hg/v4l-dvb/) that allows you to set v4l controls from the command line (v4l2-utils/util/v4l2-ctl.c). Maybe you could write a custom udev rule that calls it when your webcam is attached. There is a feature request about uncommon controls support in gstreamer but I never got too much attention (http://bugzilla.gnome.org/show_bug.cgi?id=545519). I'm not sure but probably Stefan already implemented something similar in GstPhotography interface for camerabin. I'm still not sure when but we'll probably support that stuff when it'll be ready.
Updating bug title.
Ah, so the controls in the preferences dialogs are software controls, very very confusing! May I suggest making this much more clear in the UI. I would rather see these added as a possible effect, rather then putting them in the preferences, this really makes one think they are hardware settings. Also note that I do not believe that adding support for v4l2 controls to cheese itself is the right solution. The right solution is to hafve a v4l2 control / mixer application, just like there are mixer applications for soundcards. Take a look at v4l2ucp for example. Now if someone could do a gtk version of that (hint hint) that would be great.
(In reply to comment #5) > Ah, so the controls in the preferences dialogs are software controls, > very very confusing! May I suggest making this much more clear in the UI. Don't forget our target user base. I don't really think the common user knows or wants to know the difference between software and hardware controls. They just want to have a slider to have a brighter image if the webcam is too dark. Implementing hardware controls was more difficult because it involved builing a different UI to expose different controls different devices implement. The slowdown caused by an extra videobalance element in the pipeline was barely noticeable so I chose the software implementation. For me, given the little time I had, it was this way or nothing. > I would rather see these added as a possible effect, rather then putting them > in the preferences, this really makes one think they are hardware settings. We have several effects that tweak brightness, saturation, hue, etc with custom preset values but we needed a slider for small corrections to the camera image. I don't see how this can fit in the effects ui. > Also note that I do not believe that adding support for v4l2 controls > to cheese itself is the right solution. The right solution is to > hafve a v4l2 control / mixer application, just like there are mixer > applications for soundcards. Completely agree. As I said it was just a quick solution for those who complained about their dark (or too blue, or too saturated, etc) webcam. The best way to solve those problems, as I said here too, is to write a custom udev rule that tweaks the right hardware controls when the device is attached. > Take a look at v4l2ucp for example. Now if someone could do a gtk > version of that (hint hint) that would be great. The biggest downside of doing this with a GUI is that each webcam can expose different controls, with different (non standard afaik) names, with different value ranges. IMHO a command line tool really fits better this purpose.
(In reply to comment #6) > (In reply to comment #5) > > Ah, so the controls in the preferences dialogs are software controls, > > very very confusing! May I suggest making this much more clear in the UI. > > Don't forget our target user base. I don't really think the common user knows > or wants to know the difference between software and hardware controls. They > just want to have a slider to have a brighter image if the webcam is too dark. > If the webcam image is significantly too dark by default, that is a driver bug, and once the driver is not setting the right exposure, gain, etc. In the end software is not going to help much. So I really see this as working around driver bugs and would rather see people file bugs against the drivers involved instead. I do agree controls like this could be useufull for a small correction though. > Implementing hardware controls was more difficult because it involved builing a > different UI to expose different controls different devices implement. Ack, see below. <snip> > We have several effects that tweak brightness, saturation, hue, etc with custom > preset values but we needed a slider for small corrections to the camera image. > I don't see how this can fit in the effects ui. > I must admit I've never played with the effects much, I expected some effects to have one or more sliders associated with them, but I guess that does not exist. > > Also note that I do not believe that adding support for v4l2 controls > > to cheese itself is the right solution. The right solution is to > > hafve a v4l2 control / mixer application, just like there are mixer > > applications for soundcards. > > Completely agree. As I said it was just a quick solution for those who > complained about their dark (or too blue, or too saturated, etc) webcam. The > best way to solve those problems, as I said here too, is to write a custom udev > rule that tweaks the right hardware controls when the device is attached. > No, if the controls need to be significantly adjusted, the defaults are off and the user should file a bug against the driver, no custom udev rules please. > > Take a look at v4l2ucp for example. Now if someone could do a gtk > > version of that (hint hint) that would be great. > > The biggest downside of doing this with a GUI is that each webcam can expose > different controls, with different (non standard afaik) names, with different > value ranges. IMHO a command line tool really fits better this purpose. The v4l2 control API has a way to query all this, and with a dynamic GUI this can easily be handled. Please install and try v4l2ucp, then you'll see what I mean (and you might even get inspired to write something similar using gtk).
*** Bug 680791 has been marked as a duplicate of this bug. ***
SInce I last commented on this bug, some big changes in the right direction have happened, I'm one of the authors of gtk-v4l: https://fedorahosted.org/gtk-v4l/ This a small gtk2/3 v4l2-control panel, but it is more then that, the actual code for showing all the controls of one device is a widget. It should be easy to use this widget to create an extra tab in cheese's preferences with all the v4l2-controls. I actually would like to see this code be merged into cheese-libs, with the necessary renaming and some plumbing changes to better match the rest of libcheese. If we do that we should probably move the v4l2-gtk control-panel app into cheese to, since it is quite small, and it makes little sense to keep it as a standalone project. In the mean time I advise users who are affected by this bug to install gtk-v4l and use it to control there camera's hardware settings.
*** Bug 721263 has been marked as a duplicate of this bug. ***
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old bug reports and feature requests in GNOME Bugzilla which have not seen updates for a long time. If you still use cheese and if you still see this bug / want this feature in a recent and currently supported version, then please feel free to report it at https://gitlab.gnome.org/GNOME/cheese/-/issues/ Thank you for creating this report and we are sorry it could not be implemented (volunteer workforce and time is quite limited).