Article 5J2WY Setting Webcam resolution programmatically

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?latest?d=yIl2AUoC8zA latest?i=sv2og_4TVxM:FEcNhUQknN4:F7zBnMy latest?i=sv2og_4TVxM:FEcNhUQknN4:V_sGLiP latest?d=qj6IDK7rITs latest?i=sv2og_4TVxM:FEcNhUQknN4:gIN9vFwsv2og_4TVxM
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments