Using GPUImageLookupFilter in a movie file creates a black screen

I am moving my code from a still image application to a file that creates movie files. However, there is a problem with the following code, in which the final output is a black movie screen using the GPUImageLookupFilter filter. Can anyone determine what I'm doing wrong or what I might have missed.

Header File Sample GPUImagePicture *lookupImageSource; GPUImageOutput<GPUImageInput> *filter; GPUImageMovie *movieFile; GPUImageMovieWriter *movieWriter; @property(nonatomic,strong) GPUImagePicture *lookupImageSource; Main File filter = [[GPUImageFilterGroup alloc] init]; self.lookupImageSource = [[GPUImagePicture alloc] initWithImage:[UIImage imageNamed:@"ExtremeVintage1.png"]]; GPUImageLookupFilter * filterLookup = [[GPUImageLookupFilter alloc] init]; [self.lookupImageSource addTarget:filterLookup]; [self.lookupImageSource processImage]; [(GPUImageFilterGroup *)filter addFilter:filterLookup]; [(GPUImageFilterGroup *)filter setInitialFilters:[NSArray arrayWithObject:filterLookup]]; [(GPUImageFilterGroup *)filter setTerminalFilter:filterLookup]; [movieFile addTarget:filter]; 

thanks

**** UPDATE *****

New code

 self.lookupImageSource = [[GPUImagePicture alloc] initWithImage:[UIImage imageNamed:@"ExtremeVintage1.png"]]; [self.lookupImageSource processImage]; filter = [[GPUImageLookupFilter alloc] init]; [lookupImageSource addTarget:filter]; [movieFile addTarget:filter]; 

enter image description here

+4
source share
1 answer

Is this a project with ARC support? If so, you are not holding onto a strong reference to the instance of your lookupImageSource GPUImagePicture instance after the method in which you indicated above. Once you exit this method, the GPUImagePicture that provides your search will be freed, and as a result, you will lose the search texture.

Try forcing lookupImageSource to hold the instance variable of your class tightly so that it remains above the code set above.

+5
source

Source: https://habr.com/ru/post/1495530/


All Articles