Le Ralf, The Blog
All | Moods | Prog | Rants | Android | Projects | Trackday
Most recent entry: 2009-09-17 20:00:00 -- Generated on 2011-07-24 21:11:26 by Rig3 0.4-456
2009/09/17 TrackVideo Generator
π 2009-09-17 20:00 by Ralf in Projects
Last time I used Trackmaster on an Android phone and recorded some tracks and lap times. Trackmaster also recorded lots of useful info like speed acceleration, sampled roughly every second for each session.

Since I had also recorded some video of my track sessions, I decided to write a little piece of software to generate an overlay to put on top of my video.

At first I thought I'd do a plugin for Sony Vegas Platinium, the software I use to edit the track video. The only thing I found was how to create "generator plugins", which sounded fine. Finding the SDK and the information for it was moderately easy. However the plugin architecture uses a deprecated feature of DirectX. It's hard to find the relevant SDK bits (TODO: fish some links and update this). In the end I kind of made it work but then I never managed to get the generator receive a proper time field, and it was all in COM under my old Visual Studio 2005. I guess I could have used GDI+ to render the graphics or something and then generate the bitmap for the generator but it all sounded like more work than I was willing to put in it.

So I gave up and decided to write a standalone piece of software that would generate a movie file, and then use Vegas to overlay it. I considered both Java and C# and in both case I had a hard time finding a good library to generate movies -- you'd think MS would support a managed version of Windows Media Framework but no... Moving on, I finally found a simple managed wrapper on top of the AVI file API that does the job and used that.

It's in C# using C# Express and .Net 3.5, so anyone with Windows can reuse it. There's no DirectX or WMF used, so I'd hope it would work under wine for other platforms.

Bottom line is that after spending most of my time finding the right tools and libs, I did quickly get something working:

The projects lives at http://trackvideo.googlecode.com .

It's quite primitive yet, I need to add things like a preview, some docs on the internals, there are things to refactor in the code, etc. I also need to make it more configurable since right now most things are hard-coded in the source. Oh and I need to have a fancier output. But at least it's a good foundation.

Let's be clear: my goal is to make something that's good for me out of the box, yet reasonably configurable by others. And contributions will be welcome.


More pages: August 2010 April 2010 November 2009 October 2009 September 2009 August 2009 June 2009 October 2008 August 2008 July 2008 June 2008 May 2008 April 2008 March 2008 December 2007 November 2007 September 2007 July 2007 June 2007 May 2007 April 2007 March 2007 February 2007 January 2007 December 2006 November 2006 October 2006 September 2006 August 2006 July 2006 June 2006 May 2006 April 2006 March 2006 January 2006 December 2005 November 2005 October 2005 September 2005 August 2005 July 2005 June 2005 May 2005 April 2005 March 2005 February 2005 January 2005 December 2004 November 2004 June 2004