Streaming videos, things behind the curtain
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:
- 1.Old data will be re-transmitted (that's probably for a frame that was already displayed and therefore worthless).
- 2.New data can't arrive until after old data was re-transmitted.
- UDP is ideal for teleconferencing.
<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)
- 1.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.