【问题标题】:AVCaptureVideoDataOutput and setting kCVPixelBufferWidthKey & kCVPixelBufferHeightKeyAVCaptureVideoDataOutput 和设置 kCVPixelBufferWidthKey & kCVPixelBufferHeightKey
【发布时间】:2011-11-01 14:25:43
【问题描述】:

我正在尝试通过设置 kCVPixelBufferWidthKeykCVPixelBufferHeightKeyAVCaptureVideoDataOutput 捕获特定大小的帧。
问题是缓冲区的宽度和高度永远不会改变,他们总是回来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。

有人知道设置输出缓冲区宽度/高度的工作方法吗?

【问题讨论】:

    标签: iphone ios video-capture avcapturesession


    【解决方案1】:

    来自 iOS AVCaptureOutput.h:Currently, the only supported key is kCVPixelBufferPixelFormatTypeKey.

    总结一下。

    【讨论】:

    • 我希望它确实有效——我也可以真正使用它。 :-)
    • 嗨,我怎样才能强制视频输出大小?谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-27
    • 1970-01-01
    • 2011-06-24
    • 1970-01-01
    • 1970-01-01
    • 2017-11-19
    • 2018-12-10
    相关资源
    最近更新 更多