I'm working on getting a raw image from avfoundation.
I have a understanding of general pipeline of digital image.
- image sensor
- bayer filter
- demosaicing.
My goal is getting a image as raw as possible.
I found out that using AVCaptureOutput, if device support raw pixel format, I get output as raw format in callback function -
func photoOutput(
_ output: AVCapturePhotoOutput,
didFinishCaptureFor
resolvedSettings: AVCaptureResolvedPhotoSettings,
error: Error?)
but what is difference between AVCapturePhotoOutput
in this function and CMSampleBuffer
in the AVCaptureVideodDataOutput
callback function:
func captureOutput(
_ output: AVCaptureOutput,
didOutput sampleBuffer: CMSampleBuffer,
from connection: AVCaptureConnection
)
this is my guess..
- CMSampleBuffer is image buffer which after all 1,2,3 step(after demosaicing)
- output from AVCapturePhotoOutput callback function(with raw format supported) is after step 1-2(after bayer filter)
is this right?