aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasily <just.one.man@yandex.ru>2019-10-14 13:13:04 +0300
committerVasily <just.one.man@yandex.ru>2019-10-14 13:22:53 +0300
commit3132280b0748efd6ded7d8c9d8795506ef8c30ed (patch)
tree7f76e8e781396ab49bedc58eb027d6d3f2aaee45
parent1bd12083c3d7eda02bd7e3b785f4853620dc6cc9 (diff)
* Make sure force_key_frames expression arguments are properly converted to strings
* Fore usage of keyframe cuts only in HLS
-rw-r--r--MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
index 8cbe4af1e8..1b93eaaa57 100644
--- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
@@ -925,7 +925,7 @@ namespace MediaBrowser.Api.Playback.Hls
{
var keyFrameArg = string.Format(
" -force_key_frames:0 \"expr:gte(t,{0}+n_forced*{1})\"",
- GetStartNumber(state) * state.SegmentLength,
+ (GetStartNumber(state) * state.SegmentLength).ToString(CultureInfo.InvariantCulture),
state.SegmentLength.ToString(CultureInfo.InvariantCulture));
if (state.TargetFramerate.HasValue)
{
@@ -936,7 +936,7 @@ namespace MediaBrowser.Api.Playback.Hls
// be created outside of segment, which breaks seeking.
keyFrameArg += string.Format(
" -g {0} -keyint_min {0}",
- (int)(state.SegmentLength * state.TargetFramerate)
+ ((int)(state.SegmentLength * state.TargetFramerate)).ToString(CultureInfo.InvariantCulture)
);
}
@@ -982,6 +982,15 @@ namespace MediaBrowser.Api.Playback.Hls
var threads = EncodingHelper.GetNumberOfThreads(state, encodingOptions, videoCodec);
+ if (state.BaseRequest.BreakOnNonKeyFrames)
+ {
+ // FIXME: this is actually a workaround, as ideally it really should be the client which decides whether non-keyframe
+ // breakpoints are supported; but current implementation always uses "ffmpeg input seeking" which is liable
+ // to produce a missing part of video stream before first keyframe is encountered, which may lead to
+ // awkward cases like a few starting HLS segments having no video whatsoever, which breaks hls.js
+ Logger.LogInformation("Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request");
+ state.BaseRequest.BreakOnNonKeyFrames = false;
+ }
var inputModifier = EncodingHelper.GetInputModifier(state, encodingOptions);
// If isEncoding is true we're actually starting ffmpeg