It isn't an API as such but a command line tool. It is the de facto video converter used in this kind of stuff though.
http://www.ffmpeg.org/
UPDATE:
I didn't say it's the only way, someone else might have written another tool to do this. Given how widely used ffmpeg is I'd be surprised if someone had. Either way, what you want to look for is not an API but a video decoder/encoder. I recommend using ffmped, it supports pretty much any codec/fileformat you can think of, has good support, does a good job and is fairly easy to use.
Googling for .NET video encoding I found this (http://stackoverflow.com/questions/44161/real-time-wmv-video-encoding-in-c).