我正在从我的iPhone应用程序录制视频并将其上传到服务器。视频需要有一个16:9的纵横比,所以我设置
[videoRecorderController setVideoQuality:UIImagePickerControllerQualityTypeIFrame960x540]有没有办法减少视频的内存大小,并保持16:9的宽高比?
发布于 2012-11-21 14:42:51
这对我很有帮助:
- (void)convertVideoToLowQuailtyWithInputURL:(NSURL*)inputURL
outputURL:(NSURL*)outputURL
handler:(void (^)(AVAssetExportSession*))handler
{
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:inputURL options:nil];
AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetMediumQuality];
exportSession.outputURL = outputURL;
exportSession.outputFileType = AVFileTypeQuickTimeMovie;
[exportSession exportAsynchronouslyWithCompletionHandler:^(void)
{
handler(exportSession);
}];
}https://stackoverflow.com/questions/13394841
复制相似问题