The Application Layer: Video Streaming

 
The Application Layer:
Video Streaming
 
Srinivas Narayana
 
1
Quick recap of concepts
Sender’s
user agent
Sender’s
mail server
Recipient’s
mail server
Recipient’s
user agent
 
SMTP
 
Simple Mail Transfer
Protocol (SMTP)
 
SMTP
 
??
 
Mail access protocols
POP, IMAP, 
HTTP
 
Video
representation:
Pixels 
in 
Frames
 
Spatial coding
 
Temporal coding
 
Codec
Video codecs: terminology
 
Video 
bit rate
: 
effective number of bits per second of the
video after encoding
Higher bit rate == higher perceptual quality
CBR: (constant bit rate): 
fixed bit-rate video
VBR:  (variable bit rate): 
different parts of the video have
different bit rates, e.g., changes in color, motion, etc.
For VBR, we talk about 
average bit-rate 
over video’s duration
 
https://blog.video.ibm.com/streaming-video-tips/what-is-video-encoding-codecs-compression-techniques/
Networking multimedia: 3 types
 
On-demand streamed video/audio
Can begin playout before downloading the entire file
Ful video/audio stored at the server: able to transmit faster than
audio/video will be rendered (with storing/buffering at client)
e.g., Spotify, YouTube, Netflix
Conversational
 
voice or video over IP
interactive human-to-human communication limits delay tolerance
e.g., Zoom, Google Stadia
Live streamed 
audio, video
e.g, sporting event on sky sports
Can buffer a little, but must be close to the “live edge” of content
 
On-demand Video Streaming
 
Streaming (stored) video
 
Media is prerecorded at different qualities
Available in storage at the server
Client downloads an initial portion and starts
viewing
The rest is downloaded as time progresses
No need for user to wait for entire content to be
downloaded!
Can change the quality of the content and
where it’s fetched mid-stream
More on this soon
Streaming stored video
Cumulative data
(e.g. bytes)
time
7
Server
e.g. Netflix
Client
e.g., your
phone
Constant
bit rate
video
Streaming stored video: challenges
 
Continuous playout constraint
: once client playout begins,
playback must match the original timing of the video (why?)
 
But 
network delays are variable!
 
Clients have a 
client-side buffer 
of downloaded video to
absorb variation in network conditions
 
Client interactivity: pause, fast-forward, rewind, jump through
video
8
 
       constant bit 
      rate video
transmission
Cumulative data
time
 
Client-side buffering with playout delay:
compensate for network-added delays and variations in the delay
Scenario 1: Constant bit-rate video
9
       constant bit 
      rate video
transmission
Cumulative data
time
 
       constant bit
     rate video
 playout at client
 
Playout delay that’s too small can cause stalls
There’s nothing in the buffer to show to the user
Scenario 2: Small playout delay
10
Client-side buffering, playout
 
variable fill
rate, 
x(t)
 
Client’s
buffer, size B
max
 
playout rate,
e.g., CBR 
r
 
buffer fill level,
B(t)
video server
client
11
Most video is broken up in time into multiple 
segments
Client downloads video segment by segment
For example: a segment might be 4 seconds worth of video.
variable fill 
rate, 
x(t)
buffer fill level,
B(t)
video server
client
 
1. 
Initial fill of buffer until playout begins at t
p
 
2. 
playout begins at t
p
3. 
buffer fill level varies over time as fill rate
 x(t)
varies (assume playout rate 
r
 is constant for now)
12
Client-side buffering, playout
Client’s
buffer, size B
max
variable fill 
rate, 
x(t)
buffer fill level,
B(t)
video server
13
Client-side buffering, playout
 
playout buffering: average fill rate (x), playout rate (r):
x < r: 
buffer eventually empties for a sufficiently long video. Stall and
rebuffering
x > r: 
buffer will not empty, provided the initial playout delay is large
enough to absorb variability in x(t)
initial playout delay tradeoff: 
buffer starvation less likely with larger
delay, but also incur a larger delay until the user begins watching
 
Client’s
buffer, size B
max
variable fill 
rate, 
x(t)
buffer fill level,
B(t)
video server
14
Client-side buffering, playout
 
playout buffering: average fill rate (x), playout rate (r):
is x < r or x > r for a given network connection?
It is hard to predict this in general!
Best effort network suffers long queues, paths with low bandwidth, …
How to set playout rate r?
Too low a bit-rate r: video has poorer quality than needed
Too high a bit-rate r: buffer might empty out. Stall/rebuffering!
Client’s
buffer, size B
max
Adaptive bit–rate video
 
Motivation: Want to provide high quality video experience, without
stalls
Observations:
Videos come in different qualities (average bit rates)
Versions of the video for different quality levels readily available
Different segments of video can be downloaded separately
Adapt bit rate per segment 
through collaboration between the
video client (e.g., your browser) and the server (e.g., @ Netflix)
Adaptive bit-rate (ABR) video: 
change the bit-rate (quality) of next
video segment based on network and client conditions
A typical strategy:  
Buffer-based rate adaptation
Buffer-based bit-rate adaptation
 
Key idea: If there is a large stored buffer of video, optimize
aggressively for video quality, i.e., high bit rates
 
Else (i.e., buffer has low occupancy), avoid stalls by being
conservative and ask for a lower quality (bit-rate)
Hope: lower bandwidth requirement of a lower quality stream is satisfiable
more easily
 
Buffer-based bit-rate adaptation
 
 
 
 
 
 
 
 
 
 
 
http://yuba.stanford.edu/~nickm/papers/sigcomm2014-video.pdf
A Buffer-Based Approach to Rate Adaptation
 
A highly effective method
to provide high video
quality despite variable and
intermittently poor
network conditions.
 
Used by Netflix.
 
Dynamic Adaptive Streaming
over HTTP (DASH)
 
 
Streaming multimedia with DASH
 
Dynamic Adaptive Streaming over 
HTTP
Used by Netflix and most popular video streaming services
Adaptive: 
Perform video bit rate adaptation
It can be done on the client, or the server (with client feedback)
Dynamic:
 Retrieve a single video from multiple sources
The DASH video server is just a standard HTTP server
Provides video/audio content in multiple formats and encodings
Leverage existing web-based infrastructure
DNS
CDNs!
 
DASH: Key ideas
 
Content (video, audio,
transcript, etc.) divided
into 
segments (time)
Algorithms to determine
and request 
varying
attributes (e.g., bitrate,
language) for each
segment
Goal: ensure good
quality of service, match
user prefs, etc.
 
Video
 
Audio
 
Transcripts
 
Issue requests on time.
Pick attributes for each
segment of content
What does the manifest contain?
Source: Stockhammer, MMSys.
https://www.w3.org/2010/11/web-and-tv/papers/webtv2_submission_64.pdf
 
Periods:
Durations
of content
 
Adaptation set:
functionally
equivalent
content
 
Representations:
codecs, bit rates,
etc.
 
Multiple
segments per
representation
URL available
for each
segment
Byte ranges
per segment
(HTTP header
for a 
range
request
)
 
Dynamic changes in stream quality
Get stream from anywhere!
Just an HTTP request for an HTTP object
 
CDN servers
caching the
video
Internet
 
DASH reference player
 
https://reference.dashif.org/dash.js/latest/samples/dash-if-
reference-player/index.html
 
DASH Summary
 
Piggyback video on HTTP: 
widely used
Enables independent HTTP requests per segment
Choose dynamic quality & preferences over time
Independent HTTP byte ranges
Works well with CDNs
Fetch segments from locations other than the origin server
Fetch different segments from possibly different locations
More resources on DASH
https://www.w3.org/2010/11/web-and-
tv/papers/webtv2_submission_64.pdf
https://www.youtube.com/watch?v=xgowGnH5kUE
 
              Server Selection
 
File 
     
  
 
  
DNS returns different IP addresses for a given DNS name
 
HTTP redirect
Use HTTP status code 3xx [with new URL]
Web browser does a GET from the new site
 
IP anycast
Use BGP to announce the same IP address from different locations
Client reaches “nearest” location according to inter-domain routing
 
Slide Note
Embed
Share

This content provides an in-depth overview of video streaming concepts including video representation, codecs, networking multimedia, on-demand video streaming, and streaming stored video. Topics covered include pixels in frames, spatial coding, temporal coding, different types of video/audio streaming, video bit rates, and more. Explore the intricacies of video encoding, storage, and transmission protocols in the realm of multimedia networking.

  • Video streaming
  • Codecs
  • Multimedia
  • Networking
  • On-demand

Uploaded on Feb 21, 2025 | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. The Application Layer: Video Streaming Lecture 8 http://www.cs.rutgers.edu/~sn624/352-S22 Srinivas Narayana 1

  2. Quick recap of concepts Video representation: Pixels in Frames Spatial coding Temporal coding Codec Simple Mail Transfer Protocol (SMTP) Mail access protocols POP, IMAP, HTTP Recipient s mail server Sender s mail server SMTP Sender s user agent Recipient s user agent SMTP ??

  3. Video codecs: terminology Video bit rate: effective number of bits per second of the video after encoding Higher bit rate == higher perceptual quality CBR: (constant bit rate): fixed bit-rate video VBR: (variable bit rate): different parts of the video have different bit rates, e.g., changes in color, motion, etc. For VBR, we talk about average bit-rate over video s duration https://blog.video.ibm.com/streaming-video-tips/what-is-video-encoding-codecs-compression-techniques/

  4. Networking multimedia: 3 types On-demand streamed video/audio Can begin playout before downloading the entire file Ful video/audio stored at the server: able to transmit faster than audio/video will be rendered (with storing/buffering at client) e.g., Spotify, YouTube, Netflix Conversationalvoice or video over IP interactive human-to-human communication limits delay tolerance e.g., Zoom, Google Stadia Live streamed audio, video e.g, sporting event on sky sports Can buffer a little, but must be close to the live edge of content

  5. On-demand Video Streaming

  6. Streaming (stored) video Media is prerecorded at different qualities Available in storage at the server Client downloads an initial portion and starts viewing The rest is downloaded as time progresses No need for user to wait for entire content to be downloaded! Can change the quality of the content and where it s fetched mid-stream More on this soon

  7. Streaming stored video Constant bit rate video Client e.g., your phone 2. video sent 1. video recorded (e.g., 30 frames/sec) 3. video received, played out at client (30 frames/sec) network delay (fixed in this example) time streaming: at this time, client playing out early part of video, while server still sending later part of video Server e.g. Netflix 7

  8. Streaming stored video: challenges Continuous playout constraint: once client playout begins, playback must match the original timing of the video (why?) But network delays are variable! Clients have a client-side buffer of downloaded video to absorb variation in network conditions Client interactivity: pause, fast-forward, rewind, jump through video 8

  9. Scenario 1: Constant bit-rate video constant bit rate video transmission client video reception constant bit rate video playout at client variable network delay buffered video time client playout delay Client-side buffering with playout delay: compensate for network-added delays and variations in the delay 9

  10. Scenario 2: Small playout delay constant bit rate video transmission client video reception constant bit rate video playout at client variable network delay buffered video time client playout delay Playout delay that s too small can cause stalls There s nothing in the buffer to show to the user 10

  11. Client-side buffering, playout buffer fill level, B(t) playout rate, e.g., CBR r variable fill rate, x(t) video server Client s buffer, size Bmax client Most video is broken up in time into multiple segments Client downloads video segment by segment For example: a segment might be 4 seconds worth of video. 11

  12. Client-side buffering, playout buffer fill level, B(t) playout rate, e.g., CBR r variable fill rate, x(t) video server Client s buffer, size Bmax client 1. Initial fill of buffer until playout begins at tp 2. playout begins at tp 3. buffer fill level varies over time as fill rate x(t) varies (assume playout rate r is constant for now) 12

  13. Client-side buffering, playout buffer fill level, B(t) playout rate, e.g., CBR r variable fill rate, x(t) video server Client s buffer, size Bmax playout buffering: average fill rate (x), playout rate (r): x < r: buffer eventually empties for a sufficiently long video. Stall and rebuffering x > r: buffer will not empty, provided the initial playout delay is large enough to absorb variability in x(t) initial playout delay tradeoff: buffer starvation less likely with larger delay, but also incur a larger delay until the user begins watching 13

  14. Client-side buffering, playout buffer fill level, B(t) playout rate, e.g., CBR r variable fill rate, x(t) video server Client s buffer, size Bmax playout buffering: average fill rate (x), playout rate (r): is x < r or x > r for a given network connection? It is hard to predict this in general! Best effort network suffers long queues, paths with low bandwidth, How to set playout rate r? Too low a bit-rate r: video has poorer quality than needed Too high a bit-rate r: buffer might empty out. Stall/rebuffering! 14

  15. Adaptive bitrate video Motivation: Want to provide high quality video experience, without stalls Observations: Videos come in different qualities (average bit rates) Versions of the video for different quality levels readily available Different segments of video can be downloaded separately Adapt bit rate per segment through collaboration between the video client (e.g., your browser) and the server (e.g., @ Netflix) Adaptive bit-rate (ABR) video: change the bit-rate (quality) of next video segment based on network and client conditions A typical strategy: Buffer-based rate adaptation

  16. Buffer-based bit-rate adaptation Key idea: If there is a large stored buffer of video, optimize aggressively for video quality, i.e., high bit rates Else (i.e., buffer has low occupancy), avoid stalls by being conservative and ask for a lower quality (bit-rate) Hope: lower bandwidth requirement of a lower quality stream is satisfiable more easily

  17. Buffer-based bit-rate adaptation A highly effective method to provide high video quality despite variable and intermittently poor network conditions. Used by Netflix. http://yuba.stanford.edu/~nickm/papers/sigcomm2014-video.pdf A Buffer-Based Approach to Rate Adaptation

  18. Dynamic Adaptive Streaming over HTTP (DASH)

  19. Streaming multimedia with DASH Dynamic Adaptive Streaming over HTTP Used by Netflix and most popular video streaming services Adaptive: Perform video bit rate adaptation It can be done on the client, or the server (with client feedback) Dynamic: Retrieve a single video from multiple sources The DASH video server is just a standard HTTP server Provides video/audio content in multiple formats and encodings Leverage existing web-based infrastructure DNS CDNs!

  20. DASH: Key ideas Web Browser Or Video Client Content (video, audio, transcript, etc.) divided into segments (time) Algorithms to determine and request varying attributes (e.g., bitrate, language) for each segment Goal: ensure good quality of service, match user prefs, etc. HTTP client Media player Issue requests on time. Pick attributes for each segment of content Media Presentation Description (manifest) Video Server Audio Transcripts

  21. What does the manifest contain? Adaptation set: functionally equivalent content Representations: codecs, bit rates, etc. Periods: Durations of content Multiple segments per representation URL available for each segment Byte ranges per segment (HTTP header for a range request) Source: Stockhammer, MMSys. https://www.w3.org/2010/11/web-and-tv/papers/webtv2_submission_64.pdf

  22. Dynamic changes in stream quality

  23. Get stream from anywhere! Just an HTTP request for an HTTP object 2. HTTP reply containing html to construct the web page, manifest, with URsL for video content 3. HTTP GET request for URLs CDN servers caching the video YouTube origin servers Internet 1. HTTP GET request for video URL 4. HTTP reply with cached resources at those URLs User

  24. DASH reference player https://reference.dashif.org/dash.js/latest/samples/dash-if- reference-player/index.html

  25. DASH Summary Piggyback video on HTTP: widely used Enables independent HTTP requests per segment Choose dynamic quality & preferences over time Independent HTTP byte ranges Works well with CDNs Fetch segments from locations other than the origin server Fetch different segments from possibly different locations More resources on DASH https://www.w3.org/2010/11/web-and- tv/papers/webtv2_submission_64.pdf https://www.youtube.com/watch?v=xgowGnH5kUE

Related


More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#