Scope:
To build a Raspberry Pi powered video camera, capable of streaming over a home wireless network.
BOM:
– Raspberry Pi (With Raspbian OS)
– RPi compatible Wifi Dongle (List here)
– Camera Module (Here)
– Wifi enabled PC with VLC media player
Instructions:
- Connect the Raspberry Pi Camera Module to the CSI connector located between the ethernet and HDMI ports.
- Enable the Raspberry Pi camera module in the Raspberry Pi Configuration Menu
$ sudo raspi-config
- Enable Camera. This now gives access to the command line tool “raspivid” and “raspistill” which controls the camera
- Reboot Raspberry Pi as required.
- Update and Upgrade packages and Raspberry Pi firmware
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo rpi-update
- Reboot as necessary
- Now, to invoke an instance of raspivid to begin the video streaming process.
$ raspivid -o - -t 0 -hf -vf -w 640 -h 360 -fps 25
- This line calls a new instance of raspivid with the following parameters:
- -o: Output file
- -t 0: run for x milliseconds (0 means continuously)
- -hf, -vf: horizontal and vertical flip
- -w: 640 pixels width
- -h: 360 pixels heigh
- -fps: frames per second.
- Because the camera and raspivid default to a h264 encoding format, we must also pipe the raspivid output to vlc and wrap tell VLC which streaming methods, encoding and port to output the stream.
'#standard{access=http,mux=ts,dst=:8090}' :demux=h264
- The full command is as follows:
$ raspivid -o - -t 0 -hf -vf -w 640 -h 360 -fps 25|cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264
- The full command is as follows:
- The camera is now piping it’s output to port 8090 of the raspberry pi and the only thing left to do now is to point the PC to the appropriate location on the home network to find the stream
- Open a new instance of VLC media player on the PC
- Under Media -> Open Network Stream
- VLC should now be displaying the output of the raspberry pi camera module (with a slight delay)
Discussion:
The Raspberry Pi computer is a credit card sized computer powered by an ARM processor and BCM2835 SOC running a Debian distribution of Linux. The Pi has GPIOs as well as dedicated CSI (Camera Serial Interface) connectors which enable peripherals to be easily connected to it.
This makes it an ideal, and budget friendly, starting point for an embedded system such as the streaming security camera presented here. The BOM for this camera is the $30.00 Raspberry Pi, $30.00 camera module and a $10.00 wifi dongle.
For more detail: [Project] Raspberry Pi Powered WiFi Streaming Camera