Table of Contents

Class VideoSource

Namespace
LiveKit.Rtc
Assembly
LivekitRtc.dll

Represents a video source for publishing video frames.

public class VideoSource : IDisposable
Inheritance
VideoSource
Implements
Inherited Members

Constructors

VideoSource(int, int)

Initializes a new instance of the video source.

public VideoSource(int width, int height)

Parameters

width int

The width of the video source in pixels.

height int

The height of the video source in pixels.

Properties

Height

Gets the height of the video source in pixels.

public int Height { get; }

Property Value

int

Width

Gets the width of the video source in pixels.

public int Width { get; }

Property Value

int

Methods

CaptureFrame(VideoFrame, long, VideoRotation)

Captures a video frame and sends it to the video source.

public void CaptureFrame(VideoFrame frame, long timestampUs = 0, VideoRotation rotation = VideoRotation._0)

Parameters

frame VideoFrame

The video frame to capture.

timestampUs long

Optional timestamp in microseconds. If 0, current time is used.

rotation VideoRotation

Optional rotation to apply to the frame.

CreateTrack(string)

Creates a local video track from this video source.

public LocalVideoTrack CreateTrack(string name = "video")

Parameters

name string

The name of the track.

Returns

LocalVideoTrack

A new LocalVideoTrack.

Dispose()

Releases the native video source.

public void Dispose()