Skip to content

Instantly share code, notes, and snippets.

@hamiltont
Last active August 29, 2015 14:19
Show Gist options
  • Save hamiltont/1b9cb7f834854e4baac9 to your computer and use it in GitHub Desktop.
Save hamiltont/1b9cb7f834854e4baac9 to your computer and use it in GitHub Desktop.
Making TFB Video
#!/usr/bin/python
import re
import os
import urllib
# See https://github.com/gridaphobe/pyGravatar
from gravatar import Gravatar
adir='avatars'
if not os.path.exists(adir):
os.mkdir(adir)
with open('all_authors.txt') as f:
for line in f:
match = re.findall(r'[\w\.-]+@[\w\.-]+', line)
name = line.split(' <')[0]
if os.path.exists(os.path.join(adir, name+'.jpg')):
print "Skipping %s, already have avatar" % name
for email in match:
print "Found %s for %s" % (email, name)
g = Gravatar(email, default='404')
tfile = urllib.URLopener()
try:
tfile.retrieve(g.thumb, os.path.join(adir, name+'.jpg'))
print " Downloaded"
except IOError:
print " No gravatar"
# Download repo
git clone https://github.com/TechEmpower/FrameworkBenchmarks.git
cd FrameworkBenchmarks
# Create an easily-parsable list of github authors so we can
# grab their gravatar IDs
git log --format='%aN <%aE' | uniq > all_authors.txt
# Run script to fill in the avatars/ directory with images
python avatars.py
# Create gource specific log instead of reading from git each time
# we modify the commands slightly
`gource --log-command git` > glog.log
# Run gource and pipe results to avconf
# See https://github.com/acaudwell/Gource
gource -w --viewport 1024x768 \
# Make users bigger as our codebase is huge
--user-scale 2 --hide mouse,bloom,filenames \
--multi-sampling \
# Only show one level of directory names
--dir-name-depth 1 \
# First commit after round 9 to last in R10
--start-date '2014-03-19 13:10:00' --stop-date '2015-03-24' -
--seconds-per-day 0.5 --dir-colour 00D0FF --auto-skip-seconds 1 --logo te.png --date-format '%d %B %Y' \
# Allow files to hang around
--file-idle-time 0 \
# Use avatars download from gravatar by avatars.py
--user-image-dir avatars \
# Color all the collaborators orange
-highlight-colour FF8000 --highlight-user 'Brian Hauer' --highlight-user 'Mike Smith' --highlight-user 'Hamilton Turner' --highlight-user 'Keith Newman' --highlight-user 'Keith R. Gustafson' --highlight-user 'Keith Gustafson' --highlight-user 'Steven Smith' --highlight-user 'Lita Gratrix' --highlight-user 'Brittany Mazza' --highlight-user 'Alex Schneider' \
# Output to avconv
-o - glog.log | avconv -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 gource.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment