#Verify a live stream is active
The easiest way to confirm a live stream is active is to login to the Livepeer.com Dashboard, navigate to the streams list page, livepeer.com/app/user, and click on a stream name. Look at the Status row to see if the stream is Active or Idle. If the status Idle, that means that Livepeer.com is not ingesting any video with that stream’s streamKey
.
#Verify stream status with the Livepeer.com API
Make a GET
request to https://livepeer.com/api/stream/{id}
, and note the value of isActive
in the response. true
means the stream
is active, and Livepeer.com is ingesting video with that stream’s streamKey
. false
means that Livepeer.com is not ingesting any video with that streamKey
.
lastSeen
represents when the stream was last observed by the monitoring system. The time is reported in Unix epoch time. If the stream is running, the epoch will be close to the current time.
Here is an example request:
curl -H 'authorization: Bearer {api-key}' \"https://livepeer.com/api/stream/{id}"
This is an example response:
{"name":"test_stream","profiles":[{"name":"720p","bitrate":2000000,"fps":30,"width":1280,"height":720},{"name":"480p","bitrate":1000000,"fps":30,"width":854,"height":480}],{"name":"360p","bitrate":500000,"fps":30,"width":640,"height":360}],"id":"ijkl61f3-95bd-4971-a7b1-4dcb5d39e78a","createdAt":1596081229373,"streamKey":"abcd-uimq-jtgy-x98v","playbackId":"efghb2mxupongp5k","isActive":"true","lastSeen":1596119750455",{other asset object keys}}
#Return all active live streams
This example shows a decoded JSON object. But, remember that anything passed as a parameter in a GET
request URL must be URL encoded.
curl -H 'authorization: Bearer {api-key}' \"https://livepeer.com/api/stream?streamsonly=1&filters=[{"id": "isActive", "value": true}]"
#Return all idle live streams
This example shows a decoded JSON object. Remember that anything passed as a parameter in a GET
request URL must be URL encoded.
curl -H 'authorization: Bearer {api-key}' \"https://livepeer.com/api/stream?streamsonly=1&filters=[{"id": "isActive", "value": false}]"