WebRTC, a topic that cannot be avoided in audio and video

What is WebRTC?

Nothing to do, let's discuss a topic that cannot be avoided in audio and video today: WebRTC. WebRTC is no different from FFMpeg to the audio and video industry. It can be said that the open source of WebRTC has brought the audio and video industry a big step into the fast lane of development.

WebRTC is an open source project that supports real-time audio and video communication. It allows network applications or sites to establish peer-to-peer audio and video communication between browsers without installing any plug-ins or third-party software. .

The WebRTC project consists of three modules: media module, signaling module and network module.

  1. Media module: mainly responsible for audio and video collection, encoding and decoding, and encryption. The audio and video acquisition and encoding and decoding processes use audio and video encoding and decoding protocols such as G.711, H.264 and Opus respectively. These protocols can guarantee While improving audio and video quality, reduce the amount of transmitted data as much as possible, thereby improving communication efficiency.
  2. Signaling module: mainly responsible for providing signaling exchange support during the communication process, including establishing communication connections, negotiating communication parameters, and managing communication processes.
  3. Network module: mainly responsible for the transmission of audio and video data, including the sending and receiving of data packets, and also supports the establishment and maintenance of peer-to-peer network connections.

The development history of WebRTC

In May 2010, Google acquired the GIPS engine of Global IP Solutions, a VoIP software developer, for US$68.2 million, and renamed it "WebRTC". WebRTC uses the GIPS engine to realize web-based video conferencing, and supports 722, PCM, ILBC, ISAC and other encodings, and uses Google's own VP8 video decoder; it also supports RTP/SRTP transmission, etc.

Google announced on June 3, 2011 that it would open the source code of the WebRTC architecture to developers. This source code will be made available to users under a royalty-free BSD (Berkeley Software Distribution)-style license. Developers can access and obtain WebRTC source code, specifications, tools, etc. [2]

Google Chrome: In January 2012, WebRTC was integrated into the Dev Channel, and in June of the same year, the integration of version 20 of the Stable Channel was completed (in July 2012, PeerConnection and MediaStream must still be opened through the chrome://flags page).

Mozilla Firefox: At the beginning of 2012, Mozilla integrated WebRTC into Firefox Alpha. This version of Audio Mixing has been completed in Media Stream.

In January 2012, Google has integrated this software into the Chrome browser. At the same time, the FreeSWITCH project claims to support iSAC audio codec.

In April 2012, Mozilla demonstrated WebRTC video conversations in Firefox.

In June 2013, version 22.0 was released to officially integrate and support WebRTC.

In September 2013, version 24.0 was released, and Firefox for Android (mobile version) was officially integrated and supported for WebRTC.

Opera: In January 2012, Opera initially integrated WebRTC.

Internet Explorer: Microsoft started open API.

Ericsson: In November 2012, Ericsson Labs made the world's first mobile browser that supports WebRTC.

SeaMonkey: Version 15.0 released in January 2013 initially integrated WebRTC.

On October 22, 2019, the W3C WebRTC Working Group (Web Real-Time Communications Working Group) released the first public working draft of the WebRTC Scalable Video Coding (SVC) Extension (Scalable Video Coding (SVC) Extension for WebRTC). Working Draft). This document defines a set of ECMAScript APIs in WebIDL to extend the WebRTC 1.0 API to allow user agents to support Scalable Video Coding (SVC). [5]

On March 15, 2022, the W3C Media Working Group released the first public working draft of the Autoplay Policy Detection specification. This specification provides developers with the ability to detect whether to automatically start playing a media file under different circumstances. The public is welcome to provide feedback and suggestions on this document through Github.

WebRTC usage

The use of WebRTC has the following aspects:

  1. Web real-time communication: The main purpose of WebRTC is to realize real-time communication between web pages, including audio and video calls, screen sharing, etc. Through WebRTC technology, users can directly conduct real-time audio and video communication on the web page without installing any plug-ins or third-party software, which greatly improves the convenience and efficiency of communication.
  2. Point-to-point communication: WebRTC supports point-to-point communication, which can directly establish connections between peers, avoiding server transfer in traditional communication methods, and improving communication efficiency and reliability.
  3. Security guarantee: WebRTC uses some security mechanisms, such as DTLS and SRTP and other protocols, to encrypt and protect the integrity of audio and video data, ensuring the security of communication.
  4. Cross-platform: WebRTC can be used in various browsers that support HTML5, including devices such as PCs, mobile devices, and smart TVs, and can be used across platforms.
  5. Flexible scalability: WebRTC provides rich APIs and interfaces, which can be easily customized and expanded to meet the needs of different scenarios.

WebRTC communication principle

WebRTC integrates media collection, encoding, transmission, decoding, rendering and other functions, and realizes real-time, safe and efficient audio and video communication through some security mechanisms and network transmission technologies.

​The communication principle mainly includes the following steps:

  1. Media collection: Before the communication starts, the user collects local audio and video data into the application through the API of WebRTC.
  2. Media encoding: After media collection, WebRTC encodes audio and video data for subsequent transmission and processing. WebRTC supports multiple audio and video encoding protocols, such as H.264, G.711, and Opus.
  3. Media data transmission: After media encoding, WebRTC will transmit audio and video data between peers. WebRTC supports peer-to-peer (P2P) communication, which can directly establish connections between peers, avoiding server transfer in traditional communication methods, and improving communication efficiency and reliability.
  4. Media decoding: After receiving the audio and video data from the peer, WebRTC will decode the data and restore it to the original audio and video stream.
  5. Media rendering: After the audio and video data is decoded, WebRTC will render the audio and video data so that users can hear and see each other's audio and video information.
  6. Data encryption and integrity protection: During the transmission of audio and video data, WebRTC uses some security mechanisms, such as DTLS and SRTP, to encrypt and protect the integrity of audio and video data to ensure the security of communication.
  7. Network transmission and connection management: WebRTC also provides network transmission and connection management functions, including signaling transmission, network status detection, connection management and other functions, to ensure the stability and reliability of communication.

 

Guess you like

Origin blog.csdn.net/renhui1112/article/details/131712959