iPhone アプリケーションからビデオを録画してサーバーにアップロードしています。ビデオのアスペクト比は 16:9 である必要があるため、
[videoRecorderController setVideoQuality:UIImagePickerControllerQualityTypeIFrame960x540]
しかし、数秒のビデオには数MBのスペースが必要です。
ビデオのメモリ サイズを減らし、16:9 の縦横比を維持する方法はありますか?
iPhone アプリケーションからビデオを録画してサーバーにアップロードしています。ビデオのアスペクト比は 16:9 である必要があるため、
[videoRecorderController setVideoQuality:UIImagePickerControllerQualityTypeIFrame960x540]
しかし、数秒のビデオには数MBのスペースが必要です。
ビデオのメモリ サイズを減らし、16:9 の縦横比を維持する方法はありますか?
これは私を助けました:
- (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);
}];
}