You are on page 1of 12

2014

Running MJPG-Streamer on RASPBERRP PI B+

Author: P N KIRAN
Email ID:kiran@tenettech.com

#9/3,Shree Lakshmi complex,2ndFloor,Opp,To Vivekananda Park,Girinagar,Bangalore-560085.www.tenettech.com

Introduction:
This easy step by step guide will help you set up your raspberry pi and get
started with Live Streaming of video using a webcam.
Hardware requriment:
Raspberry pi
8GB Micro sd card
camera
Software requriment :
Raspbian Debian Wheezy
Raspberry pi :
The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It is a
capable little computer which can be used in electronics projects, and for many of the things
that your desktop PC does, like spreadsheets, word-processing and games. It also plays highdefinition video. We want to see it being used by kids all over the world to learn how
computers work, how to manipulate the electronic world around them, and how to program..
for more info please visit the link click here.
Camera
Enjoy 720p HD-quality video recording and clear, crisp audio with built-in noise-cancelling
microphone. Videos are captured at a smooth rate of 30 frames per second pixel . For more
Technical information about this camera please visit the link click here
Raspbian: The officially recommended official distribution from the Foundation,based on
Debian. Note that raspbian.org is a community site, not operated by the Foundation. If youre
looking for the official distribution, visit the downloads page at raspberrypi.org.
Getting Started
Step 1:

Download Raspberry pi official Operating system Raspbian . For downloading


this OS please visit the link click here

Step 2:
Prepare your SD Card:
Plug an micro sd card in card reader and plug in to an pc format his micro sd
card using sd formater For downloading this sd formater please visit the link
click here

#9/3,Shree Lakshmi complex,2ndFloor,Opp,To Vivekananda Park,Girinagar,Bangalore-560085.www.tenettech.com

Write an downloaded OS in to an micro SD card using win32 disk imager .for


downloading this win32 disk imager click here
Step 3 :
Prepare and Connect
Insert your prepared micro SD Card in to an Raspberry pi Micro SD card slot .
Plug the HDMI output into your TV or monitor. Make sure your monitor is on.
Plug in the power supply. In general, try to make sure everything else is
hooked up before connecting the power.
Turn raspberry pi board on by plugging the micro usb Power cabel(5v,1A dc)
Step 4 :
After Providing power supply to the board it automaticalliy start booting.after complition
of booting .
It will ask login id and password
start the graphical interface
o manually like this:
o raspberrypi login: pi
o Password: raspberry
o pi@raspberrypi ~ $ startx

#9/3,Shree Lakshmi complex,2ndFloor,Opp,To Vivekananda Park,Girinagar,Bangalore-560085.www.tenettech.com

Step 5:
In that Raspberry pi window we have to open LX-terminal .

First we have to find our IP address of raspberry pi board. For that we have to provide Internet
connection through Lan cabel.
open LX-terminal. for finding ip addres of raspberry pi we have to type :
Sudo ifconfig
It will show the IP Adress of raspberry pi
For example: my IP Adress is 192.168.0.123
http:/<Raspberry pi IP>/:8080/?action=stream
Step6:
We have to follow the below steps to get the MJPG-Streamer installed on the Raspberry pi
Step 6.1:
downloads the package lists from the repositories and "updates" them to get information on
the newest versions of packages and their dependencies.
sudo apt-get update

#9/3,Shree Lakshmi complex,2ndFloor,Opp,To Vivekananda Park,Girinagar,Bangalore-560085.www.tenettech.com

step 6.2:
will fetch new versions of packages existing on the machine if APT knows about these new
versions by way of apt-get update.
sudo apt-get upgrade
step 6.3:
Initially you need to download and compile mjpg streamer.
wget http://lilnetwork.com/download/raspberrypi/mjpg-streamer.tar.gz
step 6.4:
It will downloaded as a tar file,we have to untar it.
tar xvzf mjpg-streamer.tar.gz
step 6.5:
sudo apt-get install libjpeg8-dev
step 6.6:
sudo apt-get install imagemagick
step 6.7:
Enter in to the directory mjpg-streamer/ mjpg-streamer for compilation.
cd mjpg-streamer/mjpg-streamer
step 6.8:
Run the following command for compilation
make

#9/3,Shree Lakshmi complex,2ndFloor,Opp,To Vivekananda Park,Girinagar,Bangalore-560085.www.tenettech.com

Connect a camera to raspberry pi USB port


Step 6.9:
Before starting webcam we have to see the webcam driver is detected or not . for that we have
to give command as
Cd /dev
At the end of file it show as vide03 (in my case)
Start the webcam.
sudo ./mjpg_streamer -i "./input_uvc.so
"./output_http.so -w ./www

/dev/video3

-y

320x240"

#9/3,Shree Lakshmi complex,2ndFloor,Opp,To Vivekananda Park,Girinagar,Bangalore-560085.www.tenettech.com

-o

#9/3,Shree Lakshmi complex,2ndFloor,Opp,To Vivekananda Park,Girinagar,Bangalore-560085.www.tenettech.com

or
sudo ./mjpg_streamer -i "./input_uvc.so -y -r 320x240" -o "./output_http.so -w ./www"
Now you should be able to view the stream from another computer on your network. Open a
web browser and open the following link:
http://{name or IP-address of the Raspi}:8080

open browser. Type a ip addres and port number


192.168.0.123:8080

#9/3,Shree Lakshmi complex,2ndFloor,Opp,To Vivekananda Park,Girinagar,Bangalore-560085.www.tenettech.com

Or select Stream
Install VLC media player in your PC.(not in working raspberry pi PC )
media player
A media player is a computer program for playing multimedia files. Media players display
standard media control icons known from physical devices such as tape recorders and CD
players. Examples of these icons are (play), (pause), and (stop). Main stream operating systems
have at least one built-in media player.
Open the VLC media player on your PC
Go to media

#9/3,Shree Lakshmi complex,2ndFloor,Opp,To Vivekananda Park,Girinagar,Bangalore-560085.www.tenettech.com

Select stream

open network

type your network URL

#9/3,Shree Lakshmi complex,2ndFloor,Opp,To Vivekananda Park,Girinagar,Bangalore-560085.www.tenettech.com

My network URL is = http://192.168.0.123:8080/?action=stream


select stream
stream output window will open
again select stream

Click the play button on vlc and then open media window will open then type your URL then
click play

#9/3,Shree Lakshmi complex,2ndFloor,Opp,To Vivekananda Park,Girinagar,Bangalore-560085.www.tenettech.com

Now Live streaming will start in VLC media player:

To buy this raspberry pi product click here


Training
Daily and weekly Deals
For queries:kiran@tenettech.com
Contact:080-26722726

#9/3,Shree Lakshmi complex,2ndFloor,Opp,To Vivekananda Park,Girinagar,Bangalore-560085.www.tenettech.com

You might also like