【发布时间】:2016-05-03 11:54:56
【问题描述】:
我正在开发一个实时应用程序。我需要在视频缓冲区中添加过滤器。 然后我使用 GPUImage 框架并编写了一个过滤器。看起来不错,但是 'willOutputSampleBuffer:' 函数中没有任何过滤器效果的缓冲区。
以下是一些关键代码:
self.videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:self.sessionPreset cameraPosition:AVCaptureDevicePositionFront];
self.videoCamera.delegate = self;
self.videoCamera.horizontallyMirrorFrontFacingCamera = YES;
self.filterView = [[GPUImageView alloc] init];
GPUImageBeautifyFilter *beautifyFilter = [[GPUImageBeautifyFilter alloc] init];
[self.videoCamera addTarget:beautifyFilter];
[beautifyFilter addTarget:self.filterView];
dispatch_async(dispatch_get_main_queue(), ^{
[self.view insertSubview:self.filterView atIndex:1];
[self.filterView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
[self.videoCamera startCameraCapture];
});
有没有我忽略的细节?谢谢!!!
【问题讨论】:
标签: ios objective-c gpuimage avcapturesession