Tag Archives: camera

Rocket launch footage from an onboard Pi

via Raspberry Pi

From rocket launchers to high altitude ballooning to Sonic Pi space music to Astro Pi, much of the Raspberry Pi community is excited by the idea of exploring beyond our Blue Marble. We think you’ll enjoy this video from a Pi camera belonging to Portland State Aerospace Society, who launched a rocket from the Oregon desert last month. When I first watched it, it brought the whole of the Raspberry Pi Foundation to my desk in seconds, something even Krispy Kreme doesn’t reliably accomplish.

The video was captured by one of two Raspberry Pis aboard the rocket, both with cameras set up to stream live footage; the streaming seems to have been succcessful, even though the viewing angle for part of the video above wasn’t quite as planned.

You’ll find plenty of technical information in PSAS’ GitHub repository for this launch, and enthusiasts will be interested to know that they’ve promised more telemetry data over the next several months. There’s also an excellent gallery of launch photos taken from the ground, including the moment of lift-off from a more conventional viewpoint.

The post Rocket launch footage from an onboard Pi appeared first on Raspberry Pi.

Naturebytes wildlife cam kit

via Raspberry Pi

Liz: The wildlife cam kit has landed. If you’re a regular reader you’ll know we’ve been following the Naturebytes team’s work with great interest; we think there’s massive potential for bringing nature to life for kids and for adults with a bit of smart computing. Digital making for nature is here.

Naturebytes is a tiny organisation, but it’s made up of people whose work you’ll recognise if you follow Raspberry Pi projects closely; they’ve worked with bodies like the Horniman Museum, who have corals to examine; and with the Zoological Society of London (ZSL). Pis watching for rhino poachers in Kenya? Pis monitoring penguins in Antarctica? People on the Naturebytes team have worked on those projects, and have a huge amount of experience in wildlife observation with the Pi. They’ve also worked closely with educators and with kids on this Kickstarter offering, making sure that what they’re doing fits perfectly with what nature-lovers want. 

Today’s guest post is from Naturebytes’ Alasdair Davies. Good luck with the Kickstarter, folks: we’re incredibly excited about the potential of what you’re doing, and we think lots of other people will be too.

We made it! (quite literally). Two years after first being supported by the Raspberry Pi Foundation’s Education Fund and the awesome folk over at Nesta, we finally pressed the big red button and went into orbit by launching the Naturebytes Wildlife Cam Kit – now available via Kickstarter.
This is the kit that will fuel our digital making for nature vision – a community of Raspberry Pi enthusiasts using the Pi to help monitor, count, and conserve wildlife; and have a hell of a lot of fun learning how to code and hack their cam kits to do so much more – yes, you can even set it up to take chicken selfies.

We’ve designed it for a wide range of audiences, whether you’re a beginner, an educator, or a grandma who just wants to capture photos of the bird species in the garden and share them with her grandchildren – there’s something for everyone.


This was the final push for the small team of three over at Naturebytes HQ. A few badgers, 2,323 coffees, 24 foxes,  and a Real Time Clock later, we signed off the prototype cam kit last week, and are proud of what we’ve achieved thanks to the support of the Raspberry Pi Foundation that assisted us in getting there.

We also get the very privileged opportunity of appearing in this follow-up guest blog, and my, how things have changed since our first appearance back in September 2014. We thought we’d take you on a quick tour to show you what we’ve changed on the kit since then, and to share the lessons learnt during our R&D, before ending with a look at some of the creative activities people have suggested the kit be used for. Suggest your own in the comments, and please do share our Kickstarter far and wide so we can get the kits into the hands of as many people as possible.

Then and now – the case.

Our earlier prototype was slick and thin, with a perspex back. Once we exposed it to the savages of British weather, we soon had to lock down the hatches and toughen up the hinges to create the version you see today. The bird feeder arm was also reinforced and a clip on mechanism added for easy removal – just one of the lessons learnt when trialing and testing.

The final cam kit case:


The final cam kit features:


Schools and Resources

A great deal of our development time has focused on the creation of a useful website back end and resource packs for teacher and educators. For Naturebytes to be a success we knew from the start that we’d need to support teachers wishing to deliver activities, and it’s paramount to us that we get this right. In doing so, we tagged along with the Foundation’s Picademy to understand the needs of teachers and to create resources that will be both helpful and accessible.

Print your own

We’ve always wanted to make it as easy as possible for experienced digital makers to join in, so the necessary 3D print files will now be released as open source assets. For those with their own Pi, Pi cam and custom components, we’ve created a developer’s kit too that contains everything you need to finish a printed version of the cam kit (note – it won’t be waterproof if you 3D print it yourself).

You can get the Developer’s Kit on Kickstarter.

The Experience


Help us develop a fantastic experience for Naturebytes users. We hope to make a GUI and customised Raspbian OS to help users get the most from the cam kit.

It’s not much fun if you can’t share your wildlife sightings with others, so we’re looking at how to build an experience on the Pi itself. It will most likely be in the form of a Python GUI that boots at startup with a modified Raspbian OS to theme up the desktop. Our end goal is the creation of what we are calling “Fantastic Fox” – a simple-to-use Raspbian OS with pre-loaded software and activities together with a simple interface to submit your photos etc. This will be a community-driven build, so if you want to help with its, development please contact us and we’ll get you on board.

Creative activities

This is where the community aspect of Naturebytes comes into play. As everyone’s starting with the same wildlife cam kit, whether you get the full complete kit from us or print your own, there are a number of activities to get you started. Here are just a few of the ones we love:

Participate in an official challenge

We’ll be hosting challenges for the whole community. Join us on a hedgehog hunt (photo hunt!) together with hundreds of others, and upload your sightings for the entire community to see. There will be hacking challenges to see who can keep their cams powered the longest, and even case modification design competitions too.

Identify another school’s species (from around the globe!)

Hook up a WiFi connection and you’ll be able to share your photos on the internet. This means that a school in Washington DC could pair up with a school in Rochdale and swap their photos once a day. An exciting opportunity to connect to other schools globally, and discover wildlife that you thought you may never encounter by peeking into the garden of school a long way away.

Build a better home (for wildlife)

It’s not just digital making that you can get your hands into. Why not build a garden residence for the species that you most want to attract, and use the camera to monitor if they moved in (or just visited to inspect)? A great family project, fuelled by the excitement of discovering that someone, or something, liked what you build for them.

Stamp the weather on it

There’s an official Raspberry Pi weather station that we love – in fact, we were one of the early beta testers and have always wanted to incorporate it into Naturebytes. A great activity would be connecting to the weather station to receive a snapshot of data and stamping that on to the JPEG of the photo your camera just created. Then you’ll have an accurate weather reading together with your photo!

Time-lapse a pond, tree or wild space

It’s fantastic to look through a year’s worth of photographic data within 60 seconds. Why not take a look at the species visiting your pond, tree or a wild space near you by setting up a time-lapse and comparing it with other Naturebytes users near you?

We’d love to hear your ideas for collaborative projects – please leave a note in the comments if you’ve got something to add!


The post Naturebytes wildlife cam kit appeared first on Raspberry Pi.

Streaming Your Webcam w/ Raspberry Pi

via Wolf Paulus » Embedded

[Last updated on Feb. 2. 2013 for (2012-12-16-wheezy-raspbian) Kernel Version 3.2.27+]

Three years ago, we bought two small Webcams and since we wanted to use them on Linux and OS X, we went with the UVC and Mac compatible Creative LIVE! CAM Video IM Ultra. This Webcam (Model VF0415) has a high-resolution sensor that lets you take 5.0-megapixel pictures and record videos at up to 1.3-megapixel; supported resolutions include 640×480, 1290×720, and 1280×960. If you like, you can go back and read what I was thinking about the IM Ultra, back in 2009. Today, it’s not much used anymore, but may just be the right accessory for a Raspberry Pi.

With the USB Camera attached to the Raspi, lsusb returns something like this:


Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 005: ID 041e:4071 Creative Technology, Ltd

Using the current Raspbian “wheezy” distribution (Kernel 3.2.27+), one can find the following related packages, ready for deployment:

  • luvcview, a camera viewer for UVC based webcams, which includes an mjpeg decoder and is able to save the video stream as an AVI file.
  • uvccapture, which can capture an image (JPEG) from a USB webcam at a specified interval

While these might be great tools, mpeg-streamer looks like a more complete, one-stop-shop kind-of solution.

Get the mpeg-streamer source code

Either install Subversion (svn) on the Raspberry Pi or use svn installed on your Mac or PC, to get the source-code before using Secure Copy (scp) to copy it over to your Raspi.

Here, I’m using svn, which is already installed on the Mac, before copying the files over to my Raspi, (username pi, hostname is phobos)

cd ~
mkdir tmp
cd tmp
svn co https://mjpg-streamer.svn.sourceforge.net/svnroot/mjpg-streamer mjpg-streamer
scp -r ./mjpg-streamer pi@phobos:mjpg-streamer

Please note: Looks like the repo got recently moved, Try this to check-out the code if the previous step does not work:

svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer/ mjpg-streamer

Over on the Raspi, I tried to make the project, but quickly ran into error messages, hinting at a missing library.

ssh pi@phobos
cd mjpg-streamer/mjpg-streamer
jpeg_utils.c:27:21: fatal error: jpeglib.h: No such file or directory, compilation terminated.
make[1]: *** [jpeg_utils.lo] Error 1

After finding out, which libraries were available (apt-cache search libjpeg), I installed libjpeg8-dev like so: sudo apt-get install libjpeg8-dev. This time, I got a lot further, before hitting the next build error:

make[1]: *** [pictures/640x480_1.jpg] Error 127
make[1]: Leaving directory `/home/pi/mjpg-streamer/mjpg-streamer/plugins/input_testpicture'

After some google-ing, which resulted in installing ImageMagick like so: sudo apt-get install imagemagick, the next build attempt looked much more promissing:


and ls -lt shows the newly built files on top:

-rwxr-xr-x 1 pi pi 13909 Sep 8 07:51 input_file.so
-rwxr-xr-x 1 pi pi 168454 Sep 8 07:51 input_testpicture.so
-rwxr-xr-x 1 pi pi 31840 Sep 8 07:50 output_http.so
-rwxr-xr-x 1 pi pi 14196 Sep 8 07:50 output_udp.so
-rwxr-xr-x 1 pi pi 19747 Sep 8 07:50 output_file.so
-rwxr-xr-x 1 pi pi 29729 Sep 8 07:50 input_uvc.so
-rwxr-xr-x 1 pi pi 15287 Sep 8 07:50 mjpg_streamer
-rw-r--r-- 1 pi pi 1764 Sep 8 07:50 utils.o
-rw-r--r-- 1 pi pi 9904 Sep 8 07:50 mjpg_streamer.o


MJPG-streamer is a command line tool to stream JPEG files over an IP-based network. MJPG-streamer relies on input- and output-plugins, e.g. an input-plugin to copy JPEG images to a globally accessible memory location, while an output-plugin, like output_http.so, processes the images, e.g. serve a single JPEG file (provided by the input plugin), or streams them according to existing mpeg standards.

Therefore, the important files that were built in the previous step are:

  • mjpg_streamer – command line tool that copies JPGs from a single input plugin to one or more output plugins.
  • input_uvc.so – captures such JPG frames from a connected webcam. (Stream up to 960×720 pixel large images from your webcam at a high frame rate (>= 15 fps) with little CPU load.
  • output_http.so – HTTP 1.0 webserver, serves a single JPEG file of the input plugin, or streams them according to M-JPEG standard.

Starting the Webcam Server

A simple launch command would look like this:
./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"

MJPG Streamer Version: svn rev:
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
i: Frames Per Second.: 5
i: Format…………: MJPEG
o: HTTP TCP port…..: 8080
o: username:password.: disabled
o: commands……….: enabled

Open a Webbrowser on another computer on the LAN and open this url: http://{name or IP-address of the Raspi}:8080

However, experimenting with the resolution and frame rate parameters is well worth it and can improved the outcome.

UVC Webcam Grabber Parameters

The following parameters can be passed to this plugin:

-d video device to open (your camera)
-r the resolution of the video device,
can be one of the following strings:
or a custom value like: 640×480
-f frames per second
-y enable YUYV format and disable MJPEG mode
-q JPEG compression quality in percent
(activates YUYV format, disables MJPEG)
-m drop frames smaller then this limit, useful
if the webcam produces small-sized garbage frames
may happen under low light conditions
-n do not initalize dynctrls of Linux-UVC driver
-l switch the LED “on”, “off”, let it “blink” or leave
it up to the driver using the value “auto”

HTTP Output Parameters

The following parameters can be passed to this plugin:

-w folder that contains webpages in flat hierarchy (no subfolders)
-p TCP port for this HTTP server
-c ask for “username:password” on connect
-n disable execution of commands

I have seen some good results with this
./mjpg_streamer -i "./input_uvc.so -n -f 15 -r 640x480" -o "./output_http.so -n -w ./www"
but even a much higher resolution didn’t impact the actually observed frame-rate all that much:
./mjpg_streamer -i "./input_uvc.so -n -f 15 -r 1280x960" -o "./output_http.so -n -w ./www"

MJPG Streamer Version: svn rev:
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 1280 x 960
i: Frames Per Second.: 15
i: Format…………: MJPEG
o: www-folder-path…: ./www/
o: HTTP TCP port…..: 8080
o: username:password.: disabled
o: commands……….: disabled

Webcam Stream Clients

The included Website (http://{name or IP-address of the Raspi}:8080) shows examples for how to connect a client to the Webcam stream. The easiest way is obviously a simple HTML page that works great with Google Chrome and Firefox but not so much with Safari. Anyways, it’s important to specify the width and height that was configured with the output_http.so, in the HTML as well

  <img alt="" src="http://phobos:8080/?action=stream" width="1280" height="960" />

Raspberry Pi Webcam Streamer

Taking the Raspberry Pi Web Stream Server Outside

This is the Raspberry Pi powered by a 5VDC, 700mA battery, with an (Edimax EW-7811Un) USB-WiFi Adapter and the Creative LIVE! CAM Video IM Ultra connected.

Video Lan Client for Viewing and Recording

Using Video Lan Client, you can view and also record the video stream, served by the Raspi.

Recorded Webcam Streamer

Movie, streamed from a Raspberry Pi

Raspberry Pi Webcam from Tech Casita Productions on Vimeo.

Let me know what Webcam software you found that works well on the Raspberry Pi.