Skip to content

Instantly share code, notes, and snippets.

@shinmiy
Created February 26, 2020 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinmiy/00912cdfbfac402bb119841fefbe94e5 to your computer and use it in GitHub Desktop.
Save shinmiy/00912cdfbfac402bb119841fefbe94e5 to your computer and use it in GitHub Desktop.
#!/bin/bash
while :;do
filename=`date +"%Y-%m-%d_%H-%M-%S"`
screencapture -Cx screenshot_${filename}.jpg
convert screenshot_${filename}.jpg -resize 50% screenshot_${filename}_small.jpg
# imagesnap -w 2 face_${filename}.jpg
# convert face_${filename}.jpg -resize 25% face_${filename}_small.jpg
# convert screenshot_${filename}_small.jpg face_${filename}_small.jpg -gravity southeast -background none \
# \( -clone 1 -chop 319x0 \) \( -clone 0,2 +append \) \
# -delete 0,2 +swap -composite capture_${filename}.jpg
# rm screenshot_${filename}.jpg
# rm screenshot_${filename}_small.jpg
# rm face_${filename}.jpg
# rm face_${filename}_small.jpg
sleep 5
done
#!/bin/bash
a=1
for i in *.jpg; do
new=$(printf "screenshot_%05d.jpg" "$a")
mv -- "$i" "$new"
let a=a+1
done
ffmpeg -r 15 -i screenshot_%5d.jpg timelapse_`date +"%Y-%m-%d"`.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment