W3cubDocs

/Web APIs

VideoColorSpace

The VideoColorSpace interface of the WebCodecs API represents the color space of a video.

Constructor

VideoColorSpace() Experimental

Creates a new VideoColorSpace object.

Instance properties

VideoColorSpace.primaries Read only

A string containing the color primary describing the color gamut of a video sample.

VideoColorSpace.transfer

A string containing the transfer characteristics of video samples.

VideoColorSpace.matrix

A string containing the matrix coefficients describing the relationship between sample component values and color coordinates.

VideoColorSpace.fullRange

A Boolean. If true indicates that full-range color values are used.

Instance methods

VideoColorSpace.toJSON()

Returns a JSON representation of the VideoColorSpace object.

Examples

In the following example, colorSpace is a VideoColorSpace object returned from VideoFrame. The object is then printed to the console.

js

let colorSpace = VideoFrame.colorSpace;
console.log(colorSpace);

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
VideoColorSpace 94 94 No No 80 17 94 94 No 66 17 17.0
VideoColorSpace 94 94 No No 80 15.4 94 94 No 66 15.4 17.0
fullRange 94 94 No No 80 15.4 94 94 No 66 15.4 17.0
matrix 94 94 No No 80 15.4 94 94 No 66 15.4 17.0
primaries 94 94 No No 80 15.4 94 94 No 66 15.4 17.0
toJSON 94 94 No No 80 15.4 94 94 No 66 15.4 17.0
transfer 94 94 No No 80 15.4 94 94 No 66 15.4 17.0

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/VideoColorSpace