Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change dynamic video resolution during a call (in WebRTC)

I have been using SimpleWebRTC lib for my project.

  1. How to change dynamic remote video resolution during a call (like google hangout when resizing browser)
  2. hangout browser resizing will change remote video resolution size (.videoWidth .videoHeight)
  3. Is this associated with webrtc plan b?

I would like to know how it is implemented for many peer connection.

like image 449
dodortus Avatar asked May 07 '15 10:05

dodortus


1 Answers

Tell the sending end (say via DataChannels) to change resolution to NxM. At the sending end, until the new APIs are available to change a getUserMedia/MediaStream capture size on the fly, you can request a second camera/mic stream and replace the existing streams with them. (Note: this will cause onnegotiationneeded i.e. renegotiation, and the far side would see a new output stream.)

Smoother (but only in Firefox thus far -- in the standardization process) would be to use RTPSender.replaceTrack() to change the video track without touching audio or renegotiating.

Another option that will exist (though doesn't yet in either browser) is to use RTPSender.width/height (or whatever syntax gets agreed) to scale outgoing video before encoding.

Plan B for multistream/BUNDLE (which Chrome implements) was not adopted; Firefox has now (in Fx38 which goes out in a few days) implemented the Unified Plan; expect to see a blog post soon from someone on how to force the two to work together (until Chrome gets to implementing Unified Plan)

like image 174
jesup Avatar answered Jan 02 '23 19:01

jesup