Support transparent video with ExoPlayer
@marcbaechinger is already working on this.
Since May 23, 2024.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Use case description
Android is to my knowledge the only major operating system which in 2024 still does not support video playback of transparent (alpha) video. ExoPlayer is the main recommended video player of Android.
People have been requesting this feature in the following thread since 2020:
https://github.com/google/ExoPlayer/issues/7789
We have heard nothing formally from Google or Android about why this is not supported or if there will ever be support for it or when.
Google is the primary developer for VP8 and VP9 which it seeks to make standard codecs for broad usage. Both support transparent backgrounds. VP9 was released by Google in 2013. But yet 11 years later, Android cannot in any way natively play back transparent video using these codecs.
This does not seem logical. It would be hoped that someone at Google could fix ExoPlayer so we can utilize the very transparent video codecs Google has developed for us.
Proposed solution
Please allow the TextureView mode of ExoPlayer to playback transparent video (alpha video support, eg. VP8/VP9) such that a transparent region of the video will show the view underneath as would be expected.
Alternatives considered
The only existing workaround for the lack of transparency support was proposed here:
https://medium.com/go-electra/unlock-transparency-in-videos-on-android-5dc43776cc72
This individual:
- Created a custom video with a side by side view (rgb channel on one side, and alpha channel on other side in gray levels)
- Played this video using ExoPlayer
- Outputted ExoPlayer into a SurfaceTexture
- Used an OpenGL shader to merge the data of the SurfaceTexture to output rgb+a pixels
- Rendered the shader output on a TextureView
The amount of technical expertise and custom coding required to do all this is absurd considering again that Google's flagship video codecs VP8/VP9 already support transparency. No other operating system prohibits simple rendering of a transparent video.
Is it not at this point logical that ExoPlayer should support the basic VP8/VP9 transparency feature, like other operating systems do equivalently?
Thanks for any help.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.