EncodingOptions.cs 8.6 KB

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