To verify a stream is running, you can fetch the stream status by sending a
GET
request to https://livepeer.com/api/stream/
with the stream object id
appended. You received the id
in the response when you
created a stream object.
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":[{"bitrate":2000000,"fps":30,"height":720,"name":"720p","width":1280},{"bitrate":1000000,"fps":30,"height":480,"name":"480p","width":854},{"bitrate":500000,"fps":30,"height":360,"name":"360p","width":640}],"id":"2d10f1fd-dbf7-495b-8aef-08916507fcce","createdAt":1596118509635,"isActive":true,"lastSeen":1596119750455}
isActive: true
means video segments are currently being ingested by
Livepeer.com. isActive: false
means the live stream is idle and no video
segments are currently being ingested by Livepeer.com.
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.
Exclude child-session objects
curl -H 'authorization: Bearer {api-key}' \"https://livepeer.com/api/stream?streamsonly=1&filters=[{"id": "isActive", "value": true}]"
Exclude child-session objects
curl -H 'authorization: Bearer {api-key}' \"https://livepeer.com/api/stream?streamsonly=1&filters=[{"id": "isActive", "value": false}]"
Next, learn how to playback a live stream with the Livepeer.com API.