This is a toy project for learning how to use a couple of python libraries.
What it does
- The web client sends video stream data (from the user's webcam) to a flask server using socketio
- The server does some processing on the video stream
- The client receives the processed video stream and re-displays the results in a different frame
In the demo site, the server is simply flipping the image horizontally. You could imagine it doing something more useful (e.g. applying some filters, OpenCv processing, detections from OpenCV).
Demo
Setup
Optional
- setup heroku (
brew install heroku
) - Use a python virtualenv
Required
git clone https://github.com/dxue2012/python-webcam-flask.git
pip install -r requirements.txt
Run locally
IF YOU HAVE HEROKU:
-
heroku local
IF NOT: -
gunicorn -k eventlet -w 1 app:app --log-file=-
-
in your browser, navigate to localhost:5000
Deploy to heroku
git push heroku master
- heroku open
Common Issues
If you run into a 'protocol not found' error, see if this stackoverflow answer helps.