sara
sara

Reputation: 45

How to capture the black and white video

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

Answers (1)

Pochi
Pochi

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

Related Questions