GTG's code_swarm video

Final video

How to make it

Convert bzr repository into git:

# Install bazaar plugin
mkdir -p ~/.bazaar/plugins
cd ~/.bazaar/plugins
bzr get lp:bzr-fastimport fastimport
cd -

# Get the code
bzr branch lp:gtg
mkdir gtg-git
cd gtg-git/
git --bare init

# Export data to git repository
bzr fast-export --marks=../marks.bzr ../gtg | git fast-import --export-marks=../marks.git

Export activity log from the git repository:

git log --name-status --pretty=format:'%n------------------------------------------------------------------------%nr%h >> | %ae | %ai (%aD) | x lines%nChanged paths:' > activity.log

Grab code_swarm and unpack it.

Convert git activity log into activity.xml:

cp activity.log ../codeswarm-0.1/
cd ../codeswarm-0.1/
python convert_logs/convert_logs.py -g activity.log -o activity.xml 

# Create frames directory
mkdir frames

Edit configuration file data/sample.conf to something like this:

# This is a sample configuration file for code_swarm

# Frame width
Width=1280

# Frame height
Height=720

# Input file
InputFile=activity.xml

# Particle sprite file
ParticleSpriteFile=src/particle.png

#Font Settings
Font=Ubuntu
FontSize=14
BoldFontSize=18

# Project time per frame
MillisecondsPerFrame=21600000

# Maximum number of Background processes
MaxThreads=4

# Optional Method instead of MillisecondsPerFrame
#FramesPerDay=4

# Background in R,G,B
Background=0,0,0

# Color assignment rules
# Keep in order, do not skip numbers. Numbers start
# at 1.
# 
# Pattern:  "Label", "regex", R,G,B, R,G,B
# Label is optional.  If it is omitted, the regex
# will be used.
#
ColorAssign1="Code",".*\.py", 255,0,0, 255,0,0
ColorAssign2="Glade",".*\.galde", 0,0,255, 0,0,255
ColorAssign3="XML",".*\.xml", 119,68,119, 119,68,119
ColorAssign4="Images",".*\.png",  0,255,0, 0,255,0
#ColorAssign5="PNG",".*\.png", 0,255,0, 0,255,0
#ColorAssign6="Code5",".*src5.*", 0,0,255, 0,0,255
#ColorAssign6="Code5",".*src5.*", 119,68,119, 119,68,119
#ColorAssign7="Code6",".*src6.*", 136,51,17, 136,51,17
#ColorAssign8="Code7",".*src7.*", 250,110,110, 250,110,130
#ColorAssign9="Code8",".*src8.*", 238,102,68, 238,102,68
#ColorAssign10=".*src9.*", 238,68,119, 238,68,119

# Save each frame to an image?
TakeSnapshots=true

# Where to save each frame
SnapshotLocation=frames/code_swarm-#####.png

# Draw names (combinatory) :
# Draw sharp names?
DrawNamesSharp=true
# And draw a glow around names? (Runs slower)
DrawNamesHalos=true

# Draw files (combinatory) :
# Draw sharp files
DrawFilesSharp=false
# Draw fuzzy files
DrawFilesFuzzy=true
# Draw jelly files
DrawFilesJelly=false

# Show the Legend at start
ShowLegend=true

# Show the History at start
ShowHistory=true

# Show the Date at start
ShowDate=true

# Show edges between authors and files, mostly for debug purpose
ShowEdges=false

# Turn on Debug counts.
ShowDebug=false

# Natural distance of files to people
EdgeLength=25

# Amount of life to decrement
EdgeDecrement=-2
FileDecrement=-2
PersonDecrement=-1

#Speeds.
#Optional: NodeSpeed=7.0, If used, FileSpeed and PersonSpeed need not be set.
#
FileSpeed=7.0
PersonSpeed=2.0

#Masses
FileMass=1.0
PersonMass=10.0

# Life of an Edge
EdgeLife=250

# Life of a File
FileLife=200

# Life of a Person
PersonLife=255

# Highlight percent.
# This is the amount of time that the person or
# file will be highlighted.
HighlightPct=10

## Physics engine selection and configuration
# Directory physics engine config files reside in.
PhysicsEngineConfigDir=physics_engine
# Force calculation algorithms ("PhysicsEngineLegacy", "PhysicsEngineSimple"...) :
PhysicsEngineSelection=PhysicsEngineLegacy

# OpenGL is experimental. Use at your own risk.
UseOpenGL=false

Run code_swarm and confirm to use the sample configuration:

./run.sh

After rendering, run command

ffmpeg -f image2 -r 24 -i ./frames/code_swarm-%05d.png -sameq ./gtg.webm

Afterwards you can edit gtg.webm file and add subtitles, background music and so on in PiTiVi or kdenlive.

Apps/GTG/code_swarm (last edited 2015-01-06 10:33:39 by OliverPropst)