Skip to main content

Live Stream

Methods for Live Stream creation and management

AuditStream

AuditStream({
  objectId, // optional
  versionHash, // optional
  salt, // optional
  samples, // optional
  authorizationToken // optional
}) → Promise.<Object>

Audit the specified live stream against several content fabric nodes

Returns: Response describing audit results

Parameters

NameTypeRequiredDescription
objectIdstring

Object ID of the live stream

versionHashstring

Version hash of the live stream -- if not specified, latest version is returned

saltstring

base64-encoded byte sequence for salting the audit hash

samplesArray.<number>

list of percentages (0.0 - <1.0) used for sampling the content part list, up to 3

authorizationTokenstring

Additional authorization token for this request

FileInfo

FileInfo(
  path,
  fileList
) → Promise.<Array.<Object>>

Converts a list of File objects into an array of file info objects suitable for upload.

Returns: Array of file info objects with path, type, size, mime_type, and data

Parameters

NameTypeRequiredDescription
pathstring

The destination path prefix for the files

fileListFileList | Array.<File>

The list of File objects to process

OutputsCreate

OutputsCreate({
  libraryId, // optional
  objectId,
  streamObjectId, // optional
  name, // optional
  description, // optional
  nodeIds, // optional
  geos, // optional
  passphrase, // optional
  stripRtp, // optional
  srtConfig // optional
}) → Promise.<Object>

Create a new live output.

At the current version of the live outputs API an output will be pinned to a node, by either:

  • specifying the node directly in 'nodeIds'
  • specifying an 'elvgeo' and use fabric config 'live_egress' services to pick a node ID

Note: Output creation and modification is transactional. To create multiple outputs in a single transaction, use EditContentObject to open a write token, call CallBitcodeMethod for each output, then finalize with FinalizeContentObject. This method handles a single output end-to-end.

Returns: The created output

Parameters

NameTypeRequiredDescription
libraryIdstring

Library ID of the output settings object. If not provided, it will be retrieved automatically.

objectIdstring

Object ID of the outputs settings object

streamObjectIdstring

Object ID of the input stream to use as the output source

namestring

Display name for the output

descriptionstring

Description of the output

nodeIdsArray.<string>

Explicit node ID(s) for SRT delivery (max 1)

geosArray.<string>

Geo regions for SRT delivery (max 1) — used to resolve a node from live_egress endpoints

passphrasestring

SRT passphrase for encrypted delivery

stripRtpboolean

Whether to strip RTP headers (default: false)

srtConfigObject

Additional SRT connection configuration (see openapi-bitcode.html#tocssrtconnectionconfig)

OutputsDelete

OutputsDelete({
  libraryId, // optional
  objectId,
  outputId
}) → Promise.<Object>

Delete a live output.

Returns: Response from the delete call

Parameters

NameTypeRequiredDescription
libraryIdstring

Library ID of the output settings object. If not provided, it will be retrieved automatically.

objectIdstring

Object ID of the output settings object

outputIdstring

ID of the output to delete

OutputsDeleteBatch

OutputsDeleteBatch({
  libraryId, // optional
  objectId,
  outputs
}) → Promise.<Object>

Delete multiple live outputs in a single operation.

Returns: Response from the delete call

Parameters

NameTypeRequiredDescription
libraryIdstring

Library ID of the output settings object. If not provided, it will be retrieved automatically.

objectIdstring

Object ID of the output settings object

outputsArray.<string>

List of output IDs to delete

OutputsList

OutputsList({
  libraryId, // optional
  objectId,
  includeState // optional
}) → Promise.<Object.<string, LiveOutput>>

List all live outputs for a stream object, optionally including live state.

Returns: Map of output IDs to LiveOutput objects, each optionally with a state field

Parameters

NameTypeRequiredDescription
libraryIdstring

Library ID of the output settings object. If not provided, it will be retrieved automatically.

objectIdstring

Object ID of the output settings object

includeStateboolean

If true, also retrieve live state from each output's egress node (default: true)

OutputsListItem

OutputsListItem({
  libraryId, // optional
  objectId,
  outputId,
  includeState // optional
}) → Promise.<LiveOutput>

Get the configuration of a single live output by ID, optionally including live state.

Returns: Output config, optionally with a state field containing client_stats and srt_stats

Parameters

NameTypeRequiredDescription
libraryIdstring

Library ID of the output settings object. If not provided, it will be retrieved automatically.

objectIdstring

Object ID of the output settings object

outputIdstring

ID of the output to retrieve

includeStateboolean

If true, also retrieve live state from the output's egress node (default: true)

OutputsModify

OutputsModify({
  libraryId, // optional
  objectId,
  outputId,
  output,
  writeToken, // optional
  finalize // optional
}) → Promise.<Object>

Modify an existing live output.

Note: Supply all fields when modifying an output — read the current output first, then apply changes.

Note: Output modification is transactional. To modify multiple outputs in a single transaction, use EditContentObject to open a write token, call CallBitcodeMethod for each output, then finalize with FinalizeContentObject. This method handles a single output end-to-end.

Returns: The modified output

Parameters

NameTypeRequiredDescription
libraryIdstring

Library ID of the output settings object. If not provided, it will be retrieved automatically.

objectIdstring

Object ID of the output settings object

outputIdstring

ID of the output to modify

outputLiveOutput

Full output object to PUT (read the current output first, apply changes, then pass the result)

writeTokenstring

Write token to use. If not provided, a new edit will be opened.

finalizeboolean

If true, finalize after modifying (default: true)

OutputsModifyBatch

OutputsModifyBatch({
  libraryId, // optional
  objectId,
  outputs
}) → Promise.<Object>

Modify multiple live outputs in a single transaction.

Takes a map of output IDs to partial output configurations. Routes to any eligible live egress node, opens a write token, posts the map to live/outputs, then finalizes.

Example: { "out001": { "enabled": false, "input": { "stream": "iq__..." }, "name": "A03" }, "out002": { "enabled": true } }

Returns: The response from the bitcode call

Parameters

NameTypeRequiredDescription
libraryIdstring

Library ID of the output settings object. If not provided, it will be retrieved automatically.

objectIdstring

Object ID of the output settings object

outputsObject.<string, LiveOutput>

Map of output IDs to output configurations

OutputsState

OutputsState({
  libraryId, // optional
  objectId,
  outputId,
  nodeId, // optional
  includeState // optional
}) → Promise.<LiveOutput>

Get the configuration of a specific live output, optionally including live state. Retrieves the output config from a live egress node. If includeState is true, also queries the output's specific egress node for live client and SRT stats.

Returns: Output config, optionally with a state field containing client_stats and srt_stats

Parameters

NameTypeRequiredDescription
libraryIdstring

Library ID of the output settings object. If not provided, it will be retrieved automatically.

objectIdstring

Object ID of the output settings object

outputIdstring

ID of the output to retrieve state for

nodeIdstring

Node ID to query for state. If not provided, it will be retrieved from the output's config.

includeStateboolean

If true, also retrieve live state from the output's egress node (default: true)

OutputsStop

OutputsStop({
  libraryId, // optional
  objectId,
  outputId
}) → Promise.<Object>

Stop a live output.

Returns: Response from the stop call

Parameters

NameTypeRequiredDescription
libraryIdstring

Library ID of the output settings object. If not provided, it will be retrieved automatically.

objectIdstring

Object ID of the output settings object

outputIdstring

ID of the output to stop

RetrieveOutputNodeId

RetrieveOutputNodeId(
  client,
  nodeIds, // optional
  geos // optional
) → Promise.<string>

Resolve a node ID for live egress output. If nodeIds is provided, uses the first element directly. Otherwise, calls the /config API (optionally filtered by geo) to get live_egress endpoints, then resolves the first endpoint to a node ID via SpaceNodes.

Returns: A node ID for the output

Parameters

NameTypeRequiredDescription
clientObject

ElvClient instance

nodeIdsArray.<string>

Explicit node IDs to use

geosArray.<string>

Geo regions to filter config API results (max 1)

RouteToLiveEgress

RouteToLiveEgress(client) → Promise.<{restore: function()}>

Pin (route) the client to any eligible live egress node from the /config API. Returns a function that restores the original fabric URIs.

Returns: restore function

Parameters

NameTypeRequiredDescription
clientObject

ElvClient instance

RouteToOutputNode

RouteToOutputNode(
  client,
  libraryId,
  objectId,
  outputId,
  nodeId // optional
) → Promise.<{restore: function(), config: Object}>

Pin (route) the client to the egress node for a specific output. Fetches the output config to determine the node ID then sets the client fabric URIs. Currently node ID is retrieved from srt_pull.node_ids (only srt_pull outputs are supported). Assumes the client is already routed to an eligible egress node (via RouteToLiveEgress). Returns a function that restores the original fabric URIs.

Returns: restore function and output config

Parameters

NameTypeRequiredDescription
clientObject

ElvClient instance

libraryIdstring

Library ID of the output settings object

objectIdstring

Object ID of the output settings object

outputIdstring

ID of the output

nodeIdstring

Node ID if already known (skips config fetch)

StreamAddWatermark

StreamAddWatermark({
  libraryId, // optional
  objectId,
  writeToken, // optional
  simpleWatermark,
  imageWatermark,
  forensicWatermark,
  finalize // optional
}) → Promise.<Object>

Create a watermark for a live stream

Returns: The finalize response

Parameters

NameTypeRequiredDescription
libraryIdstring

Library ID of the live stream

objectIdstring

Object ID of the live stream

writeTokenstring

Write token of the draft

simpleWatermarkObject

Text watermark

imageWatermarkObject

Image watermark

forensicWatermarkObject

Forensic watermark

finalizeboolean

If enabled, target object will be finalized after adding watermark Watermark examples:

Simple Watermark: { "font_color": "", "font_relative_height": 0, "shadow": false, "template": "", "timecode": "", "timecode_rate": 0, "x": "", "y": "" }

Image watermark: { "image": "", "align_h": "", "align_v": "", "target_video_height": 0, "wm_enabled": false }

Forensic watermark: { "algo": 6, "forensic_duration": 0, "forensic_start": "", "image_a": <path_to_image>, "image_b": <path_to_image>, "is_stub": true, "payload_bit_nb": 23, "wm_enabled": true }

StreamApplyProfile

StreamApplyProfile({
  profileSlug, // optional
  profile, // optional
  objectId,
  streamWriteToken, // optional
  siteWriteToken, // optional
  finalize // optional
}) → Promise.<({config: Object}|{streamWriteToken: string, siteWriteToken: string})>

Apply a live recording config profile to a stream, writing the merged configuration to the stream's live_recording_config and updating the profile's stream index on the site object. Handles switching profiles by unassigning the previous profile from the index. Use this for CLI workflows. For app workflows managing the config edit separately, use StreamAssignProfile directly.

Returns: The merged config if finalized, otherwise the open write tokens

Parameters

NameTypeRequiredDescription
profileSlugstring

Slug of the profile to apply. Required if profile is not provided.

profileObject

Profile object to apply. Required if profileSlug is not provided. If both are provided, profile is used and profileSlug is derived from profile.name.

objectIdstring

Object ID of the stream to apply the profile to

streamWriteTokenstring

Write token for the stream object. If not provided, a new edit will be opened.

siteWriteTokenstring

Write token for the site object. If not provided, a new edit will be opened.

finalizeboolean

If enabled, both the stream and site objects will be finalized (default: true)

StreamAssignProfile

StreamAssignProfile({
  profileSlug,
  streamObjectId,
  writeToken, // optional
  finalize // optional
}) → Promise.<void>

Assign a live recording config profile to a stream by adding the stream to the profile's stream index on the site object. If the stream is already assigned, this is a no-op.

Parameters

NameTypeRequiredDescription
profileSlugstring

Slug of the profile to assign

streamObjectIdstring

Object ID of the stream to assign the profile to

writeTokenstring

Write token for the site object. If not provided, a new edit will be opened and finalized.

finalizeboolean

If enabled, the site object will be finalized after the assignment (default: true)

StreamConfig

StreamConfig({
  name,
  liveRecordingConfig, // optional
  inputStreamInfo, // optional
  writeToken, // optional
  finalize // optional
}) → Promise.<Object>

Configure the stream based on built-in logic and optional custom settings.

Returns: The status response for the stream

Parameters

NameTypeRequiredDescription
namestring

Object ID or name of the live stream object

liveRecordingConfigLiveRecordingConfig

Configuration profile for the live stream including recording, playout, and transcoding settings

inputStreamInfoInputStreamInfo

Simplified probe metadata

writeTokenstring

Write token of the draft

finalizeboolean

If enabled, target object will be finalized after configuring

StreamConfigProfile

StreamConfigProfile({
  profileName,
  profileSlug
}) → Promise.<Object>

Get a specific live recording config profile's specifications by name.

Returns: The specifications for the requested profile

Parameters

NameTypeRequiredDescription
profileNamestring

Name of the profile to retrieve

profileSlugstring

Slug of the profile to retrieve

StreamConfigProfiles

StreamConfigProfiles() → Promise.<Object>

Get all available live recording config profiles from the live stream site configuration. Ladder profiles define settings for configuring live streams including recording config, playout config, and recording params.

Returns: Object containing all live recording config profiles

StreamCreate

StreamCreate({
  libraryId,
  objectId, // optional
  url,
  finalize, // optional
  liveRecordingConfig, // optional
  options // optional
}) → Promise.<Object>

Create a live stream object

Returns: Object containing objectId, libraryId, writeToken, and hash if finalized

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library for the new live stream object

objectIdstring

ID of the object

urlstring

Source stream URL

finalizeboolean

If enabled, object will be finalized after creation (default: true)

liveRecordingConfigLiveRecordingConfig

Configuration profile for the live stream including recording, playout, and transcoding settings

optionsObject

Additional options for customizing a live stream

options.namestring

Name of the live stream

options.displayTitlestring

Display title for the live stream

options.descriptionstring

Description for the live stream

options.accessGroupsArray.<string>

Access group addresses to receive 'manage' permissions

options.permissionstring

Permission level to set on the object

options.linkToSiteboolean

If enabled, will create a link in the live stream site

options.initializeDrmboolean

If enabled, will initialize DRM for the object

options.ingressNodeIdstring

ID of the ingress node used for stream allocation (required for non-public nodes)

StreamGenerateOffering

StreamGenerateOffering({
  client,
  libraryId,
  objectId,
  writeToken, // optional
  typeAbrMaster, // optional
  typeLiveStream, // optional
  streamUrl,
  abrProfile,
  aBitRate,
  aChannels,
  aSampleRate,
  aStreamIndex,
  aTimeBase,
  aChannelLayout,
  vBitRate,
  vHeight,
  vStreamIndex,
  vWidth,
  vDisplayAspectRatio,
  vFrameRate,
  vTimeBase
}) → Promise.<string>

Set the offering for the live stream

Returns: Final hash of the live stream object

Parameters

NameTypeRequiredDescription
clientObject

The client object

libraryIdstring

ID of the library for the new live stream object

objectIdstring

ID of the new live stream object

writeTokenstring

Write token of the draft

typeAbrMasterstring

Content type hash

typeLiveStreamstring

Content type hash

streamUrlstring

Live source URL

abrProfileobject

ABR Profile for the offering

aBitRatenumber

Audio bitrate

aChannelsnumber

Audio channels

aSampleRatenumber

Audio sample rate

aStreamIndexnumber

Audio stream index

aTimeBasestring

Audio time base as a fraction, e.g. "1/48000" (usually equal to 1/aSampleRate)

aChannelLayoutstring

Channel layout, e.g. "stereo"

vBitRatenumber

Video bitrate

vHeightnumber

Video height

vStreamIndexnumber

Video stream index

vWidthnumber

Video width

vDisplayAspectRatiostring

Display aspect ratio as a fraction, e.g. "16/9"

vFrameRatestring

Frame rate as an integer, e.g. "30"

vTimeBasestring

Time base as a fraction, e.g. "1/30000"

StreamInitialize

StreamInitialize({
  name,
  drm, // optional
  format, // optional
  writeToken, // optional
  finalize // optional
}) → Promise.<Object>

Initialize the stream object

Returns: The name, object ID, and state of the stream

Parameters

NameTypeRequiredDescription
namestring

Object ID or name of the live stream object

drmboolean

If specified, playout will be DRM protected

formatstring

Specify the list of playout formats and DRM to support, comma-separated (hls-clear, hls-aes128, hls-sample-aes, hls-fairplay)

writeTokenstring

Write token of the draft

finalizeboolean

If enabled, target object will be finalized after configuration

StreamInsertion

StreamInsertion({
  name,
  insertionTime,
  sinceStart, // optional
  duration, // optional
  targetHash,
  remove // optional
}) → Promise.<Object>

Add a content insertion entry

Returns: Insertions, as well as any errors from bad insertions

Parameters

NameTypeRequiredDescription
namestring

Object ID or name of the live stream object

insertionTimenumber

Time in seconds (float)

sinceStartboolean

If specified, time specified will be elapsed seconds since stream start, otherwise, time will be elapsed since epoch

durationnumber

Time in seconds (float). Default: 20.0

targetHashstring

The target content object hash (playable)

removeboolean

If specified, will remove the inseration at the exact 'time' (instead of adding)

StreamLinkToSite

StreamLinkToSite({ objectId }) → Promise.<void>

Link a live stream object to a site by adding it to the site's live_streams metadata. Creates a fabric link to the stream object with proper ordering.

Parameters

NameTypeRequiredDescription
objectIdstring

Object ID of the live stream to link to the site

StreamListUrls

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

List the pre-allocated URLs for a site

Returns: The list of stream URLs

Parameters

NameTypeRequiredDescription
siteIdstring

ID of the live stream site object

StreamRemoveLinkToSite

StreamRemoveLinkToSite({
  objectId, // optional
  slug, // optional
  siteObjectId, // optional
  siteLibraryId, // optional
  writeToken, // optional
  finalize // optional
}) → Promise.<void>

Unlink a live stream object from a site by removing it from the site's live_streams metadata.

Parameters

NameTypeRequiredDescription
objectIdstring

Object ID of the live stream to link to the site

slugstring

Slug of the object

siteObjectIdstring

Object ID of the site (defaults to rootStore.dataStore.siteId)

siteLibraryIdstring

Library ID of the site (defaults to rootStore.dataStore.siteLibraryId)

writeTokenstring

Write token for the draft object. If not provided, a new edit will be opened and finalized.

finalizeboolean

If enabled, the site object will be finalized after the removal (default: true)

StreamRemoveWatermark

StreamRemoveWatermark({
  libraryId, // optional
  objectId,
  writeToken, // optional
  types,
  finalize // optional
}) → Promise.<Object>

Remove a watermark for a live stream

Returns: The finalize response

Parameters

NameTypeRequiredDescription
libraryIdstring

Library ID of the live stream

objectIdstring

Object ID of the live stream

writeTokenstring

Write token of the draft

typesArray.<string>

Specify which type of watermark to remove. Possible values:

  • "image"
  • "text"
  • "forensic"
finalizeboolean

If enabled, target object will be finalized after removing watermark

StreamSaveConfigProfile

StreamSaveConfigProfile({
  files,
  profileMetadata // optional
}) → Promise.<void>

Save a live recording config profile to the live stream site object. Uploads any provided profile files or profile metadata and creates a metadata link to the profile. One must be specified. The argument profileMetadata takes precendence if both are provided.

Parameters

NameTypeRequiredDescription
filesFileList | Array.<File>=

Profile files to upload to the site object

profileMetadataObject

Metadata for the profile

StreamSetOfferingAndDRM

StreamSetOfferingAndDRM({
  name,
  typeAbrMaster, // optional
  typeLiveStream, // optional
  drm, // optional
  format, // optional
  writeToken // optional
}) → Promise.<Object>

Create a dummy VoD offering and initialize DRM keys.

Returns: The name, object ID, and state of the stream

Parameters

NameTypeRequiredDescription
namestring

Object ID or name of the live stream object

typeAbrMasterstring

Content type hash

typeLiveStreamstring

Content type hash

drmboolean

If specified, DRM will be applied to the stream

formatstring

A list of playout formats and DRM to support, comma-separated (hls-clear, hls-aes128, hls-sample-aes, hls-fairplay). If specified, this will take precedence over the drm value

writeTokenstring

Write token of the draft

StreamSiteSettings

StreamSiteSettings({
  resolveIncludeSource, // optional
  resolveLinks, // optional
  resolveIgnoreErrors // optional
}) → Promise.<Object>

Load live stream data from site object

Parameters

NameTypeRequiredDescription
resolveIncludeSourceboolean

If specified, resolved links will include the hash of the link at the root of the metadata

resolveLinksboolean

If specified, links in the metadata will be resolved

resolveIgnoreErrorsboolean

If specified, link errors within the requested metadata will not cause the entire response to result in an error

StreamStartOrStopOrReset

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

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

Returns: The status response for the stream

Parameters

NameTypeRequiredDescription
namestring

Object ID or name of the live stream object

opstring

The operation to perform. Possible values: 'start' 'reset' - Stops current LRO recording and starts a new one. Does not create a new edge write token (just creates a new recording period in the existing edge write token)

  • 'stop'

StreamStartRecording

StreamStartRecording({
  name,
  start // optional
}) → Promise.<Object>

Create a new edge write token

Returns: The status response for the object

Parameters

NameTypeRequiredDescription
namestring

Object ID or name of the live stream object

startboolean

If specified, will start the stream after creation

StreamStatus

StreamStatus({
  name,
  showParams // optional
}) → Promise.<Object>

Retrieve the status of the current live stream session

Returns: The status response for the object, as well as logs, warnings and errors from the master initialization

Parameters

NameTypeRequiredDescription
namestring

Object ID or name of the live stream object

showParamsboolean

If specified, will return recording_params with status 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 but not started starting - LRO running but no source data yet running - stream is running and producing output stalled - LRO running but no source data (so not producing output)

StreamStopRecording

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

Close the edge write token and make the stream object inactive.

Returns: The finalize response for the stream object

Parameters

NameTypeRequiredDescription
namestring

Object ID or name of the live stream object

StreamUnassignProfile

StreamUnassignProfile({
  profileSlug,
  streamObjectId,
  writeToken, // optional
  finalize // optional
}) → Promise.<void>

Unassign a live recording config profile from a stream by removing the stream from the profile's stream index on the site object.

Parameters

NameTypeRequiredDescription
profileSlugstring

Slug of the profile to unassign

streamObjectIdstring

Object ID of the stream to remove from the profile

writeTokenstring

Write token for the site object. If not provided, a new edit will be opened and finalized.

finalizeboolean

If enabled, the site object will be finalized after the unassignment (default: true)

StreamUpdateConfig

StreamUpdateConfig({
  libraryId,
  objectId,
  commitMessage,
  writeToken, // optional
  liveRecordingConfig,
  overrideSettings, // optional
  finalize // optional
}) → Promise.<({writeToken: string}|void)>

Update the live recording configuration of a stream object.

Returns: The write token if finalize is false, otherwise void

Parameters

NameTypeRequiredDescription
libraryIdstring

Library ID of the stream object

objectIdstring

Object ID of the stream

commitMessagestring

Message to include about this commit

writeTokenstring

Write token for the stream object. If not provided, a new edit will be opened.

liveRecordingConfigLiveRecordingConfig

The live recording configuration to write

overrideSettingsObject

Partial LiveRecordingConfig deep-merged over liveRecordingConfig

finalizeboolean

If enabled, the stream object will be finalized after the update (default: true)