Compile MJPG-Streamer from Source on Ubuntu 11.10

Instead of downloading an old .deb package and installing it using sudo dpkg -i mjpg-streamer you can also just get the source, compile and run:

sudo apt-get install libjpeg-dev subversion imagemagick
cd ~/Downloads/
svn co mjpg-streamer
cd mjpg-streamer/mjpg-streamer
make clean all

To try a first start, run:

./mjpg_streamer -i "" -o " -w ./www"

and go to

If you like to install it (so all users can easily use it):

sudo make DESTDIR=/usr install

Using different resolution / Using the optimal resolution with a Logitech 9000 Pro

Source: The available resolutions are:

  • YUV2
    • 1600x1200 5 fps
    • 960x720 10 fps
    • 800x600 25 fps
    • 640x480 30 fps
    • 352x288 30 fps
    • 320x240 30 fps
    • 176x144 30 fps
    • 160x120 30 fps
  • MJPG
    • 960x720 15 fps
    • 800x600 30 fps
    • 640x480 30 fps
    • 352x288 30 fps
    • 320x240 30 fps
    • 176x144 30 fps
    • 160x120 30 fps

So choose 1600x1200 and let mjpg-streamer do the MJPEG conversion (high CPU load):

./mjpg_streamer -i " -d /dev/video0 -y -r 1600x1200" -o " -w ./www"

or choose 960x720 and use the hardware MJPEG compression of the Logitech 9000 Pro (low CPU load):

./mjpg_streamer -i " -d /dev/video0 -f 15 -r 960x720" -o " -w ./www"

A script to start mjpg-streamer:


mjpg_streamer -i " -d /dev/video0 -f $FRAME_RATE -r $RESOLUTION" -o " -w $MJPG_WEB_ROOT -p $PORT"

Securing the Stream with HTTP AUTH

./mjpg_streamer -i " -d /dev/video1 -f 15 -r 800x600" -o " -w ./www -c uSeRnAmE:s3cure-pAssw0rd"

Playing M-JPEG stream with mplayer

mplayer -fps 30 -demuxer lavf ""

It might be necessary to configure mplayer to prefer IPv4 instead of IPv6 Edit ~./mplayer/config and add or change the option: prefer-ipv4=yes.

Tray Icon

Untested: (From