Categories
Technology

Raspberry Pi Camera Timelapse

So I bought a Raspberry Pi camera module couple of weeks back and created some time-lapses of my garden in the back. The video above shows you one of the time-lapses I captured via the Raspberry Pi camera. I thought this was going to be fairly difficult but it turned out to be simple. So in this post I will tell you how to create your own time-lapse using your Raspberry Pi (this post will most likely be useful for other beginners like me).

So before we get started make sure you have plugged in the camera module into your Raspberry Pi and opened your command line. The command line will be used to control the camera on how long to create a time-lapse for. The first thing you want to do is create a directory to store all the pictures (you do not have to do this but I recommend it so it is easier to manage all your files). So I created a directory called timelapse.

mkdir timelapse

Next you will want to go to the directory you created.

cd timelapse

I recommend that you test the footage you are seeing via your webcam module before you set your time-lapse parameter. First set up your camera module where ever you want to capture the footage and then type the following command. If the view is not to your liking, then move the camera and test the footage again until you are satisfied.

raspivid -d

Now you can set your time-lapse parameter. I decided that I wanted to take a image every 15 seconds for 2 hours. You first tell the Raspberry Pi to capture still photographs. Then you tell it to output the file as ‘image_%04d.jpg’. The 0%4d is a frame counter which starts at 0000 and will increment itself after every image taken. Next you tell it to take an image every 15000 milliseconds (15 seconds) for 7200000 milliseconds (2 hours).

raspistill -o image_%04.jpg -til 15000 -t 7200000

And that is it. Once you press enter on the last command, the Raspberry Pi will start to capture the images. Now to stitch all the images together to create a time-lapse, I just FTP to my Raspberry Pi and moved all the files to my main computer. This is because it would have took a long time to create a time-lapse on the Raspberry Pi where on my main computer it will only take a couple of minutes. I hope this helps everybody who wants to create their own time-lapses.

Leave a Reply

Your email address will not be published. Required fields are marked *