ruby-cursor-game icon indicating copy to clipboard operation
ruby-cursor-game copied to clipboard

Thanks for this! - maybe you could help me with a variation on your code

Open philiprhoades opened this issue 3 years ago • 0 comments

I want to manipulate a v4l camera via uvcdynctrl (I can't use guvcview because I need to use the app with cheese or zoom etc).

So I want to select from the list of the camera controls with the UP and DOWN cursors, and then increase or decrease the value of the control with the LEFT and RIGHT cursors which would run the app with the new value.

The controls are:

uvcdynctrl -s "Brightness" 128
#    Values  : [ 0 .. 255, step size: 1 ],
#    Default : 128

uvcdynctrl -s "Contrast" 128
#    Values  : [ 0 .. 255, step size: 1 ],
#    Default : 128

uvcdynctrl -s "Saturation" 128
#    Values  : [ 0 .. 255, step size: 1 ],
#    Default : 128

uvcdynctrl -s "White Balance Temperature, Auto" 1
#    Values  : [ 0 .. 1, step size: 1 ],
#    Default : 1

uvcdynctrl -s "Gain" 128
#    Values  : [ 0 .. 255, step size: 1 ],
#    Default : 0

uvcdynctrl -s "Power Line Frequency" 2
#    Values  : { 'Disabled'[0], '50 Hz'[1], '60 Hz'[2] },
#    Default : 2

# uvcdynctrl -s "White Balance Temperature" 4000
#    Values  : [ 2000 .. 6500, step size: 1 ],
#    Default : 4000

uvcdynctrl -s "Sharpness" 128
#    Values  : [ 0 .. 255, step size: 1 ],
#    Default : 128

uvcdynctrl -s "Backlight Compensation" 0
#    Values  : [ 0 .. 1, step size: 1 ],
#    Default : 0

uvcdynctrl -s "Exposure, Auto" 3
#    Values  : { 'Manual Mode'[1], 'Aperture Priority Mode'[3] },
#    Default : 3

uvcdynctrl -s "Exposure (Absolute)" 250
#    Values  : [ 3 .. 2047, step size: 1 ],
#    Default : 250

uvcdynctrl -s "Exposure, Auto Priority" 0
#    Values  : [ 0 .. 1, step size: 1 ],
#    Default : 0

uvcdynctrl -s "Zoom, Absolute" 500
#    Values  : [ 100 .. 500, step size: 1 ],
#    Default : 100

uvcdynctrl -s "Pan (Absolute)" 0
#    Values  : [ -36000 .. 36000, step size: 3600 ],
#    Default : 0

uvcdynctrl -s "Tilt (Absolute)" 0
#    Values  : [ -36000 .. 36000, step size: 3600 ],
#    Default : 0

uvcdynctrl -s "Focus (absolute)" 0
#    Values  : [ 0 .. 250, step size: 5 ],
#    Default : 0

uvcdynctrl -s "Focus, Auto" 1
#    Values  : [ 0 .. 1, step size: 1 ],
#    Default : 1

Negative values need "--" and space before the "-"

What do you think? I can see that some of the existing code could be re-used but I am not sure how to do the rest . .

Any help would be much appreciated! (and it would help learn a bit more Ruby).

Thanks, Phil.

philiprhoades avatar Jan 31 '22 12:01 philiprhoades