Ok, I figured it out. For anyone else looking to write a .NET wrapper for ffmpeg. Download the 'shared' version. Add the contents of the 'bin' folder (with the executables) to your project. Just by doing right click your solution -> add new item...
Then you can use the executable as follows.
You can have ffmpeg, ffprobe etc.. output in json or xml. So you can parse the output and do whatever.
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.CreateNoWindow = false;
startInfo.UseShellExecute = false;
startInfo.FileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ffmpeg\\ffmpeg.exe");
startInfo.Arguments = "-f dshow -i video=\"Front Camera\"";
startInfo.RedirectStandardOutput = true;
//startInfo.RedirectStandardError = true;
Console.WriteLine(string.Format(
"Executing \"{0}\" with arguments \"{1}\".\r\n",
startInfo.FileName,
startInfo.Arguments));
try
{
using (Process process = Process.Start(startInfo))
{
while (!process.StandardOutput.EndOfStream)
{
string line = process.StandardOutput.ReadLine();
Console.WriteLine(line);
}
process.WaitForExit();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Console.ReadKey();
Happy coding.