Both formats, and a lot more, are supported by FFmpeg or libavcodec, which are the best libraries I know. Please see:
http://en.wikipedia.org/wiki/Ffmpeg[
^],
http://ffmpeg.org/[
^],
http://en.wikipedia.org/wiki/Libavcodec[
^],
http://libav.org/[
^].
You can use them on the server-side either directly, as the utilities, or as the libraries (please see below.) Use the codec "libvorbis".
In both cases, you can get free open-source utilities which can make nearly everything, including assembling your video from frame pictures.
Now, how to use it programmatically in a .NET application? First, you can use the available utility by running it using
System.Diagnostics.Process.Start
:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx[
^].
If this is not good enough, you can wrap the library in a .NET assembly by yourself or find appropriate wrapper. Please see:
http://www.ffmpeg-csharp.com/[
^],
http://sourceforge.net/projects/sharpffmpeg/[
^],
http://vbffmpegwrapper.codeplex.com/[
^].
After all, try to find some more:
http://bit.ly/VpboUJ[
^].
If you wish to work at such wrapper by yourself but don't know how, ask a question, I'll give you the basic ideas (using P/Invoke or C++/CLI "mixed-mode" project).
See also my past answers:
HTML5 and Mime, Streaming a video?[
^],
how to convert image to video in C#[
^].
—SA