Bloodevil / sony_camera_api

sony camera remote api
http://developer.sony.com/develop/cameras/
MIT License
244 stars 60 forks source link

Manual Focus Adjustment #66

Open ispybadguys opened 3 years ago

ispybadguys commented 3 years ago

I am wondering if this package can do the manual focus adjustment. I have managed to get this working on the A7R4 with the Sony SDK with the following commands

SDK::CrDeviceProperty prop;
prop.SetCode(SDK::CrDevicePropertyCode::CrDeviceProperty_NearFar);
prop.SetCurrentValue(selected_index);
prop.SetValueType(SDK::CrDataType::CrDataType_Int8);
SDK::SetDeviceProperty(m_device_handle, &prop);

I was wondering if you have this control in this package.

bjmc commented 3 years ago

This library just helps call whatever APIs the camera itself makes available from Python. There are some files in /doc scraped from various cameras that show what operations they expose, for example

setFocusMode getFocusMode getAvailableFocusMode getSupportedFocusMode

I don't know if any of those would do the trick, but you could give it a try depending on what your camera offers.

mungewell commented 3 years ago

It's been a while since I played with the code/cameras. I think that you may be referring to a different API (ie. over USB), this project uses the 'Sony Remote API' (over WiFi).

A found some discussion here: https://stackoverflow.com/questions/51025623/extend-camera-remote-api-for-adjusting-the-focus

My HX60

trying 'getAvailableFocusMode()':
{'result': ['AF-S', ['AF-S', 'MF']], 'id': 1}

My A5000 (which I brought more recently) appears to support the DirectManualFocus methods.

trying 'getAvailableFocusMode()':
{'result': ['AF-S', ['AF-S', 'AF-C', 'DMF', 'MF']], 'id': 1}

When Auto-tracking the camera will report these locations, and the demo app can show where these are located with markers, using the '--info' parameter: https://github.com/Bloodevil/sony_camera_api/blob/develop/examples/pygameLiveView.py#L207

mungewell commented 3 years ago

WiFi API is defined here: https://developer.sony.com/develop/cameras/#overview-content