WebRTC

What is WebRTC?

WebRTC (Web Real Time Communications) is a standard with native support for audio and video content live streaming from browser or to a browser without need for additional plugins or external add-ons installation. With this standard you can turn your browser into a video conferencing endpoint. Open any webpage and start communicating right away!

What You Need to Know About WebRTC

Advantages

  • No additional software or plugins installation is required to make a video call
  • High communication quality thanks to modern video codecs (VP8 and H. 264) and audio codecs (Opus).
  • Quality automatically adjusts to any types of connection.
  • Noise reduction and echo cancellation built-in support.
  • Automatic microphone sensitivity (AGC) control for all participants.
  • High level of security: all connections are protected (HTTPS) and encrypted (SRTP).
  • Built-in content capture mechanism (e.g. desktop sharing).
  • Could be embedded into any HTML5 and/or WebSocket-based interface
  • Cross-platform ready: all WebRTC application works good on any desktop or mobile operating system provided that your browser supports WebRTC. In this way you can cut software development costs dramatically.

Disadvantages

  • As browsers cannot synchronize multiple incoming streams, you need a video conferencing server for audio and video mixing to run group audio or video conferences.
  • WebRTC solutions are incompatible with each other. The standard generally applies only to the methods of video and audio transmission, while vendors are free to decide on signalling, messaging, file transfer, conference scheduling and etc.
  • Group conference mixing and transcoding requires large computing resources. Group video conference support for WebRTC usually requires paid subscription (in case of cloud solutions) or big infrastructure investments, as each conference layout usually requires at least one logical CPU core on the server.

How Vendors Yield This Brave New Technology

WebRTC for Video Conferencing Market

Growing number of video conferencing endpoints

WebRTC technology has a great impact on the video conferencing market development.  After the first browsers with support for WebRTC were released, the potential number of video conferencing endpoints around the world increased by 1 billion devices.

WebRTC for Developers

With wide variety of JavaScript libraries and API-based cloud services supporting WebRTC you can add video conferencing into your web projects in a few hours. Earlier, to transfer video data in real time vendors had to study protocol, standards, invest heavily in development or media engines licensing, which always leveraged additional costs on customers and users. However, now WebRTC is widely used in such services as “Call via site” or “Online chat support”, in other words WebRTC has liberated the real time communications by significantly lowering requirements for creation of video-enabled solutions.

Skype for Linux Case

In 2014, Microsoft officially withdrew Skype for Linux support, which was a huge blow for IT experts around the world. WebRTC technology is not tied to any operating system and is implemented in browser. Thus, for Linux users, WebRTC-based solutions can easily replace Skype, however we recommend to check out [a]TrueConf for Linux[/a].

Competition with Flash

WebRTC and HTML5 broke the back of Flash technology. Since 2017 all major browsers have officially stopped supporting Flash, and the technology finally disappear from the market. The credit should be given to the Flash technology, as it created the market for web conferencing and offered technical capabilities for real-time communication in browsers back in 2010s.

How WebRTC Works

Client Side

  1. User opens the web page containing HTML5 <video> tag.
  2. The browser requests access to user’s web camera and microphone.
  3. JavaScript code controls connection settings (endpoints or server's IP addresses) to bypassing NAT and Firewall.
  4. After confirming second endpoint connection parameters, the browser starts to select and adjust audio and video codecs.
  5. Once done encoding process starts and data streaming between WebRTC clients begin. In our case, between browser and the server.

WebRTC Server Side

To exchange data between two participants, the video server is not required. If you want to connect several participants in one conference, you will need a server.

WebRTC Server Schemes

In case of multipoint conference media or WebRTC server receives media streams from multiple endpoints, adjust and mix them to output over WebRTC back to endpoints group video layout. Media servers could also provide interconnectivity between browsers, conference rooms and various desktop or mobile apps by transcoding media streams from and to WebRTC endpoints. However as we said before such transcoding requires a lot of CPU power. It is possible to apply switching or peer-to-peer scheme to WebRTC multipoint conference however due to the lack of streams synchronization and SVC support in the standard itself such examples doesn’t perform well in real life.

WebRTC Codecs

Audio codecs

Opus is a scalable open-source audio codec with low latency, variable bitrate support and high compression level. Opus is a perfect codec for audio streaming in variable and low bandwidth conditions. Opus is a hybrid solution that combines the best characteristics of the SILK codec (used in Skype) and CELT (audio data encoding). Compared to other audio codecs, Opus undoubtedly wins based on a variety of indicators. It evens outperforms other popular codecs with high bit rate such as MP3, Vorbis, AAC LC. Opus restores the original sound “picture” better than AMR-WB and Speex (used in Skype). This codec is the future of audio compression and is used in WebRTC by default.

G. 711 is a pretty old voice codec with a high bit rate (64 kbps). It is mostly used in legacy telephony and video conferencing systems and is used in WebRTC for back compatibility with them. Its main advantage is the minimum computation load and low audio delay. G. 711 is supported by a large number of devices.

Video codecs

It took industry several years to choose a default video codec for WebRTC standard. Now both H.264 and VP8 video codecs are recommended. However it’s enough for a browsers to support only one of them to be WebRTC compatible and it cause a lot of trouble for developers (think about transcoding again) because Safari from Apple and Edge from Microsoft decided not to enable VP8 for WebRTC.

VP8 is relatively new open-source video codec with good scalability and high compression ratio. It also has low latency and high frames loss resistance. VP8 could be easily implement on SOC, though very few manufactures implemented it their hardware, so CPU stays the main VP8 encoder nowadays. In terms of quality it’s very similar to H.264, which in contrary implemented in every smartphone and GPU on the planet.

H.264 is a proprietary video codec that became known much earlier than VP8. This codec provides high compression while maintaining good video quality. H.264 codec is a lingua franca for all video conferencing hardware.

Please note both recommended codecs do not support scalable video coding (SVC), which is essential for CPU-less multipoint experience. WebRTC standard draft include support for SVC-ready codecs like VP9 and expected to be released and implemented by major browsers in 2018.

WebRTC API

WebRTC technology is based on three main APIs:

  • MediaStream. Web browser accepts audio and video signal from camera or desktop.
  • RTCPeerConnection. Connects browsers for sharing media content from a camera, microphone, and desktop. This API also processes signals (cleans up noise interference, adjusts mic volume)  and controls audio and video codecs in use.
  • RTCDataChannel. Provides two-side data transmission over established connection.
MediaStream

Each browser taking part in a WebRTC conference must have access to RTCPeerConnection object. Media content can be passed through NAT and firewall thanks to it. For successful media stream transmission, participants exchange the following data with the help of web sockets:

  • The first user sends Offer-SDP ( data structure containing characteristics of the media stream which it will pass) to the second user.
  • The second user generates Answer-SDP and sends it to the first user;
  • after that, ICE candidates exchange between the parties is established  (if the participants are behind NAT or firewalls).

After the exchange between participants has been successfully finished, media (audio and video) stream transferring is established.

Browsers have recently added support for RTCDataChannel making possible for text messaging or content sharing during WebRTC sessions.

Connecting via WebRTC

Desktop browsers supported

  • Google Chrome (17+) and all browsers on the Chromium-based technology.
  • Mozilla FireFox (18+).
  • Opera (18+).

Mobile browsers for Android supported

  • Google Chrome (28+);
  • Mozilla Firefox (24+);
  • Opera Mobile (12+).

WebRTC, Microsoft, and Internet Explorer

According to the Microsoft corporate policy, Redmond guys don't like using technologies that they do not control. However, eventually it became hard to ignore WebRTC even for Microsoft, and the company announced a release of ORTC project  deriving from WebRTC standard for their Edge browser.

According to the vendors, ORTC  is an enhanced version of WebRTC with improved set of JavaScript and HTML5-based APIs. It generally means that everything will stay the same, but Microsoft and not Google will control this standard and its development. Codec set is enhanced with H. 264 support and some G.7XX series audio codecs which are used in telephony and video conferencing legacy systems. We are waiting for built-in support for RDP (content transfer) and messaging. By the way, Internet Explorer users got the short straw, because ORTC support would be only supported  in Edge.

WebRTC, Apple and Safari

According to analysts, WebRTC for Safari is on the way. We are waiting for this release in late 2017. For now we recommend using Chrome browser for both iOS and macOS. Apple’s likely to be enhanced with video codec H. 264 and H. 265 support and AAC-ELD audio codec (encoders used in FaceTime).

Technology Support in Browsers

BrowserWebRTC SupportVP8 SupportH.264 SupportScreen capture
Chrome 17+cheksVXV
Mozilla FireFox 18+VVVV
Opera 18+VVXV
Internet ExplorercheksXcheksX
SafariXXXX

Mobile Browsers with WebRTC Support

BrowserWebRTC Support
Chrome 29+cheks
Opera 20+cheks
Firefox 24+cheks
Safaricheks

TrueConf Web Conference via Browser

Useful Links

WebRTC official website
WebRTC on Wiki
WebRTC for developers
TrueConf WebRTC