8

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.

Community
  • 1
  • 1
dodortus
  • 171
  • 2
  • 7

1 Answers1

5

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)

jesup
  • 6,765
  • 27
  • 32
  • just a few doubts, user would be prompted again for a new stream? also does firefox honor the getUserMedia constrains that we set? bec as far as I know, firefox( unlike chrome) doesn't bother with the constraints we set, also one work around for OP's issue is, like you said renegotiation with modified sdp while using the same stream, assuming that the aim is to reduce the bandwidth used. – mido May 08 '15 at 06:50
  • If you already have permanent permission from the user (allow always) there's no re-prompt. – jesup May 08 '15 at 10:51
  • 3
    Firefox does honor getUserMedia constraints, and in fact the problem you have is most likely that we use constraints that are much closer to the spec; Chrome's are current based on a much older proposed design, not what was finally agreed on. We also expect to work on changing the characteristics of a gUM stream soon, and RTPSender parameters to force scaling (we have RTPSender already, so this is pretty easy) – jesup May 08 '15 at 10:58
  • Looking forward to that :) – mido May 08 '15 at 11:17