FFProbeResult.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System.Collections.Generic;
  2. namespace MediaBrowser.Controller.FFMpeg
  3. {
  4. /// <summary>
  5. /// Provides a class that we can use to deserialize the ffprobe json output
  6. /// Sample output:
  7. /// http://stackoverflow.com/questions/7708373/get-ffmpeg-information-in-friendly-way
  8. /// </summary>
  9. public class FFProbeResult
  10. {
  11. public IEnumerable<MediaStream> streams { get; set; }
  12. public MediaFormat format { get; set; }
  13. }
  14. /// <summary>
  15. /// Represents a stream within the output
  16. /// A number of properties are commented out to improve deserialization performance
  17. /// Enable them as needed.
  18. /// </summary>
  19. public class MediaStream
  20. {
  21. public int index { get; set; }
  22. public string profile { get; set; }
  23. public string codec_name { get; set; }
  24. public string codec_long_name { get; set; }
  25. public string codec_type { get; set; }
  26. //public string codec_time_base { get; set; }
  27. //public string codec_tag { get; set; }
  28. //public string codec_tag_string { get; set; }
  29. //public string sample_fmt { get; set; }
  30. public string sample_rate { get; set; }
  31. public int channels { get; set; }
  32. //public int bits_per_sample { get; set; }
  33. //public string r_frame_rate { get; set; }
  34. //public string avg_frame_rate { get; set; }
  35. //public string time_base { get; set; }
  36. //public string start_time { get; set; }
  37. public string duration { get; set; }
  38. public string bit_rate { get; set; }
  39. public int width { get; set; }
  40. public int height { get; set; }
  41. //public int has_b_frames { get; set; }
  42. //public string sample_aspect_ratio { get; set; }
  43. //public string display_aspect_ratio { get; set; }
  44. //public string pix_fmt { get; set; }
  45. //public int level { get; set; }
  46. public Dictionary<string,string> tags { get; set; }
  47. }
  48. public class MediaFormat
  49. {
  50. public string filename { get; set; }
  51. public int nb_streams { get; set; }
  52. public string format_name { get; set; }
  53. public string format_long_name { get; set; }
  54. public string start_time { get; set; }
  55. public string duration { get; set; }
  56. public string size { get; set; }
  57. public string bit_rate { get; set; }
  58. public Dictionary<string, string> tags { get; set; }
  59. }
  60. }