mjpg_streamer
Section:
USER COMMANDS (1)
Updated: June 28, 2012
Index
NAME
mjpg_streamer - Stream webcam video to HTTP
SYNOPSIS
mjpg_streamer[-b|--background] [-i "INPUT_PLUGIN [INPUT_OPTIONS]"]
-o "OUTPUT_PLUGIN [OUTPUT_OPTIONS]"
mjpg_streamer-h | --help
mjpg_streamer-v | --version
DESCRIPTION
mjpg_streamertakes JPGs from Linux-UVC compatible webcams, from the filesystem or fromother input plugins and streams them as M-JPEG via HTTP to webbrowsers, VLCand other software. Alternatively, the stream can be saved to a file orsingle frames can be captured and saved. It is the successor ofuvc-streamer, a Linux-UVC streaming application with Pan/Tilt.
Note:The name of the executable program is mjpg_streamer (with underscore) butthe name of the package is mjpg-streamer (with hyphen). The latter is usedin pathnames too.
OPTIONS
-i | --input "<input-plugin.so> [parameters]"
-o | --output "<output-plugin.so> [parameters]"
-h | --help
display a short help message.
-v | --version
display version information.
-b | --background
fork to the background, run in daemon mode.
EXAMPLES
To open an UVC webcam "/dev/video1" and stream it via HTTP:
mjpg_streamer-i "input_uvc.so -d /dev/video1"
-o "output_http.so"
To open an UVC webcam and stream via HTTP port 8090:
mjpg_streamer-i "input_uvc.so" -o "output_http.so -p 8090"
To get help for a certain plugin:
mjpg_streamer-i "input_uvc.so --help"
mjpg_streamer-i input_testpicture.so
-o "output_http.so --help"
This is the minimum command line to start mjpg_streamer with webpages. For the input-plugin default parameters are used:
mjpg_streamer-o "output_http.so
-w /usr/share/mjpg-streamer/www"
FINDING THE PLUGINS
The default search path for the plugins is taken from the variableLD_LIBRARY_PATH. When you get an error saying that plugins can not be found,set LD_LIBRARY_PATH like this:
exportLD_LIBRARY_PATH="/usr/lib/mjpg-streamer"
or - for 64-Bit systems:
exportLD_LIBRARY_PATH="/usr/lib64/mjpg-streamer"
Or instead of just providing the plugin file name, use a complete (absolute)path and filename:
mjpg_streamer-i "/usr/lib/mjpg-streamer/input_uvc.so"
PLUGINS
input_uvc.so- UVC webcam grabber
The following parameters can be passed to this plugin:
-d | --device <DEVICE>
Video device to open. Example: /dev/video0.
-r | --resolution <RES>
The resolution of the video device. Can be one of the following strings:QSIF QCIF CGA QVGA CIF VGA SVGA XGA SXGA or a custom value like thefollowing example: 640x480.
-f | --fps <NUMBER>
Frames per second. You must choose a value supported by your camera.
-y | --yuv
Enable YUYV format and disable MJPEG mode.
-q | --quality <PERCENT>
JPEG compression quality in percent (activates YUYV format, disables MJPEG).
-m | --minimum_size <SIZE>
Drop frames smaller then this limit, useful if the webcam producessmall-sized garbage frames. This may happen under low light conditions.
-n | --no_dynctrl
Do not initalize dynctrls of Linux-UVC driver.
-l | --led <on|off|blink|auto>
Switch the LED "on", "off", let it "blink" or leave it up to the driverusing the value "auto".
input_file.so- File input plugin.
-d | --delay <DELAY>
Delay to pause between frames in ms.
-f | --folder <DIRECTORY>
Folder to watch for new JPEG files.
-r | --remove
Remove/delete JPEG file after reading.
-n | --name
Ignore changes unless filename matches.
input_gspcav1.so- GSPCAV1 webcam grabber.
-d | --device <DEVICE>
Video device to open.
-r | --resolution <RES>
The resolution of the video device. Can be one of the following strings:QSIF QCIF CGA QVGA CIF VGA SVGA XGA SXGA or a custom value like thefollowing example: 640x480.
-f | --format <r16|r24|r32|yuv|jpg>
Grabbing format, should be set to 'jpg'. Can be: r16 r24 r32 yuv jpg.
input_testpicture.so- Test picture input plugin.
-d | --delay <DELAY>
Delay to pause between frames in ms.
-r | --resolution <RES>
Can be one of 960x720, 640x480, 320x240, 160x120.
output_http.so- HTTP output plugin
-w | --www <DIRECTORY>
Directory that contains webpages in flat hierarchy (no subdirectories). ForopenSUSE packages this is
/usr/share/mjpg-streamer/www.
-p | --port <PORT>
TCP port for this HTTP server. The default port is 8080.
-c | --credentials <USERNAME
ASSWORD>
Ask for "username
assword" on connect.
-n | --nocommands
Disable execution of commands.
output_file.so- File output plugin.
-f | --folder <DIRECTORY>
Directory to save pictures.
-m | --mjpeg
Save the stream to an mjpeg file.
-d | --delay <DELAY>
Delay after saving pictures in ms.
-s | --size <NUMBER>
Size of ring buffer (max number of pictures to hold).
-e | --exceed <NUMBER>
Allow ringbuffer to exceed limit by this amount.
-c | --command <COMMAND>
Execute command after saving picture.
output_udp.so- UDP output plugin.
This plugin saves a picture from the stream upon receiving an UDP request.The request is sent usingmjpg_streamer_udp_client.
-f | --folder <DIRECTORY>
Directory to save pictures.
-d | --delay <DELAY>
Delay after saving pictures in ms.
-c | --command <COMMAND>
Execute command after saving picture.
-p | --port <PORT>
UDP port to listen for picture requests. UDP message is the filename tosave. By default the client uses port 2001.
output_autofocus.so- Autofocus output plugin
This plugin continuously grabs a fresh frame, calculates focus for bestsharpness and adjusts the focus accordingly.
-d | --delay <DELAY>
Delay between grabbing frames in ms. Defaults to 1000.
EXIT STATUS
A runningmjpg_streamercan be stopped with CTRL-C or by sending the signal SIGINT (kill -SIGINT) tothe process. Receiving the signal will shutdown all plugins and freeresources. On normal termination it returns a zero exit status and onerror it returns 1.
AUTHOR
Tom Stöveken, Márton Miklós