gpt4 book ai didi

ios - 如何检测 GPUImageMovie 何时完成处理

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:04:53 24 4
gpt4 key购买 nike

有没有办法检测 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];

最佳答案

通过使用计时器然后检查 GPUImageMovie 上的进度值解决了这个问题。

self.sampleTimer = [NSTimer scheduledTimerWithTimeInterval:0.1f
target:self
selector:@selector(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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com