Skip to content

Instantly share code, notes, and snippets.

@kvz
Created May 7, 2010 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kvz/393704 to your computer and use it in GitHub Desktop.
Save kvz/393704 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -x
mp3="/data/music/music/!Frank!/CD1/007 Mixed By Dave Seaman.mp3"
mp3="/data/music/music/!House!/Progressive/Sander Kleinenberg/This Is Everybody Too CD1.mp3"
outbase="gourcedump"
getavatars="1"
#resolution="640x480"
resolution="800x600"
# http://nullkey.ath.cx/projects/glc/wiki/HowtoInstall
if [ ! -x /usr/bin/glc-capture ]; then
sudo echo "Please install with the default options (just press enter)"
cd /usr/src
sudo aptitude install build-essential cmake libx11-dev libxxf86vm-dev libgl1-mesa-dev libasound2-dev libpng12-dev
sudo wget http://nullkey.ath.cx/glc/scripts/glc-build.sh
sudo chmod a+x glc-build.sh
sudo ./glc-build.sh
cd -
fi
if [ ! -x /usr/bin/mencoder ]; then
sudo aptitude install mencoder
fi
[ -x /usr/bin/gource ] || sudo aptitude -y install gource || exit 1
rep="."
[ -z "${1}" ] || rep="${1}"
outbase="${rep}/${outbase}"
if [ "${getavatars}" = 1 ]; then
[ -x ${rep}/getavatars.pl ] && ${rep}/getavatars.pl || (echo "Get the perl script from http://code.google.com/p/gource/wiki/GravatarExample and save it as ${rep}/getavatars.pl" && exit 1)
fi
/usr/bin/glc-capture --disable-audio --fps=12 --out=${outbase}.glc --start \
gource -${resolution} --highlight-all-users --user-image-dir .git/avatar --disable-progress --multi-sampling -s 1 -a 1 ${rep}
glc-play ${outbase}.glc -o - -y 1 | mencoder -demuxer y4m - -nosound -ovc x264 -x264encopts qp=18:pass=1 -of avi -o ${outbase}.avi || exit 1
glc-play ${outbase}.glc -o - -y 1 | mencoder -demuxer y4m - -audiofile "${mp3}" -oac copy -ovc x264 -x264encopts qp=18:pass=2 -of avi -o ${outbase}.avi || exit 1
rm -f ${outbase}.glc
echo ""
echo ""
echo "Your file is ready: ${outbase}.avi"
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment