Monitor Stream Status
Monitor Using Heartbeat Server
Health Score
You can check on Stream through built-in Heartbeat Server:
- Start Stream with
docker run ... -p 8001:8001 ...
to enable access to the Server - Send a GET request to the following endpoint:
curl -i http://localhost:8001/status/
- The Server will return a status code
200
if all cameras are still functional,500
otherwise - The attached JSON response contains the current status of each camera:
{
"version": "1.51.0",
"cameras": {
"camera-1": {
"health": -1,
"status": "starting",
"last_checked": "2024-05-13 11:21:44.904403+00:00",
"received_fps": -1.0, // starting from version 1.58.0
"buffered_frames": 0, // starting from version 1.58.0
"file_processing": { // starting from version 1.56.0
"processed_seconds": -1.0,
"total_seconds": -1.0
}
},
"camera-2": {
"health": 95,
"status": "running",
"last_checked": "2024-05-13 11:21:44.904623+00:00",
"received_fps": 24.5,
"buffered_frames": 3,
"file_processing": {
"processed_seconds": -1.0,
"total_seconds": -1.0
}
},
"camera-3": {
"health": 0,
"status": "stopped",
"last_checked": "2024-05-13 11:21:44.904623+00:00",
"received_fps": 0.1,
"buffered_frames": 90,
"file_processing": {
"processed_seconds": -1.0,
"total_seconds": -1.0
}
}
}
}
All last_checked
timestamps are using timezone parameter configurable per camera.
New in version 1.51.0.
File processing
For files, you will be able to see current progress as well:
{
"...",
"cameras": {
"...",
"file-1": {
"health": 95,
"status": "running",
"last_checked": "2024-05-13 11:21:44.904623+00:00",
"received_fps": 0.1, // starting from version 1.58.0
"buffered_frames": 90, // starting from version 1.58.0
"file_processing": { // starting from version 1.56.0
"processed_seconds": 10,
"total_seconds": 100
}
},
"..."
}
}
New in version 1.56.0.
Network
Heartbeat also provides useful information about network connection through received_fps
and buffered_frames
fields.
The first one, received_fps
, indicates how many frames of the original footage Stream is fetching per second.
This value is not affected by the sample parameter and should be close to the actual FPS output of the camera.
If not, it could indicate network problems.
The second one, buffered_frames
, is the percentage of the received frames that were buffered by the video backend before being processed.
Some buffering is acceptable, but 25% or more could indicate bandwidth or processing bottlenecks.
Note that this value could be unreliable for Variable Bitrate videos.
New in version 1.58.0.
Monitor Via Our Online Dashboard
The Stream Activity Status feature provides users with a visual representation of the activity status of their stream licenses. The following symbols and colors are used to indicate the status of each stream:
- All Active: ✅
- Partially Active: ⚠️
- Inactive: ❌
- Not Installed: ✘
Users can click on the activity status to view more detailed information about the activity status of each stream license.
Setting Up Inactivity Notifications
Users can also set up inactivity notifications for their stream licenses. This will notify user via email if there's no activity on the license for a defined period of time. This can be done through the "Setup Notification" dropdown located in the manage section of the license settings.
- Navigate to the "Manage" section of your license settings.
- Locate the "Setup Notification" dropdown.
- Choose your desired notification settings.
- Ensure that the notification interval is set to more than 8 hours to avoid unnecessary notifications.
By utilizing the Stream Activity Monitor feature and setting up inactivity notifications, users can effectively monitor the status of their streams and stay informed about any potential issues.
Monitor Using Script
Stream Monitor checks Stream status through its logs. It exposes a single API endpoint that returns the status of each camera (running or offline).
The command python stream_monitor.py
starts a web server that returns the status of each camera. For example:
{"active": true, "cameras": {"camera-1": {"status": "running"}}}
See instructions and examples on our GitHub.