MJPEG Streamer (commonly written as mjpg-streamer) is a lightweight, open-source command-line application designed to copy JPEG frames from input sources (like webcams) and stream them across an IP-based network to various viewers.
Because it compresses each individual frame as a separate JPEG image rather than using complex interframe video compression, it requires very little processing power. This makes it a popular tool for resource-constrained, embedded systems such as the Raspberry Pi. Key Features
Extremely Low CPU & RAM Usage: It was intentionally built for embedded devices with limited resources. Many USB webcams naturally compress data into JPEG format natively; mjpg-streamer simply passes these pre-compressed frames straight to the network without re-encoding them, resulting in minimal CPU usage.
Plugin-Based Architecture: The tool relies on separate modules for inputs and outputs. You can mix and match plugins depending on your project needs.
Universal Viewer Compatibility: The output stream can be natively viewed in web browsers (like Chrome or Firefox) or media players (such as VLC and mplayer) without installing specialized codecs. Architecture & Plugins
The utility relies entirely on a system of dynamic input and output plugins: 1. Input Plugins
These components grab individual image frames from physical hardware or virtual environments.
input_uvc.so: The most common plugin, used to capture JPG frames directly from UVC-compatible USB webcams.
input_raspicam.so: Specifically optimized for older or dedicated Raspberry Pi Camera modules.
input_file.so: Reads JPEG frames from a specified directory on the host computer’s storage filesystem.
input_opencv.so: Connects to OpenCV for advanced computer vision pipelines. 2. Output Plugins
These components package the frames and distribute them across the network.
output_http.so: Creates an HTTP-based server that dishes out a Motion-JPEG stream or captures standalone .jpg snapshots.
output_file.so: Saves the incoming stream as standalone images onto a local disk. Performance: MJPEG vs. H.264 / H.265
When setting up a video stream, choosing mjpg-streamer involves a distinct trade-off:
Leave a Reply