我正在使用AVCaptureVideoDataOutput捕捉摄像机视频。我想要裁剪CMSampleBufferRef来制作最后的视频方块。但我找不到解决办法。你有什么想法吗?
请不要提供AVAssetExportSession。
谢谢。
发布于 2014-03-27 20:58:43
试探性地,您可以尝试用您的width和height在下面的内容上设置一个字典
NSDictionary* videoSettingsDictionary = @{
(id)kCVPixelBufferWidthKey : @(width),
(id)kCVPixelBufferHeightKey : @(height),
AVVideoScalingModeKey : AVVideoScalingModeFit
};
[yourAVCaptureVideoDataOutput setVideoSettings:videoSettingsDictionary];据说,AVVideoScalingModeFit强迫AVCaptureVideoDataOutput到Crop to remove edge processing region; preserve aspect ratio of cropped source by reducing specified width or height if necessary. (链接到AVF文档)
https://stackoverflow.com/questions/22658343
复制相似问题