Skip to content

Instantly share code, notes, and snippets.

@kiliankoe
Created May 22, 2014 19:44
Show Gist options
  • Save kiliankoe/60dc9133ff3882ae5d94 to your computer and use it in GitHub Desktop.
Save kiliankoe/60dc9133ff3882ae5d94 to your computer and use it in GitHub Desktop.
Create a timelapse video from a directory of webcam images
#! /bin/sh
echo "FPS: "
read input_fps
echo "Copying files into tmp dir"
mkdir tmp/
find ./ -name "*.jpg" -exec cp -i {} ./tmp/ > /dev/null \;
echo "Joining files into video$input_fps.mp4"
cd tmp/
cat *.jpg | ffmpeg -loglevel quiet -f image2pipe -r $input_fps -vcodec mjpeg -i - video$input_fps.mp4
cp video$input_fps.mp4 ../
echo "removing tmp dir"
cd ..
rm -rf tmp/
echo "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment