iosavfoundationavcapturesessionavcapturedeviceavcapturephotosettings

AVCaptureVideoDataOutput P3 colorspace


Is there anyway of getting CMSampleBuffers in 10bit P3 colorspace using AVCaptureVideoDataOutput (or otherwise?) at minimum 30 frames per second? I can configure AVCaptureSession to use P3 color space but in AVCaptureVideoDataOutput delegate can not get anything better than BGRA or YUV420, both of which are 8 bit formats.


Solution

  • Are you mixing colorspaces up with pixel formats? P3 colorspace doesn't specify the size of each element. You can have 8 bit per channel output in the P3 colorspace. If you want a different pixel format checkout

    AVCaptureVideoDataOutput.availableVideoCVPixelFormatTypes. 
    

    That will give you a list of the available pixel formats for video output. You can then set the pixel format as follows

    AVCaptureVideoDataOutput.videoSettings = [kCVPixelBufferPixelFormatTypeKey: pixelFormat]
    

    Last time I checked the only ones available are 32 bit BGRA, 420v and 420f.