RAW support with custom video device format

Hi,


I'm trying to save RAW photos using iOS but the problem is

availableRawPhotoPixelFormatTypes
always returns 0 elements unless I set
sessionPreset
to
AVCaptureSessionPresetPhoto
. I've tried all the formats available for my
AVCaptureDevice
but none of them allows me to save RAW photos. How is that possible? Same format used for session preset won't allow me to save RAW when I activate it directly (through
activeFormat
). Any ideas what am I missing here?


I can't use session presets since it only allows you to take picture in the highest resolution.


Thanks

Replies

It's my understanding your app can edit existing RAW files, but iOS can't convert/save as generated RAW files.

The behavior you're seeing is expected. RAW capture is currently only supported using AVCaptureSessionPresetPhoto. The photo preset delivers the full sensor resolution. RAW support in the video (16:9) formats would involve cropping the bayer raw. RAW capture is also not supported when any digital zoom is being applied, as that would also involve cropping the bayer raw.

Hi bford,


I'm fine with RAW being supported only for full resolution 4:3 photos. But why is it not supported when I don't use the preset but use the same format the preset uses? Is there some private API the preset method calls which doesn't happen if I choose the format directly?


Thanks

Your initial post said:

"I can't use session presets since it only allows you to take picture in the highest resolution."


If you use the -[AVCaptureDevice setActiveFormat:] API with the same device format used implicitly by the photo preset, you are getting a picture at the highest resolution.


I agree with you that the activeFormat API equivalent of the photo preset should be supported, and that's a great API enhancement request. Please log in at bugreport.apple.com and formally request this enhancement.

Yeah, the original post said that I can't use session presets since the user can choose the resolution and aspect ratio. I will have to add workaround code for the highest resolution and use preset for that in order to be able to save as RAW. Pretty annoying.


I've logged an enhancement request with Apple.


Thanks for your help.

Just to know if this is resolved or the latest iOS still doesn't supports it.