opened
SunLz
username_0
self.gpuImageView = [[GPUImageView alloc] initWithFrame:self.frame];
    [self addSubview:self.gpuImageView];
    
    self.movieMaskWithTopFilter = [[GPUImageScreenBlendFilter alloc] init];
    self.imageWithMovieMaskFilter = [[GPUImageColorBurnBlendFilter alloc] init];
    
    self.imagePicture = [[GPUImagePicture alloc] initWithImage:[self.images objectAtIndex:0]];
    self.currentIndex = 1;

    
    self.movieMaskItem = [[AVPlayerItem alloc]initWithURL:movieMaskUrl];
    self.movieMaskPlayer = [AVPlayer playerWithPlayerItem:self.movieMaskItem];
    self.movieMaskPlayer.rate = 1.0f;
    self.movieMaskFile = [[GPUImageMovie alloc] initWithPlayerItem:self.movieMaskItem];
    self.movieMaskFile.runBenchmark = YES;
    self.movieMaskFile.playAtActualSpeed = YES;
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerMovieMaskItemDidReachEnd:) name:AVPlayerItemDidPlayToEndTimeNotification object:self.movieMaskItem];
    
    self.movieItem = [[AVPlayerItem alloc] initWithURL:movieUrl];
    self.moviePlayer = [AVPlayer playerWithPlayerItem:self.movieItem];
    self.moviePlayer.rate = 1.0f;
    self.movieFile = [[GPUImageMovie alloc] initWithPlayerItem:self.movieItem];
    self.movieFile.runBenchmark = YES;
    self.movieFile.playAtActualSpeed = YES;
    self.movieFile.delegate = self;
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerMovieItemDidReachEnd:) name:AVPlayerItemDidPlayToEndTimeNotification object:self.movieItem];
    
    self.imagePicture2 = [[GPUImagePicture alloc] initWithImage:[self.images objectAtIndex:(self.currentIndex)]];
    self.alphaBlendFilter = [[GPUImageAlphaBlendFilter alloc] init];
    self.alphaBlendFilter.mix = 0.5f;

[self.imagePicture addTarget:self.alphaBlendFilter];
    [self.imagePicture2 addTarget:self.alphaBlendFilter];
    [self.alphaBlendFilter addTarget:self.imageWithMovieMaskFilter];
    [self.movieMaskFile addTarget:self.imageWithMovieMaskFilter];
    [self.imageWithMovieMaskFilter addTarget:self.movieMaskWithTopFilter];
    [self.movieFile addTarget:self.movieMaskWithTopFilter];
    [self.movieMaskWithTopFilter addTarget:self.gpuImageView];

[self.imagePicture processImage];
        [self.imagePicture2 processImage];
        [self.movieFile startProcessing];
        [self.moviePlayer play];
        
        [self.movieMaskFile startProcessing];
        [self.movieMaskPlayer play];

This is my code,but when I run it ,the code still get a crash:
*** Assertion failure in -[GPUImageFramebuffer unlock], /Users/sunzliu/Documents/code/iPhoneQQMusic/QQMusic/Librarys/GPUImage/framework/Source/GPUImageFramebuffer.m:301
2015-04-04 15:34:09.650 QQMusic[1184:303218] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Tried to overrelease a framebuffer, did you forget to call -useNextFrameForImageCapture before using -imageFromCurrentFramebuffer?'
*** First throw call stack:
(0x1822e6530 0x1932bc0e4 0x1822e63f0 0x183191c34 0x10126af60 0x1012534e0 0x10125cd7c 0x1012531c8 0x10124e414 0x101250ad4 0x1012698c0 0x10124e414 0x101250ad4 0x1012698c0 0x1012667a0 0x101264ea0 0x102f20f94 0x102f2b08c 0x10125cd8c 0x101264e1c 0x102e64a9c 0x186495094 0x186494f2c 0x18347d510 0x1822898dc 0x18229e548 0x18229e4a8 0x18229c428 0x1821c91f4 0x18b5eb6fc 0x186b5a10c 0x1005996a0 0x19393aa08)
libc++abi.dylib: terminating with uncaught exception of type NSException

Can anyone tell why and how to solve it?
Why can not mix two GPUImagePicture with GPUImageMovie
issue
closed
BradLarson
username_1
issue
created
BradLarson
username_1
Please don't spam issues: #1951
comment