joseph-long / starlette-aiortc-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

# From https://github.com/aiortc/aiortc/tree/main/examples/webcam

## WIP trying to make it work with Starlette

Webcam server

This example illustrates how to read frames from a webcam and send them to a browser.

Running

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 webcam.py

You can then browse to the following page with your browser:

http://127.0.0.1:8080

Once you click Start the server will send video from its webcam to the browser.

Additional options

If you want to play a media file instead of using the webcam, run:

$ python server.py --play-from video.mp4

Credits

The original idea for the example was from Marios Balamatsias.

About


Languages

Language:Python 64.9%Language:JavaScript 25.9%Language:HTML 9.2%