我正在使用 AVFoundation 录制 MOV 文件,但我无法找到如何更改视频的尺寸。我有videoGravity
的财产captureVideoPreviewLayer
set to AVLayerVideoGravityResizeAspectFill
和UIView
显示预览图层具有自定义尺寸(与屏幕的长宽比不同)。
录制效果很好,但录制视频的尺寸与屏幕的宽高比相同。如何记录 UIView 或预览层的宽高比?
这是使用 AVFoundation 录制视频的最佳示例代码
https://developer.apple.com/library/ios/#samplecode/RosyWriter/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011110 https://developer.apple.com/library/ios/#samplecode/RosyWriter/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011110
在文件中:RosyWriterVideoProcessor.m
方法名称
- (BOOL) setupAssetWriterVideoInput:(CMFormatDescriptionRef)currentFormatDescription
在视频压缩设置中您可以更改尺寸,希望这对您有帮助。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)