headermask image

header image

Proving them wrong

One experiment I’ve started working on recently is getting behind the hood of motion-compensation based video codecs, specifically the decoder, and trying to distort the motion vectors before the macro-block is recontructed. The purpose is to see whether interesting/beautiful/ugly video sequences will result. I’ve often seen such if there’s an error in an existing video stream and the decoder leaves behind artifacts. I’d like to make this an interactive process.

In order to do so, I needed to get the source code. Easy: libavcodec (part of ffmpeg). Next (since I do most of my development on Windows) I needed to compile and debug it using Visual Studio (MSVC). Hard: since the authors wrote it conforming to C99, it won’t compile under MSVC since it doesn’t support the spec. It does however compile using MSys+MinGW – this is still no good as I need to interactive debug the damn thing under MSVC. Furthermore, I’d like to quote the guide: “FFMPEG DOES NOT BUILD UNDER MSVC++, AND WILL NOT, EVER, BUILD UNDER MSVC++.

So what do I do? I spent a day porting libavcodec to Windows (albeit not in its entirety: no networking code, and all encoders that rely on external source are disabled). I compiled a fresh version of ffdshow, plugged in my compiled version of libavcodec, and voila! It actually works!

If you liked my post, feel free to subscribe to my rss feeds

Post a Comment

Your email is never published nor shared. Required fields are marked *