HandBrake is an open-source Win app written in .NET that supports a wide variety of compression standards.
Site: [
^].
On Git-Hub: [
^].
You can use HandBrake from the command line: [
^].
However, you should understand that video compression is a very complex, deep, technical process; software like HandBrake has an amazing number of options, and trying to use it from the command line, or within your own .NET app, would, imho, require extremely advanced technical expertise in both video formats, codecs, and .NET programming.