What player can be used to play transparent video

2019-01-15 23:23发布

I have a video, which is transparent in some portion. When I try to play this video using AVPlayer or MPMoviePlayer, It is not getting played.

Can anyone suggest what player can be used to play a video which has transparent background.

Thanks Suresh S

3条回答
▲ chillily
2楼-- · 2019-01-15 23:34

You have run into a limitation with the video support provided by Apple under iOS. Specifically, there is no builtin support for video that contains an alpha channel. It is possible to work around this limitation, as shown in this blog post h-264-video-with-an-alpha-channel. If you are not concerned about download size of your app, then you could encode video frames as a series of PNG images. But, be aware that app download size can grow quickly with a series of PNG images. Using h.264 encoded video is a lot more complex but it means that your app download size will be a lot smaller.

查看更多
霸刀☆藐视天下
3楼-- · 2019-01-15 23:41

Use AVAnimator - http://www.modejong.com/AVAnimator/

It requires you to transcode it to APNG or their proprietary format, but it works well.

查看更多
淡お忘
4楼-- · 2019-01-15 23:57

Suresh

You can try AVPlayerLayer. If you are new to Core Animation you can read a programming guide.

Good luck with your project!

查看更多
登录 后发表回答