Configure webcam with v4l2-ctl

I bought a USB webcam recently and found a way to configure the device in the shell by using the v4l2-ctl command.

On my Ubuntu system I had to install the application first:

sudo apt install v4l-utils

The webcam is a video device so it's one of the devices listed in:

ls /dev/video*

To determine the right device you can show information about it with:

v4l2-ctl -d /dev/videoX --all

To show all controls with their supported values, defaults and current values use:

v4l2-ctl -d /dev/videoX -l

With -L instead of -l you get more information for menus. (Just give it a try.)

To set a certain control use:

v4l2-ctl -d /dev/videoX -c NAME_OF_CONTROL=VALUE

For example set brightness to 24:

v4l2-ctl -d /dev/video1 -c brightness=24