screen-share / element-capture

https://screen-share.github.io/element-capture/
19 stars 6 forks source link

please consider adding support for transparency #54

Open pikilipita opened 2 weeks ago

pikilipita commented 2 weeks ago

Thank you for developing the Element Capture API,

I can read on the documentation ( https://developer.chrome.com/docs/web-platform/element-capture ) that transparency is not supported.

Do you have plans to make add an alpha channel the capture? Or is there a workaround?

My use case is the following: capture html widgets ( ex weather widget ) and use them as webgl textures. But most html widget do use graphics with transparency

markafoltz commented 2 weeks ago

In Chrome, there currently isn't a way I know of to force the capture media stream to produce video frames that preserve alpha channel information (i.e. RGBA pixel format). Once there is a way to do that through a Web API, this technically is possible as we do support RGBA capture. Note that other browsers' capture implementations may behave differently.

So there are two things that are needed:

  1. Web API work, but not in this spec. Either in getDisplayMedia() through constraints, or MediaStreamTransform for applications to indicate the preferred pixel format for the frame data?
  2. Implementation work in Chrome to support what was decided.
pikilipita commented 2 weeks ago

Thank you for your reply, let's hope things will evolve on that topic