Last active
January 11, 2018 23:37
-
-
Save lancewalton/6b7d60ca15448214e0bb to your computer and use it in GitHub Desktop.
Produces a video of the evolution of a git repository using gource (see https://code.google.com/p/gource/). Also downloads committers' gravatars to use on the video.
This file contains 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/zsh | |
# For Macs, get gource with HomeBrew: | |
# brew install gource | |
# brew install ffmpeg | |
if (( !($# == 3) )) | |
then | |
echo "Usage:" | |
echo $0 "<gravatar directory> <output file base name> <seconds per day>" | |
exit 1 | |
fi | |
gravatar_dir=$1 | |
output_file=$2 | |
seconds_per_day=$3 | |
git log --pretty=format:"%ae|%an" | sort | uniq | while read -r line | |
do parts=("${(s/|/)line}") | |
username=$parts[2] | |
gravatar_file=$gravatar_dir/${username}.jpg | |
if [[ ! (-f $gravatar_file) ]] | |
then email=$parts[1] | |
email_hash=`md5 -qs $email` | |
curl --output $gravatar_dir/${username}.jpg http://www.gravatar.com/avatar/${email_hash}.jpg | |
fi | |
done | |
gource --user-image-dir $gravatar_dir --seconds-per-day $seconds_per_day --hide filenames,usernames --key -1280x720 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 ${output_file}.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment