supported iosurface/pixelbuffer formats

I'm trying unsuccesfully to upgrade our CIImage based video display pipeline to wide color and HDR. The problem is finding a >8bit pixelformat supported by CIImage imageWithIOSurface: or imageWithCVImageBuffer:


for all but the most common formats (32, '2vuy', etc) i get the following error on console:

[api] [CIImage initWithIOSurface:options:] failed because surface format was x422.

I've tried kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange (suggested format for HEVC wide decomp according to avf wwdc video) and numerous others.


Are supported pixelformats documented anywhere?

Replies

Did you find a solution to this? How about using a MTLTexture or a raw buffer?

Generally you want to use the "4:2:0", or 1/2 res biplanar formats like:
  • kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange = '420v'

  • kCVPixelFormatType_420YpCbCr8BiPlanarFullRange  = '420f'

  • kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange = 'x420'

  • kCVPixelFormatType_420YpCbCr10BiPlanarFullRange  = 'xf20'

I've successfully used these to grab frames and put them into -[CIImage initWithCVPixelBuffer:]

Hope that helps!