Created
April 30, 2014 12:34
-
-
Save gre/3f4c32d33c4695cc4de6 to your computer and use it in GitHub Desktop.
script to create movie from images. Design to go with the timelapse script: https://gist.github.com/gre/11219793
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# script to create movie from images. Design to go with the timelapse script: https://gist.github.com/gre/11219793 | |
# | |
# Usage: ./generatevideo.sh dirWhereImagesAre/ | |
# Usage: ./generatevideo.sh # default is './timelapse' directory | |
# | |
# will generates movie.mp4 | |
dir=${1-"timelapse"} | |
echo "Creating symlinks..."; | |
cd $dir; | |
count=0 | |
find . -name '*.jpg' | while read f; do | |
printf -v counts "%06d" $count | |
ln -s $f frame_$counts.jpg | |
count=`expr $count + 1` | |
done; | |
cd -; | |
echo "Generating video..."; | |
ffmpeg -r 30 -i $dir/frame_%06d.jpg movie.mp4 | |
echo "Removing symlinks..."; | |
cd $dir | |
find . -name 'frame_*.jpg' | while read f; do rm $f; done | |
cd - | |
# Gaëtan Renaudeau - DWTFYW License http://www.wtfpl.net/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
also can do annotation with the date: