w3c / webrtc-pc

WebRTC 1.0 API
https://w3c.github.io/webrtc-pc/
Other
439 stars 115 forks source link

support for alpha channel when transferring canvas. #2920

Open jimmywarting opened 10 months ago

jimmywarting commented 10 months ago

RTCPeerConnection does not seem to support the alpha channel. is there any trick into choosing a encoder / codec that supports alpha channel also?

the video i'm capturing is coming from a canvas.captureStream() and it dose not have a background. and the receiver instead sees a solid black background.

it's evident on demos such as:

it's unfortunately that we have to resort to solutions such as: https://github.com/webrtcHacks/transparent-virtual-background

there should be a way with webrtc to transfer video with alpha channels

fippo commented 10 months ago

Support for alpha channel (or lack thereof) is a long standing issue (as you found out in the samples repository)

https://bugs.chromium.org/p/chromium/issues/detail?id=1395218 is the most recent incarnation in Chrome, maybe @rosetta-jpn knows whether it is supposed to work.

rosetta-jpn commented 10 months ago

@jimmywarting Could you file an issue in Chromium (https://crbug.com) ccing folks in the above metioned issue tracker? This is not what I can make a decision on my own. We have been alive in the manner of dropping alpha channel in RTCPeerConnection for a long time for the sake of better performance. Changing it needs the disucission.

Thanks!

rosetta-jpn commented 10 months ago

By the way, does the Firefox work in the same manner?

jimmywarting commented 10 months ago

By the way, does the Firefox work in the same manner?

Firefox and safari both also display black backgrounds