Mix two videos with color key using GPUImage

I am trying to combine two videos using GPUImage. One of them (show.mov) contains a green background.
Here is show.mov and galaxy.mov .
I downloaded the latest version GPUImageand modified the example SimpleVideoFileFilter:

- (void)viewDidLoad
{
    [super viewDidLoad];

    _movie = [[GPUImageMovie alloc] initWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"galaxy" ofType:@"mov"]]];
    _greenMovie = [[GPUImageMovie alloc] initWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"snow" ofType:@"mov"]]];

    _movie.playAtActualSpeed = YES;
    _greenMovie.playAtActualSpeed = YES;

    _filter = [[GPUImageChromaKeyBlendFilter alloc] init];

    [_greenMovie addTarget:_filter];
    [_movie addTarget:_filter];

    GPUImageView *filterView = (GPUImageView *)self.view;
    [_filter addTarget:filterView];

    [_greenMovie startProcessing];
    [_movie startProcessing];
}

When I start the project (regardless of the device or simulator), I get only an empty white view and after 14 seconds (show.mov length) I see only the last frame of mixed videos. Using the script from the example, create a file on disk, but this file does not open.
I am using iPhone 5 with 7.0.3 and Xcode 5.0.2
Am I missing something?

+3
source share
1 answer

@BradLarson github issue, commit, .

GPUImageMovie.m startProcessing:

[inputAsset loadValuesAsynchronouslyForKeys:[NSArray arrayWithObject:@"tracks"] completionHandler: ^{
    //runSynchronouslyOnVideoProcessingQueue(^{
        NSError *error = nil;
        AVKeyValueStatus tracksStatus = [inputAsset statusOfValueForKey:@"tracks" error:&error];
        if (!tracksStatus == AVKeyValueStatusLoaded)
        {
            return;
        }
        blockSelf.asset = inputAsset;
        [blockSelf processAsset];
        blockSelf = nil;
    //});
}];
+1

All Articles