Streaming Stored Video
Streaming of videos involve, storing of prerecorded videos on servers.
- Users send request to those servers.
- Users may watch the video from the start till the end, and may pause it anytime, do a forward or reverse skip, or stop the video whenever they want to do so.
There are 3 video streaming categories:
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
1. UDP Streaming 2. HTTP Streaming 3. Adaptive HTTP Streaming
Usually, today’s system employs HTTP and Adaptive HTTP Streaming.
Common characteristic of these three streaming technique is that the extensive use of Client-Side Buffering.
Advantages of Client Buffering:
- Client side buffer absorbs variations in server-client delay. Until the delayed packet is received by the client, the received-but not yet-played video will be played.
- Even if bandwidth drops, user can view the video until the buffer is completely drained.
1. UDP STREAMING:
UDP servers send video chunks (Chunk: unit of information that contains either control information or user data) to clients, based on client’s consumption rate. It transmits chunks at a rate, that matches client’s video consumption rate by clocking out video chunks over UDP over steady state.
Video consumption rate = 2Mbps Capacity of one UDP packet = 8000 bits Therefore, Transmission rate = 8000 bits/2 Mbps = 4000 msec
- UDP does not use congestion-control mechanism. Video chunks are encapsulated before transmission using RTT (Real-Time Transport) Protocol.
- Additional client-server path is maintained to inform the client state to server like pause, resume, skip and so on.
- Bandwidth is unpredictable and varying between client and server.
- UDP streaming requires a separate media control server like RTSP server(Real-Time Streaming Protocol) to track client state(pause, resume etc).
- Devices are configured with firewalls to block UDP traffic which prevents the reception of UDP packets to clients.
2. HTTP STREAMING:
Video is stored in an HTTP server as a simple ordinary file with a unique URL. Client establishes TCP connection with server and issues a HTTP GET request for that URL. Server sends the video file along with an HTTP RESPONSE. Now the client buffer grabs the video and then displayed on user screen.
- Use of HTTP over TCP allows the video to traverse firewalls and NATs easily.
- Does not need any media control servers like RTSP servers causing reduction in cost of large-scale deployment over internet.
Youtube and Netflix uses HTTP streaming mechanism.
3. ADAPTIVE HTTP STREAMING:
The major drawbacks of HTTP streaming, lead to development of new type of HTTP based streaming referred to as DASH (Dynamic Adaptive Streaming over HTTP). Videos are encoded into different bit rate versions, having different quality. The host makes a dynamic video request of few seconds in length from different bit versions. When bandwidth is high, high bit rate chunks are received hence high quality similarly, low quality video during low bandwidth.
- DASH uses the user to switch over different qualities of video on screen.
- Client can use HTTP byte-range request to precisely control the amount of pre-fetched video that is locally buffered.
- DASH also stores the audio in different versions with different quality and different bit-rate with unique URL.
So the client dynamically selects the video and audio chunks and synchronizes it locally in the play-out.
COMCAST uses DASH for streaming high quality video contents.