Code Monkey home page Code Monkey logo

picamweb's Introduction

PiCamWeb

About

PiCamWeb is a Python based web interface for Raspberry Pi Camera (both v1 and v2 can be used). It uses websockets for data transport and jsmpg to render the video feed in the browser.
Tornado is used for the webserver and websockets, picamera for camera recording and ffmpeg to encode the raw video data to MPEG1.
The project is inspired by the pistreaming project.
If you need authentication for the video stream you can check my alfred project.

Installation

After making sure your camera module works (you can test it using raspistill) install dependencies:
sudo apt-get install libav-tools git python3-pip nginx
sudo pip3 install tornado picamera
Copy source files, edit relevant settings in the settings.py module if needed and configure services:

cd /var/www
sudo git clone https://github.com/iticus/picamweb
sudo chown -R pi:pi picamweb
cd picamweb
nano settings.py
sudo cp scripts/picamweb.service /etc/systemd/system/picamweb.service
sudo systemctl daemon-reload
sudo systemctl enable picamweb && sudo systemctl start picamweb
sudo cp scripts/nginx.default /etc/nginx/sites-available/default
sudo systemctl restart nginx

Your camera feed should now be available under:
http://RPI_ADDRESS/
Useful debug command (to view application log):
sudo journalctl -u picamweb.service

Notes

  • jsmpg and ffmpeg were chosen in order to minimize network traffic when viewing the camera feed
  • ffmpeg is running in the background all the time (even when the web interface is not being accessed) which can be quite CPU intensive especially on older single-core Raspberry Pi models; that being said, it works on a Raspberry Pi 1 Model B+ with a system load of ~ 1.2 - 1.3
  • an option to load ffpmeg on demand might be introduced in the future

picamweb's People

Contributors

iticus avatar

Watchers

 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.