What's new? | Help | Directory | Sign in
Google
  
  
  
  
    
Search
for
Updated Aug 09, 2008 by kraeusen
GeneratingAVideo  
Howto generate a video of your project's activity with code_swarm.

Introduction

There are several ways to generate a video:

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).

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 :

  1. get the activity log out of your versionning system
  2. convert the activity log to something code_swarm can use
  3. excuting code_swarm
  4. 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

  1. Move to the convert_logs directory
  2. Copy the activity.log file generated above into the current directory
  3. 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!


Comment by BVandeputte, Jun 25, 2008

please add a line (for noobs like me) to say what python version is required (2.5?) to convert logs ;)

Comment by hestomet, Jun 25, 2008

You can also use ffmpeg for generating the video (from your frames directory): ffmpeg -f image2 -i swarm-%05d.png /tmp/foobar.mpg

Comment by BVandeputte, Jun 25, 2008

maybe plan a option to convert apache/httpd access log into xml event would be a good idea ?

Comment by goa...@mail.ru, Jun 25, 2008

"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)?

Comment by altjeringa, Jun 25, 2008

"Processing" is an application you down load from

http://processing.org/

Comment by ve...@difane.com, Jun 26, 2008

String

mencoder mf://.png -mf fps=24:type=png -ovc lavc -oac copy -o movie.avi 

must be changed to

mencoder mf://*.png -mf fps=24:type=png -ovc lavc -oac copy -o movie.avi  

Regards, Vyacheslav

Comment by hans.forsberg, Jun 26, 2008

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?

Comment by daniel.watling, Jun 26, 2008

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!

Comment by daniel.watling, Jun 26, 2008

Actually, you will need to write out the date, then author, then filename for 'sort' to work correctly.

Comment by valery1707, Jun 27, 2008

What command necessary use with CVS Reposotory for generate correct log file?

Comment by daniel.watling, Jun 27, 2008

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:

sort activity.xml > sorted-activity.xml

Comment by jeremywosborne, Jun 28, 2008

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.

Comment by jeremywosborne, Jun 28, 2008

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.

Comment by arjenw, Jul 03, 2008

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.

Comment by ajbanck, Jul 03, 2008

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.

Comment by acgourley, Jul 06, 2008

ajbanck - email it to me and i'll commit: acgourley (gmail)

Comment by michael.ogawa, Jul 09, 2008

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.

Comment by ol.loginov, Jul 17, 2008

ajbanck: could you mail the converter to "oregu at yandex dot ru"?

Comment by halyava, Aug 04, 2008

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.

Comment by harald.schilly, Today (10 hours ago)

there is no sound, use the "-nosound" switch for mencoder and remove the -oac copy ...


Sign in to add a comment