【发布时间】:2014-08-05 21:25:05
【问题描述】:
CVPixelBufferLockBaseAddress(pixelBuffer, 0);
const size_t lumaPlaneIndex = 0;
size_t lumaPlaneWidth = CVPixelBufferGetWidthOfPlane(pixelBuffer, lumaPlaneIndex);
size_t lumaPlaneHeight = CVPixelBufferGetHeightOfPlane(pixelBuffer, lumaPlaneIndex);
const size_t cbcrPlaneIndex = 1;
size_t cbcrPlaneWidth = CVPixelBufferGetWidthOfPlane(pixelBuffer, cbcrPlaneIndex);
size_t cbcrPlaneHeight = CVPixelBufferGetHeightOfPlane(pixelBuffer, cbcrPlaneIndex);
NSLog(@"lumaPlaneWidth: %zu", lumaPlaneWidth);
NSLog(@"lumaPlaneHeight: %zu", lumaPlaneHeight);
NSLog(@"cbcrPlaneWidth: %zu", cbcrPlaneWidth);
NSLog(@"cbcrPlaneHeight: %zu", cbcrPlaneHeight);
CVPixelBufferUnlockBaseAddress(pixelBuffer, 0);
在运行 iOS 7 的 iPhone 5 上,前置摄像头的输出是:
lumaPlaneWidth: 1280
lumaPlaneHeight: 720
cbcrPlaneWidth: 640
cbcrPlaneHeight: 360
luma (Y) 平面是 CbCr 平面大小的两倍,这是为什么呢?
【问题讨论】:
-
1280x720 为 720p。你为什么期望它是那个大小的一半?您是在询问以较低频率采样 Cb 和 Cr 吗?
-
@Tommy - 实际上你可能是对的,我很困惑为什么平面有不同的尺寸,我可能错误地认为亮度平面是错误的。我会重新提出问题。
标签: ios avfoundation video-capture video-processing