AVCaptureDevice fixed shutter speed

Hello,


Wondering if someone can help me with this. Is there an easy way to set a fixed shutter speed for an AVCaptureDevice?


At the moment my only option seems to be to use setExposureModeCustom(duration:iso:completionHandler:) using the currentExposureDuration and currentISO to get an EV value and then recalculate an equivilent EV with the fixed shutter speed.


But, was wondering if there was a simpler, more direct way to achieve this?


Thanks,


Kapsy

Replies

Looks like you're doing it right.


There was a session 508 on the topic in WWDC 2014, unfortunately, there is no coding detail on how to set the speed.

h ttps://asciiwwdc.com/2014/sessions/508

And finally, you can know when exposure is being adjusted through this key-value observable property.

Now, new in iOS 8 we're introducing support for fully manual exposure or what we call in the API, custom exposure.

In custom mode you can get, set and key-value observe ISO and shutter speed.

Now, we refer to shutter speed as exposure duration in the API set since our cameras don't have a physical shutter.

I'll use those two terms interchangeably from here on out.

I feel a demo coming on.


h ttp://devstreaming.apple.com/videos/wwdc/2014/508xxfvaehrll14/508/508_sd_camera_capture_manual_controls.mov?dl=1


Here is the API (at minute 28 of video)

New exposure mode AVCaptureExposureModeCustom

- (void)setExposureModeCustomWithDuration:(CMTime)duration
 ISO:(float)ISO


completionHandler:(void (^)(CMTime syncTime))handler;

Thanks for your answer and the links!


I'll have a good watch of the video around the point you mention. Seems like there are some good tips there.


I also should have clarified that I'm interested in keeping the exposure constant, but setting a fixed (or even upper limit) on the shutter speed. This is to prevent the blurring of moving objects while capturing. It's the same functionality that SLRs have in "shutter priority" mode.


Interestingly, setting the AVCaptureSessions sessionPreset to AVCaptureSession.Preset.hd4K3840x2160 imposes an upper limit (presumably to maintain 60fps), even when taking photos using captureStillImageAsynchronously. However this limit isn't present for AVCaptureSession.Preset.photo, and there seems to be no way to access the internals of the preset to change it.


Once again, thanks for your help.