A modern video streaming application built with Flask and FFmpeg that supports adaptive streaming formats (HLS and DASH) for smooth playback across different network conditions.
- File Upload: Secure video file upload with drag-and-drop support
- Adaptive Streaming: Converts videos to HLS and DASH formats
- Modern UI: Responsive interface built with Tailwind CSS and Alpine.js
- Video Player: Built-in player supporting both HLS and DASH playback
- File Management: List and manage uploaded videos
- Cross-Platform: Works on desktop and mobile browsers
- Python 3.7+
- FFmpeg
- Modern web browser with HTML5 video support
- Fork and Clone the repository:
git clone https://github.com/yourusername/flask-streamer.git
cd flask-streamer- Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install required packages:
pip install -r requirements.txt- Install FFmpeg:
- Ubuntu/Debian:
sudo apt update sudo apt install ffmpeg
- macOS:
brew install ffmpeg
- Windows: Download from FFmpeg official website
- Start the Flask server:
python main.py- Open your browser and navigate to:
http://localhost:5000
- Upload a video file using the web interface:
- Drag and drop a video file or click to browse
- Wait for the conversion process to complete
- Access your video through the player or direct streaming URLs
Input formats:
- MP4
- AVI
- MOV
- MKV
- WMV
- FLV
- WebM
Output formats:
- HLS (.m3u8)
- DASH (.mpd)
flask-streamer/
├── main.py # Main Flask application
├── requirements.txt # Python dependencies
├── uploads/ # Original video storage
├── streams/ # Converted stream files
└── templates/ # HTML templates
├── index.html # Main upload interface
└── player.html # Video player page
Default configurations in main.py:
- Maximum upload size: 100MB
- Server host: 0.0.0.0
- Server port: 5000
- Debug mode: Enabled
- File type validation
- Secure filename handling
- Size limitations
- Cross-Origin Resource Sharing (CORS) enabled
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request