Newbie question about WebRTC (muting audio/video)

1,865 views
Skip to first unread message

Enrique Arizon Benito

unread,
May 2, 2013, 12:13:57 PM5/2/13
to discuss...@googlegroups.com
Hello,

After following this link (http://blog.gingertech.net/2012/06/04/video-conferencing-in-html5-webrtc-via-web-sockets/) about using websocket as signaling channel I succeded to make my first peer to peer app. (for anyone curious, the websocket server side is a twisted-python server that "forward" requests to/from an XMPP server -gtalk for testing-)


Now I would like the user to be able to switch on/off audio/video, both from its local camera/mic and from remote streams. I googled around but I don't have a clear idea about what's the best way to do it.
- Must I renegotiate with the other peer?
- It's it just enough to switch off "something" locally (for example removing a track)?
- Anything  else?

Using Firefox on slow computers is problematic since video and audio progresively desyncrhonize (looks there is no support for frame-dropping in case of high cpu-ussage).
I wonder whether it's possible using the WebRTC API to change the streaming quality from our local webcam programatically?

In my particular scenario there is a local server close to the client that can get in charge of video compresion, so I wonder whether there is/will be/is planned to let WebRTC send raw video to such server and let this last one make the hard encoding work (let's imagine the client is a old mobile phone with no hardware encoding capabilities and the local server is a WiFi AP with hardware support for video encoding/transcoding).

Thanks in advance for any help, hint, link or comment!

Enrique Arizón Benito

Vikas

unread,
May 3, 2013, 6:57:49 PM5/3/13
to discuss-webrtc
some answers inline

On May 2, 9:13 am, Enrique Arizon Benito <eari...@viotech.net> wrote:
> Hello,
>
> After following this link (http://blog.gingertech
> .net/2012/06/04/video-conferencing-in-html5-webrtc-via-web-sockets/) about
> using websocket as signaling channel I succeded to make my first peer to
> peer app. (for anyone curious, the websocket server side is a
> twisted-python server that "forward" requests to/from an XMPP server
> -gtalkfor testing-)
>
> Now I would like the user to be able to switch on/off audio/video, both
> from its local camera/mic and from remote streams. I googled around but I
> don't have a clear idea about what's the best way to do it.
> - Must I renegotiate with the other peer?
> - It's it just enough to switch off "something" locally (for example
> removing a track)?
> - Anything  else?
>
You should be able to achieve this by muting/unmuting mediastream
tracks. You can test apprtc demo on 2 sides (https://
apprtc.appspot.com). Once you setup a call, you can in the JS console
type localStream.getVideoTracks()[0].enabled=false to mute local
video. This will also stop sending any video to the remote side and
the remote side will see a black frame. You can do similarly to mute/
unmute remote video/audio using remoteStream.getVideoTracks()
[0].enabled property.

> Using Firefox on slow computers is problematic since video and audio
> progresively desyncrhonize (looks there is no support for frame-dropping in
> case of high cpu-ussage).
> I wonder whether it's possible using the WebRTC API to change the streaming
> quality from our local webcam programatically?
>
You can specify resolution in the getusermedia api. See
http://webrtc.googlecode.com/svn/trunk/samples/js/demos/html/constraints-and-stats.html

> In my particular scenario there is a local server close to the client that
> can get in charge of video compresion, so I wonder whether there is/will
> be/is planned to let WebRTC send raw video to such server and let this last
> one make the hard encoding work (let's imagine the client is a old mobile
> phone with no hardware encoding capabilities and the local server is a WiFi
> AP with hardware support for video encoding/transcoding).
>
Sorry, not sure if their are any plans for that, but i think you can
always lower the resolution on weaker platforms.
Reply all
Reply to author
Forward
0 new messages