EncodingOptions.cs 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. #nullable disable
  2. using MediaBrowser.Model.Entities;
  3. namespace MediaBrowser.Model.Configuration;
  4. /// <summary>
  5. /// Class EncodingOptions.
  6. /// </summary>
  7. public class EncodingOptions
  8. {
  9. /// <summary>
  10. /// Initializes a new instance of the <see cref="EncodingOptions" /> class.
  11. /// </summary>
  12. public EncodingOptions()
  13. {
  14. EnableFallbackFont = false;
  15. DownMixAudioBoost = 2;
  16. DownMixStereoAlgorithm = DownMixStereoAlgorithms.None;
  17. MaxMuxingQueueSize = 2048;
  18. EnableThrottling = false;
  19. ThrottleDelaySeconds = 180;
  20. EncodingThreadCount = -1;
  21. // This is a DRM device that is almost guaranteed to be there on every intel platform,
  22. // plus it's the default one in ffmpeg if you don't specify anything
  23. VaapiDevice = "/dev/dri/renderD128";
  24. EnableTonemapping = false;
  25. EnableVppTonemapping = false;
  26. TonemappingAlgorithm = "bt2390";
  27. TonemappingRange = "auto";
  28. TonemappingDesat = 0;
  29. TonemappingThreshold = 0.8;
  30. TonemappingPeak = 100;
  31. TonemappingParam = 0;
  32. VppTonemappingBrightness = 0;
  33. VppTonemappingContrast = 1.2;
  34. H264Crf = 23;
  35. H265Crf = 28;
  36. DeinterlaceDoubleRate = false;
  37. DeinterlaceMethod = "yadif";
  38. EnableDecodingColorDepth10Hevc = true;
  39. EnableDecodingColorDepth10Vp9 = true;
  40. EnableEnhancedNvdecDecoder = false;
  41. PreferSystemNativeHwDecoder = true;
  42. EnableIntelLowPowerH264HwEncoder = false;
  43. EnableIntelLowPowerHevcHwEncoder = false;
  44. EnableHardwareEncoding = true;
  45. AllowHevcEncoding = false;
  46. EnableSubtitleExtraction = true;
  47. AllowOnDemandMetadataBasedKeyframeExtractionForExtensions = new[] { "mkv" };
  48. HardwareDecodingCodecs = new string[] { "h264", "vc1" };
  49. }
  50. /// <summary>
  51. /// Gets or sets the thread count used for encoding.
  52. /// </summary>
  53. public int EncodingThreadCount { get; set; }
  54. /// <summary>
  55. /// Gets or sets the temporary transcoding path.
  56. /// </summary>
  57. public string TranscodingTempPath { get; set; }
  58. /// <summary>
  59. /// Gets or sets the path to the fallback font.
  60. /// </summary>
  61. public string FallbackFontPath { get; set; }
  62. /// <summary>
  63. /// Gets or sets a value indicating whether to use the fallback font.
  64. /// </summary>
  65. public bool EnableFallbackFont { get; set; }
  66. /// <summary>
  67. /// Gets or sets the audio boost applied when downmixing audio.
  68. /// </summary>
  69. public double DownMixAudioBoost { get; set; }
  70. /// <summary>
  71. /// Gets or sets the algorithm used for downmixing audio to stereo.
  72. /// </summary>
  73. public DownMixStereoAlgorithms DownMixStereoAlgorithm { get; set; }
  74. /// <summary>
  75. /// Gets or sets the maximum size of the muxing queue.
  76. /// </summary>
  77. public int MaxMuxingQueueSize { get; set; }
  78. /// <summary>
  79. /// Gets or sets a value indicating whether throttling is enabled.
  80. /// </summary>
  81. public bool EnableThrottling { get; set; }
  82. /// <summary>
  83. /// Gets or sets the delay after which throttling happens.
  84. /// </summary>
  85. public int ThrottleDelaySeconds { get; set; }
  86. /// <summary>
  87. /// Gets or sets the hardware acceleration type.
  88. /// </summary>
  89. public string HardwareAccelerationType { get; set; }
  90. /// <summary>
  91. /// Gets or sets the FFmpeg path as set by the user via the UI.
  92. /// </summary>
  93. public string EncoderAppPath { get; set; }
  94. /// <summary>
  95. /// Gets or sets the current FFmpeg path being used by the system and displayed on the transcode page.
  96. /// </summary>
  97. public string EncoderAppPathDisplay { get; set; }
  98. /// <summary>
  99. /// Gets or sets the VA-API device.
  100. /// </summary>
  101. public string VaapiDevice { get; set; }
  102. /// <summary>
  103. /// Gets or sets a value indicating whether tonemapping is enabled.
  104. /// </summary>
  105. public bool EnableTonemapping { get; set; }
  106. /// <summary>
  107. /// Gets or sets a value indicating whether VPP tonemapping is enabled.
  108. /// </summary>
  109. public bool EnableVppTonemapping { get; set; }
  110. /// <summary>
  111. /// Gets or sets the tone-mapping algorithm.
  112. /// </summary>
  113. public string TonemappingAlgorithm { get; set; }
  114. /// <summary>
  115. /// Gets or sets the tone-mapping range.
  116. /// </summary>
  117. public string TonemappingRange { get; set; }
  118. /// <summary>
  119. /// Gets or sets the tone-mapping desaturation.
  120. /// </summary>
  121. public double TonemappingDesat { get; set; }
  122. /// <summary>
  123. /// Gets or sets the tone-mapping threshold.
  124. /// </summary>
  125. public double TonemappingThreshold { get; set; }
  126. /// <summary>
  127. /// Gets or sets the tone-mapping peak.
  128. /// </summary>
  129. public double TonemappingPeak { get; set; }
  130. /// <summary>
  131. /// Gets or sets the tone-mapping parameters.
  132. /// </summary>
  133. public double TonemappingParam { get; set; }
  134. /// <summary>
  135. /// Gets or sets the VPP tone-mapping brightness.
  136. /// </summary>
  137. public double VppTonemappingBrightness { get; set; }
  138. /// <summary>
  139. /// Gets or sets the VPP tone-mapping contrast.
  140. /// </summary>
  141. public double VppTonemappingContrast { get; set; }
  142. /// <summary>
  143. /// Gets or sets the H264 CRF.
  144. /// </summary>
  145. public int H264Crf { get; set; }
  146. /// <summary>
  147. /// Gets or sets the H265 CRF.
  148. /// </summary>
  149. public int H265Crf { get; set; }
  150. /// <summary>
  151. /// Gets or sets the encoder preset.
  152. /// </summary>
  153. public string EncoderPreset { get; set; }
  154. /// <summary>
  155. /// Gets or sets a value indicating whether the framerate is doubled when deinterlacing.
  156. /// </summary>
  157. public bool DeinterlaceDoubleRate { get; set; }
  158. /// <summary>
  159. /// Gets or sets the deinterlace method.
  160. /// </summary>
  161. public string DeinterlaceMethod { get; set; }
  162. /// <summary>
  163. /// Gets or sets a value indicating whether 10bit HEVC decoding is enabled.
  164. /// </summary>
  165. public bool EnableDecodingColorDepth10Hevc { get; set; }
  166. /// <summary>
  167. /// Gets or sets a value indicating whether 10bit VP9 decoding is enabled.
  168. /// </summary>
  169. public bool EnableDecodingColorDepth10Vp9 { get; set; }
  170. /// <summary>
  171. /// Gets or sets a value indicating whether the enhanced NVDEC is enabled.
  172. /// </summary>
  173. public bool EnableEnhancedNvdecDecoder { get; set; }
  174. /// <summary>
  175. /// Gets or sets a value indicating whether the system native hardware decoder should be used.
  176. /// </summary>
  177. public bool PreferSystemNativeHwDecoder { get; set; }
  178. /// <summary>
  179. /// Gets or sets a value indicating whether the Intel H264 low-power hardware encoder should be used.
  180. /// </summary>
  181. public bool EnableIntelLowPowerH264HwEncoder { get; set; }
  182. /// <summary>
  183. /// Gets or sets a value indicating whether the Intel HEVC low-power hardware encoder should be used.
  184. /// </summary>
  185. public bool EnableIntelLowPowerHevcHwEncoder { get; set; }
  186. /// <summary>
  187. /// Gets or sets a value indicating whether hardware encoding is enabled.
  188. /// </summary>
  189. public bool EnableHardwareEncoding { get; set; }
  190. /// <summary>
  191. /// Gets or sets a value indicating whether HEVC encoding is enabled.
  192. /// </summary>
  193. public bool AllowHevcEncoding { get; set; }
  194. /// <summary>
  195. /// Gets or sets a value indicating whether subtitle extraction is enabled.
  196. /// </summary>
  197. public bool EnableSubtitleExtraction { get; set; }
  198. /// <summary>
  199. /// Gets or sets the codecs hardware encoding is used for.
  200. /// </summary>
  201. public string[] HardwareDecodingCodecs { get; set; }
  202. /// <summary>
  203. /// Gets or sets the file extensions on-demand metadata based keyframe extraction is enabled for.
  204. /// </summary>
  205. public string[] AllowOnDemandMetadataBasedKeyframeExtractionForExtensions { get; set; }
  206. }