I am moving my code over from a still image application to one that produces movie files. There is a problem however with the following code where the final output is a black movie screen using the GPUImageLookupFilter filter. Can anyone spot what I am doing wrong or what I may 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];
Is this an ARC-enabled project? If so, you're not holding on to a strong reference to your lookupImageSource GPUImagePicture instance past the method where you've set up the above. As soon as you exit that method, the GPUImagePicture providing your lookup will be deallocated and you'll lose your lookup texture as a result.
Try making lookupImageSource a strongly held instance variable of your class, so that it persists beyond the setup code above.