public static MediaFileInfo GetMetadata(string pathToFile) { MediaFileInfo result; using (var cmd = Command.Run(SolutionSettings.Default.FFprobePath, null, options => options.StartInfo(i => i.Arguments = string.Format("-i \"{0}\" -v error -print_format json -show_format -show_streams", pathToFile)))) { cmd.Wait(); result = MediaFileInfo.FromJson(cmd.StandardOutput.ReadToEnd()); } return(result); }
public static string ToJson(this MediaFileInfo self) => JsonConvert.SerializeObject(self, Converter.Settings);