Skip to content
Type

VideoSampleInit

Metadata used for VideoSample initialization.

ts
type VideoSampleInit = {
	format?: VideoSamplePixelFormat;
	codedWidth?: number;
	codedHeight?: number;
	rotation?: Rotation;
	timestamp?: number;
	duration?: number;
	colorSpace?: VideoColorSpaceInit;
	layout?: PlaneLayout[];
	visibleRect?: Rectangle | undefined;
	displayWidth?: number | undefined;
	displayHeight?: number | undefined;
};

See VideoSamplePixelFormat, Rotation, and Rectangle.

Used by

Properties

format

ts
format?: VideoSamplePixelFormat;

The internal pixel format in which the frame is stored. See pixel formats

See VideoSamplePixelFormat.

codedWidth

ts
codedWidth?: number;

The width of the frame in pixels.

codedHeight

ts
codedHeight?: number;

The height of the frame in pixels.

rotation

ts
rotation?: Rotation;

The rotation of the frame in degrees, clockwise.

See Rotation.

timestamp

ts
timestamp?: number;

The presentation timestamp of the frame in seconds.

duration

ts
duration?: number;

The duration of the frame in seconds.

colorSpace

ts
colorSpace?: VideoColorSpaceInit;

The color space of the frame.

layout

ts
layout?: PlaneLayout[];

The byte layout of the planes of the frame.

visibleRect

ts
visibleRect?: Rectangle;

Visible region in the coded frame. When omitted, the rect defaults to (0, 0, codedWidth, codedHeight).

See Rectangle.

displayWidth

ts
displayWidth?: number;

Width of the frame in pixels after applying aspect ratio adjustments and rotation.

displayHeight

ts
displayHeight?: number;

Height of the frame in pixels after applying aspect ratio adjustments and rotation.

Released under the Mozilla Public License 2.0.