裁剪CMSampleBufferRef样本

时间:2014-03-26 10:38:10

标签: ios iphone video-processing

我正在使用AVCaptureVideoDataOutput来捕捉相机视频。我想裁剪CMSampleBufferRef以制作最终视频广场。但我无法找到解决办法。你有什么想法吗?

请不要提供AVAssetExportSession

感谢。

1 个答案:

答案 0 :(得分:1)

暂时,您可以尝试使用widthheight设置类似以下内容的词典:

NSDictionary* videoSettingsDictionary = @{
    (id)kCVPixelBufferWidthKey : @(width),
    (id)kCVPixelBufferHeightKey : @(height),
    AVVideoScalingModeKey : AVVideoScalingModeFit
};
[yourAVCaptureVideoDataOutput setVideoSettings:videoSettingsDictionary];

据称,AVVideoScalingModeFit强制AVCaptureVideoDataOutputCrop to remove edge processing region; preserve aspect ratio of cropped source by reducing specified width or height if necessary.link to AVF docs