Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support transparent video with ExoPlayer #1388

Open
jonmdev opened this issue May 22, 2024 · 2 comments
Open

Support transparent video with ExoPlayer #1388

jonmdev opened this issue May 22, 2024 · 2 comments
Assignees

Comments

@jonmdev
Copy link

jonmdev commented May 22, 2024

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:

google/ExoPlayer#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.

@marcbaechinger marcbaechinger self-assigned this May 23, 2024
@marcbaechinger marcbaechinger changed the title In 2024, Android/ExoPlayer still does not support transparent (alpha) video? Even though Google created VP8/VP9 which support transparency? Any help or solution? Support transparent video with ExoPlayer May 23, 2024
@marcbaechinger
Copy link
Contributor

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
Copy link
Contributor

Internal bug ref: 190802665

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants