Skip to content

Python tray-server that converts RTSP/H-264 cameras into lightweight MJPEG endpoints for browsers and PixPulse Viewer.

License

Notifications You must be signed in to change notification settings

zEhmsy/StreamTray

Repository files navigation

README — StreamTray

Contributors Forks Stargazers Issues Apache 2.0 License

StreamTray logo

StreamTray

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
  1. About The Project
  2. Key Features
  3. Built With
  4. Getting Started
  5. Usage
  6. Screenshot
  7. Roadmap
  8. Contributing
  9. License
  10. Contact

About The Project

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.

(back to top)


Features

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

(back to top)


Built With

  • 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

(back to top)


Getting Started

Prerequisites

  • Python 3.10 or newer (Windows users: enable “Add Python to PATH” on installer)

Installation

# 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.exe

Firewall tip – allow inbound TCP 5000 so other devices can reach http://YOUR_PC_IP:5000/.

(back to top)


Usage

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>.

(back to top)

Screenshot

Roadmap

  • 1 thread / camera, auto-close when idle
  • Logging & --debug flag
  • ONVIF auto-discover cameras
  • HLS / WebRTC output options
  • Docker image
  • TLS (HTTPS) support
  • User/password auth for MJPEG endpoints

See issues.

(back to top)


Contributing

  1. Fork the repo & create your feature branch: git checkout -b feat/Amazing
  2. Commit your changes: git commit -m "feat: Amazing"
  3. Push to the branch: git push origin feat/Amazing
  4. Open a Pull Request

If this project saves you time, consider showing a little love 💜:

"Buy Me A Coffee"

Star the project ⭐ if it helps you!

License

StreamTray is distributed under the Apache 2.0 license. See LICENSE for details.

Contact

Giacomo Turturro – info.g.turturro@gmail.com Project URL: https://github.com/zEhmsy/StreamTray

(back to top)

About

Python tray-server that converts RTSP/H-264 cameras into lightweight MJPEG endpoints for browsers and PixPulse Viewer.

Topics

Resources

License

Stars

Watchers

Forks