アプリで記録する OpenGL ビューを作成しようとしています。
GPUImageMovieWriter と GPUImageUIElement でビューを記録しようとしています
そのような:
self.imageUIElement = [[GPUImageUIElement alloc]initWithView:self.myView];
NSString *pathToMovie = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Movie.m4v"];
unlink([pathToMovie UTF8String]); // If a file already exists, AVAssetWriter won't let you record new frames, so delete the old movie
NSURL *movieURL = [NSURL fileURLWithPath:pathToMovie];
movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(480.0, 640.0)];
__weak UIViewController * controller = self;
movieWriter.completionBlock = ^{
MPMoviePlayerViewController * _controller = [[MPMoviePlayerViewController alloc]initWithContentURL:movieURL];
[controller presentMoviePlayerViewControllerAnimated:_controller];
};
[self.imageUIElement addTarget:movieWriter];
記録を停止して開始するための2つのボタンがあり、記録を停止すると次のエラーが発生します。
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '*** -[AVAssetWriterInput markAsFinished] Cannot call method when status is 0'
?
私のビューは OpenGL 1.x です