|
|
Introduction
There are several ways to generate a video:
- if you want to access a subversion repository, simply run runrepositoryfetch.bat on windows systems or runrepository.sh on linux (linux support for this way has not been tested yet).
A dialog will show up, asking you for the repository url, your username and password. The repository gets fetched, converted and codeswarm will be started. This will create the frames of the video for you. If you want to create a real video, see "Creating the video" (below).
- if you want to access a non-svn repository, read on:
This guide explains how to generate a video under a Linux install (it is based on Linux tools) but might be applied to a Windows workstation as well (some other tools might need to be used)
To make it short, generating your video is done in 4 steps :
- get the activity log out of your versionning system
- convert the activity log to something code_swarm can use
- excuting code_swarm
- making a video out of the exported images
The first step, of course, is to download code_swarm from SVN (check out the Source Checkout page for that). You will also need java and ant to build it.
Getting the activity log
SVN
To get the activity log from your SVN repository, just get a local copy of your repository, enter the main directory and execute
svn log -v > activity.log
This will create a file called activity.log.
CVS
To get the activity log from your CVS repository, just get a local copy of your repository, enter the main directory and execute
cvs log > activity.log
This will create a file called activity.log.
MediaWiki (Using SwarmExport extension)
To get a wikiswarm report from the wiki use the maintenance script inside of the SwarmExport extension: http://svn.nadir-point.com/viewvc/mediawiki-extensions/branches/stable/SwarmExport/
Other versionning systems
Documentation to come
Convert the log
code_swarm has a python converter in its convert_logs directory. Before you start using it, make sure you read this issue report: http://code.google.com/p/codeswarm/issues/detail?id=6
- Move to the convert_logs directory
- Copy the activity.log file generated above into the current directory
- Launch the convert_logs.py script:
- For SVN use: python convert_logs.py -s activity.log -o activity.xml
- For CVS use: python convert_logs.py -c activity.log -o activity.xml
- For MediaWiki using SwarmExport use: python convert_logs.py --wikiswarm-log=activity.log -o activity.xml
This will generate a file called activity.xml.
At this point, you will not need activity.log anymore, so you can delete it.
Executing code_swarm
To execute code_swarm, you need just need ant and javac. For most people, you just want to check out trunk and use the supplied ant script or run.sh script in that directory. Please refer to the [HowtoBuild] Wiki page.
Before running, you will need to configure a config file for your project. /trunk/data has an example of a config file. See the rest of the wiki for more help.
Creating the video
The previous step created a series of screenshots in the PNG format under the code_swarm/frames/ directory. Now you want to use them to build a video. MEncoder is one tool to do that. Just get into that frames/ directory and type:
mencoder mf://*.png -mf fps=24:type=png -ovc lavc -oac copy -o movie.avi
For a 15000 commits video, this might take about 40MB, so you want to reduce the size a little bit. You can do that by converting to DivX (MPG4) and reducing the frame rate:
mencoder movie.avi -ovc xvid -oac mp3lame -xvidencopts bitrate=200 -o project-activity.avi
For a 40MB video, this reduces the size to 10MB. You can also try using the h264 format if your MEncoder has the right libraries to do so:
mencoder movie.avi -ovc x264 -oac mp3lame -xvidencopts bitrate=200 -o project-activity2.avi
To make a high quality .mov (no loss from the frames) suitable for iMovie or Final Cut:
ffmpeg -f image2 -r 24 -i ./frames/swarm-%05d.png -sameq ./out.mov -pass 2
(Or you can use Quick Time Player to open a image sequence and then save a resulting high quality .mov file.)
That's it, you should have a beautiful video of your project's activity by now!
Sign in to add a comment

please add a line (for noobs like me) to say what python version is required (2.5?) to convert logs ;)
You can also use ffmpeg for generating the video (from your frames directory): ffmpeg -f image2 -i swarm-%05d.png /tmp/foobar.mpg
maybe plan a option to convert apache/httpd access log into xml event would be a good idea ?
"To execute code_swarm, you need the Processing application (which uses Java)." I'm newbie, so can you please explain me what exactly I have to type in my command line to execute code_swarm (I use Ubuntu 8.04)?
"Processing" is an application you down load from
http://processing.org/
String
must be changed to
Regards, Vyacheslav
Wher do I store activity.xml, I am using version 0.139, and it seems to execute but nothing happens. I have put activity.xml in the data folder, should it be somwhere else?
Just an FYI, if you are trying to generate an activity.xml for CVS (it's on this project's trunk as of this morning), you will need to do the following: 1) Line 142 should be "...strip()", not "...strip('\n')". I had some issues where there was still a carriage-return at the end of the line which caused it not to equate properly. 2) After your output, you WILL need to sort it. In order to do this, you can change line 182 (where the "xml_handle" writes out the event) to write the date out first. Once you've done this, run the converter. Edit the XML output, and remove the first two lines and the very last line. Run sort on it, then add the three lines back in. Now you're ready to go. If anyone has alternatives to make this easier, let me know!
Actually, you will need to write out the date, then author, then filename for 'sort' to work correctly.
What command necessary use with CVS Reposotory for generate correct log file?
I can only speak for Ubuntu 8.04 (although I wouldn't be surprised if this applies to all nix systems). After you've got the activity.xml for CVS and you've removed the appropriate lines do something like the following:
Here's my java n00b question: Is this geared to a specific JDK? I'm using JDK 1.6.0_10-beta-b25 and am getting stack traces using code_swarm.pde with Processing. Also, was this written with a certain version of Processing? (I'm going to see if I can answer my own question and user a previous version of Processing.) Thanks for any help. If I wasn't such a Java dork, I'd help out with this program.
There appears to be a limit, at least on my rinky system (only 1G RAM on Windows Vista), to the size allowed in the generically named activity.xml file. Had a 20 MB SVN dump from a very busy /trunk. Broke this down to ~5MB and everything works fine. I did (finally) read the FAQ. My processing version was too old (I grabbed the 0135 beta, not the newer 0142 beta) and figured out my jdk was just fine. Thanks guys/gals for the cool program.
In order to process a lot of data it does require a lot of memory. Each file node that ever enters CVS/SVN is kept internally for book keeping, so it does add up.
I generally run at about 512m with large files, which seems good enough, but if you don't have that free the only way is to split up the file indeed.
I created a converter to generate the activity xml from Perforce. Let me know if there is interest in this and I can try to upload it somewhere.
ajbanck - email it to me and i'll commit: acgourley (gmail)
For users of ffmpeg, here's the command I used: ffmpeg -f image2 -r 24 -i ./frames/swarm-%05d.png -sameq ./out.mov -pass 2
That means input as images, 24 frames per second, input filename format, high quality, output file, 2 passes.
ajbanck: could you mail the converter to "oregu at yandex dot ru"?
convert_logs.py script now supports perforce: python convert_logs.py "--perforce-path=//depot/..." This command will generate depot.xml including all file activities in specified perforce folder. Command "p4" should be installed and configured.
there is no sound, use the "-nosound" switch for mencoder and remove the -oac copy ...