sony_camera_api icon indicating copy to clipboard operation
sony_camera_api copied to clipboard

Add example script for controlling/setting the Zoom of the attached lens

Open mungewell opened this issue 3 years ago • 0 comments

https://github.com/ma1co/OpenMemories-Tweak/issues/70#issuecomment-814441931 Was asked on another project whether it was possible to set the zoom to a particular setting... it is, but on my lens the control is a bit limited and it tends to overshoot - even if you use the '1shoot' capability to nudge it into position.

Script attached, is this worth adding as an example? set_zoom.py.txt

simon@thevoid:~/sony_camera_api-sdw-github/examples$ python3 set_zoom.py -p 0
Searching for camera...
Found: http://192.168.122.1:8080
Zoom currently 100

simon@thevoid:~/sony_camera_api-sdw-github/examples$ python3 set_zoom.py -v -n 30 
Searching for camera...
Found: http://192.168.122.1:8080
Setting Zoom to 30
{'zoomPositionCurrentBox': 100, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 100}
{'zoomPositionCurrentBox': 100, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 100}
{'zoomPositionCurrentBox': 100, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 100}
{'zoomPositionCurrentBox': 96, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 96}
{'zoomPositionCurrentBox': 87, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 87}
{'zoomPositionCurrentBox': 87, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 87}
{'zoomPositionCurrentBox': 80, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 80}
{'zoomPositionCurrentBox': 77, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 77}
{'zoomPositionCurrentBox': 77, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 77}
{'zoomPositionCurrentBox': 70, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 70}
{'zoomPositionCurrentBox': 64, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 64}
{'zoomPositionCurrentBox': 61, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 61}
{'zoomPositionCurrentBox': 61, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 61}
{'zoomPositionCurrentBox': 54, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 54}
{'zoomPositionCurrentBox': 54, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 54}
{'zoomPositionCurrentBox': 54, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 54}
{'zoomPositionCurrentBox': 45, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 45}
{'zoomPositionCurrentBox': 35, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 35}
{'zoomPositionCurrentBox': 19, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 19}
Nudge:
{'zoomPositionCurrentBox': 12, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 12}
Nudge:
{'zoomPositionCurrentBox': 16, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 16}
Nudge:
{'zoomPositionCurrentBox': 22, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 22}
Nudge:
{'zoomPositionCurrentBox': 32, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 32}
Nudge:
{'zoomPositionCurrentBox': 25, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 25}
Nudge:
{'zoomPositionCurrentBox': 29, 'type': 'zoomInformation', 'zoomIndexCurrentBox': 0, 'zoomNumberBox': 1, 'zoomPosition': 29}

simon@thevoid:~/sony_camera_api-sdw-github/examples$ python3 set_zoom.py -p 0
Searching for camera...
Found: http://192.168.122.1:8080
Zoom currently 38

mungewell avatar Apr 07 '21 01:04 mungewell