Skip to content

winteriscomingpinball/mjpg-streamer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

mjpg-streamer

This is a fork of http://sourceforge.net/projects/mjpg-streamer/ with added support for the Raspberry Pi camera via the input_raspicam plugin.

Edits were made to output_http.c to force WXP_COMPAT for jpg images and change name from "cam" to "img" so that the streamed snapshot can be used in Mario Kart Arcade GP 1 and 2 at expected IP/img.jpg. For Mario Kart Arcade, the game settings allow you to choose which of 4 IDs a given motherboard should take. ID 1 expects a camera at 192.168.2.104. 2 expects .105, 3 expects .106, and 4 expects .107, so you can set your RPi to the necessary IP and run mjpg_streamer as follows to get a working camera server going for Mario Kart Arcade GP 1 and 2:

Webcam:

/usr/local/bin/mjpg_streamer -i "input_uvc.so -r 320x240 -d /dev/video0 -f 30 -q 80" -o "output_http.so -p 80 -w /usr/local/share/mjpg-streamer/www

Pi Camera:

/usr/local/bin/mjpg_streamer -i "input_raspicam.so --width 320 --height 240 -d /dev/video0 -fps 30 -quality 80" -o "output_http.so -p 80 -w /usr/local/share/mjpg-streamer/www

mjpg-streamer is a command line application that copies JPEG frames from one or more input plugins to multiple output plugins. It can be used to stream JPEG files over an IP-based network from a webcam to various types of viewers such as Chrome, Firefox, Cambozola, VLC, mplayer, and other software capable of receiving MJPG streams.

It was originally written for embedded devices with very limited resources in terms of RAM and CPU. Its predecessor "uvc_streamer" was created because Linux-UVC compatible cameras directly produce JPEG-data, allowing fast and perfomant M-JPEG streams even from an embedded device running OpenWRT. The input module "input_uvc.so" captures such JPG frames from a connected webcam. mjpg-streamer now supports a variety of different input devices.

Security warning

WARNING: mjpg-streamer should not be used on untrusted networks! By default, anyone with access to the network that mjpg-streamer is running on will be able to access it.

Plugins

Input plugins:

Output plugins:

Building & Installation

You must have cmake installed. You will also probably want to have a development version of libjpeg installed. I used libjpeg8-dev. e.g.

sudo apt-get install cmake libjpeg8-dev

Simple compilation

This will build and install all plugins that can be compiled.

cd mjpg-streamer-experimental
make
sudo make install

By default, everything will be compiled in "release" mode. If you wish to compile with debugging symbols enabled, you can do this:

cd mjpg-streamer-experimental
make distclean
make CMAKE_BUILD_TYPE=Debug
sudo make install

Advanced compilation (via CMake)

There are options available to enable/disable plugins, setup options, etc. This shows the basic steps to enable the experimental HTTP management feature:

cd mjpg-streamer-experimental
mkdir _build
cd _build
cmake -DENABLE_HTTP_MANAGEMENT=ON ..
make
sudo make install

Usage

From the mjpeg streamer experimental folder:

export LD_LIBRARY_PATH=.
./mjpg_streamer -o "output_http.so -w ./www" -i "input_raspicam.so"

See README.md or the individual plugin's documentation for more details.

Discussion / Questions / Help

Probably best in this thread http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=45178

Authors

mjpg-streamer was originally created by Tom Stöveken, and has received improvements from many collaborators since then.

License

mjpg-streamer is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Releases

No releases published

Packages

No packages published

Languages

  • C 94.6%
  • HTML 1.9%
  • C++ 1.4%
  • CMake 0.8%
  • JavaScript 0.5%
  • Shell 0.3%
  • Other 0.5%