我想在视频文件上叠加图像,它正在工作,但图像在视频上被破坏。
叠加图像:
虽然我在处理视频后得到视频如下:
我的代码如下:
CGSize videoSize = [clipVideoTrack naturalSize];
UIImage *myImage = [UIImage imageNamed:@"f1.png"];
CALayer *aLayer = [CALayer layer];
aLayer.contents = (id)myImage.CGImage;
aLayer.frame = CGRectMake(0, 0, videoSize.width,videoSize.height);
aLayer.opacity = 1;
CALayer *parentLayer = [CALayer layer];
CALayer *videoLayer = [CALayer layer];
parentLayer.frame = CGRectMake(0, 0, videoSize.width,videoSize.height);
videoLayer.frame = CGRectMake(0, 0, videoSize.width,videoSize.height);
[parentLayer addSublayer:videoLayer];
[parentLayer addSublayer:aLayer];
请帮我解决这个问题,这样我就可以在视频上叠加正确的图像。
谢谢