GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

iOS 10.1.1 - GPUImageContext fails to create OpenGL ES 2.0 Context

Open ar9jun opened this issue 10 years ago • 1 comments

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 GPUImageMovieWriter in 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!

ar9jun avatar Nov 22 '16 22:11 ar9jun

I had the exact same issue.

These are my steps to reproduce:

  1. Create a GPUImageMovieWriter
  2. Call startRecording
  3. Call finishRecording
  4. 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

charmingtoad avatar Dec 20 '17 23:12 charmingtoad