Table of Contents

Class EgressServiceClient

Namespace
Livekit.Server.Sdk.Dotnet
Assembly
LivekitApi.dll

Client of the LiveKit Egress service: records or streams rooms, participants, tracks and web pages. See Egress overview.

public class EgressServiceClient : BaseService
Inheritance
EgressServiceClient
Inherited Members

Constructors

EgressServiceClient(string, string, string, HttpClient)

Creates the client.

public EgressServiceClient(string host, string apiKey = null, string apiSecret = null, HttpClient client = null)

Parameters

host string

URL of the LiveKit server, http(s):// or ws(s)://; a subpath such as https://host/livekit is kept.

apiKey string

API key; the LIVEKIT_API_KEY environment variable when omitted.

apiSecret string

API secret; the LIVEKIT_API_SECRET environment variable when omitted.

client HttpClient

Optional HttpClient to send the requests with. The SDK never modifies it, so it can be shared with other clients and code.

Methods

ListEgress(ListEgressRequest)

Lists the egresses, optionally filtered by room, egress ID or active state.

public Task<ListEgressResponse> ListEgress(ListEgressRequest request)

Parameters

request ListEgressRequest

Optional filters: room name, egress ID, active egresses only.

Returns

Task<ListEgressResponse>

The matching egresses.

StartEgress(StartEgressRequest)

Start any type of egress. The request's source and outputs determine the egress type.

public Task<EgressInfo> StartEgress(StartEgressRequest request)

Parameters

request StartEgressRequest

Which kind of egress to start, with its own options.

Returns

Task<EgressInfo>

The started egress, with its ID and status.

StartParticipantEgress(ParticipantEgressRequest)

Starts a participant egress: records or streams the tracks of one participant.

public Task<EgressInfo> StartParticipantEgress(ParticipantEgressRequest request)

Parameters

request ParticipantEgressRequest

Room name, participant identity and the outputs.

Returns

Task<EgressInfo>

The started egress, with its ID and status.

StartRoomCompositeEgress(RoomCompositeEgressRequest)

Starts a room composite egress: records or streams the whole room, rendered by a web template.

public Task<EgressInfo> StartRoomCompositeEgress(RoomCompositeEgressRequest request)

Parameters

request RoomCompositeEgressRequest

Room name, layout, template and the file, stream, segment or image outputs.

Returns

Task<EgressInfo>

The started egress, with its ID and status.

StartTrackCompositeEgress(TrackCompositeEgressRequest)

Starts a track composite egress: records or streams one audio and one video track mixed together.

public Task<EgressInfo> StartTrackCompositeEgress(TrackCompositeEgressRequest request)

Parameters

request TrackCompositeEgressRequest

Room name, the audio and video track SIDs and the outputs.

Returns

Task<EgressInfo>

The started egress, with its ID and status.

StartTrackEgress(TrackEgressRequest)

Starts a track egress: exports a single track to a file or to a WebSocket.

public Task<EgressInfo> StartTrackEgress(TrackEgressRequest request)

Parameters

request TrackEgressRequest

Room name, track SID and the file or WebSocket output.

Returns

Task<EgressInfo>

The started egress, with its ID and status.

StartWebEgress(WebEgressRequest)

Starts a web egress: records or streams an arbitrary web page.

public Task<EgressInfo> StartWebEgress(WebEgressRequest request)

Parameters

request WebEgressRequest

URL to render and the outputs.

Returns

Task<EgressInfo>

The started egress, with its ID and status.

StopEgress(StopEgressRequest)

Stops a running egress.

public Task<EgressInfo> StopEgress(StopEgressRequest request)

Parameters

request StopEgressRequest

Egress ID.

Returns

Task<EgressInfo>

The stopped egress.

UpdateLayout(UpdateLayoutRequest)

Changes the layout of a running room composite egress.

public Task<EgressInfo> UpdateLayout(UpdateLayoutRequest request)

Parameters

request UpdateLayoutRequest

Egress ID and the new layout.

Returns

Task<EgressInfo>

The updated egress.

UpdateStream(UpdateStreamRequest)

Adds or removes stream destinations (RTMP, SRT) of a running stream egress.

public Task<EgressInfo> UpdateStream(UpdateStreamRequest request)

Parameters

request UpdateStreamRequest

Egress ID and the stream URLs to add or remove.

Returns

Task<EgressInfo>

The updated egress.