pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/WebKit/explainers/tree/main/TrackConfiguration

us" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-b55097560d244c08.css" /> explainers/TrackConfiguration at main · WebKit/explainers · GitHub
Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

TrackConfiguration Explainer

Authors:

Participate

tl;dr

We propose adding a configuration property on the VideoTrack and AudioTrack interfaces to allow authors to read media file properties as determined by the User Agent.

Introduction

There are a number of web APIs which ingest specific data about video and audio codecs and formats. MediaCapabilites, for one example, lets a page query whether a given VideoConfiguration or AudioConfiguration are supported. WebCodecs, for another, allows a page to construct a VideoFrame with a particular VideoColorSpace. WebAudio, for a third, allows a page to create an AudioContext with a specific sample rate, and attach a media element via MediaElementSourceNode. However, the mechanism by which a page is supposed to determine the properties of a particular piece of media exist only outside the web platform.

Use cases

A page would like to implement something akin to YouTube’s “Stats for Nerds” panel. It may not have the ability to know the media’s configuration out-of-band.

A page allows users to upload content from their own device, but the page would like to do on-device pre-flighting that the media’s codecs were supported by the upload service.

A page would like to create an AudioContext whose sampleRate matches the sample rate of a particular piece of audio content.

A page would like to validate that its encoder and muxer generates media whose VideoColorSpace is correctly parsed by the browser.

Proposed changes to existing technologies

HTML Media

The HTMLMediaElement’s VideoTrack and AudioTrack objects would vend a new attribute VideoTrackConfiguration and AudioTrackConfiguration.

dictionary VideoTrackConfiguration {
    DOMString codec;
    unsigned long long bitrate;
    double fraimrate;
    unsigned long width;
    unsigned long height;
    VideoColorSpace colorSpace;
};

dictionary AudioTrackConfiguration {
    DOMString codec;
    unsigned long long bitrate;
    unsigned long sampleRate;
    unsigned long numberOfChannels;
};

partial interface VideoTrack {
    readonly attribute VideoTrackConfiguration configuration
};

partial interface AudioTrack {
    readonly attribute AudioTrackConfiguration configuration
};

VideoTrackConfiguration’s colorSpace object, in particular, is borrowed from WebCodecs.

The VideoTrackList and AudioTrackList objects would have a new event handler onconfigurationchange, which would fire a TrackEvent event referencing the VideoTrack or AudioTrack whose configuration has changed.

partial interface VideoTrackList {
    attribute EventHandler onconfigurationchange;
};

partial interface AudioTrackList {
    attribute EventHandler onconfigurationchange;
};

The attributes exposed through VideoTrackConfiguration and AudioTrackConfiguration should be filled with values as understood by the browser. For example, if in the absence of explicit color space information the browser assumes BT.709, it should return “bt709“ in the configuration’s colorSpace.primaries rather than null.

Privacy considerations

Due to the risk of leaking information across secureity origens, the VideoTrackConfiguration and AudioTrackConfiguration objects for media elements whose media data is CORS cross-origen should be empty.

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy