Skip to content

Instantly share code, notes, and snippets.

@langalex
Created June 8, 2013 15:51
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 langalex/5735585 to your computer and use it in GitHub Desktop.
Save langalex/5735585 to your computer and use it in GitHub Desktop.
Turns a series of JPEG files into a video.
#!/bin/bash
# usage: cd <directory full of JPGs> && make_timelapse
mkdir ./captures
COUNTER=0;
for i in `find . -name '*.JPG'` ;
do
#Write the filename to be friendly with ffmpeg's odd filename input
FILENAME=`printf '%04d.jpg' $COUNTER`
cp $i ./captures/$FILENAME
let COUNTER=COUNTER+1;
done
nice ffmpeg -r 20 -vcodec copy -i ./captures/%4d.jpg timelapse.mov
rm -rf ./captures
@novemberkilo
Copy link

I wasn't able to get this to work -- it didn't find the 'copy' codec. What am I doing wrong?

I did nice ffmpeg -f image2 -i ./captures/%4d.jpg -r 5 timelapse.mov instead

@langalex
Copy link
Author

To be honest I have no idea where that codec is coming from. I think I installed ffmpeg via homebrew on osx and that was it. If image2 works for you great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment