public
Last active

Generate gource video out of bzr repositories for Ubuntu Touch Core Apps.

  • Download Gist
gource-ubuntu-core-apps.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
#!/usr/bin/env bash
 
# Generate gource video out of bzr repositories for Ubuntu Touch Core Apps.
#
# Corey Goldberg 2013
#
# Usage:
# gource-ubuntu-core-apps.sh /path/to/repo1 /path/to/repo2
#
# Example - generate video for all Ubuntu Touch Core Apps:
# $ ./gource-ubuntu-core-apps.sh \
# account-plugin-evernote \
# dropping-letters \
# music-app \
# reminders-app \
# stock-ticker-mobile-app \
# sudoku-app ubuntu-calculator-app \
# ubuntu-calendar-app \
# ubuntu-clock-app \
# ubuntu-docviewer-app \
# ubuntu-emailclient-app \
# ubuntu-facebook-app \
# ubuntu-filemanager-app \
# ubuntu-phone-commons \
# ubuntu-rssreader-app \
# ubuntu-terminal-app \
# ubuntu-weather-app
 
 
outfile="gource.mp4"
resolution="1920x1080"
 
 
# get a bzr branch of each project
for repo in $*; do
branch_command="bzr branch lp:"$repo
echo $branch_command
$branch_command
done
 
i=0
for repo in $*; do
# generate a gource custom log file for each repo
logfile="$(mktemp /tmp/gource.XXXXXX)"
gource --output-custom-log "${logfile}" $repo
# make each repo appear on a separate branch by adding
# an extra parent directory to the path of the files in each project.
sed -i -E "s#(.+)\|#\1|/${repo}#" ${logfile}
logs[$i]=$logfile
let i=$i+1
done
 
# generate the combined log
combined_log="$(mktemp /tmp/gource.XXXXXX)"
cat ${logs[@]} | sort -n > $combined_log
rm ${logs[@]}
 
# remove the branch directories after creating log
for repo in $*; do
rm -rf $repo
done
 
# print the committers found
echo "Committers:"
cat $combined_log | awk -F\| {'print $2'} | sort | uniq
echo "======================"
 
# run gource, piping output to avconv for video rendering
time gource $combined_log \
-s 0.2 \
-$resolution \
--logo ubuntu_logo.png \
--title "Ubuntu Touch Core Apps" \
--auto-skip-seconds 1 \
--multi-sampling \
--highlight-users \
--file-extensions \
--highlight-dirs \
--file-idle-time 0 \
--max-files 0 \
--hide mouse,progress \
--key \
--stop-at-end \
--output-ppm-stream - \
--output-framerate 30 \
--background-colour 000000 \
--default-user-image user_icon.png \
--colour-images \
--font-size 28 \
| avconv -y -r 30 -f image2pipe -vcodec ppm -i - -b 8192K $outfile
 
# remove the log when done
rm $combined_log

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.