1

Is it possible to play a video with alpha channel in you iPhone app?

I'm thinking UIView with a subview (the movie view) and play a movie with alpha channel in that view..

Is this possible?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
user688291
  • 83
  • 3
  • 11

2 Answers2

3

Take a peek at the "APNG" app on the app store. This app is a free demo that shows how animations with an alpha channel can be implemented in an iOS app using the .apng file format. One can also take a peek at h.264 with an alpha channel for a detailed description about how a pair of h.264 videos can be used to implement a video with an alpha channel.

APNG app

MoDJ
  • 4,309
  • 2
  • 30
  • 65
  • Uh, that library costs $475. Is there something cheaper? – sztembi Feb 19 '14 at 21:18
  • U can use it for free if you release your source code under the GPL terms as defined in the license. The pay license is if you are creating a product that you intend to make money from and you do not want to free your software. Free software is not the same thing as free beer. – MoDJ Feb 20 '14 at 04:52
  • MoDJ's library needs a commercial license, has rather involved extra steps and has not that great performance (extracting 7z, extra video track, etc) Here is a solution using free open source library, works entirely on the GPU (great performance even with big videos) and requires only two things: - Transparent image (either PNG or in code) - Instead of a transparent, a green background for the video http://stackoverflow.com/questions/33244347/video-with-gpuimagechromakeyfilter-has-tint-when-played-in-transparent-gpuimagev/33255662 – Морт Oct 21 '15 at 09:38
  • A point by point comparison that shows actual results from a green screen vs alpha channel comparison is available. http://www.modejong.com/blog/post18_green_screen/ – MoDJ Dec 02 '15 at 23:34
2

It looks like there's no way to do this with iOS provided solutions. But according to this answer to a similar question you might succeed with ffmpeg. The problem with ffmpeg is that GPL/LGPL are incompatible with Apple's terms so you can't use it in an app for the App Store.

Community
  • 1
  • 1
DarkDust
  • 90,870
  • 19
  • 190
  • 224
  • ffmpeg has some murky legal issues that you would need to deal with before putting an app linked to ffmpeg into the app store. Be sure to do all the research into this issue before starting on an implementation. Stating "there's no way to do this with iOS" is not quite correct, one could simply provide an array of PNG images and that would work though it would take up far to much disk space to be a finished solution. – MoDJ Nov 25 '12 at 23:04