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.