EncodingOptions.cs 8.8 KB

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