Internet Windows Android

What is WebRTC and how to disable it. How to organize WebRTC online broadcast using a webcam and a VPS server webrtc technology

Today, WebRTC is the "hot" technology for streaming audio and video in browsers. Conservative technologies, such as HTTP Streaming and Flash, are more suitable for distributing recorded content (video on demand) and are significantly inferior to WebRTC in terms of real-time and online broadcasts, i.e. where minimal video latency is required, allowing viewers to see what is happening "live".

The possibility of high-quality real-time communication comes from the WebRTC architecture itself, where the UDP protocol is used to transport video streams, which is the standard basis for transmitting video with minimal delays and is widely used in real-time communication systems.

Communication latency is important in live streaming systems, webinars, and other applications where interactive communication with the video source, end users, and solution is required.

Another good reason to try WebRTC is definitely a trend. Today, every Android Chrome browser supports this technology, which guarantees millions of devices are ready to watch the broadcast without installing any additional software and configurations.

In order to test the WebRTC technology in action and launch a simple online broadcast on it, we used the Flashphoner WebRTC Media & Broadcasting Server server software. The features declare the ability to broadcast WebRTC streams in the one-to-many mode, as well as support for IP cameras and video surveillance systems via the RTSP protocol; in this review, we will focus on web-web broadcasts and their features.

Installing WebRTC Media & Broadcasting Server

Since there was no server version for the Windows system, and I didn’t want to install a virtual machine like VMWare + Linux, I couldn’t test online broadcasts on my home Windows computer. To save time, we decided to take an instance on cloud hosting like this:

It was a Centos x86_64 version 6.5 without any pre-installed software in an Amsterdam data center. Thus, all we have at our disposal is a server and ssh access to it. For those who are familiar with Linux console commands, installing a WebRTC server promises to be easy and painless. So what we did:

1. Download archive:

$wget https://website/download-wcs5-server.tar.gz

2. Unpack:

$tar -xzf download-wcs5-server.tar.gz

3. Install:

$cd FlashphonerWebCallServer

During installation, enter the IP address of the server: XXX.XXX.XXX.XXX

4. Activate license:

$cd /usr/local/FlashphonerWebCallServer/bin

$./activation.sh

5. Start WCS server:

$service webcallserver start

6. Check log:

$tail - f /usr/local/FlashphonerWebCallServer/logs/flashphoner_manager.log

7. Check that two processes are in place:

$ps aux | grep Flashphoner

The installation process is complete.

Testing WebRTC live streams

Testing broadcasts turned out to be a simple matter. In addition to the server, there is a web client, which consists of a dozen Javascript, HTML and CSS files and was deployed by us to the /var/www/html folder during the installation phase. The only thing that had to be done was to enter the server's IP address into the flashphoner.xml config so that the web client could establish a connection to the server via HTML5 Websockets. Let's describe the testing process.

1. Open the index.html page of the test client in the Chrome browser:

2. In order to start broadcasting, you need to click the "Start" button in the middle of the screen.
Before doing this, you need to make sure that the webcam is connected and ready to go. There are no special requirements for a webcam, for example, we used a standard built-in laptop camera with a resolution of 1280 × 800.

Chrome browser will definitely ask for access to the camera and microphone so that the user understands that his video will be sent to the Internet server and allows him to do so.

3. The interface represents a successful broadcast of the video stream from the camera to the WebRTC server. In the upper right corner, the indicator indicates that the stream is going to the server, in the lower corner there is a "Stop" button to stop sending the video.

Take a look at the link below. It contains a unique identifier for this stream, so anyone can join the view. Just open this link in a browser. To copy it to the clipboard, you need to click on the "Copy" button.

In real applications like webinars, lectures, online video broadcasts or interactive TV, developers will have to implement the distribution of this identifier to certain groups of viewers so that they can connect to the desired streams, but this is the logic of the application. WebRTC Media & Broadcasting Server it does not affect, but only deals with the distribution of video.

5. The connection is established and the viewer sees the stream on the screen. Now he can send the link to someone else, stop stream playback or enable full screen mode using the controls in the lower right corner.

WebRTC server testing results for online broadcasts

During tests, latency seemed to be perfect. The ping to the data center was about 100 milliseconds and the delay was not visible to the eye. From here, we can assume that the real delay is the same 100 plus or minus a few tens of milliseconds for the buffering time. Compared to Flash video, Flash does not perform as well as WebRTC in these tests. So, if you move your hand on a similar network, then the movement on the screen can be seen only after one / two seconds.

Regarding the quality, we note that sometimes you can distinguish cubes on movements. This is in line with the nature of the VP8 codec and its main goal is to provide real-time video communication with acceptable quality and without communication delays.

The server is quite easy to install and configure, it does not require any serious skills to run it, except for knowledge of Linux at the level of an advanced user who can execute commands from the console via ssh and use a text editor. As a result, we managed to set up a one-to-many online broadcast between browsers. Connecting additional viewers to the stream also did not cause problems.

The broadcast quality turned out to be quite acceptable for webinars and online broadcasts. The only thing that caused some questions was the resolution of the video. The camera supports 1280x800, but the resolution on the test picture is very similar to 640x480. Apparently, this issue needs to be clarified with the developers.

Video on testing broadcast from a webcam
via WebRTC server

WebRTC (Web Real Time Communications) is a standard that describes the transfer of streaming audio data, video data and content from the browser and to the browser in real time without installing plugins or other extensions. The standard allows you to turn the browser into a video conferencing terminal, just open a web page to start communication.

What is WebRTC?

In this article, we will cover everything there is to know about WebRTC technology for the average user. Let's consider the advantages and disadvantages of the project, reveal some secrets, tell you how it works, where and what WebRTC is used for.

What you need to know about WebRTC?

The evolution of video standards and technologies

Sergey Yutsaitis, Cisco, Video+Conference 2016

How WebRTC works

On the client side

  • The user opens a page containing an HTML5 tag
  • The browser requests access to the user's webcam and microphone.
  • The JavaScript code on the user page controls the connection parameters (IP addresses and ports of the WebRTC server or other WebRTC clients) to bypass NAT and Firewall.
  • When receiving information about the interlocutor or about the stream with the conference mixed on the server, the browser starts negotiating the audio and video codecs used.
  • The process of encoding and streaming data between WebRTC clients (in our case, between the browser and the server) begins.

On the WebRTC server side

A video server is not required for data exchange between two participants, but if you want to combine several participants in one conference, a server is required.



The video server will receive media traffic from various sources, convert it and send it to users who use WebRTC as a terminal.

The WebRTC server will also receive media traffic from WebRTC peers and pass it on to conference participants using desktop or mobile applications, if any.

Benefits of the standard

  • No software installation required.
  • Very high communication quality thanks to:
    • Use of modern video (VP8, H.264) and audio codecs (Opus).
    • Automatic adjustment of stream quality to connection conditions.
    • Built-in echo and noise cancellation.
    • Automatic level control of participants' microphones (AGC).
  • High level of security: all connections are secure and encrypted according to the TLS and SRTP protocols.
  • There is a built-in mechanism for capturing content, such as the desktop.
  • Ability to implement any control interface based on HTML5 and JavaScript.
  • The ability to integrate the interface with any back-end systems using WebSockets.
  • An open source project - you can embed it in your product or service.
  • True cross-platform: the same WebRTC application will work equally well on any operating system, desktop or mobile, provided that the browser supports WebRTC. This saves a lot of resources for software development.

Disadvantages of the standard

  • To organize group audio and video conferences, a videoconferencing server is required that would mix video and audio from participants, because the browser does not know how to synchronize multiple incoming streams with each other.
  • All WebRTC solutions are incompatible with each other, because the standard describes only methods for transmitting video and sound, leaving the implementation of methods for addressing subscribers, tracking their availability, exchanging messages and files, scheduling, and other things for the vendor.
  • In other words, you will not be able to call from a WebRTC application of one developer to a WebRTC application of another developer.
  • Mixing group conferences requires a lot of computing resources, so this type of video communication requires the purchase of a paid subscription or investment in its infrastructure, where each conference requires 1 physical core of a modern processor.

WebRTC Secrets: How Vendors Benefit From Disruptive Web Technology


Tzachi Levent-Levi, Bloggeek.me, Video+Conference 2015

WebRTC for the video conferencing market

Increase in the number of video conferencing terminals

WebRTC technology has had a strong impact on the development of the video conferencing market. After the release of the first browsers with WebRTC support in 2013, the potential number of video conferencing terminals around the world immediately increased by 1 billion devices. In fact, each browser has become a videoconferencing terminal that is not inferior to its hardware counterparts in terms of communication quality.

Use in specialized solutions

The use of various JavaScript libraries and cloud service APIs with WebRTC support makes it easy to add video support to any web projects. In the past, real-time data transmission required developers to learn how the protocols worked and to use the work of other companies, which most often required additional licensing, which increased costs. WebRTC is already actively used in services like “Call from the site”, “Online support chat”, etc.

Ex-users of Skype for Linux

In 2014, Microsoft announced the end of support for the Skype for Linux project, which caused great annoyance among IT professionals. WebRTC technology is not tied to the operating system, but is implemented at the browser level, i.e. Linux users will be able to see WebRTC-based products and services as a full-fledged replacement for Skype.

Competition with Flash

WebRTC and HTML5 were a death blow for Flash technology, which was already going through its far from the best years. Since 2017, the leading browsers have officially stopped supporting Flash and the technology has finally disappeared from the market. But you have to give Flash credit, because it was he who created the web conferencing market and offered the technical capabilities for live communication in browsers.

WebRTC video presentations

Dmitry Odintsov, TrueConf, Video+Conference October 2017

Codecs in WebRTC

Audio codecs

To compress audio traffic in WebRTC, Opus and G.711 codecs are used.

G.711- the oldest voice codec with a high bitrate (64 kbps), which is most often used in traditional telephony systems. The main advantage is the minimal computational load due to the use of lightweight compression algorithms. The codec has a low level of compression of voice signals and does not introduce additional audio delay during communication between users.

G.711 is supported by a large number of devices. Systems that use this codec are easier to use than those based on other audio codecs (G.723, G.726, G.728, etc.). In terms of quality, G.711 received a score of 4.2 in MOS testing (a score of 4-5 is the highest and means good quality, similar to the quality of voice traffic in ISDN and even higher).

Opus is a codec with low encoding latency (from 2.5 ms to 60 ms), variable bit rate support, and high compression, which is ideal for audio streaming over variable bandwidth networks. Opus is a hybrid solution that combines the best features of SILK (Voice Compression, Human Speech Distortion Elimination) and CELT (Audio Data Encoding) codecs. The codec is freely available, developers who use it do not need to pay royalties to copyright holders. Compared to other audio codecs, Opus certainly wins in many ways. It has eclipsed quite popular low bitrate codecs such as MP3, Vorbis, AAC LC. Opus restores the "picture" of sound closer to the original than AMR-WB and Speex. This codec is the future, which is why the creators of WebRTC technology included it in the mandatory range of supported audio standards.

Video codecs

The issues of choosing a video codec for WebRTC took the developers several years, in the end they decided to use H.264 and VP8. Almost all modern browsers support both codecs. Video conferencing servers need only support one to work with WebRTC.

VP8 is a free video codec with an open license, featuring high video stream decoding speed and increased resistance to frame loss. The codec is universal, it is easy to implement it into hardware platforms, so developers of video conferencing systems often use it in their products.

Paid video codec H.264 became known much earlier than his brother. This is a codec with a high degree of compression of the video stream while maintaining high video quality. The high prevalence of this codec among hardware video conferencing systems suggests its use in the WebRTC standard.

Google and Mozilla are actively promoting the VP8 codec, while Microsoft, Apple and Cisco are actively promoting H.264 (to ensure compatibility with traditional video conferencing systems). And here a very big problem arises for developers of cloud-based WebRTC solutions, because if all participants in the conference use one browser, then it is enough to mix the conference once with one codec, and if browsers are different and among them there is Safari / Edge, then the conference will have to be encoded twice different codecs, which will double the system requirements for the media server and, as a result, the cost of subscriptions to WebRTC services.

WebRTC API

WebRTC technology is based on three main APIs:

  • (responsible for the web browser to receive audio and video signals from cameras or the user's desktop).
  • RTCPeerConnection(responsible for the connection between browsers for the “exchange” of media data received from the camera, microphone and desktop. Also, the “duties” of this API include signal processing (cleaning it from extraneous noise, adjusting the microphone volume) and control over the audio and video codecs used) .
  • RTC Data Channel(provides two-way data transfer over an established connection).

Before accessing the user's microphone and camera, the browser asks for this permission. In Google Chrome, you can pre-configure access in the "Settings" section, in Opera and Firefox, the choice of devices is carried out directly at the time of access, from the drop-down list. The permission request will always appear when using the HTTP protocol and once if using HTTPS:


RTCPeerConnection. Each browser participating in a WebRTC conference must have access to this object. Thanks to the use of RTCPeerConnection, media data from one browser to another can even pass through NAT and firewalls. To successfully transmit media streams, participants must exchange the following data using a transport such as web sockets:

  • the initiating participant sends to the second participant an Offer-SDP (data structure, with the characteristics of the media stream that it will transmit);
  • the second participant generates a “response” - Answer-SDP and sends it to the initiator;
  • then, an exchange of ICE candidates is organized between the participants, if any are found (if the participants are behind NAT or firewalls).

After the successful completion of this exchange between the participants, the transfer of media streams (audio and video) is organized directly.

RTC Data Channel. Support for the Data Channel protocol appeared in browsers relatively recently, so this API can only be considered in cases where WebRTC is used in Mozilla Firefox 22+ and Google Chrome 26+ browsers. With it, participants can exchange text messages in the browser.

WebRTC connection

Supported desktop browsers

  • Google Chrome (17+) and all browsers based on the Chromium engine;
  • Mozilla Firefox (18+);
  • Opera (12+);
  • Safari (11+);

Supported mobile browsers for Android

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

WebRTC, Microsoft and Internet Explorer

For a very long time, Microsoft was silent about WebRTC support in Internet Explorer and in its new Edge browser. The guys from Redmond don't really like to put technology in the hands of users that they don't control, that's the kind of policy. But gradually things got off the ground, because. It was no longer possible to ignore WebRTC, and the ORTC project, derived from the WebRTC standard, was announced.

According to the developers, ORTC is an extension of the WebRTC standard with an improved set of APIs based on JavaScript and HTML5, which, translated into ordinary language, means that everything will be the same, only Microsoft, not Google, will control the standard and its development. The set of codecs has been expanded with support for H.264 and some G.7XX series audio codecs used in telephony and hardware video conferencing systems. Perhaps there will be built-in support for RDP (for transferring content) and messaging. By the way, Internet Explorer users are out of luck, ORTC support will only be in Edge. And, of course, such a set of protocols and codecs fits in with Skype for Business with little blood, which opens up even more business applications for WebRTC.

Hello friends, as you already know, we update you regularly with new technologies, today I will introduce WebRTC, a technology developed by Google that allows users to speak directly in the browser video and audio without requiring that the use of plugins- Websites or applications. Video and audio direct connection between users takes place directly in the browser.
WebRTC technology is supported in Mozilla Firefox browsers Google Chrome and on any operating system, Opera will join soon.
What is WebRTC and what?
WebRTC is short for Web Real Time Communication, this technology allows you to open audio and video chats directly in the browser without the need for other plug-ins, applications or services on the Internet for this. The connection is made directly from the browser to the browser.
Where known services (Skype, Yahoo Messenger, Apple FaceTime, Google Hago, etc.) require a server that connects users in order to initiate and manage traffic. Using these services we need to register and set up a list of clients and contacts.
With WebRTC, we don't need servers, applications, or servers that connect to intercede.
WebRTC advantages:
1. No more apps consuming resource and battery usage.
2. Chats are more private (relatively).
3. Contact can be done locally, not Flos US servers for local connections.
4. Simplicity, ease of use.
5. The possibility of further development, and in other directions.
6. Communication is stable and does not depend on external connections, which are sometimes extremely unstable.
In the tutorial, I used a demo that people at Google have developed, this demo is quite simple, more advanced features and faster connections can use one of the applications that support WebRTC, they are easier to use. Soon we will be making a tutorial about WebRTC applications as well.
How to use the WebRTC demo?
Very simply click on the link below, it automatically generates a chat. to link this room, you must send a friend / girlfriend you want to get in touch.
A friend / girlfriend and yours, but you should only use the most recent versions of Mozilla Firefox or Google Chrome.

Demo WebRTC(Introductory chat audio - video)

Attention:
The demo is not very stable, it is made for demonstration purposes only. It can be used for a limited period of time during which small connection errors may occur.
If you're having connectivity issues, try creating a different chat.

European Internet users are divided into two parts: according to a survey by the Institute for Public Opinion Analysis in Allenbach (Germany), Skype, chat and instant messaging systems have become an integral part of everyday life for 16.5 million adults and children, 9 million use these services from case by case, and 28 million do not touch them.

The situation may change, since now Firefox is integrated real time communication technology (WebRTC), as well as the client himself. Starting an audio and video chat is now no more difficult than opening a website. Services such as Facebook and Skype, on the other hand, rely on solutions using a separate client and creating an account.

WebRTC is not only easy to use. This method even allows you to set direct connection between two browsers. Thus, audio and video data does not pass through a server where overload can occur or whose administrator is not particularly sensitive to privacy or data protection. With a direct connection, WebRTC does not require registration or an account with any service.

To start a conversation, you only need to follow the link. Communication remains private because the data stream is encrypted. Real-time communication through the browser, Google began to actively engage in back in 2011, when it published the source code of its WebRTC implementation.

Shortly thereafter, Chrome and Firefox received their own WebRTC engines. Currently, their mobile versions are equipped with both this technology and the WebView 3.6 engine installed with Android 5.0, which is used by applications.

For real-time communication, the appropriate JavaScript interfaces must be implemented in the web viewer. With GetUserMedia, the software enables capture from audio and video sources, i.e. webcam and microphone. RTCPeerConnection is responsible for establishing the connection, as well as for the communication itself.

In parallel with browser integration, the World Wide Web Consortium (W3C) working group has been pushing the WebRTC standardization process. It should be completed in 2015.

WebRTC is content with little

Using the WebRTC service does not require many resources, since the server only connects the buddies. Establishing a connection is also not particularly difficult. First, the browser signals the WebRTC server that it plans to initiate a call. It receives an HTTPS link from the server - the connection is encrypted. The user sends this link to his interlocutor. The browser then asks the user for permission to access the webcam and microphone.

To establish a direct streaming connection with the other party, the browser receives its IP address and configuration data from the WebRTC service. The buddy's web browser does the same.

In order for the streaming connection to function smoothly and in good quality, three engines work in the browser. Two of them optimize and compress audio and video data, the third is responsible for their transportation. It sends data via SRTP protocol(Secure Real-time Transport Protocol), which allows real-time encrypted streaming.

If a direct connection fails, WebRTC looks for another path. For example, this happens when the network settings prevent the STUN server from being able to report the IP address. The WebRTC standard stipulates that in this case the conversation will take place, but with the intermediate inclusion of the TURN server (Traversal Using Relays around NAT). So, on the netscan.co website, you can check if WebRTC is implemented on your computer and with your access to the Web.

How the connection is made

First you need to register a conversation (1). The WebRTC service provides a link that needs to be sent to the interlocutor. The browser, using the STUNserver, finds out its own IP address (2), sends it to the service and receives the IP of the partner to establish a direct connection (3). If STUN fails, the conversation is redirected using the TURNserver (4).

Communication using WebRTC technology in the browser is launched using JavaScript code. After that, three engines are responsible for communication: the voice and video engines collect multimedia data from the webcam and microphone, and the transport engine combines the information and sends the stream in encrypted form using the Secure Real-time Protocol (SRTP).

Which browsers work with WebRTC

Chrome and Firefox are equipped with a WebRTC engine that uses services such as talky.io. The Mozilla browser can work directly with its own client.

Google and Mozilla continue to develop the idea of ​​real-time communication: Chrome can host a WebRTC conference with multiple participants, and the new Hello client in Firefox is developed with the help of a subsidiary of telecommunications giant Telefonica. Apple remains on the sidelines for now, you should not expect WebRTC in Safari yet. However, there are plenty of alternative iOS apps and plugins for Safari.

Microsoft is taking a slightly different course. As the owner of the competitive Skype service, this company is not going to capitulate to WebRTC so easily. Instead, Microsoft is developing a technology called ORTC (Object Real-Time Communications) for Internet Explorer.

Differences from WebRTC, such as different codecs and protocols for establishing contact with the server, are minor and over time, most likely, will become in addition to the WebRTC standard, which will include these differences. Thus, only Apple remains behind - as usual.

Photo: manufacturing companies; goodluz/Photolia.com