Giter Site home page Giter Site logo

pi-camera-stream-flask's Introduction

Make you own Raspberry Pi Camera Stream

Create your own live stream from a Raspberry Pi using the Pi camera module. Build your own applications from here.

How it works

The Pi streams the output of the camera module over the web via Flask. Devices connected to the same network would be able to access the camera stream via

<raspberry_pi_ip:5000>

Screenshots

Setup Live Pi Camera Stream
Pi Setup Pi - Live Stream

Preconditions

  • Raspberry Pi 4, 2GB is recommended for optimal performance. However you can use a Pi 3 or older, you may see a increase in latency.
  • Raspberry Pi 4 Camera Module or Pi HQ Camera Module (Newer version)
  • Python 3 recommended.

Library dependencies

Install the following dependencies to create camera stream.

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install libatlas-base-dev
sudo apt-get install libjasper-dev
sudo apt-get install libqtgui4
sudo apt-get install libqt4-test
sudo apt-get install libhdf5-dev

sudo pip3 install flask
sudo pip3 install numpy
sudo pip3 install opencv-contrib-python
sudo pip3 install imutils
sudo pip3 install opencv-python

Note: This installation of opencv may take a while depending on your pi model.

OpenCV alternate installation (in the event of failed opencv builds):

sudo apt-get install libopencv-dev python3-opencv

Step 1 – Cloning Raspberry Pi Camera Stream

Open up terminal and clone the Camera Stream repo:

cd /home/pi
git clone https://github.com/EbenKouao/pi-camera-stream-flask.git

Step 2 – Launch Web Stream

Note: Creating an Autostart of the main.py script is recommended to keep the stream running on bootup.

sudo python3 /home/pi/pi-camera-stream-flask/main.py

Step 3 – Autostart your Pi Stream

Optional: A good idea is to make the the camera stream auto start at bootup of your pi. You will now not need to re-run the script every time you want to create the stream. You can do this by going editing the /etc/profile to:

sudo nano /etc/profile

Go the end of the and add the following (from above):

sudo python3 /home/pi/pi-camera-stream-flask/main.py

This would cause the following terminal command to auto-start each time the Raspberry Pi boots up. This in effect creates a headless setup - which would be accessed via SSH. Note: make sure SSH is enabled.

More Projects / Next Steps

View the latest Build: Pi Smart Cam with Motion Sensor

Alternatively, view more projects that build on the Pi Camera on smartbuilds.io.

pi-camera-stream-flask's People

Contributors

ebenkouao avatar flipthedog avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.