Skip to main content

Active_streams

Active_Streams

This requests a list of streams that are currently active, and only those. The list includes any wildcard versions of streams as well as temporary streams that may be active.

It has two forms:

//Either...
{
"active_streams": true //Any non-array value will work, value is ignored.
}
//Or...
{
"active_streams": [
//Array of string values of stream properties that are to be retrieved. Possible options are:
"clients", //Current count of connected clients (viewers+inputs+outputs)
"lastms", //Newest/last (currently) available timestamp in milliseconds
"firstms", //Oldest/first requestable timestamp in milliseconds
"viewers", //Current viewers count
"inputs", //Current inputs count
"outputs", //Current outputs count
"views", //Total viewer session count since stream start
"viewseconds", //Total sum of seconds watched by viewers since stream start
"upbytes", //Total bytes uploaded since stream start
"downbytes", //Total bytes downloaded since stream start
"packsent", //Total packets sent since stream start
"packloss", //Total packets lost since stream start
"packretrans", //Total packets retransmitted since stream start
"zerounix", //Unix time in seconds of timestamp epoch (zero point), if known
"health", //Stream health object, identical to payload of STREAM_BUFFER health data
"tracks", //Count of currently valid tracks in this stream
"status" //Current stream status in human readable format

]
}
//Or...
{
"active_streams": {
//Object that describes what information you want. All properties optional. Possible properties are:
"fields": [], //array of strings with field names requested, same list as described above is supported
"streams": [], //string or array of strings with stream names
"stream": "streamname", //string with stream name
"longform": true //If set to true, changes output format to long form (defaults to false)
}
}

The form of the response depends on the request form used.

//First form:
{
"active_streams": ["stream1", "stream2", "stream3", ...]
}
//Second form:
{
"active_streams": {
"stream1": [1,0], //the stream properties requested, in the same order as requested.
"stream2": [365,0], //the stream properties requested, in the same order as requested.
"stream3": [26,0] //the stream properties requested, in the same order as requested.
//Etcetera
}
}
//Third form:
{
"active_streams":{
"fields":["array", "of", "field", "names"]
"data":{
//object containing an array with fields in same order as "fields", for each stream
}
}
}
//Third form with "longform" flag set to true:
{
"active_streams":{
//object of objects, where each object contains each field with it's corresponding value. For example:
"streamname":{
"lastms": xxx,
"firstms": yyy,
//etc
}
}
}