Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I recorded a video with a bluescreen. We have the software to convert that video to a transparent background. What's the best way to play this video overlaid on a custom UIView? Anytime I've seen videos on the iPhone it always launches that player interface. Any way to avoid this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
308 views
Welcome To Ask or Share your Answers For Others

1 Answer

Don't know if anyone is still interested in this besides me, but I'm using GPUImage and the Chromakey filter to achieve this^^ https://github.com/BradLarson/GPUImage

EDIT: example code of what I did (may be dated now):

-(void)AnimationGo:(GPUImageView*)view {
    NSURL *url = [[NSBundle mainBundle] URLForResource:@"test" withExtension:@"mov"];

    movieFile = [[GPUImageMovie alloc] initWithURL:url];
    filter = [[GPUImageChromaKeyBlendFilter alloc] init];

    [movieFile addTarget:filter];

    GPUImageView* imageView = (GPUImageView*)view;
    [imageView setBackgroundColorRed:0.0 green:0.0 blue:0.0 alpha:0.0];
    imageView.layer.opaque = NO;
    [filter addTarget:imageView];

    [movieFile startProcessing];

    //to loop
    [imageView setCompletionBlock:^{
        [movieFile removeAllTargets];
        [self AnimationGo:view];
    }];
}

I may have had to modify GPUImage a bit, and it may not work with the latest version of GPUImage but that's what we used


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...