Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to programmatically set the camera focus off an iOS device to infinity?

I am creating an app that locks the camera focus for video recording purposes. I want to lock the focus to infinity without having the user manually adjust the focus. Is this possible? Thanks!

like image 992
jsrivo Avatar asked Dec 13 '11 11:12

jsrivo


1 Answers

Sadly, no. You can set the camera into focus-locked mode, as Artem said; put into autofocus mode (focus, then lock), or continuous autofocus mode, but you can't give the camera a specific distance to focus at.

The best I've been able to come up with (for exposure and white balance control, which are similarly limited) is to have the user point the camera at an appropriate scene (in your case, something far away) and have him/her push a lock button.

Details on the capture device API, such as it is: https://developer.apple.com/library/mac/#documentation/AVFoundation/Reference/AVCaptureDevice_Class/Reference/Reference.html

like image 177
Adam Wilt Avatar answered Oct 05 '22 18:10

Adam Wilt