libavcodec & ffdshow

To perform these experiments, I needed to be able to tweak the source code of a video decompressor. Since I do most of my development on the Windows platform using Visual Studio and I wanted to support as many codecs that use motion compensation, my options became limited. libavcodec in ffmpeg is the library to encode and decode any of a host of video and audio codecs. There is one catch however: it is written in C using C99 features and VC does not compile C99. Therefore I (back-)ported libavcodec to the Windows platform so I could use a GUI debugger and quickly learn the structure of the code. This would allow me to make quick changes and evaluate the results.

ffdshow is a DirectShow filter that, among others, uses libavcodec to handle a variety of formats in the context of a DirectShow filter graph - very handy stuff. I also modified this to be compatible with my version of libavcodec and to stream a video's motion vectors to an external application via UDP. This enabled me to visualise the motion vectors in my 2D fluid dynamics simulation.

I imagine a Windows version of libavcodec (albeit not in its entirety) would be useful to many people, so I will shortly attach it to this post along with a patch that can be applied to the SVN trunk.