1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
Audio, video and data channel server
====================================
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.
Running
-------
First install the required packages:
.. code-block:: console
$ 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:
.. code-block:: console
$ python server.py
You can then browse to the following page with your browser:
http://127.0.0.1:8080
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'.
Additional options
------------------
If you want to enable verbose logging, run:
.. code-block:: console
$ python server.py -v
Credits
-------
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
|