# WebRTC for Live Video Streaming

- Speaker: [Evyatar Rosner](/wiki/speakers/evyatar-rosner.md)
- Event: [Reversim Summit 2021](/wiki/years/2021.md)
- Video: https://www.youtube.com/watch?v=ym_U2Nm6qXM
- Transcript: [/transcripts/2021/03-ym_U2Nm6qXM.md](/transcripts/2021/03-ym_U2Nm6qXM.md)
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: [Networking](/wiki/topics/networking.md), [Frontend](/wiki/topics/frontend.md), [Distributed Systems](/wiki/topics/distributed-systems.md), [Scalability](/wiki/topics/scalability.md)

> Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

## Summary

The speaker shares the technical journey of building a remote assistance tool for coding students using WebRTC. Traditional video conferencing platforms proved inadequate for teaching because they lacked private screen-sharing capabilities and incurred prohibitive server costs. The speaker explains how WebRTC enables direct peer-to-peer video streaming, bypassing expensive servers and reducing latency. Finally, the talk reviews the limitations of WebRTC, including network limitations, CPU consumption, and connection scaling limits.

## Key points

- [1:21](https://www.youtube.com/watch?v=ym_U2Nm6qXM&t=81s) The transition to remote learning created severe challenges in providing individual student assistance and maintaining engagement.
- [2:32](https://www.youtube.com/watch?v=ym_U2Nm6qXM&t=152s) Standard video conferencing tools force public screen sharing, which prevents private student troubleshooting during exercises.
- [4:33](https://www.youtube.com/watch?v=ym_U2Nm6qXM&t=273s) Commercial video APIs offered a simple integration solution but proved far too expensive for private budgeting.
- [5:35](https://www.youtube.com/watch?v=ym_U2Nm6qXM&t=335s) Building custom video streaming infrastructure exposed major engineering obstacles like asymmetric bandwidth, codec negotiation, and high egress network costs.
- [10:10](https://www.youtube.com/watch?v=ym_U2Nm6qXM&t=610s) WebRTC provides a browser-native framework for direct peer-to-peer communication without requiring a media server in the middle.
- [15:45](https://www.youtube.com/watch?v=ym_U2Nm6qXM&t=945s) Establishing a WebRTC connection requires signaling to exchange SDP descriptions and ICE candidates through a temporary server.
- [19:05](https://www.youtube.com/watch?v=ym_U2Nm6qXM&t=1145s) Fallback TURN servers are necessary to handle restricted networks and firewalls when direct peer connections fail.
- [23:11](https://www.youtube.com/watch?v=ym_U2Nm6qXM&t=1391s) WebRTC struggles to scale beyond a small number of concurrent connections and places heavy processing loads on the CPU.

## Takeaways

- Use WebRTC for low-latency, peer-to-peer applications to eliminate expensive media server and bandwidth costs.
- Implement a signaling mechanism using WebSockets to exchange SDP and ICE candidates before establishing a direct connection.
- Always plan for fallback TURN servers because a percentage of clients will be behind strict firewalls that block direct peer connections.

## Questions this talk answers

- How can I stream a student's screen privately to an instructor without broadcasting it to everyone in the room?
- What are the main architectural components required to establish a direct WebRTC connection between two browsers?
- When should I avoid using WebRTC and opt for a traditional server-based streaming architecture instead?

## Technologies

WebRTC, JavaScript, WebSocket

## Tags

browser apis, frontend architecture, networking, peer-to-peer, video streaming, webrtc
