0

iPhone アプリケーションからビデオを録画してサーバーにアップロードしています。ビデオのアスペクト比は 16:9 である必要があるため、

[videoRecorderController setVideoQuality:UIImagePickerControllerQualityTypeIFrame960x540]

しかし、数秒のビデオには数MBのスペースが必要です。

ビデオのメモリ サイズを減らし、16:9 の縦横比を維持する方法はありますか?

4

1 に答える 1

0

これは私を助けました:

- (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);
 }];
}
于 2012-11-21T06:42:50.880 に答える