Getting started with Raspbery Pi Camera module

Reviewed by Editor: Jack Allison

Raspberry Pi Camera modules:


– Installation command:

sudo apt-get install -y python-picamera

– Optional command (for development in python version #3 and up):

sudo apt-get install python3-picamera python-rpi.gpio


You will be able to start using the camera (directly from terminal command line or by some minimal Python scripting) with the help of the links provided below.

Find my usage in the descriptions of my experiments in this blog.

Streaming video to Web

  • Upgrade your RPi

sudo apt-get update
sudo apt-get dist-upgrade
sudo rpi-update

  • Install VLC player

sudo apt-get install vlc

  • To start streaming, type the following at shell command-line:

raspivid -o – -t 0 -n -w 640 -h 480 -f 20 |cvlc -vvv stream:///dev/stdin –sout ‘#standard{access=http,mux=ts,dst=:8080}’ :demux=h264

  • Now you should be able to receive your stream by VLC’s ‘Open Network Stream’ menu-command by using the following URL: http://<RPi_IP&gt;:8080/
  • To be able to receive this stream through WEB login into your router and edit Network Address Translation (NAT) parameters. You will need to define a Virtual Server so that remote users accessing services such as the Web or FTP at your local site via Public IP Addresses can be automatically redirected to local servers configured with Private IP Addresses. In other words, depending on the requested service (TCP/UDP) port number, the Broadband router redirects the external service request to the appropriate internal server (located at one of your LAN’s Private IP Address).
  • What remained is to detect which IP address is assigned to your home router at WAN. This may be done by the following command:

ping -r 4

You will notice that first address appearing in this ping trace that doesn’t rel;ate to your LAN is fixed while the rest change between pings.

  • You can use this fixed Web IP address to access your RPi stream with VLC UI or command line:

“C:\Program Files (x86)\VideoLAN\VLC\vlc.exe” “http://<RPi_Web_IP&gt;:8080/”

!!! DON’T FORGET: before you publish that RPi_Web_IP, change your router’s password to some value known only to you to prevent intervention of strangers.

Recommended References:

5 thoughts on “Getting started with Raspbery Pi Camera module

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s