diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index 419eeacf2..46470bbac 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -230,7 +230,7 @@ namespace MediaBrowser.Api.Playback.Hls { var probeSize = GetProbeSizeArgument(state.Item); - var args = string.Format("{0} {1} {2} -i {3}{4} -threads 0 {5} {6} {7} -hls_time 10 -start_number 0 -hls_list_size 1440 \"{8}\"", + var args = string.Format("{0} {1} {2} -i {3}{4} -threads 0 {5} {6} -sc_threshold 0 {7} -hls_time 10 -start_number 0 -hls_list_size 1440 \"{8}\"", probeSize, GetUserAgentParam(state.Item), GetFastSeekCommandLineParameter(state.Request), @@ -246,7 +246,7 @@ namespace MediaBrowser.Api.Playback.Hls { var lowBitratePath = Path.Combine(Path.GetDirectoryName(outputPath), Path.GetFileNameWithoutExtension(outputPath) + "-low.m3u8"); - var lowBitrateParams = string.Format(" -threads 0 -vn -codec:a:{1} aac -strict experimental -ac 2 -ab 64000 -hls_time 10 -start_number 0 -hls_list_size 1440 \"{0}\"", + var lowBitrateParams = string.Format(" -threads 0 -vn -codec:a:{1} libmp3lame -ac 2 -ab 32000 -hls_time 10 -start_number 0 -hls_list_size 1440 \"{0}\"", lowBitratePath, state.AudioStream.Index); diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs index 7dd98fc89..e541ae0fb 100644 --- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs @@ -180,7 +180,7 @@ namespace MediaBrowser.Api.Playback.Hls return IsH264(state.VideoStream) ? "-codec:v:0 copy -bsf h264_mp4toannexb" : "-codec:v:0 copy"; } - const string keyFrameArg = " -force_key_frames expr:if(isnan(prev_forced_t),gte(t,1),gte(t,prev_forced_t+5))"; + const string keyFrameArg = " -force_key_frames expr:if(isnan(prev_forced_t),gte(t,.1),gte(t,prev_forced_t+5))"; var args = "-codec:v:0 " + codec + " -preset superfast" + keyFrameArg; @@ -188,7 +188,7 @@ namespace MediaBrowser.Api.Playback.Hls if (bitrate.HasValue) { - args += string.Format(" -b:v {0} -maxrate {0} -minrate {0} -bufsize ({0}/10)", bitrate.Value.ToString(UsCulture)); + args += string.Format(" -b:v {0} -maxrate {0} -minrate {0} -bufsize ({0}/11)", bitrate.Value.ToString(UsCulture)); } // Add resolution params, if specified diff --git a/MediaBrowser.Api/Playback/Progressive/VideoService.cs b/MediaBrowser.Api/Playback/Progressive/VideoService.cs index 2ccbfa04e..18eb473f2 100644 --- a/MediaBrowser.Api/Playback/Progressive/VideoService.cs +++ b/MediaBrowser.Api/Playback/Progressive/VideoService.cs @@ -144,7 +144,7 @@ namespace MediaBrowser.Api.Playback.Progressive return state.VideoStream != null && IsH264(state.VideoStream) ? args + " -bsf h264_mp4toannexb" : args; } - const string keyFrameArg = " -force_key_frames expr:if(isnan(prev_forced_t),gte(t,1),gte(t,prev_forced_t+5))"; + const string keyFrameArg = " -force_key_frames expr:if(isnan(prev_forced_t),gte(t,.1),gte(t,prev_forced_t+5))"; args += keyFrameArg; @@ -285,7 +285,7 @@ namespace MediaBrowser.Api.Playback.Progressive if (bitrate.HasValue) { - args += " -b:v " + bitrate.Value.ToString(UsCulture); + args += string.Format(" -b:v {0} -maxrate {0} -minrate {0} -bufsize ({0}/11)", bitrate.Value.ToString(UsCulture)); } return args.Trim();