Skip to content

Instantly share code, notes, and snippets.

@creaktive
Last active August 29, 2017 16:30
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 creaktive/fca3b04c4916ef8c24c02b79f8ecb9c1 to your computer and use it in GitHub Desktop.
Save creaktive/fca3b04c4916ef8c24c02b79f8ecb9c1 to your computer and use it in GitHub Desktop.
GoPro HERO4 Session CLI timelapse
# unwarp, rescale & rename GoPro pics using 4 CPUs
find /Volumes/NO\ NAME/DCIM/ -type f -regex '.*/G[0-9]+.JPG' |
sort |
perl -MPOSIX=strftime -lne 'printf qq(convert "%s" -filter Lanczos -distort barrel "0.06335 -0.18432 -0.13009" -resize 1440x1080 -font Courier -pointsize 32 -draw "gravity southeast fill white text 0,0 \\\"%s\\\"" -quality 100 tl%05d.jpg\0), $_, strftime("%Y-%m-%d %H:%M", localtime [stat($_)]->[9]), ++$i' |
xargs -0 -n1 -P4 sh -c
# build timelapse at 60 fps
ffmpeg -f image2 -framerate 60 -i tl%05d.jpg -s 1440x1080 -pix_fmt yuv420p timelapse.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment