androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.69k stars 406 forks source link

Support transparent video with ExoPlayer #1388

Open jonmdev opened 5 months ago

jonmdev commented 5 months ago

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:

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.

marcbaechinger commented 5 months ago

Thanks for your report!

Android cannot in any way natively play back transparent video using these codecs

You are correct that playing media efficiently with ExoPlayer requires codec support from the operating system it runs on.

I'm not sure if this issue tracker is the right place to track framework codec feature development, but I keep this issue open for visibility. We as the Media3 team can't really help you with this expect by raising awareness for the issue. I actually think this is a known issue and I'm not involved into codec development and the reasoning behind this or that roadmap. However, I'll make sure the codec team is aware of this issue even though I think this is already the case.

marcbaechinger commented 5 months ago

Internal bug ref: 190802665