Skip to content

Instantly share code, notes, and snippets.

@BlinkyStitt
Created July 17, 2013 01:09
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save BlinkyStitt/6016808 to your computer and use it in GitHub Desktop.
Save BlinkyStitt/6016808 to your computer and use it in GitHub Desktop.
Run gource over a bunch of repos and save an mp4
#!/usr/bin/env bash
# Generates gource video (h.264) out of multiple repositories.
# Pass the repositories in command line arguments.
# Example:
# <this.sh> /path/to/repo1 /path/to/repo2
OUTFILE="gource.mp4"
set -x
combined_log="$(mktemp /tmp/gource_combined.XXXXXX)"
for repo in $*; do
# output the repo to a logfile
logfile="$(mktemp /tmp/gource.XXXXXX)"
gource --output-custom-log "${logfile}" ${repo}
# namespace the repos
sed -E 's/(.+)\|/\1\|\/'${repo}'/' ${logfile} >> $combined_log
# delete temp logfile
rm ${logfile}
done
# sort the combined_log
sort -n -o $combined_log $combined_log
# run the log through gource and ouput to ffmpeg
# todo: lots of possible flags to pass
time gource -o - --time-scale 4.0 $combined_log | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 $OUTFILE
# cleanup the log
rm $combined_log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment