The timelapse script creates a timelapse video from a series of still images. It overlays the timestamp on to each frame/snapshot, so that a ticking timer appears in the video. The timestamp is generated based on the image file name by default. The script also includes an option to first rename the image file to reflect the timestamp in the metadata (creation date), although not all image capture devices record this metadata and so the images they create may not support this option.
You need to capture the still images separately. This script does not deal with the image capture, but the post-processing. The images should lend themselves to be compiled into a video, e.g., the dimensions should be constant and the camera angle should not change.
On a Linux computer:
- Place all source images in a single folder. The folder should only contain the source images and nothing else.
- Download the
timelapsescript and save it to an executable path, e.g.,/usr/local/binor~/.local/bin. This allows you to execute the script anywhere across the file system. cdto the folder where you have saved thetimelapsescript, and make the script executable:chmod +x timelapse.- In a terminal,
cdto the source image folder and execute the script:timelapse. This command supports the PNG image format by default. If your images are in a different format, you will need to configuretimelapseto use them.
By default, the script will:
- Create a
./timelapsefolder within the source image folder - Timestamp the source images and save them to
./timelapse/<yyyymmddHHMMSS>.png - Compile the video and save it as
./timelapse/timelapse.mp4.
The behaviour of timelapse can be configured by passing certain arguments to the timelapse command. For details, execute timelapse -h.
By default, the script expects the image file name to reflect the timestamp in the format: <yyyymmddHHMMSS>.png. Variants including delimiters (e.g., yyyy-mm-dd-HH-MM-SS.png) are acceptable. The script will strip the file name of any non-numerical characters to generate the timestamp. The file name must correspond to a valid timestamp in the format yyyymmddHHMMSS when stripped of such characters. The file extension can vary depending on the file format. The script supports most common image file formats (e.g., with extensions .jpg, .tif, .bmp, .webp) as long as imagemagick can convert them into the PNG format. However, all the images in the series must be of the same format.
The position of the timestamp and its appearance can also be configured.
The following tools can be used to rename the image files to the required format (e.g., <yyyymmddHHMMSS>.png) in bulk before running timelapse:
The timelapse script is written for the bash shell, which is shipped with many Linux distributions. You may be able to get it working on other operating systems if you can get the dependencies working, e.g., using the Windows Subsystem for Linux.