3

Firstly; I do not want to go thru the use of a context; be it CIContext, CGContext, etc. Reason for this is that these methods are memory intensive and it causes to hit the arbitrary memory ceiling for app extensions.

Have verified that the buffer returned in the method:

override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with 
sampleBufferType: RPSampleBufferType) {

is of type: kCVPixelFormatType_420YpCbCr8BiPlanarFullRange

However, when attempting to convert the bi-planar data into a usable image it becomes heavily distorted or colors washed out.

have tried using the libyuv in order to attempt some conversion but am confused by the lack of documentation. Have tried creating a I420 buffer or a NV12 buffer in order to try and convert it to an image but am unsure of whether I am doing it right.

Have tried using the Metal Framework and vImage methods however I still don't have any luck with it. So looking for an example; a nudge in the right direction.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
palcabao
  • 51
  • 2
  • Are all the frames distorted? I'm unable to get a consistent picture of the frame via CPU (so copying the bytes out or using vImage). Metal works, but I have memory usage problems with that. – Rhythmic Fistman Jan 22 '20 at 13:13
  • I have the same problem. I managed the fix this issue with Accelerate framework that consumes less memory but much higher CPU than GPU. Have you found any solution that consumes less CPU and memory but more GPU(with Metal)? – Mehmet Baykar Sep 03 '21 at 12:13

0 Answers0