GPUImageWriter intermittent failure

I am using GPUImage environment for video recording. However, while recording, I like to stop recording, start recording and repeat. My code looks like this:

-(void) startRecording {
NSLog(@"begin recording ");
dispatch_async(recordingQ, ^{
    @autoreleasepool {
        _assetURL = [self mediaURLAsVideo:YES];
        _movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:[self mediaURLAsVideo:YES] size:CGSizeMake(640, 480)];
        [_overlay addTarget:_movieWriter];
        [_movieWriter startRecording];
    }
});

      

}

-(void) stopRecording {
NSLog(@"stop recording");
dispatch_sync(recordingQ, ^{
    [_overlay removeTarget:_movieWriter];
    [_movieWriter finishRecording];
});
}

      

Sometimes I see this glitch:

*** Assertion failure in -[GPUImageMovieWriter createDataFBO], /Users/.../Pods/GPUImage/framework/Source/iOS/GPUImageMovieWriter.m:548

      

I'm not sure why this is the case, but any help would be appreciated.

There is also a second problem. Sometimes console logs

Couldn't write a frame
Couldn't write a frame
Couldn't write a frame
Couldn't write a frame

      

+3
gpuimage


source to share


No one has answered this question yet

Check out similar questions:

6
Mysterious app crash with OpenGL
6
__Copy_helper_block_ error in AVFoundation
3
Application error on GPUImageVideoCamera in glDrawArrays
2
GPUImage crashes in simulator, not much on device
2
GPUImage crash in iOS 8
1
GPUImageMovieWriter crashes from propertyWriterPixelBufferInput
1
GPUImage: framebuffer overload after memory warning
0
GPUImage simple code glitch on execution
0
GPUImage gpus_ReturnNotPermittedKillClient error using GPUImageFilter
0
Got a crash when using GPUImageFilter



All Articles
Loading...
X
Show
Funny
Dev
Pics