EncodingOptions.cs 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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. // Enhanced Nvdec or system native decoder is required for DoVi to SDR tone-mapping.
  41. EnableEnhancedNvdecDecoder = true;
  42. PreferSystemNativeHwDecoder = true;
  43. EnableIntelLowPowerH264HwEncoder = false;
  44. EnableIntelLowPowerHevcHwEncoder = false;
  45. EnableHardwareEncoding = true;
  46. AllowHevcEncoding = false;
  47. EnableSubtitleExtraction = true;
  48. AllowOnDemandMetadataBasedKeyframeExtractionForExtensions = new[] { "mkv" };
  49. HardwareDecodingCodecs = new string[] { "h264", "vc1" };
  50. }
  51. /// <summary>
  52. /// Gets or sets the thread count used for encoding.
  53. /// </summary>
  54. public int EncodingThreadCount { get; set; }
  55. /// <summary>
  56. /// Gets or sets the temporary transcoding path.
  57. /// </summary>
  58. public string TranscodingTempPath { get; set; }
  59. /// <summary>
  60. /// Gets or sets the path to the fallback font.
  61. /// </summary>
  62. public string FallbackFontPath { get; set; }
  63. /// <summary>
  64. /// Gets or sets a value indicating whether to use the fallback font.
  65. /// </summary>
  66. public bool EnableFallbackFont { get; set; }
  67. /// <summary>
  68. /// Gets or sets the audio boost applied when downmixing audio.
  69. /// </summary>
  70. public double DownMixAudioBoost { get; set; }
  71. /// <summary>
  72. /// Gets or sets the algorithm used for downmixing audio to stereo.
  73. /// </summary>
  74. public DownMixStereoAlgorithms DownMixStereoAlgorithm { get; set; }
  75. /// <summary>
  76. /// Gets or sets the maximum size of the muxing queue.
  77. /// </summary>
  78. public int MaxMuxingQueueSize { get; set; }
  79. /// <summary>
  80. /// Gets or sets a value indicating whether throttling is enabled.
  81. /// </summary>
  82. public bool EnableThrottling { get; set; }
  83. /// <summary>
  84. /// Gets or sets the delay after which throttling happens.
  85. /// </summary>
  86. public int ThrottleDelaySeconds { get; set; }
  87. /// <summary>
  88. /// Gets or sets the hardware acceleration type.
  89. /// </summary>
  90. public string HardwareAccelerationType { get; set; }
  91. /// <summary>
  92. /// Gets or sets the FFmpeg path as set by the user via the UI.
  93. /// </summary>
  94. public string EncoderAppPath { get; set; }
  95. /// <summary>
  96. /// Gets or sets the current FFmpeg path being used by the system and displayed on the transcode page.
  97. /// </summary>
  98. public string EncoderAppPathDisplay { get; set; }
  99. /// <summary>
  100. /// Gets or sets the VA-API device.
  101. /// </summary>
  102. public string VaapiDevice { get; set; }
  103. /// <summary>
  104. /// Gets or sets a value indicating whether tonemapping is enabled.
  105. /// </summary>
  106. public bool EnableTonemapping { get; set; }
  107. /// <summary>
  108. /// Gets or sets a value indicating whether VPP tonemapping is enabled.
  109. /// </summary>
  110. public bool EnableVppTonemapping { get; set; }
  111. /// <summary>
  112. /// Gets or sets the tone-mapping algorithm.
  113. /// </summary>
  114. public string TonemappingAlgorithm { get; set; }
  115. /// <summary>
  116. /// Gets or sets the tone-mapping range.
  117. /// </summary>
  118. public string TonemappingRange { get; set; }
  119. /// <summary>
  120. /// Gets or sets the tone-mapping desaturation.
  121. /// </summary>
  122. public double TonemappingDesat { get; set; }
  123. /// <summary>
  124. /// Gets or sets the tone-mapping threshold.
  125. /// </summary>
  126. public double TonemappingThreshold { get; set; }
  127. /// <summary>
  128. /// Gets or sets the tone-mapping peak.
  129. /// </summary>
  130. public double TonemappingPeak { get; set; }
  131. /// <summary>
  132. /// Gets or sets the tone-mapping parameters.
  133. /// </summary>
  134. public double TonemappingParam { get; set; }
  135. /// <summary>
  136. /// Gets or sets the VPP tone-mapping brightness.
  137. /// </summary>
  138. public double VppTonemappingBrightness { get; set; }
  139. /// <summary>
  140. /// Gets or sets the VPP tone-mapping contrast.
  141. /// </summary>
  142. public double VppTonemappingContrast { get; set; }
  143. /// <summary>
  144. /// Gets or sets the H264 CRF.
  145. /// </summary>
  146. public int H264Crf { get; set; }
  147. /// <summary>
  148. /// Gets or sets the H265 CRF.
  149. /// </summary>
  150. public int H265Crf { get; set; }
  151. /// <summary>
  152. /// Gets or sets the encoder preset.
  153. /// </summary>
  154. public string EncoderPreset { get; set; }
  155. /// <summary>
  156. /// Gets or sets a value indicating whether the framerate is doubled when deinterlacing.
  157. /// </summary>
  158. public bool DeinterlaceDoubleRate { get; set; }
  159. /// <summary>
  160. /// Gets or sets the deinterlace method.
  161. /// </summary>
  162. public string DeinterlaceMethod { get; set; }
  163. /// <summary>
  164. /// Gets or sets a value indicating whether 10bit HEVC decoding is enabled.
  165. /// </summary>
  166. public bool EnableDecodingColorDepth10Hevc { get; set; }
  167. /// <summary>
  168. /// Gets or sets a value indicating whether 10bit VP9 decoding is enabled.
  169. /// </summary>
  170. public bool EnableDecodingColorDepth10Vp9 { get; set; }
  171. /// <summary>
  172. /// Gets or sets a value indicating whether the enhanced NVDEC is enabled.
  173. /// </summary>
  174. public bool EnableEnhancedNvdecDecoder { get; set; }
  175. /// <summary>
  176. /// Gets or sets a value indicating whether the system native hardware decoder should be used.
  177. /// </summary>
  178. public bool PreferSystemNativeHwDecoder { get; set; }
  179. /// <summary>
  180. /// Gets or sets a value indicating whether the Intel H264 low-power hardware encoder should be used.
  181. /// </summary>
  182. public bool EnableIntelLowPowerH264HwEncoder { get; set; }
  183. /// <summary>
  184. /// Gets or sets a value indicating whether the Intel HEVC low-power hardware encoder should be used.
  185. /// </summary>
  186. public bool EnableIntelLowPowerHevcHwEncoder { get; set; }
  187. /// <summary>
  188. /// Gets or sets a value indicating whether hardware encoding is enabled.
  189. /// </summary>
  190. public bool EnableHardwareEncoding { get; set; }
  191. /// <summary>
  192. /// Gets or sets a value indicating whether HEVC encoding is enabled.
  193. /// </summary>
  194. public bool AllowHevcEncoding { get; set; }
  195. /// <summary>
  196. /// Gets or sets a value indicating whether subtitle extraction is enabled.
  197. /// </summary>
  198. public bool EnableSubtitleExtraction { get; set; }
  199. /// <summary>
  200. /// Gets or sets the codecs hardware encoding is used for.
  201. /// </summary>
  202. public string[] HardwareDecodingCodecs { get; set; }
  203. /// <summary>
  204. /// Gets or sets the file extensions on-demand metadata based keyframe extraction is enabled for.
  205. /// </summary>
  206. public string[] AllowOnDemandMetadataBasedKeyframeExtractionForExtensions { get; set; }
  207. }