16

Can you control things like viewing angle, zoom, fps, and video resolution for a webcam connected to Ubuntu, through a standard set of commands or API?

As a case in point, the Logitech Brio 4K Ultra HD. This camera seems to be advertised to allow adjustments of those properties that I just mentioned above, and I am wondering whether controlling them is accessible via any standard linux command-line (or standard programming API).

Typically I had good experience with all Logitech devices in Ubuntu but these features I've never experienced adjusting from/in Ubuntu.

Motivation note: I could use these features for acquiring indoors imagery for a machine learning project and the ability to adjust those properties could be important. That aside, these abilities might bear on how much all the sophistication built into this device actually leverages for quality in more mundane use cases like video chat.

4 Answers 4

17

You can customize a lot of settings using guvcview.

enter image description here

Install with:

sudo apt install guvcview

To select which webcam to use, click in the Video tab, then select your device (Brio). In the confirm dialog, select to Restart.

Unfortunately it miss angle setting.

8
  • 1
    I guess that controlling the viewing angle, which I think you mention too, is more complicated to enable in software, as both this tool and the one from my answer do not seem to handle it. I wonder what might be the reason. Maybe that aspect (angle) is somehow less standardized at the hardware interface level?
    – matanster
    Aug 8, 2020 at 15:24
  • 1
    The only way I found to customize angle was install Logitech software in Windows virtualbox, then share the Brio with the virtual machine. Dec 3, 2020 at 13:05
  • 1
    Does one require a license for intermittently running Windows in VirtualBox for stuff like this?
    – matanster
    Jan 11, 2021 at 18:54
  • 3
    @matanster: if your purpose is just to tweak this or evaluate any other software, you can use the Microsoft official testing virtual machine images: developer.microsoft.com/en-us/windows/downloads/… Jan 11, 2021 at 21:18
  • 2
    Worth noting that the "Image controls" section here persists into other controls after you close guvcview. The "video controls" and "audio controls" do not. I just tested this with Cheese and Zoom. If I lowered the brightness all the way down in guvcview and exited then launched Cheese/Zoom, then the change was easily noticed. Jan 14, 2021 at 17:40
6

According to https://help.ubuntu.com/community/Webcam, one should consult the supported devices list in http://www.ideasonboard.org/uvc/, the main vehicle for webcam customization in Ubuntu. The model I have mentioned in this question isn't (currently) there, but many other Logitech models are.

Here's one account of the compatibility of the Logitech Brio too (see the Q&A in the comments trail there). Looks like most of the above is adjustable from Ubuntu to judge by that, although I have not tried myself.

I believe however that fps and resolution are selected by the application using the camera (maybe on the video acquisition API / protocol used by each application) and likely not set as a global configuration for the device. If that's not the case please do post a correction comment!

In general, fiddling camera settings is enabled via the v4l2 CLI, which you can use to inquire and change the camera's settings even while it is in use. See for example here. Here's my output from v4l2-ctl -l for this camera:

brightness 0x00980900 (int)    : min=0 max=255 step=1 default=128 value=128
                               contrast 0x00980901 (int)    : min=0 max=255 step=1 default=128 value=128
                             saturation 0x00980902 (int)    : min=0 max=255 step=1 default=128 value=128
         white_balance_temperature_auto 0x0098090c (bool)   : default=1 value=1
                                   gain 0x00980913 (int)    : min=0 max=255 step=1 default=0 value=0
                   power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=2 value=1
              white_balance_temperature 0x0098091a (int)    : min=2000 max=7500 step=10 default=4000 value=5210 flags=inactive
                              sharpness 0x0098091b (int)    : min=0 max=255 step=1 default=128 value=128
                 backlight_compensation 0x0098091c (int)    : min=0 max=1 step=1 default=1 value=1
                          exposure_auto 0x009a0901 (menu)   : min=0 max=3 default=3 value=3
                      exposure_absolute 0x009a0902 (int)    : min=3 max=2047 step=1 default=250 value=312 flags=inactive
                 exposure_auto_priority 0x009a0903 (bool)   : default=0 value=0
                           pan_absolute 0x009a0908 (int)    : min=-36000 max=36000 step=3600 default=0 value=0
                          tilt_absolute 0x009a0909 (int)    : min=-36000 max=36000 step=3600 default=0 value=0
                         focus_absolute 0x009a090a (int)    : min=0 max=255 step=5 default=0 value=20 flags=inactive
                             focus_auto 0x009a090c (bool)   : default=1 value=1

                      zoom_absolute 0x009a090d (int)    : min=100 max=500 step=1 default=100 value=100

I can confirm that zoom, auto-focus (on/off) and focus can be set via this utility, but other properties may require using a lower-level utility from the v4l2 suite, or are not supported by this model.

3
  • 1
    Looks like field of view (viewing angle) cannot be managed using the v4l2-ctl utility. It's not mentioned in the v4l2 spec either.
    – matanster
    Jul 30, 2020 at 6:52
  • Interesting. It's not supported yet v4l2-ctl manages everything but FoV. Surely it's just not included in the API, but could be managed as well
    – Ufos
    Oct 23, 2021 at 16:43
  • 1
    For the FoV there's a weird solution: configure it on windows (dual boot, different device) and then use as is. github.com/opencv/opencv/issues/12498#issuecomment-723043094
    – Ufos
    Oct 23, 2021 at 16:50
3

I have the exact same model and run ubuntu 20.04

  • guvcview kinda works, but lags and crashes
  • v4l-utils does everything you need, but you need to use it from the terminal. gtk-v4l on github provides a GUI if you need it.

Install

sudo apt install v4l-utils

Find you webcam

you might have multiple. Also, for some reason, it may list two devices per camera, pick first.

v4l2-ctl --list-devices

The output should be something like

HD User Facing: HD User Facing (usb-0000:05:00.3-1):
    /dev/video1
    /dev/video2

BRIO 4K Stream Edition (usb-0000:05:00.3-4):
    /dev/video3
    /dev/video4

Tweak

Get Controls

Let's see what we can control

v4l2-ctl -d /dev/videoX --list-ctrls  # X -- for your device number

The output should be something like

                     brightness 0x00980900 (int)    : min=0 max=255 step=1 default=128 value=128
                       contrast 0x00980901 (int)    : min=0 max=255 step=1 default=128 value=128
...
                     focus_auto 0x009a090c (bool)   : default=1 value=1
                  zoom_absolute 0x009a090d (int)    : min=100 max=500 step=1 default=100 value=100

Example: change angle to look down

v4l2-ctl --device /dev/video3 --set-ctrl=tilt_absolute=36000

This works when tweaking zoom/skype, but in the ubuntu testing utility "cheese" some settings take no effect.

0

Update: other control options added, if like me you were looking for these. enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.