我正在尝试创建一个将与我的应用程序一起记录的 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];
我有两个按钮用于停止开始录制,当我停止录制时出现以下错误:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '*** -[AVAssetWriterInput markAsFinished] Cannot call method when status is 0'
?
我的观点是 OpenGL 1.x