Fast Web video streaming for the Raspberry-Pi

I have not posted anything in a long time about my Raspberry-Pi mower/Dalek , but I have been working on it a lot. Now I have so many things to post that I am having a hard time figuring out where to start.

First of all, I am now using the RaspberryPi Mark2 in order to get better performance for all the features I want to add to my robot such as face detection and video streaming.

The original control system for the raspiMower was based on a wireless keyboard connected to the Pi. This proved to be really annoying to use over time, and so I have been working on a web interface to control it using a tablet or smart phone.

The main feature I wanted to add was a high quality live video stream, which proved to be very inadequate using mjpeg streaming. The mjpeg stream was only able to do about 2 frames per second even at the lowest resolutions. This was disappointing, so I have been looking for other solutions. I have finally found one that is acceptable, giving over 10 frames per second at 1080p using h264 and the uv4l project. It has about a half second latency, which is about half what I was getting using the mjpeg steam.

Here are the instructions for setting up UV4L on your raspberry pi along with links to the original articles.

I found the installation instructions for UV4L at (If you have trouble with the install commands below, go back to the source to see if the instructions have changed)

Here is a summary of the commands you need to install it:

To install UV4L open a terminal and type the following commands:
$ curl | sudo apt-key add -

Add the following line to the file /etc/apt/sources.list :
deb wheezy main

$ sudo apt-get update
$ sudo apt-get install uv4l uv4l-raspicam uv4l-raspicam-extras
$ sudo service uv4l_raspicam restart

Great, now we have the drivers installed and we need to install something to stream the video to a web browser. I found a post about it at stackexchange, it is called uv4l-webrtc .

Basically, all you need to do is run the commands

$ sudo apt-get install uv4l-webrtc
$ sudo service uv4l_raspicam restart

Get the IP address of your pi on the network using
$ ifconfig
and then use your phone or tablet (or another computer) to open the url http://[raspberryPi IP Address]:8080/

Unfortunately I was unable to view the stream from the pi, as all the browsers (Chrome, Epiphany, Iceweasel) failed to display the video stream.

The Webrtc package provides a web interface for configuring and streaming the video from the raspi Camera! I was very pleasantly surprised at how fast the video stream was at 1080p on my phone.

The next step is to integrate this into my own web page for controlling my robot.