Setting Webcam resolution programmatically
by PaulExordium from LinuxQuestions.org on (#5J2WY)
With "Logitech C920 Pro HD Webcam" in Debian 9, I'd like to reduce the resolution to 640x480 programmatically.
With "cheese" and "v4l-utils", the following script doesn't modify the resolution:
Code:#!/bin/sh
v4l2-ctl -d /dev/video0 --set-fmt-video=width=640,height=480
v4l2-ctl --all | grep "Width/Height"
nohup cheese &
sleep 10
v4l2-ctl -d /dev/video0 --set-ctrl=power_line_frequency=1
v4l2-ctl -d /dev/video0 --set-ctrl=focus_auto=1
v4l2-ctl --all | grep "Width/Height"
exitCode: Width/Height : 640/480
nohup: appending output to 'nohup.out'
Width/Height : 1920/1080Is it possible and if so what is the correct way to set the resolution?


With "cheese" and "v4l-utils", the following script doesn't modify the resolution:
Code:#!/bin/sh
v4l2-ctl -d /dev/video0 --set-fmt-video=width=640,height=480
v4l2-ctl --all | grep "Width/Height"
nohup cheese &
sleep 10
v4l2-ctl -d /dev/video0 --set-ctrl=power_line_frequency=1
v4l2-ctl -d /dev/video0 --set-ctrl=focus_auto=1
v4l2-ctl --all | grep "Width/Height"
exitCode: Width/Height : 640/480
nohup: appending output to 'nohup.out'
Width/Height : 1920/1080Is it possible and if so what is the correct way to set the resolution?