Mitch Allen How to Stream from a Raspberry Pi Camera to your Browser

Created by Mitch Allen last modified

Steps for streaming from a NoIR camera attached to a PiZero

Using Raspian Jessie Lite on a PiZero 1.3 with a NoIR camera over Wireless.

This was also tested on a Pi 3 running the regular version of Jessie with the same camera.

Login to your Pi over ssh and do the following:

$ sudo apt-get update
$ sudo raspi-config  # Enable the camera: 6 Enable Camera / Yes / OK / Finish
$ mkdir projects
$ cd projects/
$ sudo apt-get install git  # If git is not already installed
$ git clone
$ cd mjpg-streamer/
$ cd mjpg-streamer-experimental/
$ sudo apt-get install cmake
$ sudo apt-get install python-imaging
$ sudo apt-get install libjpeg-dev
$ sudo make install
$ export LD_LIBRARY_PATH=.
$ ./mjpg_streamer -o " -w ./www" -i ""

Note that this worked fine on the Pi Zero. But on the Pi 3 the image was reversed and I had to add the -hf flag:

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

On another machine (like a Mac using Chrome) browse to (replacing HOSTNAME with your Pi hostname):




If the image is backwards, see my note above about the -hf flag.

You can also try:

$ ./mjpg_streamer -o " -w ./www" -i " -x 1280 -y 720 -fps 15 -ex night"

Or if it's backwards, add the -hf flag:

$ ./mjpg_streamer -o " -w ./www" -i " -x 1280 -y 720 -fps 15 -ex night -hf"

See related article:

Comments (0)