Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๏ฟฝ StreamWatcher - Professional IPTV Channel Monitoring Suite

Python License Platform Status

Discord

Real-Time IPTV Stream Validation & Quality Monitoring Dashboard

Features โ€ข Installation โ€ข Usage โ€ข Configuration โ€ข Dashboard


๐ŸŽฏ Overview

StreamWatcher is a professional-grade IPTV stream validator with a real-time web dashboard. Designed for network engineers, ISPs, and content providers who need reliable stream quality monitoring and channel validation. Features sequential testing to isolate server-side issues, cumulative quality metrics, and beautiful live analytics.

โœจ Key Highlights

  • ๐Ÿ”„ Sequential Testing - Test channels one at a time to isolate server-side performance issues
  • ๐Ÿ“Š Real-time Dashboard - Live updates every second with progress tracking
  • ๐Ÿ” Loop Testing - Single run, loop X times, or infinite loop modes
  • ๐ŸŽฌ Resolution Detection - Automatic 720p, 1080p, and 4K detection with icons
  • ๐Ÿ“ˆ Cumulative Metrics - Track buffering and disconnects across all loop iterations
  • ๐ŸŒ External M3U Links - Load playlists from URLs or local files
  • โฑ๏ธ Total Time Tracking - Cumulative time display from initial start
  • ๐ŸŒ“ Dark Mode - Toggle between light and dark themes
  • ๐Ÿ” Channel Selection UI - Interactive GUI with group filtering and search

๐Ÿš€ Features

Testing Capabilities

  • Stream Validation - Uses ffprobe to detect video/audio streams
  • Resolution Detection - Automatically identifies 720p (HD), 1080p (Full HD), and 4K (Ultra HD)
  • Buffering Detection - Tracks buffering events and counts occurrences
  • Disconnect Tracking - Monitors connection failures and reconnection attempts
  • Configurable Duration - Set custom test duration (1s - 999s) with time units (seconds/minutes/hours)
  • Sequential Execution - Tests one channel at a time to prevent local system bottlenecks

Loop Modes

Mode Description
Single Run Test all channels once
Loop X Times Repeat testing for a specified number of iterations (1-100+)
Infinite Loop Continuous testing until manually stopped

Dashboard Features

  • Live Progress Bar - Visual progress indicator
  • Status Indicators - Pending (gray), Testing (blue), Pass (green), Issue (red)
  • Resolution Icons - Visual indicators for 720p, 1080p, and 4K streams
  • Buffering Count - Total buffering events across all loops
  • Disconnect Count - Cumulative disconnections across iterations
  • Details Column - Error messages, stream information, and resolution data
  • Dark Mode - Eye-friendly dark theme with localStorage persistence
  • Responsive Design - Adapts to different screen sizes

๐Ÿ“ฆ Installation

Prerequisites

  • Python 3.13+ (tested on 3.13.7)
  • ffprobe (part of FFmpeg package)
  • Linux/macOS/Windows with terminal access

Install FFmpeg

Ubuntu/Debian:

sudo apt update
sudo apt install ffmpeg

macOS:

brew install ffmpeg

Windows: Download from ffmpeg.org and add to PATH

Clone Repository

git clone https://github.com/Nigel1992/streamwatcher.git
cd streamwatcher

Setup Virtual Environment

python3 -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

Install Dependencies

pip install -r requirements.txt

๐ŸŽฎ Usage

Basic Usage

python run_local_test.py <path_to_m3u_file_or_url>

Examples:

# Local M3U file
python run_local_test.py data/test_sample.m3u

# External M3U URL
python run_local_test.py https://example.com/playlist.m3u8

Interactive Channel Selection

When you run the script, a GUI window will appear:

  1. Select Channels - Choose channels from groups or search by name
  2. Set Duration - Enter test duration (e.g., 15 seconds, 5 minutes, 1 hour)
  3. Choose Loop Mode:
    • Single Run
    • Loop X Times (specify iterations)
    • Infinite Loop
  4. Click "Start Testing"

View Dashboard

The dashboard opens automatically in your default browser at:

http://localhost:9001/results.html

Stop Testing

Press Ctrl+C in the terminal to stop the test runner.


โš™๏ธ Configuration

M3U File Format

Your M3U playlist should follow the standard format. The URLs can be any stream format that ffprobe supports (HLS .m3u8, direct .ts, RTSP, HTTP streams, etc.):

#EXTM3U
#EXTINF:-1 tvg-id="channel1" tvg-name="Channel Name" tvg-logo="logo.png" group-title="Group",Channel Name
https://stream.example.com/channel1/playlist.m3u8
#EXTINF:-1 tvg-id="channel2" tvg-name="Another Channel" group-title="Group",Another Channel
http://stream.example.com/live/channel2.ts
#EXTINF:-1 tvg-id="channel3" tvg-name="RTSP Stream" group-title="Group",RTSP Stream
rtsp://stream.example.com:554/live/channel3

Port Configuration

Default HTTP port: 9001

To change the port, edit run_local_test.py:

HTTP_PORT = 9001  # Change to your preferred port

Test Duration

  • Minimum: 1 second
  • Maximum: No hard limit (can use days/hours/minutes/seconds units)
  • Default: 15 seconds

Loop Iterations

  • Loop X Times: 1-100+ iterations
  • Infinite: Runs until stopped manually

๐Ÿ“Š Dashboard

Real-time Metrics

The dashboard displays:

Column Description
Channel Channel name with resolution icon
Status Current status (pending/testing/pass/issue)
Resolution Detected resolution with icon (720p/1080p/4K)
Tested Seconds tested for current iteration
Disconnects Total disconnection count (cumulative)
Buffering Total buffering event count (cumulative)
Details Stream information or error messages

Status Colors

  • ๐Ÿ”ต Testing - Currently being tested
  • โšช Pending - Waiting to be tested
  • ๐ŸŸข Pass - Stream validated successfully
  • ๐Ÿ”ด Issue - Buffering or connection errors detected

Loop Information

When using loop modes, the dashboard shows:

  • Single Run: No loop indicator
  • Loop X Times: "Loop Iteration: 3/5"
  • Infinite Loop: "Infinite Loop - Iteration: 7"

๐Ÿ—๏ธ Project Structure

streamwatcher/
โ”œโ”€โ”€ run_local_test.py           # Main test runner
โ”œโ”€โ”€ results.html                # Dashboard interface
โ”œโ”€โ”€ requirements.txt            # Python dependencies
โ”œโ”€โ”€ data/
โ”‚   โ””โ”€โ”€ test_sample.m3u        # Sample M3U playlist
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ iptv_monitor/
โ”‚       โ”œโ”€โ”€ config.py          # Configuration
โ”‚       โ”œโ”€โ”€ db.py              # Database operations
โ”‚       โ””โ”€โ”€ worker.py          # Stream testing logic
โ””โ”€โ”€ README.md                  # This file

๐Ÿ”ง Advanced Features

Sequential vs Concurrent Testing

Sequential Testing (default):

  • Tests one channel at a time
  • Isolates server-side performance issues
  • Prevents local system resource bottlenecks
  • Recommended for accurate server validation

Persistent Metrics Across Loops

When using loop modes, the following metrics persist across iterations:

  • Buffering Count - Cumulative total across all loops
  • Disconnect Count - Total disconnections across iterations
  • Total Time - Cumulative time from initial test start

Database Storage

Test results are stored in SQLite database:

iptv_monitor.db

Contains:

  • Channel information
  • Test history
  • Metrics and timestamps

๐Ÿ› Troubleshooting

Port Already in Use

If port 9001 is occupied:

sudo lsof -i :9001 | grep -v COMMAND | awk '{print $2}' | xargs -r sudo kill -9

Or change the port in run_local_test.py.

FFprobe Not Found

Ensure FFmpeg is installed:

ffprobe -version

If not installed, see Installation section.

Permission Errors

On Linux, you may need to kill ports with sudo:

sudo fuser -k 9001/tcp

Browser Not Opening

Manually navigate to:

http://localhost:9001/results.html

๐Ÿ“ Example Output

[INFO] Found 10 channels. Opening channel selector...
[INFO] Selected 10 channels for testing.
[INFO] Test duration set to 15 seconds
[INFO] Loop mode: Loop 5 times

[INFO] Starting iteration 1/5
Reading local file data/test_sample.m3u
Imported 10 channels
Starting 10 checks (duration=15s)...

Results:
3ABN Canada: pass - [video detected] [audio detected] [video detected 1280x720]
3ABN English: pass - [video detected] [audio detected] [video detected 1920x1080]
...

[INFO] Iteration 1 complete. Looping again...
[INFO] Starting iteration 2/5

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Setup

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • FFmpeg team for the excellent ffprobe tool
  • The IPTV community for format standards and inspiration
  • All contributors who help improve this project

๐Ÿ“ž Support

If you encounter any issues or have questions:

  1. Check the Troubleshooting section
  2. Open an issue
  3. Start a discussion

โญ If you find this project useful, please consider giving it a star! โญ

Made with โค๏ธ by Nigel1992

About

๐Ÿš€ StreamWatcher - Professional IPTV Stream Validator. Real-time quality monitoring with sequential testing, resolution detection (720p/1080p/4K), cumulative metrics, buffering & disconnect tracking, and beautiful live dashboard analytics.

Topics

Resources

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Contributors

Languages