GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

Screen flickers while changing GPUImageMovie filters

Open vadimf opened this issue 13 years ago • 9 comments

I blend a GPUImageMovie and videoCamera input using GPUImageAddBlendFilter After several times changing the filters, the screen starts flickering hard.

Any idea why / how to fix it?

This is the code that changes the filters:

if (currentFilter) { [currentFilter stopRecording]; [_camera removeAllTargets]; [currentFilter removeAllTargets];

        if (_filterBlendingMovie){
            _filterBlendingMovie.delegate = nil;
            [_filterBlendingMovie cancelProcessing];
            [_filterBlendingMovie removeAllTargets];

            _filterBlendingMovie = nil;
        }
        currentFilter = nil;
    }

    if (newFilter.filterInfo.isVideoFilter){
         currentFilter = newFilter;

        _filterBlendingMovie = [[GPUImageMovie alloc] initWithURL:[[NSBundle mainBundle] URLForResource:filterInfo.movieFileName withExtension:@"mov"]];

        _filterBlendingMovie.playAtActualSpeed = YES;
        _filterBlendingMovie.delegate = self;

        //camera ->                gpuImageView
        //              filter ->
        //movie ->                  movieWriter
        [videoCamera addTarget: currentFilter.gpuFilter ];
        [_filterBlendingMovie addTarget:currentFilter.gpuFilter];
        [currentFilter.gpuFilter addTarget:gpuImageView];
        [currentFilter.gpuFilter addTarget:movieWriter];

        gpuImageView.fillMode = kGPUImageFillModePreserveAspectRatioAndFill;
        [currentFilter.gpuFilter prepareForImageCapture];
        [_filterBlendingMovie startProcessing];
    }

vadimf avatar Jun 02 '13 09:06 vadimf

Hi Brad.

It seems that I nailed this flickering - there are some synchronization issues within GPUImageMovie. I'll test the fix throughly and will submit a pull request in following days.

Thanks for the framework!

vadimf avatar Jun 02 '13 15:06 vadimf

Vadimf, if you find a fix for correctly switching filters on GPUImageMovie, could you kindly let me know?

jNoxx avatar Jun 03 '13 14:06 jNoxx

Sure. where can I send you the files? The code is a bit ugly now, but works.

vadimf avatar Jun 03 '13 15:06 vadimf

my email -> [email protected] Ive been experiencing bug's in it to, but it's above my skillset to actually fix it. Thanks.

jNoxx avatar Jun 03 '13 15:06 jNoxx

Or you can add me on skype if needed. I'm always interested to hear more about your fix.

jNoxx avatar Jun 03 '13 15:06 jNoxx

Hey is this resolved?

mikerz avatar Jun 21 '13 14:06 mikerz

@jNoxx @vadimf Please send me your solution. [email protected]

Best regards

balabs avatar Sep 13 '13 08:09 balabs

Hi All,

Did anyone ever find a solution to this?

ghost avatar Feb 25 '15 08:02 ghost

@vadimf @jNoxx can you Please let me know how you solved the issue ? or please share to [email protected].

codedreamer46 avatar Feb 25 '17 06:02 codedreamer46