Streaming videos, things behind the curtain
Posted on 17 Dec, 2020
This is a log of things I learn on how streaming "videos" works & what are the modern ways companies do it and possibly everything about it.
TCP is more appropriate for serving video on demand
Live streaming via TCP/IP, then it would be forced to wait for dropped packets before it could continue processing newer data. That's not good because:
Old data will be re-transmitted (that's probably for a frame that was already displayed and therefore worthless).
New data can't arrive until after old data was re-transmitted.
UDP is ideal for teleconferencing.
QUIC protocol for transport layer over UDP. It is fast, secure and reliable. It builds on top of UDP
The
<audio>
and<video>
tags are protocol agnostic, no browser currently supports anything other than HTTP without requiring plugins, although this looks set to change. Protocols other than HTTP may also be subject to blocking from firewalls or proxy servers.Netflix and other streaming providers make extensive use of distributed content delivery networks (CDN), which store content in locations around the world that are much closer to users.
Adaptive Streaming: Quality of video is automatically chosen based on user's network and processing capabilities. (think YouTube's Auto setting. DASH)
Protocols
DASH Used by YouTube, Netflix or Amazon Prime Video (and many others). DASHβ manifest is called the Media Presentation Description (or MPD) and is at its base XML. Itβs an adaptive bitrate streaming technique that enables high-quality streaming of videos over the web from conventional HTTP web servers. Via this technique, the content is made available to the viewer at different bit rates. YouTube client automatically adapts the video rendering as per the internet connection speed of the viewer thus cutting down the buffering as much as possible.
HLS Developed by Apple, used by DailyMotion, Twitch.tv, and many others. The HLS manifest is called the playlist and is in the m3u8 format (which are m3u playlist files, encoded in UTF-8).
Smooth Streaming Developed by Microsoft, used by multiple Microsoft products and MyCanal.
Resources
Last updated