A Django-based live streaming application that loops pre-recorded videos to RTMP destinations like YouTube, Twitch, Facebook, and custom RTMP servers.
- Multi-Platform Streaming: Stream to YouTube, Twitch, Facebook, or any custom RTMP server
- Video Playlist Management: Upload and organize videos with drag-and-drop ordering
- Multi-Stream Support: Run multiple streams simultaneously to different platforms
- Config-Specific Playlists: Assign different videos to different stream configurations
- Loop Playback: Videos play continuously in a loop
- Directory Sync: Drop videos directly into the media folder and sync with one click
- Real-time Status: Monitor stream status with live updates
- Session History: Track all streaming sessions with detailed logs
git clone <your-repo-url> stream_station
cd stream_station
./setup.shThe setup script will automatically:
- Install Python 3.10+ (if not present)
- Install FFmpeg (if not present)
- Create virtual environment
- Install all dependencies
- Run database migrations
- Create admin user (optional)
- Start the development server
If you prefer manual installation:
# 1. Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# 2. Install dependencies
pip install -r requirements.txt
# 3. Run migrations
python manage.py migrate
# 4. Create admin user
python manage.py createsuperuser
# 5. Start server
python manage.py runserverOption 1: Web Upload
- Go to Videos page
- Click "Add Video"
- Upload your video file
Option 2: Direct Upload (Recommended for large files)
- Copy video files to
media/videos/directory - Go to Videos page
- Click "Refresh" to sync with database
- Go to Configurations page
- Click "New Configuration"
- Fill in:
- Name: A friendly name for this config
- Platform: Select your streaming platform
- RTMP URL: Auto-filled based on platform
- Stream Key: Your platform's stream key
- Video Settings: Resolution, FPS, bitrate
- Playlist Videos: Select which videos to stream (optional)
- Save configuration
- Go to Dashboard
- Select a configuration from dropdown
- Click "Go Live"
- Monitor stream status in real-time
You can run multiple streams simultaneously:
- Start first stream with one configuration
- Select another configuration from dropdown
- Click "Go Live" again
- Each stream can be stopped individually
- MP4 (recommended)
- MKV
- AVI
- MOV
- WebM
- FLV
- WMV
- M4V
| Platform | RTMP URL |
|---|---|
| YouTube | rtmp://a.rtmp.youtube.com/live2 |
| Twitch | rtmp://live.twitch.tv/app |
rtmps://live-api-s.facebook.com:443/rtmp/ |
Stream Station provides REST API endpoints:
| Endpoint | Description |
|---|---|
GET /api/stream/status/ |
Get current stream status |
POST /api/stream/control/ |
Start/stop streams |
GET /api/ffmpeg/status/ |
Get FFmpeg installation status |
GET /api/videos/ |
List all videos |
GET /api/configs/ |
List all configurations |
GET /api/sessions/ |
List streaming sessions |
stream_station/
├── manage.py
├── setup.sh # One-click setup script
├── requirements.txt
├── media/
│ ├── videos/ # Video files
│ ├── playlists/ # Generated playlist files
│ └── logs/ # FFmpeg logs
├── stream_station/ # Django project settings
└── streaming/ # Main application
├── models.py # Video, StreamConfig, StreamSession
├── views.py # Web views
├── api_views.py # REST API views
├── services/ # FFmpeg service
└── templates/ # HTML templates
- Python 3.10+
- FFmpeg
- Django 5.0+
- Django REST Framework
- Ensure your video has audio or the stream generates silent audio automatically
- Check that your stream key is correct
- Verify YouTube Studio shows "receiving data"
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg
# CentOS/RHEL
sudo yum install ffmpegchmod +x setup.sh
./setup.shMIT License