Created
July 17, 2013 01:09
-
-
Save BlinkyStitt/6016808 to your computer and use it in GitHub Desktop.
Run gource over a bunch of repos and save an mp4
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
#!/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