Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mungewell opened this issue Apr 7, 2021 · 0 comments

Comments

@mungewell
Copy link
Contributor

ma1co/OpenMemories-Tweak#70 (comment)
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant