Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I obtain raw data from a CVImageBuffer object

I'm trying to use cocoa to grab images from a webcam. I'm able to get the image in RGBA format using the QTKit and the didOutputVideoFrame delegate call, and converting the CVImageBuffer to a CIImage and then to a NSBitmapImageRep.

I know my camera grabs natively in YUV, what I want is to get the YUV data directly from the CVImageBuffer, and proccess the YUV frame before displaying it.

My question is: How can I get the YUV data from the CVImageBuffer?

thanks.

like image 934
jslap Avatar asked Nov 06 '22 13:11

jslap


1 Answers

You might be able to create a CIImage from the buffer using +[CIImage imageWithCVBuffer:] and then render that CIImage into a CGBitmapContext of the desired pixel format.

Note, I have not tested this solution.

like image 178
Barry Wark Avatar answered Nov 11 '22 02:11

Barry Wark