有没有办法检测 GPUImageMovie 何时完成处理?目前我不想保存电影,所以没有带有完成 block 的 GPUImageMovieWriter。
self.movieFile = [[GPUImageMovie alloc] initWithURL:assetURL];
if([filterType isEqualToString"BigApple 1"]){
self.lookupImageSource = [[GPUImagePicture alloc] initWithImage:[UIImage imageNamed"BigApple1.png"]];
[self.lookupImageSource processImage];
[self.lookupImageSource useNextFrameForImageCapture];
filter = [[GPUImageLookupFilter alloc] init];
[lookupImageSource addTarget:filter atTextureLocation:1];
}
[movieFile addTarget:filter];
[filter addTarget:videoWindow];
[self.imageThumbnail removeFromSuperview];
[movieFile startProcessing];
Best Answer-推荐答案 strong>
通过使用计时器然后检查 GPUImageMovie 上的进度值解决了该问题。
self.sampleTimer = [NSTimer scheduledTimerWithTimeInterval:0.1f
target:self
selectorselector(retrievingSampleProgress)
userInfo:nil
repeats:YES];
- (void)retrievingSampleProgress {
NSLog(@"Sample Complete:%f",self.movieFile.progress);
if(self.movieFile.progress == 1){
[self.sampleTimer invalidate];
self.viewingSample = 0;
}else {
self.viewingSample = 1;
}
}
关于ios - 如何检测 GPUImageMovie 何时完成处理,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/24573287/
|