Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public static string ToJson(this MediaFileInfo self) => JsonConvert.SerializeObject(self, Converter.Settings);