Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ErsatzTV/legacy/llms.txt

Use this file to discover all available pages before exploring further.

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.
curl http://localhost:8409/api/sessions

Response Fields

channelNumber
string
required
The channel number that this session is serving (matches the number field from GET /api/channels).
state
string
required
Current state of the HLS segmenter worker. Common values include Active (currently transcoding) and Idle (paused, waiting for a viewer).
transcodedUntil
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.
lastAccess
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.
channelNumber
string
required
The channel number whose session should be stopped (e.g. "1" or "2.1").

Responses

StatusDescription
204 No ContentThe session was successfully stopped.
404 Not FoundNo active session was found for the given channel number.
curl -X DELETE http://localhost:8409/api/session/1
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.

Build docs developers (and LLMs) love