Skip to content

Instantly share code, notes, and snippets.

@alexander-bauer
Created October 16, 2012 02:27
Show Gist options
  • Save alexander-bauer/3896937 to your computer and use it in GitHub Desktop.
Save alexander-bauer/3896937 to your computer and use it in GitHub Desktop.
Small script to wrap using gource and ffmpeg to save repository visualizations to files
#!/bin/sh
# This script is meant to act as a wrapper to gource, and creates a
# movie file (with the supplied file extension,) at 60fps and of the
# given number of seconds per day.
#
# Please see https://code.google.com/p/gource for information on
# gource.
#
if [ -z $1 ]
then
echo "usage: $0 outfile.flv [speed] [title]"
fi
OUTFILE=$1
SPEED=$2
TITLE=$3
OPT_SPEED="-s 0.5 -a 0.5"
OPT_TITLE=
OPT_FRAMERATE="-r 60"
OPT_HIDE="--hide progress,filenames,mouse"
OPT_HIGHLIGHT="--highlight-all-users --highlight-dirs"
OPT_FILEIDLE="--file-idle-time 0"
if [ -n $SPEED ]
then
OPT_SPEED="-s $SPEED -a $SPEED"
fi
if [ -n $TITLE ]
then
OPT_TITLE="--title \"$TITLE\""
fi
gource $OPT_SPEED $OPT_TITLE \
$OPT_FRAMERATE $OPT_HIDE $OPT_HIGHLIGHT $OPT_FILEIDLE \
--stop-at-end -o -\
| ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - \
$OPT_FRAMERATE -sameq $OUTFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment