This is a simplified version of a WebRTC streaming system, demonstrating the core concepts of real-time video streaming using WebRTC technology.
- WebRTC video streaming
- Simple animated avatar generation
- Clean and responsive web interface
- Real-time video processing pipeline
.
├── README.md
├── requirements.txt
├── server/
│ ├── app.py # Main server application
│ └── video_processor.py # Video processing and frame generation
├── static/
│ └── js/
│ └── client.js # Client-side WebRTC handling
└── templates/
└── index.html # Web interface
- Python 3.8+
- pip (Python package manager)
-
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Start the server:
python server/app.py
-
Open a web browser and navigate to:
http://localhost:8080 -
Click the "Start Stream" button to begin streaming.
- The server generates a simple animated avatar using OpenCV
- WebRTC is used to establish a peer connection between the browser and server
- The video stream is sent in real-time to the browser
- The browser displays the stream in a video element
app.py: Main server application handling WebRTC signalingvideo_processor.py: Generates video frames for streamingclient.js: Handles WebRTC connection on the browser sideindex.html: Provides the user interface
- WebRTC connection establishment
- SDP (Session Description Protocol) exchange
- Video track handling
- Real-time streaming pipeline
- Basic video frame generation and processing
You can extend this project by:
- Adding audio support
- Implementing more complex avatar animations
- Adding interactive controls
- Implementing multiple stream support
- Adding data channels for bi-directional communication
If you encounter issues:
- Make sure all dependencies are installed correctly
- Check that no other service is using port 8080
- Ensure your browser supports WebRTC (most modern browsers do)
- Check the browser console for error messages