h264_qsv changes

This commit is contained in:
Luke Pulverenti 2015-01-13 23:02:57 -05:00
parent 87c23f145c
commit 7771b89c6a

View File

@ -349,6 +349,24 @@ namespace MediaBrowser.Api.Playback
}
}
// h264 (h264_qsv)
else if (string.Equals(videoCodec, "h264_qsv", StringComparison.OrdinalIgnoreCase))
{
switch (qualitySetting)
{
case EncodingQuality.HighSpeed:
param = "-preset 7";
break;
case EncodingQuality.HighQuality:
param = "-preset 4";
break;
case EncodingQuality.MaxQuality:
param = "-preset 1";
break;
}
}
// webm
else if (string.Equals(videoCodec, "libvpx", StringComparison.OrdinalIgnoreCase))
{
@ -567,6 +585,11 @@ namespace MediaBrowser.Api.Playback
}
}
if (string.Equals(outputVideoCodec, "h264_qsv", StringComparison.OrdinalIgnoreCase))
{
filters[filters.Count - 1] += ":flags=fast_bilinear";
}
var output = string.Empty;
if (state.SubtitleStream != null && state.SubtitleStream.IsTextSubtitleStream)
@ -1183,6 +1206,22 @@ namespace MediaBrowser.Api.Playback
return string.Format(" -b:v {0}", bitrate.Value.ToString(UsCulture));
}
// h264_qsv
if (string.Equals(videoCodec, "h264_qsv", StringComparison.OrdinalIgnoreCase))
{
if (hasFixedResolution)
{
if (isHls)
{
return string.Format(" -b:v {0} -maxrate ({0}*.80) -bufsize {0}", bitrate.Value.ToString(UsCulture));
}
return string.Format(" -b:v {0}", bitrate.Value.ToString(UsCulture));
}
return string.Format(" -b:v {0} -maxrate ({0}*1.2) -bufsize ({0}*2)", bitrate.Value.ToString(UsCulture));
}
// H264
if (hasFixedResolution)
{