Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/robsmall/flask-raspi-video-streamer

Raspberry Pi video streamer based off of miguelgrinberg/flask-video-streaming using Flask-RESTful to work with robsmall/raspi-video-streamer-app or web clients
https://github.com/robsmall/flask-raspi-video-streamer

flask flask-api flask-application flask-backend flask-restful mjpeg mjpeg-stream mjpeg-video-writer raspberry-pi raspberry-pi-3 raspberry-pi-camera raspberrypi

Last synced: 3 months ago
JSON representation

Raspberry Pi video streamer based off of miguelgrinberg/flask-video-streaming using Flask-RESTful to work with robsmall/raspi-video-streamer-app or web clients

Awesome Lists containing this project

README

        

flask-raspi-video-streamer
==========================

Flask-RESTful API to create and serve up a live-stream from a raspberry pi to web and android clients.

Original code borrowed/altered from [miguelgrinberg/flask-video-streaming](https://github.com/miguelgrinberg/flask-video-streaming).

Android client is available at [robsmall/raspi-video-streamer-app](https://github.com/robsmall/raspi-video-streamer-app).

Set Up A Virtual Environment To Run The App Using Virtualenv On A Pi
--------------------------------------------------------------------

Install virtualenv on the pi as root
```
$ sudo pip install virtualenv
```

Then, create a `.env` virtual environment
```
$ virtualenv .env
```
and use it
```
$ source .env/bin/activate
```

Then, install all the requirements for the pi
```
$ pip install -U -r requirements-pi.txt
```

Set the `CAMERA` environment variable to use the pi camera for android
```
$ export CAMERA=pi_android
```

Now you are good to run the app using
```
$ python app.py
```

To Run Using Gunicorn
---------------------
Instead of running the app directly using python, run
```
$ gunicorn --threads 5 --workers 1 --bind 0.0.0.0:5000 app:app
```

Resources
---------
- [miguelgrinberg/flask-video-streaming](https://github.com/miguelgrinberg/flask-video-streaming)
- Also see linked articles in repo's README
- [PiCamera Python Docs](http://picamera.readthedocs.io/en/latest)
- [Web Streaming Example](http://picamera.readthedocs.io/en/latest/recipes2.html#web-streaming)

TODO
----
- This is currently set up for `pi_android`, hook everything else up to work properly too.
- Get this to work with web clients or allow for running of the one-off `simple_mjpeg-server.py` script.
- See TODOs in `video_feed.py`