WebRTC — Behind the scenes of Online Video Calls

Pranav Tiwari
3 min readJan 25, 2023

--

Day 25 / 365

Photo by visuals on Unsplash

Today I learned about “WebRTC”, the technology that enables us to make video calls online. I had created websites in the past that had video-calling functionality, but I never really understood how it works. With the help of my trusty sidekick ChatGPT, I decided to look into it today. I would like to share with you what I have understood.

How most websites work

For most of the stuff you do online, you are using your web browser to talk to a server somewhere. You click a button on a website, your browser sends some message to the server, the server replies back and the browser used that reply to update what you are seeing.

Say when you post a comment on a post on Facebook. Your comment goes to the server and is saved there, and anyone who opens the post after that would see that comment.

How I thought Video Calls worked

Since most of the online stuff is you interacting with servers, I thought that video calls worked the same way. Your browser will record a short chunk of your video, say half a second, and send that to the server. The other person on the call will receive that chunk from the server and the browser will play it.

I couldn’t have been more wrong.

How Video Calls actually work

My mistake was assuming that two people on the internet would need to have a server in between in order to communicate. That’s not true.

WebRTC, or Web Real-Time Communication, is a technology that allows for real-time communication between web browsers. Audio, video and other data are sent directly from one browser to the other, without the need for a server in between.

When ChatGPT told me this (I know how weird that sounds), I got the point, but I still had a big question. If there isn’t a server involved, how do the two browsers find each other?

The Signaling Server

My question was valid, and I got a satisfying answer as well. Although we don’t need a server in between to transfer the audio and video when the call is going on, we do need a server to start the video call. This is known as the Signaling Server.

If I want to start a video call with a friend, I would send a request to the signaling server with some information that my browser gives me. The server will send that information to the friend’s browser, which would then use it to establish a direct connection with my browser. Post that, our browsers can talk directly to each other.

It’s like a friend setting you up on a date. Your friend would take your phone number and give it to the person they want to set you up with, but after that, you can communicate with them directly.

That’s my quick explanation of how video calls work. I hope you found that helpful!

--

--

Pranav Tiwari
Pranav Tiwari

Written by Pranav Tiwari

I write about life, happiness, work, mental health, and anything else that’s bothering me

No responses yet