The color of video is wrong when made from UIImage of the PNG files

I am taking a UIImage from Png file and feed it to the videoWriter.

avAdaptor appendPixelBuffer:pixelBuffer

When the end result video comes out, it seems to lacking the one color, missing the yellow color or something.

I take alook of the function that made the pixelbuffer out of the UIImage

CVPixelBufferCreateWithBytes(NULL,
                             myWidth,
                             myHeight,
                             kCVPixelFormatType_32BGRA, 
                             (void*)CFDataGetBytePtr(image), 
                             CGImageGetBytesPerRow(cgImage), 
                             NULL, 
                             0,
                             NULL, 
                             &pixelBuffer);

I also try the kCVPixelFormatType_32AGRB and others, it didn't help.

any thoughts?

9
задан DarkDust 25 October 2010 в 06:14
поделиться