Tiny Python tray-server that converts any RTSP camera/DVR
into lightweight MJPEG feeds for browsers & mobile apps.
Explore the docs »
·
Report Bug
·
Request Feature
Table of Contents
StreamTray is a zero-config micro-server that sits in your system-tray,
opens an RTSP connection once per camera and re-streams frames as
multipart/x-mixed-replace; boundary=frame — the format any browser <img>
tag (or PixPulse Viewer) can render.
┌────────────────────────┐
│ │
│ RTSP/H-264│ Camera │
│ streams ► │ DVR / NVR │
└────────────────────────┘
│
▼ single thread per cam
┌──────────────────────────┐
│ StreamTray Flask │
│ ▸ SQLite DB of streams │
│ ▸ OpenCV capture │
│ ▸ MJPEG endpoint │
└──────────────────────────┘
│
▼
Browser ▸ \<img src=/video\_feed/1>
PixPulse Viewer (Flutter)Runs on Windows as one-file .EXE via PyInstaller.
| Server logic | Tray / GUI |
|---|---|
| 🔄 Single RTSP worker per camera (thread-safe) | 🖥️ Tray icon start / stop / quit |
| 💤 Auto-shutdown when last viewer disconnects | 📋 GUI to add / edit / delete RTSP URLs |
| ⚡ Re-uses existing RTSP session for many clients | 🔗 “Open first stream” quick link |
| 🗃️ SQLite database stored next to executable | 🔔 Desktop notification on server start |
🪵 Built-in logging (--debug flag) |
📦 Self-contained one-file build with PyInstaller |
- Python 3.10+
- Flask – HTTP layer
- Waitress – production WSGI server
- OpenCV-Python – RTSP capture & JPEG encode
- PyStray – system-tray icon
- tkinter – lightweight RTSP manager window
- SQLite3 – persistent database
- Python 3.10 or newer (Windows users: enable “Add Python to PATH” on installer)
# 1. clone
git clone https://github.com/zEhmsy/StreamTray.git
cd StreamTray
# 2. install deps
python -m pip install -r requirements.txt
# 3. run in console
python streamtray.py --debug # localhost:5000
# optional – build single .exe (Windows)
pyinstaller --onefile --windowed --icon=app.ico --add-data "app.png;." --add-data "rtsp_streams.db;." --add-data "templates\\index.html;templates" --clean main.py # dist/StreamTray.exeFirewall tip – allow inbound TCP 5000 so other devices can reach
http://YOUR_PC_IP:5000/.
| Action | Where |
|---|---|
| Start server | Tray menu → Start server |
| Add camera | Tray menu → Gestisci RTSP → paste URL |
| Open stream | Browser http://PC:5000/ or PixPulse Viewer |
| Stop server | Tray menu → Chiudi or close console |
| Headless mode | python streamtray.py --debug (no tray, logs to stdout) |
Stream endpoints follow /video_feed/<camera_id>.
- 1 thread / camera, auto-close when idle
- Logging &
--debugflag - ONVIF auto-discover cameras
- HLS / WebRTC output options
- Docker image
- TLS (HTTPS) support
- User/password auth for MJPEG endpoints
See issues.
- Fork the repo & create your feature branch:
git checkout -b feat/Amazing - Commit your changes:
git commit -m "feat: Amazing" - Push to the branch:
git push origin feat/Amazing - Open a Pull Request
If this project saves you time, consider showing a little love 💜:
Star the project ⭐ if it helps you!
StreamTray is distributed under the Apache 2.0 license.
See LICENSE for details.
Giacomo Turturro – info.g.turturro@gmail.com Project URL: https://github.com/zEhmsy/StreamTray




