Skip to content
Type

MediaStreamVideoTrackSourceOptions

Options for MediaStreamVideoTrackSource.

ts
type MediaStreamVideoTrackSourceOptions = {
	frameRate?: number | null;
	timestampBase?: 'synced-zero' | 'zero' | 'unix';
};

Used by

Properties

frameRate

ts
frameRate?: number | null;

The frame rate at which the underlying video track is sampled. Defaults to the frame rate specified in the track's MediaTrackSettings. Set to null to only add a frame whenever the underlying track pushes one - this minimizes frame count but can lead to wildly irregular FPS.

timestampBase

ts
timestampBase?: 'synced-zero' | 'zero' | 'unix';

Controls the basis (zero point) for video frame timestamps.

When set to 'synced-zero', timestamps will be relative to the first chunk of media from a MediaStreamTrack added to the Output.

When set to 'zero', timestamps will be relative to the first video frame emitted by this source.

When set to 'unix', timestamps will be relative to the Unix epoch, so clearly associated with a distinct point in time. Here, pausing via MediaStreamVideoTrackSource.pause will also create gaps in timestamps. Be sure to pair this mode with BaseTrackMetadata.isRelativeToUnixEpoch.

Defaults to 'synced-zero'.

Released under the Mozilla Public License 2.0.