5

I need a simple script that can change my webcam settings. I want the changes to be applied globally, just like with guvcview. Most importantly, I want to be able to turn on the auto exposure setting.

I have checked the man page and I don't think guvcview allows that from CLI.

2
  • 1
    You might use v4lctl, which is part of the xawtv package. Commented Jul 1, 2017 at 9:51
  • 1
    @ridgy I've found this tutorial, you might want to put this comment as an answer for me to accept and upvote (: Commented Jul 2, 2017 at 22:18

1 Answer 1

3

From @Jezor comment above and the linked tutorial.

Installing the v4l-utils or v4l2-utils (depending on your distro) provides the v4l2-ctl tool that defaults to using /dev/video0

Running

v4l2-ctl --list-ctrls

will list all the settings that can be changed along with their min, max and current values.

you can then set these values with the --set-ctrl command e.g.

v4l2-ctl --set-ctrl contrast=40
v4l2-ctl --set-ctrl brightness=100
v4l2-ctl --set-ctrl saturation=80

These were run on a laptop with built in webcam during a Teams video call using Google Chrome and the camera feed was updated instantly.

To use a different video device pass the --device option e.g.

v4l2-ctl -d /dev/video3 --list-ctrls

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.