Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPad Video with Transparency

is it possible to have a QuickTime video with alpha layer (transparency) play on top of a static dynamic background UIView (i.e. a view that changes occasionally) on the iPad?

Thanks!

like image 972
ChrisB Avatar asked Sep 07 '10 16:09

ChrisB


People also ask

Can you have transparency in a video?

The reason why many people fail to export videos with a transparent background is that most video formats and codecs don't support transparency. If you want to avoid the common export mistake, you should remember: transparency only works with the MOV (PNG lossless codec) and GIFs.

Is there a video format that supports transparency?

The file types that currently support an Alpha (transparency) channel are FLV, F4V, AVI, Quicktime, and WebM. If you're using free programs, you may find they can export in these formats. Often, there will be a named codec for an Alpha channel within the settings of these, or a PNG option.

Can MP4 video have transparency?

MP4 in it's current variation and format cannot have transparency at all. Exporting your files into this format will be completely flattened.


2 Answers

Just to clear up the misinformation, you can't use a video with an alpha channel using the built in video logic in iOS. You can create a Quicktime movie encoded with the Animation codec and load the video into a view or layer using AVAnimator. What you can't do is create a H264 video with an alpha channel, that is simply is not supported by iOS.

display movies with an alpha channel under iOS

like image 114
MoDJ Avatar answered Sep 24 '22 04:09

MoDJ


MPMoviePlayerController has a backgroundView property. The docs state:

This view provides the backing content, on top of which the movie content is displayed. You can add subviews to the background view if you want to display custom background content.

I haven't tried it, but if the video content itself has alpha, it sounds like this view should show up. If you set that view to clear, it may just work...

like image 32
kcharwood Avatar answered Sep 24 '22 04:09

kcharwood