What is WebRTC?
Let’s start with the basics: what is webrtc?
Essentially, WebRTC facilitates browser-based audio and video live streaming through direct peer-to-peer communication, rather than needing the end-users to download specific plug-ins or apps.
WebRTC is supported by Google, Apple, Microsoft, Mozilla, and other major browsers.
The origins of WebRTC
WebRTC was first developed and launched by Google. It was the result of Google’s acquisition of GIPS who had been developing many of the foundational elements of RTC.
What does WebRTC do?
WebRTC can be used to facilitate a number of different things. The WebRTC website points out just a few use-cases such as basic web-apps that use camera and mic, or video-calling and screen-sharing apps.
How does WebRTC work?
It compresses audio and video files before transfer and then decompresses them on arrival to the other device.
Why would you use WebRTC?
If you’re wondering why you might want to use WebRTC, you may want to consider what advantages it offers.
Advantages of WebRTC
No need to download plug-ins or apps
The fact that WebRTC doesn’t require any plug-ins or additional software to facilitate real-time communications is a huge plus.
WebRTC benefits from low latency streaming, which is beneficial for all end-users.
Adaptable to network conditions
WebRTC is flexible and agile, meaning that it can be adjusted to match network conditions relating to stream quality, total bandwidth and the number of people tuning in, for example.
Open source and free to use
Since WebRTC is free and open-source, it’s extremely popular with developers. Not only does that mean it's easily accessible to use, but that there is a wide community of developers to support each other and develop the open source solution.
Another huge plus for WebRTC is that it is widely compatible and supported by major browsers.
Disadvantages of WebRTC
Can be impacted by bandwidth
WebRTC does have some issues with how scaleable it is. This mainly comes down to the fact that it operates on a peer-to-peer connection which can weigh heavily on bandwidth and result in bad connection. This means that if you are looking to stream to a big audience, you may need the support of a streaming server.
Can be impacted by network connection
The quality of livestreams powered by WebRTC can be affected by the network connection.
Can I use WebRTC for live video streaming?
It’s important to understand that WebRTC isn’t a live streaming software or app in itself. It’s the protocol, solution or framework that powers the live streaming function of some of the best known video conferencing and live streaming platforms out there.
So, if you’re a developer that is trying to build an application with the ability to livestream, then you can use WebRTC.
How do I use WebRTC for video streaming?
In order to be able to stream audio and video between users, you want to use RTCPeerConnection. You can follow WebRTC’s very in-depth tutorial here.
Peer Connections are what deals with ‘connecting two applications on different computers to communicate using P2P protocol.’ The peers can stream video, audio or even arbitrary binary data. In order to do this, the peers need to provide an ICE Server configuration which is then transferred to their counterpart - this process is known as ‘signaling’.
The ‘ICE’ in ICE Server configuration stands for ‘Interactivity Connectivity Establishment’. Put simply, this is a framework that allows your browser to connect with someone else’s so that you can communicate with them.
Since WebRTC doesn’t stipulate any specific signaling solution, you can implement it how you like.
Once you’ve done that, you need to initiate peer connections, ensure ICE candidates are received and then ensure the connection has indeed been established.
What sites use WebRTC?
WebRTC is widely used and many mainstream applications rely on it to facilitate their livestreaming and real-time communication features. Google Hangouts, Google Meet, Facebook Messenger, Discord and Houseparty are just a few examples of sites that use WebRTC.
FAQs on WebRTC Video Streaming
WebRTC isn’t easy to understand if you’re not familiar with it. Here we answer some of the most frequently asked questions about it:
Which is better: WebRTC or HLS?
Choosing between WebRTC and HLS can be difficult since they’re both solutions that facilitate video streaming.
HLS stands for HTTP Live Streaming. It was developed by Apple and uses a segment file format to deliver video content. HLS needs a server to transmit a video stream, whilst WebRTC operates on a P2P model.
Though both protocols are low latency, WebRTC can be faster. Additionally, because of WebRTC’s P2P model it offers high-quality real-time streaming.
Is WebRTC low latency?
Yes, WebRTC is known for its low latency.
Does Netflix use WebRTC?
No, Netflix does not use WebRTC.
Does YouTube Live use WebRTC?
YouTube Live does not seem to use WebRTC to allow users to go live.
Does OBS support WebRTC?
A version of OBS-studio that supports WebRTC has been developed. You can find information about it here.
Does WebRTC need a server?
WebRTC operates using a P2P structure. However, a server is needed for certain stages of the process, including the initial establishment of the connection between the devices.
A WebRTC server is what is involved with establishing these P2P connections, communicating the data, and ensuring the network connection is stable during the real-time communications.