I am currently using GPU framework to record a video along with WhiteBalance and Exposure Filters but the FPS is very poor (About 12 FPS). I have used the above filters in GPUImage original demo Code (SimpleVideoFilter) but the results are same.
Here is the Method that I am using to record a video with combined filters. These are the results for iPhone 5, iPod Touch which has max 30 FPS support.
Any Ideas to achieve FPS upto 28 or something with the AVCaptureSessionPresetHigh and WhiteBalance,Exposure filter together!! Thanks !!
-(void)recordVideo{
videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPresetHigh cameraPosition:AVCaptureDevicePositionBack];
videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait;
videoCamera.horizontallyMirrorFrontFacingCamera = NO;
videoCamera.horizontallyMirrorRearFacingCamera = NO;
filter = [[GPUImageFilterGroup alloc] init];
[videoCamera addTarget:filter];
GPUImageFilterGroup *group = (GPUImageFilterGroup *)filter;
GPUImageWhiteBalanceFilter *whiteBalance = [[GPUImageWhiteBalanceFilter alloc] init];
[group addFilter:whiteBalance];
GPUImageExposureFilter *exposureFilter = [[GPUImageExposureFilter alloc] init];
[group addFilter:exposureFilter];
[whiteBalance addTarget:exposureFilter];
[group setInitialFilters:[NSArray arrayWithObject:whiteBalance]];
[group setTerminalFilter:exposureFilter];
filter = group;
[videoCamera addTarget:filter];
GPUImageView *filterView = (GPUImageView *)self.view;
NSString *pathToMovie = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Movie.m4v"];
unlink([pathToMovie UTF8String]);
NSURL *movieURL = [NSURL fileURLWithPath:pathToMovie];
movieWriter.encodingLiveVideo = YES;
movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(1080.0, 1920.0)];
[filter addTarget:movieWriter];
[filter addTarget:filterView];
[videoCamera startCameraCapture];
double delayToStartRecording = 0.5;
dispatch_time_t startTime = dispatch_time(DISPATCH_TIME_NOW, delayToStartRecording * NSEC_PER_SEC);
dispatch_after(startTime, dispatch_get_main_queue(), ^(void){
NSLog(@"Start recording");
videoCamera.audioEncodingTarget = movieWriter;
[movieWriter startRecording];
double delayInSeconds = 10.0;
dispatch_time_t stopTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
dispatch_after(stopTime, dispatch_get_main_queue(), ^(void){
[filter removeTarget:movieWriter];
videoCamera.audioEncodingTarget = nil;
[movieWriter finishRecording];
NSLog(@"Movie completed");
});
});
}