Skip to content

Instantly share code, notes, and snippets.

@lancewalton
Last active January 11, 2018 23:37
Show Gist options
  • Select an option

  • Save lancewalton/6b7d60ca15448214e0bb to your computer and use it in GitHub Desktop.

Select an option

Save lancewalton/6b7d60ca15448214e0bb to your computer and use it in GitHub Desktop.

Revisions

  1. lancewalton revised this gist Oct 2, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gource.sh
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ do parts=("${(s/|/)line}")
    username=$parts[2]
    gravatar_file=$gravatar_dir/${username}.jpg

    if (( ! (-f $gravatar_file) ))
    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
  2. lancewalton revised this gist Oct 2, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gource.sh
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ do parts=("${(s/|/)line}")
    username=$parts[2]
    gravatar_file=$gravatar_dir/${username}.jpg

    if [[ ! (-f $gravatar_file) ]]
    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
  3. lancewalton revised this gist Oct 2, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gource.sh
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@
    # brew install gource
    # brew install ffmpeg

    if [[ !($# == 3) ]]
    if (( !($# == 3) ))
    then
    echo "Usage:"
    echo $0 "<gravatar directory> <output file base name> <seconds per day>"
  4. lancewalton revised this gist Oct 2, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gource.sh
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@
    # brew install gource
    # brew install ffmpeg

    if (( !($# == 3) ))
    if [[ !($# == 3) ]]
    then
    echo "Usage:"
    echo $0 "<gravatar directory> <output file base name> <seconds per day>"
  5. lancewalton created this gist Oct 1, 2014.
    31 changes: 31 additions & 0 deletions gource.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    #!/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