A minimal Quart-based web application for streaming media (video, image) files from a local directory to devices on the same network, with Windows/Linux service support.
- Cross-Platform Support: Runs as native service on both Windows and Linux
- Simple Management: Unified commands for both platforms (
install,start) - Auto-Detection: Automatically detects OS and applies appropriate service manager
- Production Ready: Uses Waitress WSGI server with configurable threads
- Persistent: Runs in background and survives reboots (when installed as service)
-
Clone the repository:
git clone https://github.com/koushikEng/minimal-video-stream.git cd minimal-video-stream -
Install dependencies:
pip install -r requirements.txt
Platform-specific dependencies:
# Windows only pip install pywin32 # Linux only sudo apt-get install systemd
| Command | Windows | Linux |
|---|---|---|
| Install service | python service.py install |
sudo python service.py install |
| Start service | python service.py start |
sudo python service.py start |
| Check status | Services MMC | sudo systemctl status stream_local |
| View logs | Event Viewer | journalctl -u stream_local |
# Install with custom port and threads
python service.py install --port 8080 --threads 8
# Available parameters:
# --port Server port (default: 80)
# --threads Worker threads (default: 4)# Development mode
python main.py [directory_path]
# Production mode
python main.py [directory_path] --prod
# Set host and port (default to 0.0.0.0 80)
python main.py [directory_path] -host [host] -port [port]- Installs via Windows Service Control Manager
- Runs under Local System account
- Automatic recovery on failure
- Managed through
services.msc
- Creates systemd unit file at
/etc/systemd/system/stream_local.service - Runs under current user account
- Automatic restart on failure
- Logs via journald
stream_local/
├── main.py # Main application
├── server.py # Server and routes
├── service.py # Cross-platform service manager
├── templates/
│ └── index.html # Web interface
├── README.md # This document
└── requirements.txt # Dependencies
Service fails to start:
- Check logs (Windows: Event Viewer, Linux:
journalctl -u stream_local) - Verify port is available (
netstat -tulnp | grep <port>) - Check firewall rules
Permission issues on Linux:
# Set proper permissions
sudo chmod 644 /etc/systemd/system/stream_local.service
sudo systemctl daemon-reloadMissing dependencies:
# Windows
pip install pywin32
# Linux
sudo apt install python3-systemd- The server binds to all interfaces (
0.0.0.0) by default - For production use:
- Consider adding authentication
- Use HTTPS with reverse proxy (Nginx/Apache)
- Restrict access to local network
MIT License - Free for personal and commercial use