Thanks to comment from @mpromonet for the update on the Linux-Projects V4L2 driver that now implements MMAL very efficiently - but it is still a work in progress.
Follow these instructions to install the linux-project repository and install the UV4L driver with extras. Then install the server and mjpeg. If you want, you can experiment with the others too.
After you install everything, you can access the HTTP server on port 8080. You should also check the /etc/uv4l/conf
file and set if you want mjpeg or h264H.264 as it makes a difference, but you can adjust a few settings via the built in-in web server.
This is what we were all waiting for (Called WebRTCcalled WebRTC) and thanks to the new driver it works great (Onon a Raspberry Pi 2).
First, follow these steps:, http://www.linux-projects.org/modules/sections/index.php?op=viewarticle&artid=14:
curl http://www.linux-projects.org/listing/uv4l_repo/lrkey.asc | sudo apt-key add -
# Add the following line to the file /etc/apt/sources.list
# deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/ wheezy main
sudo apt-get update
sudo apt-get install uv4l uv4l-raspicam
sudo apt-get install uv4l-raspicam-extras
Then on your Raspberry Pi 2 install this the WebRTC (Forfor a Raspberry Pi 1, read the linked site for other options)
You knownow have low latency-latency, high quality-quality video streaming direct into a modern browser like Chrome or Firefox. (Maybe Safari, but I cantcan't check because they dontdon't do Winblows any more and IEInternet Explorer... eh)
By default, it uses mjpeg
at 1080p, and itsit's very sluggish. I tweaked it to 800x600 framesize and using something like iSpy to process video for. For security, I get about 10fps10 fps on a crisp video. Way muchIt is way better than the 3fps3 fps at 640x480 before this driver. WorksIt works on iPhone with safariSafari, Android Chrome and almost everything else.
This also means that motion
should (I still need to test and comaptecompare) work allota lot better now. Make sure to set the configconfiguration to use v4l2_palette 8
or v4l2_palette 2
h264H.264
This has now been fixed for "streaming", and we don't have to go to great lengths to watch h264H.264 video through VLCVLC media player. The stream is sill RAW h264H.264, so you need to demux it or transcode/ encapsualte if you need it to work somewhere else. YouYou should tweak the bitrate=xxxxxx
in the configconfiguration file if you are streaming over WiFiWi-Fi.
In VLC media player, you must tell it that you want to use the h264H.264 demuxer. So if youyou're using the GUI, then make sure to add the argument :demux=264
. From command line, vlc http.../video.h264 --demux h264
otherwise. Otherwise, you will just see a blank screen even though the camera LED is turned on.
Viola! HD streaming with roughly 500ms500 ms lag (with tweaking, down to 200ms200 ms). DefinitelyIt is definitely much easier than using the old methods. Quality and FPS is superb, but you cantcan't embed this in HTML5 with outwithout transcodding to mp4MP4 or webmWebM. I hope this will be implemented as it will truly make this a great standalone server.
There is no video4linux
driver availbeavailabe yet. This means that we cantcan't use ffserverffserver to stream data using /dev/video0
or simlar like a USB webcam.