GPUImage
GPUImage copied to clipboard
The current version, the video processing error at the beginning .
In the current version, an error will occur. In August, but the downloaded version did not have this problem. What problem?
The link below is a problem SimpleVideoFileFilter project file. http://www.ifacies.com/test/SimpleVideoFileFilter.zip
Error message : 2013-10-24 03:46:44.264 SimpleVideoFileFilter[8738:60b] Application windows are expected to have a root view controller at the end of application launch 2013-10-24 03:46:44.426 SimpleVideoFileFilter[8738:1603] *** Assertion failure in -[GPUImageMovieWriter createDataFBO], /Users/jasu/Dropbox/iPhoneDevelop/DEVELOP_PROJECT/GlassMov_PROJECT/framework/GPUImage-master22/framework/Source/iOS/GPUImageMovieWriter.m:548 2013-10-24 03:46:44.446 SimpleVideoFileFilter[8738:1603] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Incomplete filter FBO: 36055' *** First throw call stack: (0x30fdde8b 0x3b2d86c7 0x30fddd5d 0x3198623f 0x31aff 0x31dd7 0x31ec9 0x3236d 0xfcd7 0x11ebf 0x2725b 0x26a13 0x26761 0x3b7c18fb 0x1ca8b 0x265e3 0x25aaf 0x3103b 0x2fe26a1f 0x3b7bd103 0x3b7c1e77 0x3b7bef9b 0x3b7c2751 0x3b7c29d1 0x3b8ecdff 0x3b8eccc4) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
I'm getting this too, in Xcode 5.0.1 and iOS 7. It seems to be crashing in GPUImageMovieWriter.m:548
NSAssert(status == GL_FRAMEBUFFER_COMPLETE, @"Incomplete filter FBO: %d", status);
WRT: Application windows are expected to have a root view controller at the end of application launch
In AppDelegate.m
//[self.window addSubview:rootViewController.view]; [self.window setRootViewController:rootViewController];
HTH, -D
Any update on this.. i am also facing the same with xcode5 and ios7. i am running the app on actual device and get this error at tis line : NSAssert(status == GL_FRAMEBUFFER_COMPLETE, @"Incomplete filter FBO: %d", status); *** Assertion failure in -[GPUImageMovieWriter createDataFBO], /Volumes/DEVELOP_PROJECT/Libs/GPUImage-master/framework/Source/iOS/GPUImageMovieWriter.m:548 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Incomplete filter FBO: 36055'
Please help me solve the issue or inform me of any workaround. Will really appreciate it.
Azeem
As per my investigation issue occurs when thr is no audio or audio channel in the video.
That's probably it - I only experience crashes on videos without sound.
Crash on videos without sound! fixed:
AVAsset *anAsset = [AVAsset assetWithURL:_dictInfo[UIImagePickerControllerMediaURL]]; AVAssetTrack *assetTrack = [[anAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]; _movieFile = [[GPUImageMovie alloc] initWithAsset:anAsset]; _movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:_URLInputVideoFile size:assetTrack.naturalSize];
if ([[anAsset tracksWithMediaType:AVMediaTypeAudio] count] > 0){
_movieFile.audioEncodingTarget = _movieWriter;
} else {//no audio
_movieFile.audioEncodingTarget = nil;
}
It works for me!
Doesn't work for me, unfortunately. Doing this, I get a crash if the video HAS audio as well.
The audioEncodingTarget property of my GPUImageMovie is already nil, btw.
Has anyone else managed to solve this bug using dovtuan's solution?
Any update on this? I use Crashlytics and this is one of the most consistent issues that I see. A user mentioned that a crash occurs when using the Cartoon filter but when I test all seems to be fine.
This is what Crashlytics is showing:
Incomplete filter FBO: 36055
__exceptionPreprocess + 130 objc_exception_throw + 38 +[NSException raise:format:] -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 90 ----> -[GPUImageMovieWriter createDataFBO] -[GPUImageMovieWriter setFilterFBO] -[GPUImageMovieWriter renderAtInternalSize] -[GPUImageMovieWriter newFrameReadyAtTime:atIndex:]
Is this down to a video having no audio then?
Same issue happening here
I experienced the same with video with no audio. and solved it with dovtuan's solution
This works great for me
if ([[anAsset tracksWithMediaType:AVMediaTypeAudio] count] > 0){ _movieFile.audioEncodingTarget = _movieWriter; } else {//no audio _movieFile.audioEncodingTarget = nil; }
I'm suffering from this problem too . I use the latest library to filter a video file , and i got
*** Assertion failure in -[GPUImageMovieWriter createDataFBO] on GPUImageMovieWriter.m:571
it was randomly given , once it occured , it will occur again even though i kill the process . I think there is something wrong with the FrameBuffer cache .
@techchee got the right point
or similiar
NSError *audioLoadError; AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:self.tempMoviePath] error:&audioLoadError];
Got this issue fixed with @dovtuan solution .
code example: importedMovieWriter.shouldPassthroughAudio = YES; importedMovie.audioEncodingTarget = [videoAsset hasAudioTrack] ? importedMovieWriter : nil; [importedMovie enableSynchronizedEncodingUsingMovieWriter:importedMovieWriter];
[importedMovieWriter startRecording]; [importedMovie startProcessing];
BTW: I extended AVAsset and added some utility methods like "hasAudioTrack" , but you can do that the old way.
This is still an issue. If i disable audio, it works fine, but that isn't an option.
@kylebrowning did you find a fix for this?
Nope
@kylebrowning I just fixed it by using the master branch of the repo. I was using a branch of mine to fix black frames at the beginning of the video...
Great @dovtuan
Also encountered the same problem,
// this line add solve your problm _movieFile.audioEncodingTarget = nil; importedMovieWriter.shouldPassthroughAudio = YES
I have the same issues, but _movieFile.audioEncodingTarget = nil;
do not fix my isuss because in my case AudioTrack.count > 0
.
And i found the reason is :
-
[assetWriterAudioInput markAsFinish]
had call before[GPUImageMovieWriter createDataFBO]
, so lead to assetWriter.status == failing,[assetWriterPixelBufferInput pixelBufferPool]
return NULL,And renderTarget create failed. so we just ensure[GPUImageMovieWriter createDataFBO]
call after[assetWriterAudioInput markAsFinish]
this bug will be fix. In my case, i inherit GPUImageMoveiWriter and rewriteenableSynchronizationCallbacks
method:
#import "GCImageMovieWriter.h"
#import <GPUImage/GPUImage.h>
@implementation GCImageMovieWriter {
BOOL videoBeganEncoding, videoEncodingIsFinished, audioEncodingIsFinished;
dispatch_queue_t audioQueue, videoQueue;
}
@synthesize videoInputReadyCallback;
@synthesize audioInputReadyCallback;
@synthesize paused = _paused;
- (void)enableSynchronizationCallbacks {
///!!!: 修复音频轨没有数据的bug
// https://github.com/BradLarson/GPUImage/issues/1276
videoBeganEncoding = NO;
if (videoInputReadyCallback != NULL)
{
if( assetWriter.status != AVAssetWriterStatusWriting )
{
[assetWriter startWriting];
}
videoQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.videoReadingQueue", NULL);
[assetWriterVideoInput requestMediaDataWhenReadyOnQueue:videoQueue usingBlock:^{
if( _paused )
{
//NSLog(@"video requestMediaDataWhenReadyOnQueue paused");
// if we don't sleep, we'll get called back almost immediately, chewing up CPU
usleep(10000);
return;
}
//NSLog(@"video requestMediaDataWhenReadyOnQueue begin");
while( assetWriterVideoInput.readyForMoreMediaData && ! _paused )
{
BOOL hasVideoEncoding = videoInputReadyCallback();
if (hasVideoEncoding) {
videoBeganEncoding = YES;
}
if( videoInputReadyCallback && ! hasVideoEncoding && ! videoEncodingIsFinished )
{
runAsynchronouslyOnContextQueue(_movieWriterContext, ^{
if( assetWriter.status == AVAssetWriterStatusWriting && ! videoEncodingIsFinished )
{
videoEncodingIsFinished = YES;
[assetWriterVideoInput markAsFinished];
}
});
}
}
//NSLog(@"video requestMediaDataWhenReadyOnQueue end");
}];
}
if (audioInputReadyCallback != NULL)
{
audioQueue = dispatch_queue_create("com.sunsetlakesoftware.GPUImage.audioReadingQueue", NULL);
[assetWriterAudioInput requestMediaDataWhenReadyOnQueue:audioQueue usingBlock:^{
if( _paused )
{
//NSLog(@"audio requestMediaDataWhenReadyOnQueue paused");
// if we don't sleep, we'll get called back almost immediately, chewing up CPU
usleep(10000);
return;
}
//NSLog(@"audio requestMediaDataWhenReadyOnQueue begin");
while( assetWriterAudioInput.readyForMoreMediaData && ! _paused )
{
if( audioInputReadyCallback && ! audioInputReadyCallback() && ! audioEncodingIsFinished )
{
runAsynchronouslyOnContextQueue(_movieWriterContext, ^{
if( assetWriter.status == AVAssetWriterStatusWriting && ! audioEncodingIsFinished && videoBeganEncoding )
{
audioEncodingIsFinished = YES;
[assetWriterAudioInput markAsFinished];
}
});
}
}
//NSLog(@"audio requestMediaDataWhenReadyOnQueue end");
}];
}
}
@end
blog: https://hql-yunyunyun.github.io/GPUImage-Incomplete-filter-FBO-36055-bug修复记录/