Pixel formats, CVPixelBufferRefs and glReadPixels

后端 未结 5 2045
太阳男子
太阳男子 2020-12-15 13:16

I\'m using glReadPixels to read data into a CVPixelBufferRef. I use the CVPixelBufferRef as the input into an AVAssetWriter

5条回答
  •  感动是毒
    2020-12-15 14:19

        glReadPixels(0, 0, width, height, GL_BGRA, GL_UNSIGNED_BYTE, _buffer);
        CVPixelBufferRef buffer = NULL;
        CVReturn ret = CVPixelBufferCreateWithBytes(kCFAllocatorDefault,_size.width,_size.height,kCVPixelFormatType_32BGRA,glubyte,_size.width*4,NULL,NULL,NULL,&buffer);
    

提交回复
热议问题