【问题标题】:How to capture the black and white video如何捕捉黑白视频
【发布时间】:2012-06-11 07:07:22
【问题描述】:

我是 iPhone 应用程序开发的新手。我开发了一个 iPhone 应用程序。在这个应用程序中,我想开发使用 iPhone 相机录制黑白视频。请帮助我如何开发它,然后也提供一些示例代码 url。

提前致谢。

【问题讨论】:

标签: iphone video record


【解决方案1】:

您想使用 kCVPixelFormatType_420YpCbCr8BiPlanarFullRange 格式。

将此添加到您的视频输出中

OSType format = kCVPixelFormatType_420YpCbCr8BiPlanarFullRange;

    videoOutput.videoSettings = [NSDictionary dictionaryWithObject:[NSNumber 
                                                                    numberWithUnsignedInt:format]
                                                            forKey:(id) kCVPixelBufferPixelFormatTypeKey];

并按照此将 Y 平面转换为灰度图像:

AVFoundation - Get grayscale image from Y plane (kCVPixelFormatType_420YpCbCr8BiPlanarFullRange)

或者如果您想将其保存为视频:

How do I convert the live video feed from the iPhone camera to grayscale?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多