Raspberry Pi mjpg-streamer realizes real-time monitoring

Ready to work

Install the camera first.
How to install it will not go into details

Raspberry Pi expansion

Insert picture description here
Some mirrors will have insufficient space. In this case, you need to expand the capacity to adapt the capacity of the mirror to the capacity of the SD card.

sudo raspi-config

Insert picture description here
Insert picture description here

Install dependent libraries

sudo apt-get update #Update software list

sudo apt-get upgrade #Update software

sudo apt-get install subversion #Subversion is a free and open source version control system
sudo apt-get install libjpeg8-dev #JPEG support library
sudo apt-get install imagemagick
sudo apt-get install libv4l-dev #4l is lowercase "L"
sudo apt-get install cmake #download compilation tool
Insert picture description here
terminal print information, wait for the end

Install git and git source code

Install git

sudo apt-get install git

Download source code

git clone https://github.com/jacksonliam/mjpg-streamer.git

Insert picture description here

Compile and install mjpeg

cd mjpg-streamer/mjpg-streamer-experimental 

make all;sudo make install

Insert picture description here

Modify the mjpeg startup script

vi start.sh 

Insert picture description here

Modify as follows
Insert picture description here

Enable camera

sudo raspi-config

Insert picture description here
Insert picture description here
Insert picture description here

verification

/home/pi/mjpg-streamer/mjpg-streamer-experimental

Continue in this directory

./start.sh

If it is in another path, use the absolute path to start

/usr/local/bin/mjpg_streamer -i "/usr/local/lib/mjpg-streamer/input_uvc.so -n -f 30 -r 1280x720" -o "/usr/local/lib/mjpg-streamer/output_http.so -p 8080 -w /usr/local/share/mjpg-streamer/www"

Browser view

Browser input

http://ip:8080

ip is the Raspberry Pi ip address
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_28258885/article/details/114884284