update progressive encoding

This commit is contained in:
Luke Pulverenti 2016-02-07 16:48:08 -05:00
parent 521cfa9584
commit fcd15da1e6
7 changed files with 17 additions and 29 deletions

View File

@ -305,9 +305,8 @@ namespace MediaBrowser.Api.Playback
/// </summary>
/// <param name="state">The state.</param>
/// <param name="videoCodec">The video codec.</param>
/// <param name="isHls">if set to <c>true</c> [is HLS].</param>
/// <returns>System.String.</returns>
protected string GetVideoQualityParam(StreamState state, string videoCodec, bool isHls)
protected string GetVideoQualityParam(StreamState state, string videoCodec)
{
var param = string.Empty;
@ -385,7 +384,7 @@ namespace MediaBrowser.Api.Playback
param = "-mbd 2";
}
param += GetVideoBitrateParam(state, videoCodec, isHls);
param += GetVideoBitrateParam(state, videoCodec);
var framerate = GetFramerateParam(state);
if (framerate.HasValue)
@ -1190,7 +1189,7 @@ namespace MediaBrowser.Api.Playback
return bitrate;
}
protected string GetVideoBitrateParam(StreamState state, string videoCodec, bool isHls)
protected string GetVideoBitrateParam(StreamState state, string videoCodec)
{
var bitrate = state.OutputVideoBitrate;
@ -1209,14 +1208,9 @@ namespace MediaBrowser.Api.Playback
}
// h264
if (isHls)
{
return string.Format(" -b:v {0} -maxrate {0} -bufsize {1}",
bitrate.Value.ToString(UsCulture),
(bitrate.Value * 2).ToString(UsCulture));
}
return string.Format(" -b:v {0}", bitrate.Value.ToString(UsCulture));
return string.Format(" -b:v {0} -maxrate {0} -bufsize {1}",
bitrate.Value.ToString(UsCulture),
(bitrate.Value * 2).ToString(UsCulture));
}
return string.Empty;

View File

@ -430,7 +430,7 @@ namespace MediaBrowser.Api.Playback.Dash
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream;
args += " " + GetVideoQualityParam(state, GetH264Encoder(state), true) + keyFrameArg;
args += " " + GetVideoQualityParam(state, GetH264Encoder(state)) + keyFrameArg;
// Add resolution params, if specified
if (!hasGraphicalSubs)

View File

@ -822,7 +822,7 @@ namespace MediaBrowser.Api.Playback.Hls
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream;
args += " " + GetVideoQualityParam(state, GetH264Encoder(state), true) + keyFrameArg;
args += " " + GetVideoQualityParam(state, GetH264Encoder(state)) + keyFrameArg;
//args += " -mixed-refs 0 -refs 3 -x264opts b_pyramid=0:weightb=0:weightp=0";

View File

@ -106,7 +106,7 @@ namespace MediaBrowser.Api.Playback.Hls
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream;
args += " " + GetVideoQualityParam(state, GetH264Encoder(state), true) + keyFrameArg;
args += " " + GetVideoQualityParam(state, GetH264Encoder(state)) + keyFrameArg;
// Add resolution params, if specified
if (!hasGraphicalSubs)

View File

@ -166,7 +166,7 @@ namespace MediaBrowser.Api.Playback.Progressive
args += GetOutputSizeParam(state, videoCodec);
}
var qualityParam = GetVideoQualityParam(state, videoCodec, false);
var qualityParam = GetVideoQualityParam(state, videoCodec);
if (!string.IsNullOrEmpty(qualityParam))
{

View File

@ -568,9 +568,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
/// </summary>
/// <param name="state">The state.</param>
/// <param name="videoCodec">The video codec.</param>
/// <param name="isHls">if set to <c>true</c> [is HLS].</param>
/// <returns>System.String.</returns>
protected string GetVideoQualityParam(EncodingJob state, string videoCodec, bool isHls)
protected string GetVideoQualityParam(EncodingJob state, string videoCodec)
{
var param = string.Empty;
@ -648,7 +647,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
param = "-mbd 2";
}
param += GetVideoBitrateParam(state, videoCodec, isHls);
param += GetVideoBitrateParam(state, videoCodec);
var framerate = GetFramerateParam(state);
if (framerate.HasValue)
@ -718,7 +717,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
return "-pix_fmt yuv420p " + param;
}
protected string GetVideoBitrateParam(EncodingJob state, string videoCodec, bool isHls)
protected string GetVideoBitrateParam(EncodingJob state, string videoCodec)
{
var bitrate = state.OutputVideoBitrate;
@ -737,14 +736,9 @@ namespace MediaBrowser.MediaEncoding.Encoder
}
// h264
if (isHls)
{
return string.Format(" -b:v {0} -maxrate {0} -bufsize {1}",
bitrate.Value.ToString(UsCulture),
(bitrate.Value * 2).ToString(UsCulture));
}
return string.Format(" -b:v {0}", bitrate.Value.ToString(UsCulture));
return string.Format(" -b:v {0} -maxrate {0} -bufsize {1}",
bitrate.Value.ToString(UsCulture),
(bitrate.Value * 2).ToString(UsCulture));
}
return string.Empty;

View File

@ -96,7 +96,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
args += GetOutputSizeParam(state, videoCodec);
}
var qualityParam = GetVideoQualityParam(state, videoCodec, false);
var qualityParam = GetVideoQualityParam(state, videoCodec);
if (!string.IsNullOrEmpty(qualityParam))
{