Open dwfangyang opened 8 years ago
I've came across similar problem, it was caused by multiple instances of video capture session. You should check out whether there are some memory leaks and multiple instances of capture session.
well, it seems like I use the output pixelbuffer at another thread which does not belong to the gpuimagecontextqueue, after I move the operation back to the gpuimagecontextqueue, everything is fine
I start a filter chain with a GPUImageTextureInput, and end the chain with a GPUImageRawDataOutput output, but occasionally on iPhone 5s,6,6P, the GPUImageRawDataOutput output wrong frame looks like the intermediate frame somewhere in the filter chain, and my code looks like this:
[GPUImageContext useImageProcessingContext]; GPUImageTextureInput input = [[GPUImageTextureInput alloc] initWithTexture:rgbTexture size:size]; GPUImageFilter beautyFilter = [GPUImageBeautyFilter new]; [input addTarget:beautyFilter]; GPUImageView view = [GPUImageView new]; [beautyFilter addTarget:view]; GPUImagePicture* pic =[ [GPUImagePicture alloc] initWithImage:[UIImage imageNamed:@"abc"]]; GPUImageTwoInputFilter* watermarkFilter = [GPUImageWaterMarkFilter new]; [filter addTarget:watermarkFilter atTextureLocation:0]; [pic addTarget:watermarkFilter atTextureLocation:1]; [pic processImage]; GPUImageRawDataOutput* rawDataOutput = [[GPUImageRawDataOutput alloc] initWithImageSize:size resultsInBGRAFormat:YES]; [watermarkFilter addTarget:rawDataOutput];
the pixelbuffer I get from the rawDataOuput's newFrameAvailableBlock is right, with the watermark picture within it ,but occasionally, the pixelbuffer is wrong with no watermark within it ,and makes it look like the output of the beautyFilter and I don't know why. Could you please tell me where is wrong?