1

I'm working on getting a raw image from avfoundation.

I have a understanding of general pipeline of digital image.

  1. image sensor
  2. bayer filter
  3. 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..

  1. CMSampleBuffer is image buffer which after all 1,2,3 step(after demosaicing)
  2. output from AVCapturePhotoOutput callback function(with raw format supported) is after step 1-2(after bayer filter)

is this right?

foundry
  • 31,615
  • 9
  • 90
  • 125

0 Answers0