Skip to main content
When a channel is configured to use the HlsSegmenter streaming mode, ErsatzTV maintains a per-channel worker process that transcodes media in real time and writes HLS segments to disk. The Sessions API lets you inspect all active segmenter workers and forcibly terminate one if it is misbehaving or consuming excessive resources.

GET /api/sessions

Returns a list of all currently active HLS segmenter sessions. Each entry corresponds to one channel worker process.

Response Fields

string
required
The channel number that this session is serving (matches the number field from GET /api/channels).
string
required
Current state of the HLS segmenter worker. Common values include Active (currently transcoding) and Idle (paused, waiting for a viewer).
string (date-time)
required
ISO 8601 timestamp indicating how far ahead the segmenter has pre-transcoded content. ErsatzTV keeps a buffer of transcoded segments ahead of the current playback position.
string (date-time)
required
ISO 8601 timestamp of the last time a client requested an HLS segment from this session. Used to determine when an idle session should be shut down automatically.
Sessions are only created for channels using the HlsSegmenter streaming mode. Channels using HlsDirect or TransportStream will not appear in this list.

DELETE /api/session/

Stops the HLS segmenter session for the specified channel. The session worker is terminated, any in-progress transcoding is aborted, and pre-written segment files are cleaned up. The next viewer request to that channel will start a fresh session.
string
required
The channel number whose session should be stopped (e.g. "1" or "2.1").

Responses

Stopping a session that has active viewers will interrupt their stream. The viewer’s player will typically reconnect and trigger a new session to start automatically, but there may be a brief interruption during the restart.