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