This example illustrates establishing audio, video and a data channel with a browser. It also performs some image processing on the video frames using OpenCV.
First install the required packages:
$ pip install aiohttp aiortc opencv-python
When you start the example, it will create an HTTP server which you can connect to from your browser:
$ python server.py
You can then browse to the following page with your browser:
Once you click Start the browser will send the audio and video from its webcam to the server.
The server will play a pre-recorded audio clip and send the received video back to the browser, optionally applying a transform to it.
In parallel to media streams, the browser sends a 'ping' message over the data channel, and the server replies with 'pong'.
If you want to enable verbose logging, run:
$ python server.py -v
The audio file "demo-instruct.wav" was borrowed from the Asterisk project. It is licensed as Creative Commons Attribution-Share Alike 3.0:
https://wiki.asterisk.org/wiki/display/AST/Voice+Prompts+and+Music+on+Hold+License