Skip to content

Instantly share code, notes, and snippets.

@vjo
Last active February 20, 2016 14:06
Show Gist options
  • Save vjo/6346302 to your computer and use it in GitHub Desktop.
Save vjo/6346302 to your computer and use it in GitHub Desktop.
Sort my gopro timelapse photos and convert it in a movie with ffmpeg
# Create a directory where to move your renamed photos
mkdir img
# Rename your first G0....JPG photos in img/img000001.JPG and so on
x=1;for i in G0*JPG; do counter=$(printf %06d $x); ln "$i" img/img"$counter".jpg; x=$(($x+1)); done
# Rotate photos if needed
cd img
for file in *.jpg; do convert $file -rotate 180 rotated-$file; done
# Convert it in a 60 fps movie
ffmpeg -framerate 60 -r 60 -i "img/img%06d.jpg" -framerate 60 -r 60 -s hd1080 -c:v libx264 -b:v 12000k -f mp4 timelapse_1080_60fps.mp4
# Make a 24 fps movie
ffmpeg -framerate 24 -r 24 -i "img/img%06d.jpg" -framerate 24 -r 24 -s hd1080 -c:v libx264 -b:v 12000k -f mp4 timelapse_1080_24fps.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment