EncodingOptions.cs 9.0 KB

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