-
Notifications
You must be signed in to change notification settings - Fork 6k
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 for transparent video #7789
Comments
I think for this to work you'll need to use a decoder that supports alpha channel, plus a texture view. I am not sure whether any of the platform decoders supports alpha channel though, but it's possible to know this through CodecCapabilities: https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities#colorFormats. If you cannot find a video codecs with the desired color format, you can bundle your own software decoder in your app. ExoPlayer already supports VP9 and AV1 and the ffmpeg video extension is in progress. With a texture view and a alpha-channel-supporting decoder, this should work. Note however, that this is not something we'll be able to include in our roadmap to support out of the box any time soon, soo you'll need to do some research on your own. @andrewlewis do you have any input on this? |
Aside, a sample video would be welcome. It will help whoever tries to explore this line of work. |
To add to @AquilesCanta's suggestion about decoding via extensions, #2509 discusses rendering videos with an alpha channel using the vp9 extension. I think it's still the case that Android platform decoders don't support this. |
+1 for chromakey support please |
See http://test.bsl.nrw/obv-client-demo/boy-test.html The webpage uses the seriously.js JavaScript library from https://github.com/brianchirls/Seriously.js/ which in turn uses WebGL. The code is distributed under the MIT Open Source license. The chromakey implementation is at https://github.com/brianchirls/Seriously.js/blob/master/effects/seriously.chroma.js Both videos are Copyright 3rd parties. The URL for the video is http://test.bsl.nrw/videos/signer.mp4 |
@jam-le Hi~ I encountered the same problem as you, have you solved it now? In other words, is there a solution? |
No solution yet. This issue is assigned to @andrewlewis. |
Here is a video with transparency to use as a sample. https://static.videezy.com/system/resources/previews/000/048/733/original/200515-AlphaBluePlanet.mp4 |
That alphaBluePlanet.mp4 video does not seem to have transparency (tested on iOS). This sample provided by Apple however does include a properly encoded video with alpha: https://developer.apple.com/documentation/avfoundation/media_playback_and_selection/using_hevc_video_with_alpha , included in the download is the file |
@mirswith thanks! Now I just need to find an android player that can play it. |
Is the issue with ExoPlayer or the MediaCodec used for HEVC on android? I'm also trying to get alpha working with ExoPlayer but so far no luck. |
I have no idea. Video codecs, formats, encoding, etc all go over my head. It's not my forte. I was hoping that there would be something by now that would support it though. @andrewlewis any chance there's some low hanging fruit around this to get this working with exoplayer? Thanks to @mirswith we do have a video sample that is confirmed to have alpha support. |
I would love to be wrong about this but it appears this is an issue with I have not tested this as it does not meet my needs but looking at the ExoPlayer Again, I'd love to be wrong about this so if anyone else has some better news please set me straight! :) |
Just to check we are seeing the same thing, I tried playing the stream with alpha on a Pixel 4a and saw jagged green edges around the edges of the puppets, and a log line Using a bundled video decoder and |
It seems that on an iOS device there are still green pixels on the boundary but the background UI does show through the video beyond them (thanks to @claincly for testing this out). |
@andrewlewis ah. So you were able to see this on iOS with the background UI showing, but on Android you just got a solid color? I'm assuming your comment still holds true then (An FfmpegVideoRenderer could work though)? All in all, it seems like there's no "easy" way to get this to work so I will have to get back to my design team and tell them this is currently possible on iOS but not Android. Thank you all for helping. |
Right, I wasn't able to get the background UI to show through the
In principle it should be possible to make this work with extension renderers that don't rely on the platform |
Is it currently possible to properly play vp8/vp9 video that have transparency with libvpx extension? I've try it but did not work and wondering if the problem lies on my implementation or it just currently not possible. |
Hey, I was trying to use a WebM file with transparent background in my app but instead of the background being transparent it's grey, is there no Android support for it? |
Unfortunately no, it does not yet support it. (tested with 2.14.0 and later release notes do not mention it). |
Any updates guys? |
We want this feature ) |
I am very frustrated to learn that Android (which has its brand in a F1 car) does not support transparent video playback. Why isn't this a relevant feature for the OS? |
This comment was marked as spam.
This comment was marked as spam.
any update on this? |
Any update ??? |
we want this feature too! is there any update? |
@andrewlewis any update on this? |
If this helps: #10957 (comment) |
I've pinged the internal bug again [Internal: b/190802665], but I'm afraid there aren't any substantive updates. To give an idea about why it's taking a long time:
For now I'm trying to raise the importance of this feature with SoC vendors when we discuss the video editing use case, which we want to support better. |
This is needed to support showing/hiding the sign language video track, to make content accessible to deaf audiences. |
please support this feature |
This should absolutely be possible using VP8/VP9 webm files. It is not a hardware issue. It is a software issue for the player to read the encoded alpha and/or have it render to a texture of some kind that is then displayed with the encoded alpha. I am attempting to use this now as part of MAUI as ExoPlayer is the MediaElement native element in that system now. I very much need transparency. Any ideas or solutions? |
This is kind of absurd in terms of how many hoops to jump through but this guy made a workaround for transparent video with ExoPlayer: https://medium.com/go-electra/unlock-transparency-in-videos-on-android-5dc43776cc72 The main point is we must have a way to output the ExoPlayer output to a TextureView as that will then allow a transparent background. If ExoPlayer could be fixed to output in this manner with transparent pixels into a TextureView it would be much easier. |
Crazy that exoplayer is not supporting alpha in channel in 2k23 |
+1 for this feature. It's already supported on iOS. We want the ExoPlayer to playback videos with alpha channel. This will allow us to improve the UI for more tailored experience and to leverage videos more for great UX. Here are 2 sample videos with alpha channel (transparent). Note that mp4 requires: Can you please consider this feature request? Let us know if help is needed |
+1 Would also really love this feature! Thank you in advance to whoever can make this a reality 🙏 |
+1 |
Shocked that Android is still not able to play videos with transparency, especially with WebP being a google thing too. Hope it gets added soon. |
+1 |
Our team needs this as well. |
+1 |
6 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
oh, come on, we really need this. |
When filing a feature request:
Fill out the sections below, leaving the headers but replacing the content. If
you're unable to provide certain information, please explain why in the relevant
section. We may close issues if they do not include sufficient information.
Playing Transparent Videos (with the transparency intact)
iPhones allow videos with transparent backgrounds to play. I would like ExoPlayer (on Android devices) to support videos which have an alpha channel. Currently, it is impossible to play high quality transparent videos that retain their transparent properties (i.e. their alpha channel properties).
Proposed solution
None, unfortunately.
Alternatives considered
Chromakey is one alternative solution, but tends to create grainy resolution around edges where transparency meets solids, along with other subtle issues.
The text was updated successfully, but these errors were encountered: