Reputation: 45
I am new in iPhone application development. I develop one iPhone application. In this application i want to develop record the black and white video using iPhone camera. Please help me how to develop this and then give some example code url also.
Thanks in advance.
Upvotes: 0
Views: 1270
Reputation: 13459
You want to use the kCVPixelFormatType_420YpCbCr8BiPlanarFullRange format.
adding this to your videooutput
OSType format = kCVPixelFormatType_420YpCbCr8BiPlanarFullRange;
videoOutput.videoSettings = [NSDictionary dictionaryWithObject:[NSNumber
numberWithUnsignedInt:format]
forKey:(id) kCVPixelBufferPixelFormatTypeKey];
and following this to convert the Y plane to grayscale to images:
AVFoundation - Get grayscale image from Y plane (kCVPixelFormatType_420YpCbCr8BiPlanarFullRange)
or if you want to save it as video:
How do I convert the live video feed from the iPhone camera to grayscale?
Upvotes: 1