C# 判断是否安装了ffmpeg
internal static bool IsFfmpegInstalled(){try{ProcessStartInfo startInfo = new ProcessStartInfo{FileName = "ffmpeg",Arguments = "-version",RedirectStandardOutput = true,RedirectStandardError = true,UseShellExecute = false,CreateNoWindow = true};using (Process process = Process.Start(startInfo)){process.WaitForExit();string output = process.StandardOutput.ReadToEnd();string error = process.StandardError.ReadToEnd();if (process.ExitCode == 0 && !string.IsNullOrEmpty(output)){return true;}}}catch{// 如果发生异常,说明ffmpeg未安装或无法运行return false;}return false;}