Create - Command Line

You can create the live stream content object using the Fabric Browser or using the API or command line tools.

Create Stream Object

Using Fabric Browser

  1. Log into your account on the Fabric Browser. and navigate to your tenant’s “Title Mezzanines” library.

  2. Create a new object under the “Title Mezzanines” library.

  1. Fill Out the create form with the following
  • Name: Your choice but a good convention would be “Live Stream - AC-DC Concert Sydney 2023”
  • Type: “<TENANT NAME> - Live Stream”
  • Description: Your choice, optional
  • Public Metadata: Leave as is
  • Private Metadata: Leave as is
  1. After creation please note down the Library and Object ID as they will be required for later steps.

Using the elv Command-Line Tool

For quick help using the elv tools to create a content object:

elv content create -h

Using the API

Using elv-client-js

Configure the Stream Object

Stream configuration is a JSON object stored at the root of the stream object metadata under the key “live_recording_config”.

To set stream configuration using elv-client-js:

  "live_recording_config": {
    "drm": "clear" | "drm",
    "input": {
      "audio": {
        "stream": "default" | "specific",
        "stream_id": 0,
        "stream_index": 0
      },
      "video": {
        "stream": "default",
        "stream_id": 0,
        "stream_index": 0
      }
    },
    "output": {
      "audio": {
        "bitrate": 0,
        "channel_layout": "Stereo (2)" | "Surround (5.1)",
        "quality": "default"
      },
      "video": {
        "bitrate": 0,
        "height": 0,
        "quality": "default" | "specific",
        "width": 0
      }
    },
    "part_ttl":3600,
    "stream_type": "MPEG-TS",
    "url": "udp://host-76-74-28-235.contentfabric.io:11001"
  }

Apply the Configuration

Using the elv-live-js tool

  ./elv-stream configure <stream object ID>

This reads the basic configuration set previously and probes the stream, and applies the resulting live stream configuration to your stream object. Note that the stream source must be active for this step (since it probes the stream source before applying the final configuration).

Using the API

Follow the sample code in the elv-live-js repository: Sample code

Initialize DRM - using elv-live-js

  1. Navigate to the elv-live-js tools that was previously set up with ./elv-stream
cd elv-live-js
./elv-stream
  1. Run the Initialize stream object command. Initilization will add the proper metadata and information for a stream to run on the object. After Initialization the stream object will be updated several times. An Eluvio private key for your account is required to run the initlization command.
export PRIVATE_KEY=0x...
# No drm (hls-clear only)
./elv-stream init $STREAM_OBJECT_ID

# Enable DRM playback with a flag (hls-fairplay hls-sample-aes hls-aes128)
./elv-stream init $STREAM_OBJECT_ID --drm

# Specify playout formats, for example, ony hls-clear and hls-aes128
./elv-stream init $STREAM_OBJECT_ID --formats hls-clear,hls-aes128

Below is an example of a successful run.

./elv-stream init iq__3xnuf4WwKk5TCFbrvC14uXFgsndV
INIT:  iq__3xnuf4WwKk5TCFbrvC14uXFgsndV
Retrieving current metadata...
Getting write token...
New write token: tqw__HSYRynAJanzXGbKn19ZvijBQsr1x2JhsPhhtzFoQyArHbjTQAHy4u225xsEGs13ngtm9JyB7DWi11fms1eJ
Writing back metadata with /production_master added...
Finalizing...
Finalized, new version hash: hq__FUQcbPiQgNL8YrZ9rGKQV6Zcz7ybNGW9NYrkiuE3LC9hTEuasRydQviW3WiL1AkW8A5LMZBemV
New version hash: hq__CTro9gc28ukxaooK4fLidSSLPNt5doBLLnPKdkKeUkYqMWgH7eRxRq9pgaKPspQZ4MSa2xmoTD
Retrieving revised metadata with offering...
Moving /abr_mezzanine/offerings to /offerings and removing /abr_mezzanine...
Getting write token...
New write token: tqw__HSYRynAJanzXGbKn19ZvijBQsr1x2JhsPhhtzFoQyArHbjTQAHy4u225xsEGs4ArmvBu1KxHAH2fF3wHu2H
Writing back metadata with /offerings...
Finalizing...
Finalized, new version hash: hq__9L61iBDnL8J6hfw22yrDktYvFoLix2fBuwmida8sBTerSL9xLd5LShSCijWsdEC1ccHvKm2TJo
GenerateOffering - DONE
name: iq__3xnuf4WwKk5TCFbrvC14uXFgsndV
object_id: iq__3xnuf4WwKk5TCFbrvC14uXFgsndV
state: initialized

Ingest and Play Stream

Using the initialized stream object we set up in Initialize the Stream Object we will start our stream.

  1. Navigate to the elv-live-js tools that was previously set up with ./elv-stream
cd elv-live-js
./elv-stream
  1. Use the following command to create a new live stream for an initialized stream object. An Eluvio private key for your account is required to run the start command.
export PRIVATE_KEY=0x...
./elv-stream create $STREAM_OBJECT_ID

Here is an example output

./elv-stream create iq__3xnuf4WwKk5TCFbrvC14uXFgsndV
START:  iq__3xnuf4WwKk5TCFbrvC14uXFgsndV start false show_curl false
Node URI https://host-76-74-28-227.contentfabric.io ID inod3ixE9cx9S3An4KsdR45LE57pPe6D
Edge token: tqw__HSYRynAJanzXGbKn19ZvijBQsr1x2JhsPhhtzFoQyArHbjTQAHy4u225xsEGsKd7ybhSND8zuqu5mRayJLg
Object hash: hq__8sow7ckdMAwvve1pDNQmUXJ1heg7w2u9rJTdu4PRTemPx3bCgireQAWaYWsEsBMzMUpEPh4MDR
object_id: iq__3xnuf4WwKk5TCFbrvC14uXFgsndV
hash: hq__8sow7ckdMAwvve1pDNQmUXJ1heg7w2u9rJTdu4PRTemPx3bCgireQAWaYWsEsBMzMUpEPh4MDR
library_id: ilib2tLjf1MM66K5cKSey7JbjJScY3u1
stream_id: >-
  tqw__HSYRynAJanzXGbKn19ZvijBQsr1x2JhsPhhtzFoQyArHbjTQAHy4u225xsEGsKd7ybhSND8zuqu5mRayJLg
edge_write_token: >-
  tqw__HSYRynAJanzXGbKn19ZvijBQsr1x2JhsPhhtzFoQyArHbjTQAHy4u225xsEGsKd7ybhSND8zuqu5mRayJLg
fabric_api: 'https://host-76-74-28-227.contentfabric.io'
state: stopped
  1. Use the following command to Start the current live stream. This will trigger the content object to start listening for data. After this step you can start sending the source stream to the RTMP/UDP url.
export PRIVATE_KEY=0x...
./elv-stream start $STREAM_OBJECT_ID

Here is an example output

./elv-stream start iq__3xnuf4WwKk5TCFbrvC14uXFgsndV
Stream  start :  iq__3xnuf4WwKk5TCFbrvC14uXFgsndV
STATUS:  {
  name: 'iq__3xnuf4WwKk5TCFbrvC14uXFgsndV',
  library_id: 'ilib2tLjf1MM66K5cKSey7JbjJScY3u1',
  object_id: 'iq__3xnuf4WwKk5TCFbrvC14uXFgsndV',
  fabric_api: 'https://host-76-74-28-227.contentfabric.io',
  url: 'rtmp://76.74.28.227:1935/rtmp/abc1234',
  edge_write_token: 'tqw__HSYRynAJanzXGbKn19ZvijBQsr1x2JhsPhhtzFoQyArHbjTQAHy4u225xsEGsKd7ybhSND8zuqu5mRayJLg',
  stream_id: 'tqw__HSYRynAJanzXGbKn19ZvijBQsr1x2JhsPhhtzFoQyArHbjTQAHy4u225xsEGsKd7ybhSND8zuqu5mRayJLg',
  state: 'inactive'
}
STARTING
Wait to start -  inactive
Status after restart -  starting
name: iq__3xnuf4WwKk5TCFbrvC14uXFgsndV
library_id: ilib2tLjf1MM66K5cKSey7JbjJScY3u1
object_id: iq__3xnuf4WwKk5TCFbrvC14uXFgsndV
fabric_api: 'https://host-76-74-28-227.contentfabric.io'
url: 'rtmp://76.74.28.227:1935/rtmp/abc1234'
edge_write_token: >-
  tqw__HSYRynAJanzXGbKn19ZvijBQsr1x2JhsPhhtzFoQyArHbjTQAHy4u225xsEGsKd7ybhSND8zuqu5mRayJLg
stream_id: >-
  tqw__HSYRynAJanzXGbKn19ZvijBQsr1x2JhsPhhtzFoQyArHbjTQAHy4u225xsEGsKd7ybhSND8zuqu5mRayJLg
recording_period_sequence: 1
tlro: tlro1EjhyUj87cFAFiWQnGZU4vH6ZxumB9LEsf5m378eb9XVxBMGkMeJcE
recording_period:
  activation_time_epoch_sec: 1682992959
  start_time_epoch_sec: 0
  start_time_text: '12/31/1969, 4:00:00 PM'
  end_time_epoch_sec: 0
  end_time_text: null
  video_parts: 0
  video_last_part_finalized_epoch_sec: 0
  video_since_last_finalize_sec: 1682992960
lro_status_url: >-
  https://host-76-74-28-227.contentfabric.io/qlibs/ilib2tLjf1MM66K5cKSey7JbjJScY3u1/q/tqw__HSYRynAJanzXGbKn19ZvijBQsr1x2JhsPhhtzFoQyArHbjTQAHy4u225xsEGsKd7ybhSND8zuqu5mRayJLg/call/live/status/tlro1EjhyUj87cFAFiWQnGZU4vH6ZxumB9LEsf5m378eb9XVxBMGkMeJcE?authorization=eyJxc3BhY2VfaWQiOiJpc3BjM0FOb1ZTek5BM1A2dDdhYkxSNjlobzVZUFBaVSIsImFkZHIiOiIweDJhOWVjM2U1NjU3NzAyODVjZWZlYTFkMTRjMjZhOWVmNmYwNWEyMjQiLCJ0eF9pZCI6IjB4NTRhZDkxOGUxZTY1NDNmZmU5ZjYyZWM1Nzk4ODg2NGVhYzJlNjQ3Y2Q4MDhiODAyMGY3YmE0MGNjNTBmNjYyYSIsInFsaWJfaWQiOiJpbGliMnRMamYxTU02Nks1Y0tTZXk3SmJqSlNjWTN1MSJ9.RVMyNTZLXzNxeE1qS2t2amRrZzRvMnJNR0pDTWRyZUgzNEVvOXhBZnRONTFHTW40b2lqS3p6VmlUY1Q3dVkzSDM2YlBubkpiY3o1akhmN1pYSnk0MmNvMzdUa2kyYWR4
state: starting
  1. Once the stream is being sent from the source you can check on the status of the stream using the following command.
export PRIVATE_KEY=0x...
./elv-stream status $STREAM_OBJECT_ID

Here is an example

./elv-stream status iq__3xnuf4WwKk5TCFbrvC14uXFgsndV
name: iq__3xnuf4WwKk5TCFbrvC14uXFgsndV
library_id: ilib2tLjf1MM66K5cKSey7JbjJScY3u1
object_id: iq__3xnuf4WwKk5TCFbrvC14uXFgsndV
fabric_api: 'https://host-76-74-28-227.contentfabric.io'
url: 'rtmp://76.74.28.227:1935/rtmp/abc1234'
edge_write_token: >-
  tqw__HSYRynAJanzXGbKn19ZvijBQsr1x2JhsPhhtzFoQyArHbjTQAHy4u225xsEGsKd7ybhSND8zuqu5mRayJLg
stream_id: >-
  tqw__HSYRynAJanzXGbKn19ZvijBQsr1x2JhsPhhtzFoQyArHbjTQAHy4u225xsEGsKd7ybhSND8zuqu5mRayJLg
recording_period_sequence: 1
tlro: tlro1EjhyUj87cFAFiWQnGZU4vH6ZxumB9LEsf5m378eb9XVxBMGkMeJcE
recording_period:
  activation_time_epoch_sec: 1682992959
  start_time_epoch_sec: 1682992985
  start_time_text: '5/1/2023, 7:03:05 PM'
  end_time_epoch_sec: 0
  end_time_text: null
  video_parts: 3
  video_last_part_finalized_epoch_sec: 1682993075.049688
  video_since_last_finalize_sec: 21.95031189918518
lro_status_url: >-
  https://host-76-74-28-227.contentfabric.io/qlibs/ilib2tLjf1MM66K5cKSey7JbjJScY3u1/q/tqw__HSYRynAJanzXGbKn19ZvijBQsr1x2JhsPhhtzFoQyArHbjTQAHy4u225xsEGsKd7ybhSND8zuqu5mRayJLg/call/live/status/tlro1EjhyUj87cFAFiWQnGZU4vH6ZxumB9LEsf5m378eb9XVxBMGkMeJcE?authorization=eyJxc3BhY2VfaWQiOiJpc3BjM0FOb1ZTek5BM1A2dDdhYkxSNjlobzVZUFBaVSIsImFkZHIiOiIweDJhOWVjM2U1NjU3NzAyODVjZWZlYTFkMTRjMjZhOWVmNmYwNWEyMjQiLCJ0eF9pZCI6IjB4ZGVjOTBiYzRiZjkyMTJiY2JmY2MxOTE4YjA3Y2NmYWQ2ZmQ2MzZjM2ZkYTQxNWNmMjM1YTg3YTE2MmYxNzczNSIsInFsaWJfaWQiOiJpbGliMnRMamYxTU02Nks1Y0tTZXk3SmJqSlNjWTN1MSJ9.RVMyNTZLX0syN1dhZVV6N2JKVFVLZGE2eVZvbjF2RVVBWmQ3YXZtMU1BWmZNcDFzWXFlSm02Q1ZXOVE4aTJLTEJZdFg3c3pDejhwTWthQVJuRkpKczJDOFI5WGh1enk5
state: running

NOTE: Upon first starting a stream the state will remain “starting” for the first 30 seconds. Once it recieves 30 seconds worth of RTMP/UDP data it will transition to a “running” state meaning your stream is now viewable!

  1. Below is an explanation of the states
  • starting: The listener is running and waiting for the RTMP/UDP source to be sent
  • running: RTMP/UDP data is being recieved, the stream should be viewable
  • terminated: The listener has exited from running and is no longer open to recieve a stream. From this state you can call to open up the listener back to the “starting” state.
./elv-stream reset $STREAM_OBJECT_ID
  1. To view the stream you will need the stream object ID and the stream listener MUST be in a “running” state.
  • Log into the Eluvio Stream Sample Application
  • Paste the Object ID in the form and click on Load
  • The stream will be viewable, there will also be an hls playout url on the right side of the page

Below is an example