mjpg-stream video services (1) | Introduction and configuration using the Raspberry Pi

      Source address: https: //github.com/jacksonliam/mjpg-streamer

Mjpg profile:

      (1) mjpg-streamer is a command-line application that JPEG frame copy from one or more plug-in to a plurality of input output card. It can be used to transfer the JPEG file from the network cameras to view streamed into various types of IP-based networks by, such as Chrome, Firefox, Cambozola, VLC, mplayer MJPG stream can be received and other software.

      (2) It was originally written for embedded devices, in terms of RAM and CPU resources are very limited. It creates "uvc_streamer" because the predecessor of Linux-UVC-compatible camera directly generate JPEG data, even embedded devices running OpenWRT, you can also achieve rapid and smooth M-JPEG stream. The input module "input_uvc.so" JPG captured frame such connection from the network camera. mjpg-streamer now supports a variety of input devices

 Source tree:

└─mjpg- streamer 
    └─mjpg -streamer- experimental 
        ├─cmake 
        ├─plugins 
        │ ├─input_control 
        │ ├─input_file 
        │ ├─input_http 
        │ ├─input_opencv 
        │ │ └─filters 
        │ │ ├─cvfilter_cpp 
        │ │ └─cvfilter_py 
        │ └─cmake │ 
        │ ├─input_ptp2 
        │ ├─input_raspicam 
        │ │ └─mmal 
        │ │ ├─core 
        │ │ ├─util 
        │ │ └─vc 
        │ ├─input_testpicture 
        │ │ └─pictures 
        │ ├─input_uvc 
        │ ├─output_autofocus
        │  ├─output_file
        │  │  └─examples
        │  ├─output_http
        │  ├─output_rtsp
        │  ├─output_udp
        │  ├─output_viewer
        │  └─output_zmqserver
        ├─scripts
        └─www

among them:

After downloading As shown, mainly plugins, www, mjpg_streamer.h header files with source code mjpg_streamer.c

Other packages are some ways, I feel satisfied that with ros_mjpg, and Dockerfile, really is a very broad application.

Explain about the meaning of these files:

plugins directory: data acquisition and transmission function subroutine some usb camera, input and output mode mainly 

www directory: used mainly in the browser, the number of the html interface functions. 

MJPG -streamer.c & .h: the main achievement of resolve and call the relevant function thread running command parameters Functions

With the above probably know, very easy to use;

Here, introduced by Raspberry 3B + :( temporary use LAN video transmission, in fact, it can be followed by visualization of the entire network configuration)

 

1. Update Raspberry Pi

sudo apt-get update  && sudo  apt-get  upgrade -y

Update soon, if your mirror country could use a little slow - >> like me can replace domestic image.

 

2. Turn on the camera

sudo raspi-config (the sudo necessary) and then select the '5 interfacing options' in the 'camera' and enable, raspberry sent after the reboot (restart required) (step below)

 

 3. Check whether the camera is good

ls / dev

This command, search through the peripheral ls / dev, If there  video0  prove Raspberry Pi camera has been detected

 

 

4. Install the necessary libraries

sudo apt-get update
sudo apt-get install subversion
sudo apt-get install imagemagick
sudo apt-get install libv4l-dev
sudo apt-get install cmake
sudo apt-get install git

 

5. Download open source packages

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

 

 

 6. compile and install

sudo git clone https://github.com/jacksonliam/mjpg-streamer.git
make all
sudo  make install

Compile and install process may be a little slow, it is recommended not to use multi-threaded compilation, may be wrong

 

7. Run

./mjpg_streamer -i "./input_uvc.so -d /dev/video0 -n -y -f 25 -r 640x480" -o "./output_http.so -n -w /usr/local/www"

出现上图,可证明已经运行成功

 

 8.打开网页  浏览器输入‘树莓派的ip:8080’即可进入mjpg-streamer界面(如下图)

 

Guess you like

Origin www.cnblogs.com/xiaote/p/10951519.html