Professional RTSP stream validation tool with visual snapshots and comprehensive metrics
A modern web application for analyzing RTSP camera streams to ensure optimal quality for AI applications, video surveillance, and real-time monitoring. Features accurate frame counting with OpenCV, bitrate measurement, visual snapshots, and professional report generation.
- 🎥 Real-time Stream Analysis - Accurate frame counting with OpenCV and FFmpeg
- 📸 Visual Snapshots - Capture and display frames from your RTSP stream
- 📊 Comprehensive Metrics - FPS, bitrate, resolution, codec, frame loss, and jitter
- 🚨 Health Monitoring - Color-coded pass/fail indicators for critical metrics
- 📄 Report Export - Professional reports in Text and JSON formats
- ⚡ Background Processing - Non-blocking analysis with real-time updates
- 🎬 Live Video Preview - Watch streams in browser via WebRTC (MediaMTX, 10-min TTL)
- 🔍 RTSP URL Helper - Built-in database of 11+ camera vendors with auto-generated URLs
- 🎯 Anavid Shoplifting Cloud Validation - Instant verification of DVR settings for cloud AI
- 📡 Bandwidth Calculator - Multi-camera capacity planning with speedtest integration
- 🔌 Network Diagnostics - Pre-flight connection testing without authentication (prevents IP bans)
- ⏱️ Auto-Cleanup - MediaMTX streams auto-expire after 10 minutes
- 🎨 Modern UI - Beautiful, responsive dashboard with TailwindCSS
- 🐳 Docker Ready - Multi-stage build for production deployment
- 🔧 Accurate Measurements - OpenCV for frame counting, FFmpeg for bitrate
- 📱 Mobile Friendly - Responsive design works on all devices
- 🌐 Open Source - MIT licensed, contributions welcome!
The analyzer checks for these critical requirements:
- Minimum FPS: 15 frames per second
- Minimum Bitrate: 500 kbps
- Frame Loss: Less than 5%
- Codec: H.264, H.265, or HEVC recommended
- Python 3.11+
- Node.js 20+
- FFmpeg and FFprobe installed
macOS:
brew install ffmpegUbuntu/Debian:
sudo apt-get update
sudo apt-get install ffmpegWindows: Download from ffmpeg.org
cd backend
pip install -r requirements.txt
python main.pyThe backend will start on http://localhost:8000
cd frontend
npm install
npm run devThe frontend will start on http://localhost:3000
docker build -t rtsp-analyzer .
docker run -p 8000:8000 rtsp-analyzerOr use Docker Compose:
docker-compose up -d-
Push to GitHub:
git init git add . git commit -m "Initial commit" git remote add origin <your-repo-url> git push -u origin main
-
In Easypanel:
- Create a new app
- Connect your GitHub repository
- Set build method to "Dockerfile"
- Set port to
8000 - Deploy!
Don't know your camera's RTSP URL format? Use the built-in helper:
- Click "RTSP URL Helper" at the top
- Select your camera vendor (Hikvision, Dahua, Axis, etc.)
- Choose stream type (Sub-stream auto-selected for Anavid)
- Fill in IP, credentials, channel
- Click "Use This URL" - auto-fills the form!
Features:
- 11+ camera vendors supported
- Auto-detect public IP with one click
- Anavid Shoplifting Cloud requirements shown for sub-streams
- Local vs remote testing guidance
-
Enter RTSP Stream URL (or use the helper above)
rtsp://admin:password@192.168.1.100:554/Streaming/Channels/202 -
Set Analysis Duration (default: 30 seconds)
- Longer duration = more accurate frame loss detection
- Recommended: 30-60 seconds
-
View Results
- Stream health status (Healthy/Warning/Critical)
- Anavid Shoplifting Cloud validation badge - instant pass/fail
- Video codec and resolution
- FPS and bitrate measurements
- Frame loss percentage
- Visual snapshot of the stream
- "Watch Live" button (if MediaMTX is configured)
- Bandwidth check for multiple cameras
- Detailed warnings for any issues
-
Export Reports
- Click the text icon for a human-readable report
- Click the download icon for JSON format
For cloud AI shoplifting detection, the analyzer validates:
- ✅ Sub-stream selected
- ✅ FPS ≥ 15
- ✅ Bitrate ≥ 1 Mbps (CBR)
- ✅ Resolution = 704x480
Testing workflow: Use your camera's public IP address to test. The analyzer runs from our remote server to simulate Anavid's cloud connectivity - exactly how Anavid will access your cameras in production.
The validation badge shows instant pass/fail for each requirement!
Prevent IP bans! Test network connectivity WITHOUT attempting RTSP authentication.
Click "Test Connection" before analysis to check:
- Ping - Is the host reachable?
- Port Scan - Is RTSP port 554 open?
- Connection Test - Can we establish TCP connection?
- Traceroute - What's the network path?
Benefits:
- ✅ No authentication attempts
- ✅ No risk of IP ban from failed logins
- ✅ Diagnose network issues before analysis
- ✅ Clear pass/fail for each test
- ✅ Includes nmap, ping, traceroute, netcat
Perfect for: Testing cameras with unknown credentials, diagnosing firewall issues, checking if DVR blocked your IP.
Want to watch your RTSP streams live in the browser? Set up MediaMTX integration!
See MEDIAMTX_SETUP.md for complete setup instructions.
When configured, a purple "Watch Live" button appears on completed analyses, allowing you to view the stream via WebRTC directly in your browser - no plugins required!
Auto-cleanup: Streams automatically expire after 10 minutes to prevent resource buildup.
Start analyzing a stream
{
"url": "rtsp://...",
"duration": 30
}List all analyzed streams
Get detailed metrics for a specific stream
Remove a stream from the list
Network diagnostics without authentication
{
"url": "rtsp://admin:password@192.168.1.100:554/stream"
}Returns: Ping, port scan, connection test, traceroute results
Health check endpoint
┌─────────────┐
│ Frontend │ React + TailwindCSS + Vite
│ (Port 3000)│ Real-time polling for updates
└──────┬──────┘
│
▼
┌─────────────┐
│ Backend │ FastAPI + Python
│ (Port 8000)│ Background task processing
└──────┬──────┘
│
▼
┌─────────────┐
│ FFmpeg │ Stream analysis
│ FFprobe │ Metadata extraction
└─────────────┘
- Measures how many frames the stream delivers per second
- Requirement: Minimum 15 FPS for AI detection
- Lower FPS = missed events
- Measures data transfer rate
- Requirement: Minimum 500 kbps
- Lower bitrate = reduced image quality
- Percentage of expected frames that were not received
- Requirement: Less than 5% loss
- High frame loss = unreliable stream
- Video compression format
- Recommended: H.264, H.265, HEVC
- Affects compatibility and quality
- Check if the RTSP URL is correct
- Verify network connectivity
- Ensure camera is online and accessible
- Check firewall rules
- Camera may be configured for low frame rate
- Network bandwidth issues
- Camera processing limitations
- Network congestion
- Unstable connection
- Camera hardware issues
- RTSP server overload
- FFmpeg is included in the Docker image
- For local development, ensure FFmpeg is installed
PORT- Server port (default: 8000)VITE_API_URL- Frontend API URL (default: /api)
rtsp_station/
├── backend/
│ ├── main.py # FastAPI application
│ └── requirements.txt # Python dependencies
├── frontend/
│ ├── src/
│ │ ├── App.jsx # Main React component
│ │ ├── main.jsx # React entry point
│ │ └── index.css # TailwindCSS styles
│ ├── package.json # Node dependencies
│ └── vite.config.js # Vite configuration
├── Dockerfile # Production build
├── docker-compose.yml # Local Docker setup
└── README.md # This file
- Update
analyze_stream_ffprobe()oranalyze_stream_detailed()inbackend/main.py - Add metric extraction logic
- Update
StreamMetricsmodel - Display in
StreamCardcomponent infrontend/src/App.jsx
Contributions are welcome! This project is open source and built for the RTSP community.
- 🐛 Report Bugs - Open an issue with details
- 💡 Suggest Features - Share your ideas
- 📝 Improve Documentation - Help others understand
- 🔧 Submit Pull Requests - Code contributions welcome
- ⭐ Star the Project - Show your support!
git clone https://github.com/magnusfroste/rtsp-stream-analyzer.git
cd rtsp-stream-analyzer
./setup.sh
./start-local.sh- AI/ML Applications - Validate streams for computer vision
- Video Surveillance - Ensure camera quality
- IoT Monitoring - Check device stream health
- Pre-deployment Testing - Validate before installation
- Network Diagnostics - Identify streaming issues
- Quality Assurance - Continuous stream monitoring
- Backend: Python 3.11, FastAPI, OpenCV, FFmpeg
- Frontend: React 18, Vite, TailwindCSS, Axios
- Deployment: Docker, Multi-stage builds
- Analysis: OpenCV (frame counting), FFmpeg (bitrate)
Built with ❤️ for the RTSP and video streaming community.
Special thanks to:
- Anavid.ai - For the use case and inspiration
- OpenCV - For accurate frame analysis
- FFmpeg - For reliable stream processing
- FastAPI - For the excellent Python framework
- React - For the modern UI framework
MIT License - see LICENSE file for details
Magnus Froste (@magnusfroste)
- Built for RTSP enthusiasts and video professionals
- Open source contributions welcome
- Available for consulting and custom development
- GitHub: magnusfroste/rtsp-stream-analyzer
- Issues: Report a bug or request a feature
- Discussions: Join the conversation
⭐ If you find this useful, please star the repository!
Made with ❤️ by @magnusfroste | Powered by Anavid.ai