Coder Social home page Coder Social logo

pi-mjpeg-server's Introduction

Pi MJPEG Server

An extremely lightweight hardware-accelerated MJPEG streaming server for Raspberry Pi + Camera Module with Flask & libcamera API.

Caution

There is no security in this code to prevent any kind of attack. Consider implementing basic authentication with HTTPS if possible!

Setup

  • Update your Raspbery Pi to latest official OS. Use Lite for lowest resource usage!
  • Update packages with :
    • sudo apt update
    • sudo apt upgrade -y
    • sudo apt dist-upgrade -y
    • sudo apt install git
  • Install Python packages with :
    • sudo apt install python3-pip -y
    • sudo apt install python3-picamera2 --no-install-recommends
  • Enable I2C via raspi-config
  • git clone https://github.com/kingkingyyk/Pi-MJPEG-Server.git
  • cd Pi-MJPEG-Server
  • Update mjpeg_server.py if needed. There are some configurations available such as resolution.
  • Move python script to somewhere safe: sudo cp mjpeg_server.py /usr/local/bin
  • Install required python packages: sudo python3 -m pip install --break-system-packages -r requirements.txt
  • Create an auto start service with:
    • sudo cp mjpeg_server.service /etc/systemd/system
    • sudo systemctl daemon-reload
    • sudo systemctl start mjpeg_server
    • sudo systemctl enable mjpeg_server
  • Verify the server is running fine with :
    • sudo systemctl status mjpeg_server
    • Open your browser and visit address http://<Pi IP>:<8764/Port>/

Motioneye Support

This code is tested on work with motioneye. Just add this server url as network camera.

Support

The code is tested to work on :

  • Pi 5 SW Encode + Camera Module v3 (~85% CPU usage for single connection)
  • Pi 4 HW Encode + Camera Module v3 (~4% CPU usage for single connection, 1% more for every connection)
  • Pi Zero 2 W HW Encode + Camera Module v1 (~35% CPU usage for single connection)
  • Pi Zero W HW Encode + Camera Module v1 (~60% CPU usage for single connection)

pi-mjpeg-server's People

Contributors

kingkingyyk avatar

Stargazers

 avatar Rancune avatar Sergio Sánchez Zavala avatar Marcel Winheim avatar  avatar  avatar Tim W. avatar James Kelly avatar  avatar Señor Frutti avatar michael avatar  avatar Cellar Nerd avatar Romeo avatar  avatar Fredrik Mandal avatar Benji avatar

Watchers

James Cloos avatar  avatar

pi-mjpeg-server's Issues

How to adjust whitebalance for NOIR camera module?

First of all, this is amazing. Super fast, quality network camera to replace motioneyeos on my Pi 4 with the v3 camera module. Love it!

However, I'm using the NOIR version of the camera module, so the colors are off. In motioneye, I would add the motion option mmalcam_control_params -awb greyworld to fix this. Is there a way to accomplish this with your script?

Error in line 90...

Hello,
executing mjpeg_server.py gives an error:

SyntaxError: invalid syntax
File "/home/juergen/Pi-MJPEG-Server/mjpeg_server.py", line 90
def down(self):
^

How can i fix this?

Regards
Juergen

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.