soyersoyer / cameractrls

Camera controls for Linux
Other
590 stars 24 forks source link

non-gui approach ? #36

Closed CdeMills closed 10 months ago

CdeMills commented 11 months ago

Hello

I would like to write a simple app which setup a few parameters of the camera, capture one image and close the camera. From what I understand:

devices = get_devices(v4ldirs) mycam = devices[0] with open(mycam.path, "w") as fd: camctl = CameraCtrls(mycam.path, fd) print(camctl.print_ctrls())

This prints a list of controls and values ... but how do I use this camctl object to set actual controls ? The function setup_ctrls expect a dict, I tried like

camctl.setup_ctrls({'Color / Balance': 'white_balance_automic=0'}, "My message")

but it does not work. Could you please show how to use the interface directly ?

TIA

Pascal

soyersoyer commented 11 months ago

Try

errs = []
camctl.setup_ctrls({'white_balance_automatic': 0}, errs)
CdeMills commented 11 months ago

Thanks

you made my day !