我正在尝试捕获特定尺寸的帧AVCaptureVideoDataOutput
通过设置kCVPixelBufferWidthKey
& kCVPixelBufferHeightKey
.
问题是缓冲区的宽度和高度永远不会改变,它们总是会回来852x640
这是我的代码:
// Add the video frame output
self.videoOutput = [[AVCaptureVideoDataOutput alloc] init];
[videoOutput setAlwaysDiscardsLateVideoFrames:YES];
// Use RGB frames instead of YUV to ease color processing
[videoOutput setVideoSettings:[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithFloat:320.0], (id)kCVPixelBufferWidthKey,
[NSNumber numberWithFloat:320.0], (id)kCVPixelBufferHeightKey,
[NSNumber numberWithInt:kCVPixelFormatType_32BGRA],(id)kCVPixelBufferPixelFormatTypeKey,
nil]];
[videoOutput setSampleBufferDelegate:self queue:dispatch_get_main_queue()];
编辑:来自 iOS AVCaptureOutput.h:目前,唯一支持的键是 kCVPixelBufferPixelFormatTypeKey。
有人知道设置输出缓冲区宽度/高度的工作方法吗?
来自 iOS AVCaptureOutput.h:Currently, the only supported key is kCVPixelBufferPixelFormatTypeKey.
总结如下。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)