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

new EluvioLiveStream({
url,
debugLogging,
token
})
EluvioLiveStream

Instantiate the EluvioLiveStream

Returns: New EluvioLiveStream object connected to the specified content fabric
Parameters:
Name Type Description
url string

Optional node endpoint URL (overwrites config URL)

debugLogging boolean

Optional debug logging flag

token string

Optional static authorization token

Source:

Methods

async CreateStreamObjectBatch(batch_file) → Promise.<boolean>

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 Description
batch_file string

Path to the YAML/JSON batch configuration file

Source:

async 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 Description
eventId string

SCTE-35 event ID to search for

status Object

Stream status object (must include lro_status_url)

Source:

async FindContentType({label}) → Promise.<(string|undefined)>

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 Description
label string

Content type label (e.g. "live-stream", "title")

Source:

async Init()

Initialize the EluvioLiveStream SDK, connecting to the Content Fabric using the PRIVATE_KEY environment variable.

Source:

async Initialize({
name,
drmoptional,
formatoptional
})
→ 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 Attributes Default Description
name string

The object ID of the live stream

drm boolean <optional>
false

Enable DRM for the stream output

format string <optional>

Output format override

Source:

async Insertion({
name,
insertionTime,
sinceStart,
durationoptional,
targetHash,
removeoptional
})
→ Promise.<Object>

Add or remove a content insertion entry in the live stream.

Returns:

Result from StreamInsertion

Parameters:
Name Type Attributes Default 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 <optional>
20.0

Insertion duration in seconds (float)

targetHash string

Content hash of the playable insertion content

remove boolean <optional>
false

Remove the insertion at the given time instead of adding it

Source:

async LatencyCalculator({status}) → Promise.<Object>

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 Description
status Object

Stream status object (from Status)

Source:

async 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 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)

Source:

async StartOrStopOrReset({
name,
op
})
→ Promise.<Object>

Start, stop, or reset a stream within the current recording session (current edge write token).

Operations:

  • start — begin the LRO
  • reset — 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 Description
name string

The object ID of the live stream

op string

Operation: "start" | "reset" | "stop"

Source:

async Status({
name,
stopLrooptional,
showParamsoptional,
saveMetaoptional
})
→ Promise.<Object>

Retrieve the status of the current live stream session.

Stream states:

  • unconfigured — no live_recording_config
  • uninitialized — no live_recording config generated
  • inactive — live_recording config initialized but no edge write token
  • stopped — edge write token exists but recording not started
  • starting — LRO running but no source data yet
  • running — stream is running and producing output
  • stalled — LRO running but no source data (not producing output)
Returns:

Stream status object

Parameters:
Name Type Attributes Default Description
name string

The object ID of the live stream

stopLro boolean <optional>
false

Stop the LRO if the stream is stalled

showParams boolean <optional>
false

Include recording parameters in the response

saveMeta boolean <optional>
true

Write edge metadata to a local JSON file

Source:

async StatusPrep({name})

Prepare a stream for status retrieval by setting a transaction-less static token, reducing auth overhead when polling multiple streams.

Parameters:
Name Type Description
name string

The object ID of the live stream

Source:

async StopSession({name}) → Promise.<Object>

Stop the live stream session and close the edge write token.

Returns:

Result from StreamStopRecording

Parameters:
Name Type Description
name string

The object ID of the live stream

Source:

async StreamConfig({name}) → Promise.<Object>

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 Description
name string

The object ID of the live stream

Source:

async StreamDownload({
name,
periodoptional,
offsetoptional,
makeFrameoptional,
mpegtsCopyoptional
})
→ 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 Attributes Default Description
name string

The object ID of the live stream

period number <optional>

Recording period index; defaults to the latest period

offset number <optional>
0

Skip parts before this many seconds from the start

makeFrame boolean <optional>
false

Extract a JPEG thumbnail from each video part

mpegtsCopy boolean <optional>
false

Output as a concatenated MPEG-TS file instead of MP4

Source:

async StreamListUrls({siteId}) → Promise.<Object>

List all playout URLs for streams associated with a site object.

Returns:

Map of stream names to playout URLs

Parameters:
Name Type Description
siteId string

Object ID of the site

Source:

async StreamStartRecording({
name,
startoptional,
show_curloptional
})
→ 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 Attributes Default Description
name string

The object ID of the live stream

start boolean <optional>
false

Immediately start the LRO after creating the token

show_curl boolean <optional>
false

Print curl commands for manual stream control

Source:

async StreamSwitch({
name,
source,
backupHashoptional
})
→ 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 Attributes 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 <optional>

Content hash of the backup object (required when source is "backup")

Source:

async Watermark({
op,
objectId,
fileNameoptional
})
→ Promise.<Object>

Set or remove a simple watermark on a live stream object.

Returns:

Object with watermark and finalized hash

Parameters:
Name Type Attributes Description
op string

Operation: "set" to apply a watermark, "rm" to remove it

objectId string

Object ID of the live stream

fileName string <optional>

Path to a JSON file containing the watermark definition (required for "set")

Source:

async streamCreate({
objectIdoptional,
libraryIdoptional,
url,
finalizeoptional,
liveRecordingConfigArg,
nameoptional,
permissionoptional,
linkToSiteoptional
})
→ 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 Attributes Description
objectId string <optional>

Existing content object ID to use as the stream object

libraryId string <optional>

Library in which to create a new stream object

url string

Ingest URL for the live source

finalize boolean <optional>

Finalize the object after creation

liveRecordingConfigArg string

Named profile or path to a YAML/JSON config file

name string <optional>

Display name for the stream object

permission string <optional>

Permission level (e.g. "editable")

linkToSite boolean <optional>

Link the stream to its site object

Source: