Creating time lapse videos using the Raspberry Pi and camera is incredibly easy, and you can create some really cool looking videos at the end of it. To make a time lapse video, you will need a Pi and a camera module.
- Set up your Raspberry Pi in the desired place.
- Test the positioning of the camera by taking a still photo (find out how to do this here)
- When you are happy, enter this code in the command line (LXTerminal): raspistill -o ****_%04d.jpg -tl 60000 -t 7200000
- This command will take a photo every 60 seconds (60000 milliseconds) for 2 hours (7200000 milliseconds) You can change this to whatever you like. The stars can be replaced by the image name of your choice.
- The bit of code that looks like this: %04d.jpg is telling the pi to name each photo with an increasing 4 digit number. Again, the .jpg means that the photos will be saved in .jpg format.
- Press enter, and leave the pi to do its business for the amount of time you specified.
- When the Pi has finished, you will find loads of pictures in your home directory.
Note: Make sure that you don't move the Pi at all during the stills being captured, this will result in a poor quality end product.
To create your video on your Pi:
- Type the following into the command line: sudo apt-get -y install libav-tools
- Press enter
- Then, type this and press enter. avconv -r 10 -1 *****_%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 ------.mp4
- Replace the stars with the name that your images were called, and the dashes with the name you wish your video to be called.
- When this has finished, you can view your video in omxplayer, as demonstrated here.