aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Configuration/EncodingOptions.cs
blob: b43e0f024b045aa54e47866f2fc483583b27ffca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
#nullable disable
using MediaBrowser.Model.Entities;

namespace MediaBrowser.Model.Configuration;

/// <summary>
/// Class EncodingOptions.
/// </summary>
public class EncodingOptions
{
    /// <summary>
    /// Initializes a new instance of the <see cref="EncodingOptions" /> class.
    /// </summary>
    public EncodingOptions()
    {
        EnableFallbackFont = false;
        EnableAudioVbr = false;
        DownMixAudioBoost = 2;
        DownMixStereoAlgorithm = DownMixStereoAlgorithms.None;
        MaxMuxingQueueSize = 2048;
        EnableThrottling = false;
        ThrottleDelaySeconds = 180;
        EncodingThreadCount = -1;
        // This is a DRM device that is almost guaranteed to be there on every intel platform,
        // plus it's the default one in ffmpeg if you don't specify anything
        VaapiDevice = "/dev/dri/renderD128";
        EnableTonemapping = false;
        EnableVppTonemapping = false;
        TonemappingAlgorithm = "bt2390";
        TonemappingRange = "auto";
        TonemappingDesat = 0;
        TonemappingThreshold = 0.8;
        TonemappingPeak = 100;
        TonemappingParam = 0;
        VppTonemappingBrightness = 0;
        VppTonemappingContrast = 1.2;
        H264Crf = 23;
        H265Crf = 28;
        DeinterlaceDoubleRate = false;
        DeinterlaceMethod = "yadif";
        EnableDecodingColorDepth10Hevc = true;
        EnableDecodingColorDepth10Vp9 = true;
        EnableEnhancedNvdecDecoder = false;
        PreferSystemNativeHwDecoder = true;
        EnableIntelLowPowerH264HwEncoder = false;
        EnableIntelLowPowerHevcHwEncoder = false;
        EnableHardwareEncoding = true;
        AllowHevcEncoding = false;
        EnableSubtitleExtraction = true;
        AllowOnDemandMetadataBasedKeyframeExtractionForExtensions = new[] { "mkv" };
        HardwareDecodingCodecs = new string[] { "h264", "vc1" };
    }

    /// <summary>
    /// Gets or sets the thread count used for encoding.
    /// </summary>
    public int EncodingThreadCount { get; set; }

    /// <summary>
    /// Gets or sets the temporary transcoding path.
    /// </summary>
    public string TranscodingTempPath { get; set; }

    /// <summary>
    /// Gets or sets the path to the fallback font.
    /// </summary>
    public string FallbackFontPath { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether to use the fallback font.
    /// </summary>
    public bool EnableFallbackFont { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether audio VBR is enabled.
    /// </summary>
    public bool EnableAudioVbr { get; set; }

    /// <summary>
    /// Gets or sets the audio boost applied when downmixing audio.
    /// </summary>
    public double DownMixAudioBoost { get; set; }

    /// <summary>
    /// Gets or sets the algorithm used for downmixing audio to stereo.
    /// </summary>
    public DownMixStereoAlgorithms DownMixStereoAlgorithm { get; set; }

    /// <summary>
    /// Gets or sets the maximum size of the muxing queue.
    /// </summary>
    public int MaxMuxingQueueSize { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether throttling is enabled.
    /// </summary>
    public bool EnableThrottling { get; set; }

    /// <summary>
    /// Gets or sets the delay after which throttling happens.
    /// </summary>
    public int ThrottleDelaySeconds { get; set; }

    /// <summary>
    /// Gets or sets the hardware acceleration type.
    /// </summary>
    public string HardwareAccelerationType { get; set; }

    /// <summary>
    /// Gets or sets the FFmpeg path as set by the user via the UI.
    /// </summary>
    public string EncoderAppPath { get; set; }

    /// <summary>
    /// Gets or sets the current FFmpeg path being used by the system and displayed on the transcode page.
    /// </summary>
    public string EncoderAppPathDisplay { get; set; }

    /// <summary>
    /// Gets or sets the VA-API device.
    /// </summary>
    public string VaapiDevice { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether tonemapping is enabled.
    /// </summary>
    public bool EnableTonemapping { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether VPP tonemapping is enabled.
    /// </summary>
    public bool EnableVppTonemapping { get; set; }

    /// <summary>
    /// Gets or sets the tone-mapping algorithm.
    /// </summary>
    public string TonemappingAlgorithm { get; set; }

    /// <summary>
    /// Gets or sets the tone-mapping range.
    /// </summary>
    public string TonemappingRange { get; set; }

    /// <summary>
    /// Gets or sets the tone-mapping desaturation.
    /// </summary>
    public double TonemappingDesat { get; set; }

    /// <summary>
    /// Gets or sets the tone-mapping threshold.
    /// </summary>
    public double TonemappingThreshold { get; set; }

    /// <summary>
    /// Gets or sets the tone-mapping peak.
    /// </summary>
    public double TonemappingPeak { get; set; }

    /// <summary>
    /// Gets or sets the tone-mapping parameters.
    /// </summary>
    public double TonemappingParam { get; set; }

    /// <summary>
    /// Gets or sets the VPP tone-mapping brightness.
    /// </summary>
    public double VppTonemappingBrightness { get; set; }

    /// <summary>
    /// Gets or sets the VPP tone-mapping contrast.
    /// </summary>
    public double VppTonemappingContrast { get; set; }

    /// <summary>
    /// Gets or sets the H264 CRF.
    /// </summary>
    public int H264Crf { get; set; }

    /// <summary>
    /// Gets or sets the H265 CRF.
    /// </summary>
    public int H265Crf { get; set; }

    /// <summary>
    /// Gets or sets the encoder preset.
    /// </summary>
    public string EncoderPreset { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether the framerate is doubled when deinterlacing.
    /// </summary>
    public bool DeinterlaceDoubleRate { get; set; }

    /// <summary>
    /// Gets or sets the deinterlace method.
    /// </summary>
    public string DeinterlaceMethod { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether 10bit HEVC decoding is enabled.
    /// </summary>
    public bool EnableDecodingColorDepth10Hevc { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether 10bit VP9 decoding is enabled.
    /// </summary>
    public bool EnableDecodingColorDepth10Vp9 { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether the enhanced NVDEC is enabled.
    /// </summary>
    public bool EnableEnhancedNvdecDecoder { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether the system native hardware decoder should be used.
    /// </summary>
    public bool PreferSystemNativeHwDecoder { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether the Intel H264 low-power hardware encoder should be used.
    /// </summary>
    public bool EnableIntelLowPowerH264HwEncoder { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether the Intel HEVC low-power hardware encoder should be used.
    /// </summary>
    public bool EnableIntelLowPowerHevcHwEncoder { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether hardware encoding is enabled.
    /// </summary>
    public bool EnableHardwareEncoding { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether HEVC encoding is enabled.
    /// </summary>
    public bool AllowHevcEncoding { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether subtitle extraction is enabled.
    /// </summary>
    public bool EnableSubtitleExtraction { get; set; }

    /// <summary>
    /// Gets or sets the codecs hardware encoding is used for.
    /// </summary>
    public string[] HardwareDecodingCodecs { get; set; }

    /// <summary>
    /// Gets or sets the file extensions on-demand metadata based keyframe extraction is enabled for.
    /// </summary>
    public string[] AllowOnDemandMetadataBasedKeyframeExtractionForExtensions { get; set; }
}