dji-sdk / Mobile-SDK-iOS

DJI Mobile SDK for iOS: http://developer.dji.com/mobile-sdk/
Other
577 stars 256 forks source link

M300 H20 setHybridZoomFocalLength:withCompletion #445

Open seungbeom-son opened 3 years ago

seungbeom-son commented 3 years ago

I want to set hybrid zoom focal length programatically.

I read this document https://developer.dji.com/api-reference/ios-api/Components/Camera/DJICamera_DJILens.html#djicamera_djilens_sethybridzoomfocallength_inline, but I cannot understand the correlation between zoom focal length (NSUInteger type) and real magnification (ex 2.0X, 5.0X, etc)

In addition, I could not set hybrid zoom focal length with the value that I got from getHybridZoomFocalLength API, like this.

lense.getHybridZoomFocalLength { (zoomFocalLength, error) in if let error = error { LOG_DEFAULT(message: "failed to get hybrid zoom focal length: \(error.localizedDescription)") } else { LOG_DEFAULT(message: "zoom focal length: \(zoomFocalLength)") lense.setHybridZoomFocalLength(zoomFocalLength) { (error2) in if let error2 = error2 { LOG_DEFAULT(message: "failed to set hybrid zoom focal legnth: \(error2.localizedDescription)") } } } }

When I ran this code, I get the error 'The parameters are invalid. Please review and submit the request.(code:-1005)'

In summary, I want to know

  1. The correlation between zoom focal length (NSUInteger type) and real magnification
  2. Why I cannot set zoom focal legnth value that I got from getHybridZoomFocalLength API.
dji-dev commented 3 years ago

Agent comment from Luce Luo in Zendesk ticket #44987:

Dear Customer,

Thank you for contacting DJI. First, please ensure you have upgraded to the latest drone, H20 firmware, and use the latest 4.14 SDK. Second, to set/get the hybrid zoom need to switch to the ZOOM lens first via the method setCameraVideoStreamSource:withCompletion and ensure the current lens is a zoom type. Third, the method setHybridZoomFocalLength:withCompletion parameter should be the "minHybridFocalLength + N*focalLenthStep", change the N. And the MSDK doesn't have the magnification, only the valid range can be changed, you can implentment your own magnification.

If the problem persists, please contact us via the form with more detail. https://formcrafts.com/a/dji-developer-feedback-en

Thanks,

Luce Luo DJI Developer Support