4

I'm working on an app that uses various advanced iOS camera controls, e.g. custom exposure settings (duration and ISO). The exposure is locked at custom values using:

device.setExposureModeCustom(duration: duration, iso: iso) {
    (timestamp:CMTime) -> Void in
    // ...
}

My app is also locking the device gains corresponding to a specific temperature/tint combination.

Everything seemed to work so far. However, when I open the resulting photo files (JPGs in my case) and look at the exposure duration/ISO values that are stored in the EXIF tags, I notice that there are huge differences between the values that I have specified programmatically and the values that are in the EXIF tags.

I have tested this with various different exposure duration/ISO combinations. As you can see, in most cases, the error is quite large:

Testing various exposure duration/ISO settings and comparing them with the EXIF data.

Why is that? Can anyone reproduce/confirm this issue? It seems like a bug on Apple's part.

Photos are captured using AVCapturePhotoOutput's capturePhoto method:

self.photoOutput.capturePhoto(with: photoSettings, delegate: captureProcessor)

Yes, I double and triple-checked that the exposure mode is set to .custom before taking any photos. The code configuring the AVCaptureDevice is working properly. You can also see that it is working in the preview, for example, using larger exposure durations or larger ISO values results in a brighter image, as you would expect.

Possibly related:


My device: iPad Pro (10.5"), iOS 13.2.2

robert
  • 3,484
  • 3
  • 29
  • 38
  • Try saving the image in HEIC (the default format for iOS devices) and check the status! – Daksh Gargas Dec 23 '19 at 09:45
  • 1
    @DakshGargas Great idea! I've tested the settings duration=5ms/iso=1000, duration=50ms/iso=200 and duration=100ms/iso=200. Using the HEIC format did not make any difference. The parameters stored in the EXIF tags suffer from the exact same shifts/offsets as in the corresponding JPG files. – robert Jan 14 '20 at 12:18
  • I have observed the same issue on iPhones, in every captureDevice format and camera combinations. The ISO and exposureDuration values settings in custom mode, are well applied in the iPhone camera. But the EXIF values are (almost) always wrongs. I guess, EXIF values for ISO are legacy based, and can only take photography historical values (32, 40, 64 ...). And the same things seems to happen with exposureDuration, it can only take fractions like 1/40s 1/60s. Even if Apple applies your settings correctly, the EXIF attached with the photo contains legacy values. – Neimsz Jul 22 '22 at 08:50

1 Answers1

0

I have experienced the same problem. Make sure the isAutoStillImageStabilizationEnabled property is set to false:

let photoSettings: AVCapturePhotoSettings

if self.photoOutput.availablePhotoCodecTypes.contains(.hevc) {
    photoSettings = AVCapturePhotoSettings(format: [AVVideoCodecKey:  AVVideoCodecType.hevc])
} else {
    photoSettings = AVCapturePhotoSettings()
}

photoSettings.isAutoStillImageStabilizationEnabled = false
self.photoOutput.capturePhoto(with: photoSettings, delegate: captureProcessor)