使用默认的viewcontroller和mainstoryboard: 使用pod安装来设置库。 这是一个seggested Filtering实时视频测试代码,但它在我的iPhone6s上不起作用。
#import "ViewController.h"
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
GPUImageVideoCamera *videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack];
enter code here
videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait;
GPUImageFilterGroup *group=[[GPUImageAmatorkaFilter alloc] init];
GPUImageFilter *customFilter=(GPUImageFilter *)[group filterAtIndex:0];
NSLog(@"%lu",(unsigned long)[group filterCount]);
GPUImageView *filteredVideoView = [[GPUImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 375, 480)];
[self.view addSubview:filteredVideoView];
[videoCamera addTarget:customFilter];
[customFilter addTarget:filteredVideoView];
[videoCamera startCameraCapture];
}
@end