update progressive encoding

pull/702/head
Luke Pulverenti 9 years ago
parent 521cfa9584
commit fcd15da1e6

@ -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,16 +1208,11 @@ 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.Empty;
}

@ -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)

@ -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";

@ -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)

@ -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))
{

@ -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,16 +736,11 @@ 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.Empty;
}

@ -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))
{

Loading…
Cancel
Save