EluvioLiveStream
Provides live stream management operations on the Eluvio Content Fabric: creating and configuring streams, controlling recording sessions, copying live recordings to VoD objects, and measuring ingest/egress latency.
Constructor
Instantiate the EluvioLiveStream
Returns: New EluvioLiveStream object connected to the specified content fabric
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | string | ✓ | Optional node endpoint URL (overwrites config URL) |
debugLogging | boolean | ✓ | Optional debug logging flag |
token | string | ✓ | Optional static authorization token |
CreateStreamObjectBatch
Create multiple live stream objects in bulk from a YAML or JSON batch file.
The file must define library, streams[], and either profile_name or
profile_data at the top level.
Returns: true on success
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
batch_file | string | ✓ | Path to the YAML/JSON batch configuration file |
CueInfo
eventId,
status
}) → Promise.<Object>
Look up the start and end times for a SCTE-35 event by its ID, using the LRO status URL from the stream status object.
Returns: Object with eventStart, eventEnd, and eventId
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
eventId | string | ✓ | SCTE-35 event ID to search for |
status | Object | ✓ | Stream status object (must include |
FindContentType
Find a content type object ID by its label, looking up the types registered
in the tenant's top-level object (public/content_types).
Returns: Content type object ID, or undefined if not found
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
label | string | ✓ | Content type label (e.g. "live-stream", "title") |
Init
Initialize the EluvioLiveStream SDK, connecting to the Content Fabric using the PRIVATE_KEY environment variable.
Initialize
name,
drm, // optional
format // optional
}) → Promise.<Object>
Initialize a live stream, generating the live_recording configuration from the user-supplied live_recording_config metadata.
Returns: Initialization result
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | The object ID of the live stream |
drm | boolean | Enable DRM for the stream output (default:false) | |
format | string | Output format override |
Insertion
name,
insertionTime,
sinceStart,
duration, // optional
targetHash,
remove // optional
}) → Promise.<Object>
Add or remove a content insertion entry in the live stream.
Returns: Result from StreamInsertion
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | The object ID of the live stream |
insertionTime | number | ✓ | Insertion time in seconds (float) |
sinceStart | boolean | ✓ | true if time is relative to stream start, false if Unix epoch seconds |
duration | number | Insertion duration in seconds (float) (default:20.0) | |
targetHash | string | ✓ | Content hash of the playable insertion content |
remove | boolean | Remove the insertion at the given time instead of adding it (default:false) |
LatencyCalculator
Calculate live streaming latency across three dimensions: part ingest delay, segment egress delay, and metadata retrieval time.
Probes segments at positions 1, 8, and 15 within the current mezzanine part and aggregates min/max/avg egress delay.
Returns: Latency stats including part_ingest, egress, and meta_delay
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
status | Object | ✓ | Stream status object (from {@link Status}) |
LatencySegment
segNum,
stats,
sequence,
period,
status
}) → Promise.<Object>
Measure the egress latency for a single HLS segment by timing an HTTP GET from its scheduled availability to first byte and full download.
Returns: Per-segment result: segNum, segDelay, segDelayFirstByte, segSize, downloadMbps
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
segNum | number | ✓ | Segment index within the recording period |
stats | Object | ✓ | Cumulative stats object; egress fields are updated in place |
sequence | number | ✓ | Current recording sequence number |
period | Object | ✓ | Recording period metadata object |
status | Object | ✓ | Stream status object (provides library/object IDs) |
StartOrStopOrReset
name,
op
}) → Promise.<Object>
Start, stop, or reset a stream within the current recording session (current edge write token).
Operations:
start— begin the LROreset— stop the current LRO and start a new one; creates a new recording period inside the existing edge write token (does NOT create a new token)stop— stop the LRO
Returns: Stream status
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | The object ID of the live stream |
op | string | ✓ | Operation: "start" | "reset" | "stop" |
Status
name,
stopLro, // optional
showParams, // optional
saveMeta // optional
}) → Promise.<Object>
Retrieve the status of the current live stream session.
Stream states:
unconfigured— no live_recording_configuninitialized— no live_recording config generatedinactive— live_recording config initialized but no edge write tokenstopped— edge write token exists but recording not startedstarting— LRO running but no source data yetrunning— stream is running and producing outputstalled— LRO running but no source data (not producing output)
Returns: Stream status object
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | The object ID of the live stream |
stopLro | boolean | Stop the LRO if the stream is stalled (default:false) | |
showParams | boolean | Include recording parameters in the response (default:false) | |
saveMeta | boolean | Write edge metadata to a local JSON file (default:true) |
StatusPrep
Prepare a stream for status retrieval by setting a transaction-less static token, reducing auth overhead when polling multiple streams.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | The object ID of the live stream |
StopSession
Stop the live stream session and close the edge write token.
Returns: Result from StreamStopRecording
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | The object ID of the live stream |
StreamConfig
Retrieve the resolved recording configuration for a live stream, merging
the user-supplied live_recording_config metadata with the base profile.
Returns: Resolved stream configuration
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | The object ID of the live stream |
streamCreate
objectId, // optional
libraryId, // optional
url,
finalize, // optional
liveRecordingConfigArg,
name, // optional
permission, // optional
linkToSite // optional
}) → Promise.<Object>
Create a live stream object on the Content Fabric. The recording configuration may be either a named profile or a path to a local YAML/JSON file.
Returns: Result from StreamCreate
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | Existing content object ID to use as the stream object | |
libraryId | string | Library in which to create a new stream object | |
url | string | ✓ | Ingest URL for the live source |
finalize | boolean | Finalize the object after creation | |
liveRecordingConfigArg | string | ✓ | Named profile or path to a YAML/JSON config file |
name | string | Display name for the stream object | |
permission | string | Permission level (e.g. "editable") | |
linkToSite | boolean | Link the stream to its site object |
StreamDownload
name,
period, // optional
offset, // optional
makeFrame, // optional
mpegtsCopy // optional
}) → Promise.<Object>
Download the raw parts of a live stream recording period and reassemble them into an MP4 (or MPEG-TS) file using ffmpeg.
Returns: Status object with file path and state
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | The object ID of the live stream |
period | number | Recording period index; defaults to the latest period | |
offset | number | Skip parts before this many seconds from the start (default:0) | |
makeFrame | boolean | Extract a JPEG thumbnail from each video part (default:false) | |
mpegtsCopy | boolean | Output as a concatenated MPEG-TS file instead of MP4 (default:false) |
StreamListUrls
List all playout URLs for streams associated with a site object.
Returns: Map of stream names to playout URLs
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
siteId | string | ✓ | Object ID of the site |
StreamStartRecording
name,
start, // optional
show_curl // optional
}) → Promise.<Object>
Start a new recording session by creating a new edge write token. Optionally prints the curl commands needed to manually control the stream.
Returns: Recording session status
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | The object ID of the live stream |
start | boolean | Immediately start the LRO after creating the token (default:false) | |
show_curl | boolean | Print curl commands for manual stream control (default:false) |
StreamSwitch
name,
source,
backupHash // optional
}) → Promise.<Object>
Switch a stream's playout source between its primary live feed and a backup content hash (e.g. a pre-recorded fallback).
Returns: Finalize result with source and resolved link
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | Object ID of the stream (site) object |
source | string | ✓ | "primary" to use the live feed, "backup" to use the backup hash |
backupHash | string | Content hash of the backup object (required when source is "backup") |
Watermark
op,
objectId,
fileName // optional
}) → Promise.<Object>
Set or remove a simple watermark on a live stream object.
Returns: Object with watermark and finalized hash
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
op | string | ✓ | Operation: "set" to apply a watermark, "rm" to remove it |
objectId | string | ✓ | Object ID of the live stream |
fileName | string | Path to a JSON file containing the watermark definition (required for "set") |