Skip to content

Instantly share code, notes, and snippets.

@orangejulius
Created September 24, 2013 07:32
Show Gist options
  • Save orangejulius/6681474 to your computer and use it in GitHub Desktop.
Save orangejulius/6681474 to your computer and use it in GitHub Desktop.
Create a timelapse from a directory full of images. Pass the directory name as the first parameter and a .mkv file with the name of that directory will be created. Requires ffmpeg
#!/bin/bash
pictureDir=$1
# make symlinks
pushd $pictureDir
j=0
for i in `ls *.JPG`; do
ln -s $i $j.jpg
j=$((j+1))
done
popd
# make the video, setting the input and output FPS to 15
avconv -r 15 -i $pictureDir/%d.jpg -s 2560x1920 -r 15 ${pictureDir}.mkv -threads 4
#unlink symlinks
pushd $pictureDir
for i in `ls *.jpg`; do
unlink $i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment