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