SlideShare a Scribd company logo
1 of 20
Download to read offline
Building a Robust Video Player
With Open Source Tech @ Hotstar
Basics First
● Media Container Formats
● Encoding Formats
● Some common Terms ---
○ Video Resolution
○ Aspect Ratio
○ Frame Rate
○ Bitrate
Bit more on Bitrate
● The data rate for a video file is the bitrate.
● So a data rate specification for video content that runs at 1 megabyte per
second would be given as a bitrate of 8 megabits per second (8 mbps).
● Internet videos, phone videos, and HD blu-ray videos for tV all vary in bitrate.
Why You told me Basics
● 360x240 resolution =====> 86400 pixels per frame.
● The frame rate is 30 Hz =====> 86400 × 30 = 2592000 pixels per second.
So let's say 1 pixel is 3 Bytes (24 Bits) of data: we have 2592000 × 24 bits per second
video (62208000 Bits), that is 62208 kBits (This is a rough estimate, and there is
something more).
Same same resolution different different
Bitrate
● Video quality has a lot to do with how the video was compressed.
● The more you compress it, the less bits it takes per frame.
● More you compress, the worse the quality is.
● Now, some videos are much easier to compress than others
● Spatial Redundancy and Temporal Redundancy
Adaptive Bitrate Streaming(a.k.a Auto Mode)
Aim: Optimize the streaming experience under a diverse set of network conditions
and across various devices
Approach:
● Produce multiple files from the same source file
● The file is consumed/delivered adaptively
● This occurs transparently to the user, so that the viewer clicks one button.
ABR Technologies
Relevant to us for now: HLS, DASH
HLS --- HTTP Live Streaming (HLS)
DASH --- Dynamic Adaptive Streaming over HTTP
HLS(HTTP Live Streaming)
DASH(Dynamic Adaptive Streaming For HTTP)
HLS vs DASH
● Proprietary
● Codec Agnostic
● No DRM method specified
● HEVC
Content Protection- Digital Rights
Management
DRM technologies use encryption to protect the content prior to or during streaming,
downloading or other transfer.
DRM encoding at source
DRM decryption at Player
Basic Player Architecture
Hls.js architecture
● Main functionalities are split into several subsystems
● All subsystems are instantiated by the Hls instance.
● Each subsystem heavily relies on events for internal/external communications.
● Events are handled using EventEmitter
DASH.js Architecture
Performance Measuring
● Key Metrics @ Hotstar to track Playback Performance
● Analytics Measurement Platform
● Analysing the weekly and monthly reports
● Identifying the key areas of improvements
Performance Improvements
Will list these during the talk
Ensuring Player Robustness
● Using fallback streams during live playback
● Handling tsunami wave of customers with a panic scenario
● Identify and build around some minor bugs in the OSS libraries
Key Takeaways and Learnings
● Video Streaming formats and technologies
● There are hundreds of thousands line of JS, that make use of Web API's to facilitate playback in
one single format
● But one does not have to reinvent the wheel. Hail OSS
● Customise the library to suit one's needs. You will be surprised of how much you can learn by
looking at the code
● Building for performance and robustness requires an approach of measuring and tuning the player

More Related Content

Similar to Web player

Video Streaming - 4.ppt
Video Streaming - 4.pptVideo Streaming - 4.ppt
Video Streaming - 4.ppt
Videoguy
 
GamingAnywhere: An Open Cloud Gaming System
GamingAnywhere: An Open Cloud Gaming SystemGamingAnywhere: An Open Cloud Gaming System
GamingAnywhere: An Open Cloud Gaming System
Academia Sinica
 

Similar to Web player (20)

[AWS Media Symposium 2019] AWS Media Services Innovation - Christer Whitehorn...
[AWS Media Symposium 2019] AWS Media Services Innovation - Christer Whitehorn...[AWS Media Symposium 2019] AWS Media Services Innovation - Christer Whitehorn...
[AWS Media Symposium 2019] AWS Media Services Innovation - Christer Whitehorn...
 
Bitmovin LIVE Tech Talks: Analytics for Workflow Automation (ft. Touchstream ...
Bitmovin LIVE Tech Talks: Analytics for Workflow Automation (ft. Touchstream ...Bitmovin LIVE Tech Talks: Analytics for Workflow Automation (ft. Touchstream ...
Bitmovin LIVE Tech Talks: Analytics for Workflow Automation (ft. Touchstream ...
 
Slide
SlideSlide
Slide
 
Brightcove live tech overview
Brightcove live tech overviewBrightcove live tech overview
Brightcove live tech overview
 
Multimedia Services: Video
Multimedia Services: VideoMultimedia Services: Video
Multimedia Services: Video
 
Encoding Video for the Web - Webinar from ReelSEO.com
Encoding Video for the Web  - Webinar from ReelSEO.comEncoding Video for the Web  - Webinar from ReelSEO.com
Encoding Video for the Web - Webinar from ReelSEO.com
 
Nimble Streamer Transcoder overview
Nimble Streamer Transcoder overviewNimble Streamer Transcoder overview
Nimble Streamer Transcoder overview
 
CHAPTER – 6 Video
CHAPTER – 6    VideoCHAPTER – 6    Video
CHAPTER – 6 Video
 
Bitmovin LIVE Tech Talks: Data Driven Video Workflows
Bitmovin LIVE Tech Talks: Data Driven Video WorkflowsBitmovin LIVE Tech Talks: Data Driven Video Workflows
Bitmovin LIVE Tech Talks: Data Driven Video Workflows
 
Build end-to-end video experiences with Azure Media Services
Build end-to-end video experiences with Azure Media ServicesBuild end-to-end video experiences with Azure Media Services
Build end-to-end video experiences with Azure Media Services
 
Building a Real-Time Gaming Analytics Service with Apache Druid
Building a Real-Time Gaming Analytics Service with Apache DruidBuilding a Real-Time Gaming Analytics Service with Apache Druid
Building a Real-Time Gaming Analytics Service with Apache Druid
 
Streaming video to html
Streaming video to htmlStreaming video to html
Streaming video to html
 
Video Streaming - 4.ppt
Video Streaming - 4.pptVideo Streaming - 4.ppt
Video Streaming - 4.ppt
 
Design in Motion: Video Production Workflow
Design in Motion: Video Production WorkflowDesign in Motion: Video Production Workflow
Design in Motion: Video Production Workflow
 
BUILD 2014 - Building end-to-end video experience with Azure Media Services
BUILD 2014 - Building end-to-end video experience with Azure Media ServicesBUILD 2014 - Building end-to-end video experience with Azure Media Services
BUILD 2014 - Building end-to-end video experience with Azure Media Services
 
Criteo Labs Infrastructure Tech Talk Meetup Nov. 7
Criteo Labs Infrastructure Tech Talk Meetup Nov. 7Criteo Labs Infrastructure Tech Talk Meetup Nov. 7
Criteo Labs Infrastructure Tech Talk Meetup Nov. 7
 
SJNC13.pptx
SJNC13.pptxSJNC13.pptx
SJNC13.pptx
 
MPEG4 vs H.264
MPEG4 vs H.264MPEG4 vs H.264
MPEG4 vs H.264
 
Video Transcoding Terms Explained
Video Transcoding Terms Explained Video Transcoding Terms Explained
Video Transcoding Terms Explained
 
GamingAnywhere: An Open Cloud Gaming System
GamingAnywhere: An Open Cloud Gaming SystemGamingAnywhere: An Open Cloud Gaming System
GamingAnywhere: An Open Cloud Gaming System
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Web player

  • 1. Building a Robust Video Player With Open Source Tech @ Hotstar
  • 2. Basics First ● Media Container Formats ● Encoding Formats ● Some common Terms --- ○ Video Resolution ○ Aspect Ratio ○ Frame Rate ○ Bitrate
  • 3. Bit more on Bitrate ● The data rate for a video file is the bitrate. ● So a data rate specification for video content that runs at 1 megabyte per second would be given as a bitrate of 8 megabits per second (8 mbps). ● Internet videos, phone videos, and HD blu-ray videos for tV all vary in bitrate.
  • 4. Why You told me Basics ● 360x240 resolution =====> 86400 pixels per frame. ● The frame rate is 30 Hz =====> 86400 × 30 = 2592000 pixels per second. So let's say 1 pixel is 3 Bytes (24 Bits) of data: we have 2592000 × 24 bits per second video (62208000 Bits), that is 62208 kBits (This is a rough estimate, and there is something more).
  • 5. Same same resolution different different Bitrate ● Video quality has a lot to do with how the video was compressed. ● The more you compress it, the less bits it takes per frame. ● More you compress, the worse the quality is. ● Now, some videos are much easier to compress than others ● Spatial Redundancy and Temporal Redundancy
  • 6. Adaptive Bitrate Streaming(a.k.a Auto Mode) Aim: Optimize the streaming experience under a diverse set of network conditions and across various devices Approach: ● Produce multiple files from the same source file ● The file is consumed/delivered adaptively ● This occurs transparently to the user, so that the viewer clicks one button.
  • 7. ABR Technologies Relevant to us for now: HLS, DASH HLS --- HTTP Live Streaming (HLS) DASH --- Dynamic Adaptive Streaming over HTTP
  • 10. HLS vs DASH ● Proprietary ● Codec Agnostic ● No DRM method specified ● HEVC
  • 11. Content Protection- Digital Rights Management DRM technologies use encryption to protect the content prior to or during streaming, downloading or other transfer.
  • 12. DRM encoding at source
  • 15. Hls.js architecture ● Main functionalities are split into several subsystems ● All subsystems are instantiated by the Hls instance. ● Each subsystem heavily relies on events for internal/external communications. ● Events are handled using EventEmitter
  • 17. Performance Measuring ● Key Metrics @ Hotstar to track Playback Performance ● Analytics Measurement Platform ● Analysing the weekly and monthly reports ● Identifying the key areas of improvements
  • 18. Performance Improvements Will list these during the talk
  • 19. Ensuring Player Robustness ● Using fallback streams during live playback ● Handling tsunami wave of customers with a panic scenario ● Identify and build around some minor bugs in the OSS libraries
  • 20. Key Takeaways and Learnings ● Video Streaming formats and technologies ● There are hundreds of thousands line of JS, that make use of Web API's to facilitate playback in one single format ● But one does not have to reinvent the wheel. Hail OSS ● Customise the library to suit one's needs. You will be surprised of how much you can learn by looking at the code ● Building for performance and robustness requires an approach of measuring and tuning the player