Last active
August 5, 2021 04:20
-
-
Save shantigilbert/4391d25af284b65c04be5c0dd36648da to your computer and use it in GitHub Desktop.
Small script to create timelapses with the Raspberry Pi (Zero W) using Raspistill
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Edit interval (in seconds), number of photos and arguments from raspistill --help | |
INTERVAL=5 | |
NUMPHOTOS=10000 | |
#ARGS="-n -vf -hf -w 1920 -h 1080" | |
ARGS="-n -vf -hf -w 2592 -h 1458" | |
DATE=$(date +"%Y-%m-%d_%H%M_%s") | |
SAVEPATH="/home/pi/camera/timelapse_${DATE}" | |
mkdir -p "${SAVEPATH}" | |
i=0 | |
while [ ${i} -le ${NUMPHOTOS} ]; do | |
DATE=$(date +"%Y-%m-%d_%H%M_%s") | |
sec=$(printf "%02d" ${i}) | |
raspistill ${ARGS} -o "${SAVEPATH}/${sec}_${DATE}.jpg" | |
((i++)) | |
sleep ${INTERVAL} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment