查看GPUImage中的SimpleVideoFilter示例。
然后用类似这样的方式消除棕褐色过滤器,以获得预览:
videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack];
GPUImageView *filterView = (GPUImageView *)self.view;
[videoCamera addTarget:filterView];
[videoCamera startCameraCapture];
这是布拉德在评论中建议的开始:
videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack];
GPUImageLanczosResamplingFilter* filter = [[GPUImageLanczosResamplingFilter alloc] init];
GPUImageView *filterView = (GPUImageView *)self.view;
[videoCamera addTarget:filter];
[filter forceProcessingAtSize:self.view.frame.size];
[filter addTarget:filterView];
[videoCamera startCameraCapture];
过滤器的输出也将被发送到 GPUImageMovieWriter。SimpleVideoFilter 示例涵盖了它。