add yadif setting

This commit is contained in:
Luke Pulverenti 2017-09-17 02:42:23 -04:00
parent 3a1efe9edc
commit 1f12ab6658
3 changed files with 23 additions and 14 deletions

View File

@ -285,7 +285,14 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{ {
var filters = new List<string>(); var filters = new List<string>();
if (string.Equals(GetEncodingOptions().DeinterlaceMethod, "bobandweave", StringComparison.OrdinalIgnoreCase))
{
filters.Add("yadif=1:-1:0");
}
else
{
filters.Add("yadif=0:-1:0"); filters.Add("yadif=0:-1:0");
}
var output = string.Empty; var output = string.Empty;

View File

@ -1288,10 +1288,7 @@ namespace MediaBrowser.Controller.MediaEncoding
/// <summary> /// <summary>
/// Gets the internal graphical subtitle param. /// Gets the internal graphical subtitle param.
/// </summary> /// </summary>
/// <param name="state">The state.</param> public string GetGraphicalSubtitleParam(EncodingJobInfo state, EncodingOptions options, string outputVideoCodec)
/// <param name="outputVideoCodec">The output video codec.</param>
/// <returns>System.String.</returns>
public string GetGraphicalSubtitleParam(EncodingJobInfo state, string outputVideoCodec)
{ {
var outputSizeParam = string.Empty; var outputSizeParam = string.Empty;
@ -1300,7 +1297,7 @@ namespace MediaBrowser.Controller.MediaEncoding
// Add resolution params, if specified // Add resolution params, if specified
if (request.Width.HasValue || request.Height.HasValue || request.MaxHeight.HasValue || request.MaxWidth.HasValue) if (request.Width.HasValue || request.Height.HasValue || request.MaxHeight.HasValue || request.MaxWidth.HasValue)
{ {
outputSizeParam = GetOutputSizeParam(state, outputVideoCodec).TrimEnd('"'); outputSizeParam = GetOutputSizeParam(state, options, outputVideoCodec).TrimEnd('"');
if (string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase)) if (string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase))
{ {
@ -1343,11 +1340,8 @@ namespace MediaBrowser.Controller.MediaEncoding
/// <summary> /// <summary>
/// If we're going to put a fixed size on the command line, this will calculate it /// If we're going to put a fixed size on the command line, this will calculate it
/// </summary> /// </summary>
/// <param name="state">The state.</param>
/// <param name="outputVideoCodec">The output video codec.</param>
/// <param name="allowTimeStampCopy">if set to <c>true</c> [allow time stamp copy].</param>
/// <returns>System.String.</returns>
public string GetOutputSizeParam(EncodingJobInfo state, public string GetOutputSizeParam(EncodingJobInfo state,
EncodingOptions options,
string outputVideoCodec, string outputVideoCodec,
bool allowTimeStampCopy = true) bool allowTimeStampCopy = true)
{ {
@ -1364,9 +1358,16 @@ namespace MediaBrowser.Controller.MediaEncoding
} }
if (state.DeInterlace && !string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase)) if (state.DeInterlace && !string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase))
{
if (string.Equals(options.DeinterlaceMethod, "bobandweave", StringComparison.OrdinalIgnoreCase))
{
filters.Add("yadif=1:-1:0");
}
else
{ {
filters.Add("yadif=0:-1:0"); filters.Add("yadif=0:-1:0");
} }
}
if (string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase)) if (string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase))
{ {
@ -2092,7 +2093,7 @@ namespace MediaBrowser.Controller.MediaEncoding
// Add resolution params, if specified // Add resolution params, if specified
if (!hasGraphicalSubs) if (!hasGraphicalSubs)
{ {
var outputSizeParam = GetOutputSizeParam(state, videoCodec); var outputSizeParam = GetOutputSizeParam(state, encodingOptions, videoCodec);
args += outputSizeParam; args += outputSizeParam;
hasCopyTs = outputSizeParam.IndexOf("copyts", StringComparison.OrdinalIgnoreCase) != -1; hasCopyTs = outputSizeParam.IndexOf("copyts", StringComparison.OrdinalIgnoreCase) != -1;
} }
@ -2116,7 +2117,7 @@ namespace MediaBrowser.Controller.MediaEncoding
// This is for internal graphical subs // This is for internal graphical subs
if (hasGraphicalSubs) if (hasGraphicalSubs)
{ {
args += GetGraphicalSubtitleParam(state, videoCodec); args += GetGraphicalSubtitleParam(state, encodingOptions, videoCodec);
} }
if (!state.RunTimeTicks.HasValue) if (!state.RunTimeTicks.HasValue)

View File

@ -13,6 +13,7 @@ namespace MediaBrowser.Model.Configuration
public string VaapiDevice { get; set; } public string VaapiDevice { get; set; }
public int H264Crf { get; set; } public int H264Crf { get; set; }
public string H264Preset { get; set; } public string H264Preset { get; set; }
public string DeinterlaceMethod { get; set; }
public bool EnableHardwareEncoding { get; set; } public bool EnableHardwareEncoding { get; set; }
public bool EnableSubtitleExtraction { get; set; } public bool EnableSubtitleExtraction { get; set; }