【发布时间】:2014-09-29 16:06:06
【问题描述】:
在我的应用程序中,它会创建一个视频 (MP4) 并在 MPMoviePlayer 中播放,现在我想将视频保存到相机胶卷中。如何将该视频保存到相机胶卷?
outputFilePath 是存储视频文件的位置。
AVAssetExportSession* _assetExport = [[AVAssetExportSession alloc] initWithAsset:mixComposition presetName:AVAssetExportPresetHighestQuality];
_assetExport.outputFileType = @"public.mpeg-4";
_assetExport.outputURL = outputFileUrl;
[_assetExport exportAsynchronouslyWithCompletionHandler:
^(void ) {
dispatch_async(dispatch_get_main_queue(), ^{
[spinner stopAnimating];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:outputFilePath]];
[moviePlayer.view setFrame:CGRectMake(0, 100, 320, 320)];
[moviePlayer prepareToPlay];
[moviePlayer repeatMode];
moviePlayer.backgroundView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:moviePlayer.view];
[moviePlayer play];
});
}
];
【问题讨论】:
标签: ios mpmovieplayercontroller mp4