EncodingJobOptions.cs 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using MediaBrowser.Model.Dlna;
  2. namespace MediaBrowser.Controller.MediaEncoding
  3. {
  4. public class EncodingJobOptions
  5. {
  6. public string OutputContainer { get; set; }
  7. public string OutputDirectory { get; set; }
  8. public long? StartTimeTicks { get; set; }
  9. public int? Width { get; set; }
  10. public int? Height { get; set; }
  11. public int? MaxWidth { get; set; }
  12. public int? MaxHeight { get; set; }
  13. public bool Static = false;
  14. public float? Framerate { get; set; }
  15. public float? MaxFramerate { get; set; }
  16. public string Profile { get; set; }
  17. public int? Level { get; set; }
  18. public string DeviceId { get; set; }
  19. public string ItemId { get; set; }
  20. public string MediaSourceId { get; set; }
  21. public string AudioCodec { get; set; }
  22. public bool EnableAutoStreamCopy { get; set; }
  23. public int? MaxAudioChannels { get; set; }
  24. public int? AudioChannels { get; set; }
  25. public int? AudioBitRate { get; set; }
  26. public int? AudioSampleRate { get; set; }
  27. public DeviceProfile DeviceProfile { get; set; }
  28. public EncodingContext Context { get; set; }
  29. public string VideoCodec { get; set; }
  30. public int? TranscodingMaxAudioChannels { get; set; }
  31. public int? VideoBitRate { get; set; }
  32. public int? AudioStreamIndex { get; set; }
  33. public int? VideoStreamIndex { get; set; }
  34. public int? SubtitleStreamIndex { get; set; }
  35. public int? MaxRefFrames { get; set; }
  36. public int? MaxVideoBitDepth { get; set; }
  37. public int? CpuCoreLimit { get; set; }
  38. public bool ReadInputAtNativeFramerate { get; set; }
  39. public SubtitleDeliveryMethod SubtitleMethod { get; set; }
  40. public bool CopyTimestamps { get; set; }
  41. /// <summary>
  42. /// Gets a value indicating whether this instance has fixed resolution.
  43. /// </summary>
  44. /// <value><c>true</c> if this instance has fixed resolution; otherwise, <c>false</c>.</value>
  45. public bool HasFixedResolution
  46. {
  47. get
  48. {
  49. return Width.HasValue || Height.HasValue;
  50. }
  51. }
  52. public EncodingJobOptions()
  53. {
  54. }
  55. public EncodingJobOptions(StreamInfo info, DeviceProfile deviceProfile)
  56. {
  57. OutputContainer = info.Container;
  58. StartTimeTicks = info.StartPositionTicks;
  59. MaxWidth = info.MaxWidth;
  60. MaxHeight = info.MaxHeight;
  61. MaxFramerate = info.MaxFramerate;
  62. Profile = info.VideoProfile;
  63. Level = info.VideoLevel;
  64. ItemId = info.ItemId;
  65. MediaSourceId = info.MediaSourceId;
  66. AudioCodec = info.TargetAudioCodec;
  67. MaxAudioChannels = info.MaxAudioChannels;
  68. AudioBitRate = info.AudioBitrate;
  69. AudioSampleRate = info.TargetAudioSampleRate;
  70. DeviceProfile = deviceProfile;
  71. VideoCodec = info.VideoCodec;
  72. VideoBitRate = info.VideoBitrate;
  73. AudioStreamIndex = info.AudioStreamIndex;
  74. MaxRefFrames = info.MaxRefFrames;
  75. MaxVideoBitDepth = info.MaxVideoBitDepth;
  76. SubtitleMethod = info.SubtitleDeliveryMethod;
  77. Context = info.Context;
  78. TranscodingMaxAudioChannels = info.TranscodingMaxAudioChannels;
  79. if (info.SubtitleDeliveryMethod != SubtitleDeliveryMethod.External)
  80. {
  81. SubtitleStreamIndex = info.SubtitleStreamIndex;
  82. }
  83. }
  84. }
  85. }