I'm sorry if my post will help you not so much as I wish to help. To me, it looks like a considerable problem, too.
A while ago, I found only one product which can do this on Windows. This is VideoLAN, see:
http://en.wikipedia.org/wiki/VideoLAN[
^],
http://www.videolan.org/[
^].
Right now, this product which was primarily designed for media streaming is provided in the form of one application called VLC Player. Even though it mainly works like a player, it can be used in both interactive and batch modes for many different purposes: streaming, capturing of media streams in many different formats, conversion into any other format, video/audio transformation, etc.
Best thing is: this application comes with API and a number of separate libraries, all Open Source. You can use the application for capturing video or you can find the standards you need to capture in the libraries and try to use their source code. I just used the compiled application, just for one standard, audio only, but successfully. Just want to warn you: the command-line interface is extremely rich and complex; so, if you think some feature does not exist, think twice; you can find a lot of functionality in the command-line documentation, it will just take some time.
I also uses some command-line media streaming capturing software on Linux, but it's harder to remember how to find it. Of course, it comes with source code, too.
So, your problem is quite solvable, you just need to invest considerable amount of time to learn this Open-Source software.
—SA