我正在尝试将 GPUImage 集成到我的 iPhone 应用程序中,以便使用实时滤镜拍摄照片。但是我发现了一个恼人的问题:当我使用前置摄像头拍照时,结果图像中总是有一些垂直的黑条。
- 后置摄像头从来没有这个问题;
- 跟滤镜没关系,我试过没有滤镜。
起初我认为它与我的iPhone硬件有关,然后我在网上搜索,其他开发人员也遇到了同样的问题(没有解决方案)。
请看这里的图片: http://i.stack.imgur.com/rPAJ9.jpg
最佳答案
也许这可以帮助你:
I had the same exact problem. In the GPUImageStillCamera.m, I commented out "[self captureOutput:photoOutput didOutputSampleBuffer:imageSampleBuffer fromConnection:[[photoOutput connections] objectAtIndex:0]];" and now the glitches are gone. That's the only way I was able to fix the problem without forcing GPUImageOpenGLESContext's +supportsFastTextureUpload to return NO.
有关更多信息,请参阅:here
关于ios - GPUImage 在使用 iPhone 前置摄像头时出现垂直黑条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13540862/