Skip to content
Collects time-lapse GIF and MP4 videos using Raspberry Pi and the Pi Camera. I use it to capture the sky/weather
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Time-lapse Video Project for Raspberry Pi

This project was created in order to collect time-lapse videos of the sky outside my house on a continuous basis (24/7). It could be used to collect time-lapse video of anything but this is the purpose for which it was built.

Required Hardware

  • Raspberry Pi with WiFi or Ethernet (I used a Pi B2 with a TP-Link WiFi adapter)
  • Raspberry Pi camera (I used a V1 camera but V2 should work as well)
  • Micro SD card (I started with an 8GB card but it wasn't large enough. 16GB would have worked but I had a 32GB handy and used that)

You should have a web server configured as well as having enabled the camera. I find it easiest to work with the Pi over SSH rather than using a display+keyboard+mouse. If you feel the same you will also need to enable SSH access. The Pi webserver is assumed to store it's files in /var/www/html. The "wx" directory needs to be created manually within that directory.

For camera installation instruction refer to this web site.

Software Components

  • crontab entries to launch the necessary scripts on a schedule
  • Three shell scripts
    • - captures a series of GIF images then combines them into an animated GIF and calls to create a separate MP4 time-lapse
    • - runs once an hour and combines the previous hour's MP4 time-lapse into a single file
    • - runs once a day and deletes the video files created 2 days prior
  • One Python script
    • - records time-lapse in MP4, called from
      • Note: If raspivid is used directly the first frames are highly over-exposed while auto-exposure makes adjustments. records and throws away a few seconds of video to avoid this issue before recording the time-lapse.


  • In /home/pi create a directory named wx_video
  • Make sure /var/www/html/wx exists and the current user has read and write permission
  • Place the three shell scripts and the script in that directory
  • Run crontab -e and place the final three lines from crontab.txt into the crontab

Once everything is installed and running visit your Pi's webserver IP and append one of these strings to access the files:

  • wx/current.gif will display the most recent GIF (recorded every 10 minutes if you use my crontab entries)
  • wx/current.mp4 displays roughly 2 minutes of real time into a 10 second MP4 time lapse (also updated every 10 minutes)
  • wx/current_hour.mp4 displays a compilation of the previous hour's MP4 files (five 10 minute time lapses)

If your Pi has IP address and your web server is using the default port then visiting with your browser should load the most recent GIF.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.