Skip to main content

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

NameTypeRequiredDescription
urlstring✓

Optional node endpoint URL (overwrites config URL)

debugLoggingboolean✓

Optional debug logging flag

tokenstring✓

Optional static authorization token

CreateStreamObjectBatch​

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

NameTypeRequiredDescription
batch_filestring✓

Path to the YAML/JSON batch configuration file

CueInfo​

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

NameTypeRequiredDescription
eventIdstring✓

SCTE-35 event ID to search for

statusObject✓

Stream status object (must include lro_status_url)

FindContentType​

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

NameTypeRequiredDescription
labelstring✓

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

Init​

Init()

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

Initialize​

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

NameTypeRequiredDescription
namestring✓

The object ID of the live stream

drmboolean

Enable DRM for the stream output

(default: false)
formatstring

Output format override

Insertion​

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

NameTypeRequiredDescription
namestring✓

The object ID of the live stream

insertionTimenumber✓

Insertion time in seconds (float)

sinceStartboolean✓

true if time is relative to stream start, false if Unix epoch seconds

durationnumber

Insertion duration in seconds (float)

(default: 20.0)
targetHashstring✓

Content hash of the playable insertion content

removeboolean

Remove the insertion at the given time instead of adding it

(default: false)

LatencyCalculator​

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

NameTypeRequiredDescription
statusObject✓

Stream status object (from {@link Status})

LatencySegment​

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

NameTypeRequiredDescription
segNumnumber✓

Segment index within the recording period

statsObject✓

Cumulative stats object; egress fields are updated in place

sequencenumber✓

Current recording sequence number

periodObject✓

Recording period metadata object

statusObject✓

Stream status object (provides library/object IDs)

StartOrStopOrReset​

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

NameTypeRequiredDescription
namestring✓

The object ID of the live stream

opstring✓

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

Status​

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_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

NameTypeRequiredDescription
namestring✓

The object ID of the live stream

stopLroboolean

Stop the LRO if the stream is stalled

(default: false)
showParamsboolean

Include recording parameters in the response

(default: false)
saveMetaboolean

Write edge metadata to a local JSON file

(default: true)

StatusPrep​

StatusPrep({ name })

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

Parameters

NameTypeRequiredDescription
namestring✓

The object ID of the live stream

StopSession​

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

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

Returns: Result from StreamStopRecording

Parameters

NameTypeRequiredDescription
namestring✓

The object ID of the live stream

StreamConfig​

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

NameTypeRequiredDescription
namestring✓

The object ID of the live stream

streamCreate​

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

NameTypeRequiredDescription
objectIdstring

Existing content object ID to use as the stream object

libraryIdstring

Library in which to create a new stream object

urlstring✓

Ingest URL for the live source

finalizeboolean

Finalize the object after creation

liveRecordingConfigArgstring✓

Named profile or path to a YAML/JSON config file

namestring

Display name for the stream object

permissionstring

Permission level (e.g. "editable")

linkToSiteboolean

Link the stream to its site object

StreamDownload​

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

NameTypeRequiredDescription
namestring✓

The object ID of the live stream

periodnumber

Recording period index; defaults to the latest period

offsetnumber

Skip parts before this many seconds from the start

(default: 0)
makeFrameboolean

Extract a JPEG thumbnail from each video part

(default: false)
mpegtsCopyboolean

Output as a concatenated MPEG-TS file instead of MP4

(default: false)

StreamListUrls​

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

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

Returns: Map of stream names to playout URLs

Parameters

NameTypeRequiredDescription
siteIdstring✓

Object ID of the site

StreamStartRecording​

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

NameTypeRequiredDescription
namestring✓

The object ID of the live stream

startboolean

Immediately start the LRO after creating the token

(default: false)
show_curlboolean

Print curl commands for manual stream control

(default: false)

StreamSwitch​

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

NameTypeRequiredDescription
namestring✓

Object ID of the stream (site) object

sourcestring✓

"primary" to use the live feed, "backup" to use the backup hash

backupHashstring

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

Watermark​

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

NameTypeRequiredDescription
opstring✓

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

objectIdstring✓

Object ID of the live stream

fileNamestring

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