EncodingOptions.cs 8.4 KB

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