Streaming video with transparent pixels using webrtc

╄→гoц情女王★ 提交于 2021-01-22 19:18:02

问题


I am trying to capture html5 canvas using captureStream API which has drawings on it and play it using html5 video tag.
Problem I am facing is, when I capture the stream and play it with in video tag It plays exactly same.
But when I send that stream to the another peer (webRTC Streaming Using Licode MCU) and play it there.

It gets played with the black background. i.e. video is not transparent anymore.
Has anyone encountered this before?

What could be the issue:

Is it the issue with the webrtc channel, may be its not able to handle transparent pixels?

OR

It can be something to do with the media server? Or something else?


回答1:


It sounds like you're sending your canvas as video data. WebRTC usually uses either VP8 or H264 to transmit video and neither support alpha channels. So if you want to sent it as a video, it is not possible to use transparency.

You could, however, send it using the data channel part of WebRTC. You'd have to serialize and deserialize it yourself, but since it's just transmitting bytes, you can keep your alpha channel.



来源:https://stackoverflow.com/questions/39763812/streaming-video-with-transparent-pixels-using-webrtc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!