From charlesreid1

This page covers notes on time-lapse photography. There are twi main aspects to time-lapse photography: the hardware, and the software.

  • Hardware - cameras, wiring, instrumentation, weatherproofing, devices, gadgetry, motors, etc.
  • Software - capturing images, firmware, storage, networking, wireless communication, control systems

Hardware

Kinds of cameras you can use (for example):

  • Raspberry pi camera
  • Big fancy cameras

Software

The software used with timelapse photography may have several goals:

  • Use drivers to communicate with the camera hardware using whatever processor type (e.g., Raspberry Pi, Arduino, computer) to be able to capture images
  • Use drivers to control motors to adjust angles
  • Capture an image from the camera (resulting in a JPG file)
  • Run a sequential timing loop to obtain a sequence of images (e.g., a Python script)
  • Process the images, modify colors or apply filters, and turn them into a movie

Generally these can be broken down into:

  • Firmware (software to talk to hardware at a low level, for camera or camera-related hardware)
  • Photography (software to actually obtain photographs)
  • Post-Processing (software to modify the obtained photographs and stitch them together)

Firmware

Most of this covered on the RaspberryPi/Timelapse and RaspberryPi/Timelapse2 pages, where notes on the software being used to obtain photographs is mentioned. Basically this boiled down to:

  • Using Raspbian Linux, not Kali Linux, for the Pi
  • Installing the Raspberry Pi camera libraries
  • Ensuring the hardware was all connected properly and that everything was seated snugly (particularly the yellow tab on the front of the camera)

Photography

To do a basic timelapse and capture photographs every few seconds, you can start with this stock script:

lapse.py

import picamera
from datetime import datetime
import time
import os

camera = picamera.PiCamera()

lapse_dir = datetime.strftime(datetime.now(),"timelapse_%Y%m%d-%H%M%S")
os.system('mkdir '+lapse_dir)

while True:

    prefix = datetime.strftime(datetime.now(),"%Y%m%d-%H%M%S")
    filename = lapse_dir+"/"+prefix+".jpg"

    camera.capture(filename)
    print "Saving photo to %s"%(filename)

    time.sleep(2)

Post-Processing

ffmpeg: One of the most useful tools for post-processing video is ffmpeg. There are some notes on ffmpeg on the wiki already: Ffmpeg. Most of the material here will be a variation on that.

xargs: Another useful tool for post-processing video is xargs. Notes on xargs on the wiki already: Xargs. This is a unix command-line utility that forks a single process or single command to multiple inputs. This is extremely useful to streamlining image processing, which can be done in parallel. (It is also useful for mass-renaming files.)

The procedure for post-processing videos looks like this:

  • Obtain and wrangle a large number of sequentially numbered jpeg files (xargs)
  • Figure out what effects to apply - single jpeg file (lightroom)
  • Apply desired effects en-masse - all jpeg files (lightroom)
  • Turn mass of jpeg files into video (ffmpeg)

There are also some interesting side topics, such as image averaging using the Python_Imaging_Library. This allows for smoother, more stretched-out timelapse videos.

See the Timelapse/Processing page for more.

Flags