作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试通过设置 kCVPixelBufferWidthKey
和 kCVPixelBufferHeightKey
从 AVCaptureVideoDataOutput
捕获特定大小的帧。
问题是缓冲区的宽度和高度永远不会改变,它们总是返回 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:目前,唯一支持的 key 是 kCVPixelBufferPixelFormatTypeKey。
有人知道设置输出缓冲区宽度/高度的工作方法吗?
最佳答案
来自 iOS AVCaptureOutput.h:目前,唯一支持的 key 是 kCVPixelBufferPixelFormatTypeKey。
这就是总结。
关于iphone - AVCaptureVideoDataOutput 和设置 kCVPixelBufferWidthKey & kCVPixelBufferHeightKey,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7967937/
我正在尝试通过设置 kCVPixelBufferWidthKey 和 kCVPixelBufferHeightKey 从 AVCaptureVideoDataOutput 捕获特定大小的帧。 问题是缓
我是一名优秀的程序员,十分优秀!