Sur*_*esh 6 iphone objective-c mpmovieplayercontroller avfoundation ios6
我使用下面的代码来压缩视频.
- (void)convertVideoToLowQuailtyWithInputURL:(NSURL*)inputURL
outputURL:(NSURL*)outputURL
handler:(void (^)(AVAssetExportSession*))handler
{
[[NSFileManager defaultManager] removeItemAtURL:outputURL error:nil];
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:inputURL options:nil];
AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetMediumQuality];
exportSession.outputURL = outputURL;
exportSession.outputFileType = AVFileTypeQuickTimeMovie;
[exportSession exportAsynchronouslyWithCompletionHandler:^(void)
{
if (exportSession.status == AVAssetExportSessionStatusCompleted)
{
printf("completed\n");
NSLog(@"outputurl is %@",outputURL);
}
else
{
printf("error\n");
NSLog(@"error is %@",exportSession.error);
}
}];
}
Run Code Online (Sandbox Code Playgroud)
在压缩后,视频在iOS6中的声音非常低,但在iOS 5中我获得了完整的原始音量,那么我如何在iOS 6中获得原始音量.
| 归档时间: |
|
| 查看次数: |
297 次 |
| 最近记录: |