Timelapse
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
Contents
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
On the Raspberry Pi, the firmware end is taken care of by a Python library called picamera - this utilizes the kernel bindings available on Raspberry Pi machines to obtain images from the camera. See the following pages for more notes:
The short version of the above pages:
- Use Raspbian Linux, not Kali Linux, if you're using a Raspberry Pi
- Install the Raspberry Pi camera libraries
- Ensure the hardware is all connected properly and that everything is 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)
Processing and Post-Processing Photos
See the Timelapse/Processing page for a detailed set of notes on the post-processing procedure. The basic steps for post-processing images into time-lapse videos are:
- 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).
Flags