FFProbeResult.cs 2.5 KB

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