Setup Raspberry Pi as a Video Streaming Server
I have googled a lot, finally I found the guideline of Mike Haldas is the easiest way to stream Raspberry Pi Video. Here I simplified the steps as:
1. Enable RPi camera if it was not.
2. Install Flask
sudo apt-get install -y python-pip sudo pip install flask
3. Download Miguel’s Flask video streaming project.
git clone https://github.com/miguelgrinberg/flask-video-streaming.git
4. Edit app.py file
sudo nano flask-video-streaming/app.py
- Comment line
from camera import Camera;
- uncomment line
from camera_pi import Camera.
5. Start Flask-server by running:
6. Find RPi’s IP address and run
RPi's IP:5000 in your web browser.
The shortcoming of this video streaming server is: it supports only one client! But, it’s fast.
By default, flask uses the “index.html” in “flask-video-streaming/templates”, we can modify that file to change its appearance. E.g. add
to “<img src= …” tag.