private void CheckFFMpeg() { var ffmpegPath = Settings.Default.FFMpegPath; if (!File.Exists(ffmpegPath)) { ChangeForm(false); ChangeStatus("Status: ffmpeg doesn't exist."); btnSet.BackColor = Color.LightCoral; return; } var fs = File.OpenRead(ffmpegPath); var magic = new byte[2]; fs.Read(magic, 0, 2); if (!ffmpegPath.ToLower().EndsWith("exe") || magic[0] != 'M' || magic[1] != 'Z') { ChangeForm(false); ChangeStatus("Status: ffmpeg file isn't a valid exe file."); btnSet.BackColor = Color.LightCoral; return; } ChangeForm(true); _ffmpeg = new FfmpegWrapper(ffmpegPath, FfmpegProgressChanged, FfmpegProcessFinished); ChangeStatus("Status: ffmpeg ready."); btnSet.BackColor = SystemColors.ButtonFace; }