Next-Generation AI Broadcast Monitoring System
StreamGuard is an industrial-grade monitoring solution designed for TV channels, OTT platforms, and 24/7 livestreams. Unlike traditional tools that only ping a server, StreamGuard uses Computer Vision (OpenCV) and Audio Analysis (FFmpeg) to "watch" and "listen" to the stream like a human operator.
If the screen freezes or audio drops, it doesn't just alert you—it records video evidence, sends it to your phone, and logs the incident on a real-time Mission Control Dashboard.
- Frozen Frame Detection: Uses pixel-difference algorithms to detect if the broadcast is stuck, even if the player is still "buffering" correctly.
- Black Screen Detection: Automatically flags complete signal loss.
- Silence Detection: Monitors decibel levels in real-time.
- Instant Alerts: Triggers an alarm if audio drops below -50dB (configurable) for more than 5 seconds.
- Automatic Recording: When an error is detected, the system automatically acts as a DVR.
- Telegram Upload: Records the last 15 seconds of the incident and uploads the video file to your Engineering Telegram Group immediately.
- Real-time Dashboard: A beautiful, dark-mode web interface (Linear-style design).
- Live Metrics: Watch
Motion ScoreandVolume Levelsupdate every second. - Remote Control: Start/Stop the AI engine directly from your browser.
- Core Engine: Python 3.9+
- Vision: OpenCV (cv2), NumPy
- Audio: FFmpeg, Subprocess
- API / Backend: FastAPI, Uvicorn
- Frontend: HTML5, CSS3 (Glassmorphism), Chart.js
- Notifications: Telegram Bot API
- Hardware: Optimized for CPU-only environments (No GPU required).
| Command Center (Web) | Mobile Alert (Telegram) |
|---|---|
| Real-time analytics and control | Instant video evidence on your phone |
Clone the repo and install dependencies:
git clone https://github.com/yourusername/streamguard.git
cd streamguard
pip install -r requirements.txtRename config.example.json to config.json and edit your settings:
{
"telegram": {
"bot_token": "YOUR_BOT_TOKEN",
"chat_id": "YOUR_CHAT_ID"
},
"streams": [
{ "url": "http://your-hls-stream.m3u8" }
]
}Run the dashboard server. The AI Engine will be managed automatically.
python dashboard_api.pyAccess the dashboard at: http://localhost:8000
graph TD
A[Live Stream HLS/RTMP] -->|Input| B(StreamGuard AI Engine)
subgraph "Core Processing"
B -->|CV2| C{Motion Analysis}
B -->|FFmpeg| D{Audio Analysis}
end
C -->|Frozen?| E[Trigger Alarm]
D -->|Silence?| E
E -->|Action 1| F[Record Evidence .mp4]
E -->|Action 2| G[Send Telegram Alert]
F --> G
B -->|Metrics| H[Status.json]
H -->|API Read| I[FastAPI Backend]
I -->|WebSocket/Poll| J[Web Dashboard]
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.