如何通过MPMoviePlayerController播放240fps AVCapture Session电影?

时间:2015-07-31 00:24:51

标签: ios mpmovieplayercontroller avcapturesession

我能够将240 [fps] AVCapture Session电影录制到我的专辑中。 但我不能用慢动作播放电影。 我该怎么办?

我试过以下情况。

[1] 我试过以下代码。 AVCapture会话委托处理240 [fps]“outputFileURL”。 但在结果中,MPMoviePlayerController播放普通的fps电影。

- (void)                 captureOutput:(AVCaptureFileOutput *)captureOutput
   didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL
                       fromConnections:(NSArray *)connections error:(NSError *)error
{


   MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:assetURL];

   player.controlStyle = MPMovieControlStyleNone;
   player.scalingMode = MPMovieScalingModeNone;
   player.movieSourceType = MPMovieSourceTypeFile;


   player.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
   [self.view addSubview:player.view];
   [player prepareToPlay];
   [player play];

}

[2] 我试过以下代码。此代码只播放由iOS Default Camera App录制的电影。此代码可以播放慢动作。但我想知道录制和录制的方式。我的代码完全播放慢动作电影。

NSString* path=[[NSBundle mainBundle] pathForResource:@"test.mov" ofType:@""];
NSURL* url=[NSURL fileURLWithPath:path];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:assetURL];

player.controlStyle = MPMovieControlStyleNone;
player.scalingMode = MPMovieScalingModeNone;
player.movieSourceType = MPMovieSourceTypeFile;

player.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
[self.view addSubview:player.view];
[player prepareToPlay];
[player play];

你有什么想法吗?

0 个答案:

没有答案