Git Product home page Git Product logo

media-capabilities's Introduction

Media Capabilities API

Problem Statement

To deliver media across an enormous range of devices and networks, modern services stream their content in a wide range of formats - varying by codec, resolution, container format, encryption scheme, and other dimensions. Unlike many devices, browsers run across a wide range of platforms and hardware, so identifying which formats are optimal - or even supported - is challenging. Existing Web APIs, like isTypeSupported and canPlayType are vague and insufficiently expressive; thus sites often pick an arbitrary target independent of actual capabilities.

Main Requirements

The Media Capabilities API seeks to provide definitive answers on several playback dimensions:

  • Given its properties, can a specified piece of media content be played at all?
  • Will playback have high quality (smoothness)? Will it be power efficient?
  • Do output capabilities (e.g. color gamut, dynamic range, audio channels) match content?
  • Are security requirements (e.g. encryption, HDCP, etc) supported or playback-impacting?
  • Given multiple possible media formats, which is preferable?

The sum of these requirements is simple; given the reality that content items are stored in multiple formats and levels, which of these should be selected for delivery to a particular UA?

Solution Outline

The proposed solution is to introduce a new API and corresponding set of properties that meet the requirements above:

  • A new query-based capability API allows pages to identify whether a given combination of properties - codec and profile, resolution, frame/sample rate, bit rate, bit depth, pixel format, color space, EOTF, content protection scheme, and others - is supported. If so, estimates of playback quality and power efficiency will also be provided. This mostly corresponds to the decoding capability of the UA.

  • Additional output properties (e.g. on window.screen), such as color gamut and dynamic range, will identify what can meaningfully be rendered to the user. This helps sites avoid resource-intensive formats that can be decoded but not properly displayed (e.g. HDR content on a SDR display, or multichannel audio with stereo speakers).

  • Even with the above, existing APIs and heuristics remain important. Network and CDN throughput aren’t addressed by the above but often constrain viable bitrates. Real-time contention for CPU/GPU, detected using dropped frame count or perhaps the new Media Playback Quality API, may also dynamically limit quality (e.g. forcing lower resolution).

The above allows sites to make optimal decisions, most of the time, before streaming begins.

media-capabilities's People

Contributors

avayvod avatar beaufortfrancois avatar chcunningham avatar foolip avatar guest271314 avatar joeyparrish avatar mattiasbuelens avatar mounirlamouri avatar onotole avatar philcluff avatar tomrittervg avatar xhwang-chromium avatar yellowdoge avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.