问题描述
我录制了带有蓝屏的视频.我们拥有将视频转换为透明背景的软件.播放叠加在自定义UIView上的视频的最佳方法是什么?每当我在iPhone上观看视频时,它始终会启动该播放器界面.有什么办法可以避免这种情况?
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?
推荐答案
除了我之外,是否还有其他人对此感兴趣,但是我正在使用GPUImage和Chromakey过滤器来实现这一目标^^ https://github.com/BradLarson/GPUImage
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
我所做的示例代码(可能已过时):
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];
}];
}
我可能不得不稍微修改GPUImage,它可能无法与最新版本的GPUImage一起使用,但这就是我们使用的
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
这篇关于iOS-如何透明播放视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!