Skip to content

Instantly share code, notes, and snippets.

@anselmobattisti
Created October 8, 2021 14:50
Show Gist options
  • Save anselmobattisti/cec764b4d2f9ab9d70635d1fe6a9b9e0 to your computer and use it in GitHub Desktop.
Save anselmobattisti/cec764b4d2f9ab9d70635d1fe6a9b9e0 to your computer and use it in GitHub Desktop.
# How to adjust brightness for HD Pro Webcam C920 on ubuntu 20.04
#
# Install the v4l2-ctl
apt-get install v4l2-ctl
# list the decives
v4l2-ctl --list-devices
###
HD Pro Webcam C920 (usb-0000:00:14.0-1.2):
/dev/video2
/dev/video3
###
# list the possible controls
v4l2-ctl -d /dev/video2 --list-ctrls
# set the control
v4l2-ctl -d /dev/video2 --set-ctrl=exposure_absolute=600
# To visualize use the result use the Chess program open during the control changing
@GlitchWitch
Copy link

Thanks for this @anselmobattisti.

I had to run v4l2-ctl -d /dev/video0 -c exposure_auto=1 in order to disable auto exposure before setting exposure_absolute would work.

@anselmobattisti
Copy link
Author

The command changed in the last ubuntu update, now it is

#! /bin/bash
v4l2-ctl -d /dev/video2 --set-ctrl=auto_exposure=1
v4l2-ctl -d /dev/video2 --set-ctrl=exposure_time_absolute=$1

@anselmobattisti
Copy link
Author

To list all the available commands in your decive use:

v4l2-ctl -d /dev/video2 -l

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment