我正在使用MPMoviePlayerViewController (用于在iPhone 4和iPhone 5上运行的应用程序),如下所示:
NSURL *videoURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:videoFile ofType:videoType]];
MPMoviePlayerViewController *moviePlayerVC = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL];
moviePlayerVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:moviePlayerVC animated:YES completion:nil];
MPMoviePlayerController *moviePlayer = moviePlayerVC.moviePlayer;
// Register to receive a notification when the movie has finished playing.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerDidExitFullscreenNotification
object:moviePlayer];
[moviePlayer prepareToPlay];
[moviePlayer play];但是,视频编辑器需要知道要使用的视频大小(即满足iPhone 4和iPhone 5的需要)。
看看苹果的文档:http://developer.apple.com/library/ios/ipad/#documentation/Miscellaneous/Conceptual/iPhoneOSTechOverview/MediaLayer/MediaLayer.html
在“视频技术”一栏中,它指出:
640×480像素
那么,什么样的视频大小将是最好的iPhone 4和5。
例如,视频编辑器应该以640×480像素输出视频吗?
还是应该出口1136x640(即iPhone 5屏幕大小)?
或者是960x640 (iPhone 4)?
发布于 2012-12-04 12:23:25
正如您从苹果文档中注意到的那样,支持的最大分辨率是640×480,因此将视频以任何更高的分辨率导出不会有任何额外的优势。
iOS中的视频技术支持使用.mov、.mp4、.m4v和.3gp文件扩展名回放电影文件,并使用以下压缩标准:
https://stackoverflow.com/questions/12782258
复制相似问题