iOS 10.1.1 - GPUImageContext fails to create OpenGL ES 2.0 Context
Hello!
I'm having a very weird issue where I get the following error - which comes from an NSAssert in GPUImageContext.m Line 249:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason:
'Unable to create an OpenGL ES 2.0 context.
The GPUImage framework requires OpenGL ES 2.0 support to work.'
Here is my flow:
I have a GPUImageVideoCamera, and when I am ready to record, I create a GPUImageMovieWriter that writes what I record to a folder. I am able to do this multiple times, successfully. No issues, no errors. Each time I do it, I create a new GPUImageMovieWriterinstance with:
- (id)initWithMovieURL:(NSURL *)newMovieURL
size:(CGSize)newSize
fileType:(NSString *)newFileType
outputSettings:(NSMutableDictionary *)outputSettings;
- to record new things each time. Each time it works. However, after about 20-30 minutes, I'll have a case where I get the error I wrote above - which occurs when Line 100 is called in
GPUImageMovieWriterin the init method noted above.
Any one have the same issue and/or know how to fix it or even have a workaround - would be much appreciated!
I had the exact same issue.
These are my steps to reproduce:
- Create a GPUImageMovieWriter
- Call startRecording
- Call finishRecording
- Repeat 1-3 about 120x
Around the 120th recording, in debug mode there's a crash and this is printed to the console:
Unable to create an OpenGL ES 2.0 context. The GPUImage framework requires OpenGL ES 2.0 support to work.
In release mode, there's not a crash but recordings start coming out black.
I created a pull request with a fix here:
https://github.com/BradLarson/GPUImage/pull/2549