0

I want to analyze colors displayed in AVSampleBufferDisplayLayer which gets frames from the data source which I don't control.

I've made my own subclass of this class and override func enqueue(_ sampleBuffer: CMSampleBuffer) to get my hands on sample buffers. My plan was to create CIImage from it and then apply CIAreaAverage filter.

Unfortunately, when I call CMSampleBufferGetImageBuffer(sampleBuffer), I get null. From what I understand, this means that I should use dataBuffer instead. But how can I convert it into CIImage?

msmialko
  • 1,439
  • 2
  • 20
  • 35
  • What is `dataBuffer`? How you get `sampleBuffer`? From `AVCaptureSession`? – Aznix Jun 04 '20 at 22:35
  • `dataBuffer` is a variable on `CMSampleBuffer`. I get those samples from the 3rd party library, and they are getting those frames from the network (these frames don't come from a device camera). – msmialko Jun 07 '20 at 18:12

0 Answers0