diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs index 0a21603ee..d724a9fbc 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs @@ -420,7 +420,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun SupportsDirectPlay = false, SupportsDirectStream = true, SupportsTranscoding = true, - IsInfiniteStream = true + IsInfiniteStream = true, + IgnoreDts = true }; mediaSource.InferTotalBitrate(); diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 8821b6f1f..8cacfd3aa 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -1517,12 +1517,6 @@ namespace MediaBrowser.Controller.MediaEncoding inputModifier += " " + GetFastSeekCommandLineParameter(state.BaseRequest); inputModifier = inputModifier.Trim(); - //inputModifier += " -fflags +genpts+ignidx+igndts"; - //if (state.IsVideoRequest && genPts) - //{ - // inputModifier += " -fflags +genpts"; - //} - if (!string.IsNullOrEmpty(state.InputAudioSync)) { inputModifier += " -async " + state.InputAudioSync; @@ -1538,6 +1532,21 @@ namespace MediaBrowser.Controller.MediaEncoding inputModifier += " -re"; } + var flags = new List(); + if (state.IgnoreDts) + { + flags.Add("+igndts"); + } + if (state.IgnoreIndex) + { + flags.Add("+ignidx"); + } + + if (flags.Count > 0) + { + inputModifier += " -fflags " + string.Join("", flags.ToArray()); + } + var videoDecoder = GetVideoDecoder(state, encodingOptions); if (!string.IsNullOrWhiteSpace(videoDecoder)) { @@ -1633,6 +1642,7 @@ namespace MediaBrowser.Controller.MediaEncoding state.RunTimeTicks = mediaSource.RunTimeTicks; state.RemoteHttpHeaders = mediaSource.RequiredHttpHeaders; state.ReadInputAtNativeFramerate = mediaSource.ReadAtNativeFramerate; + state.IgnoreDts = mediaSource.IgnoreDts; if (state.ReadInputAtNativeFramerate || mediaSource.Protocol == MediaProtocol.File && string.Equals(mediaSource.Container, "wtv", StringComparison.OrdinalIgnoreCase)) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs index 658608906..28ada9dae 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs @@ -39,6 +39,16 @@ namespace MediaBrowser.Controller.MediaEncoding public bool ReadInputAtNativeFramerate { get; set; } + public bool IgnoreDts + { + get { return MediaSource.IgnoreDts; } + } + + public bool IgnoreIndex + { + get { return MediaSource.IgnoreIndex; } + } + public string OutputContainer { get; set; } public string OutputVideoSync diff --git a/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs b/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs index b0760d91f..950d3680d 100644 --- a/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs +++ b/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs @@ -12,7 +12,9 @@ namespace MediaBrowser.Model.Dlna new ResolutionConfiguration(426, 320000), new ResolutionConfiguration(640, 400000), new ResolutionConfiguration(720, 950000), - new ResolutionConfiguration(1280, 2500000) + new ResolutionConfiguration(1280, 2500000), + new ResolutionConfiguration(1920, 4000000), + new ResolutionConfiguration(3840, 35000000) }; public static ResolutionOptions Normalize(int? inputBitrate, @@ -35,19 +37,15 @@ namespace MediaBrowser.Model.Dlna } } - foreach (var config in Configurations) + var resolutionConfig = GetResolutionConfiguration(outputBitrate); + if (resolutionConfig != null) { - if (outputBitrate <= config.MaxBitrate) + var originvalValue = maxWidth; + + maxWidth = Math.Min(resolutionConfig.MaxWidth, maxWidth ?? resolutionConfig.MaxWidth); + if (!originvalValue.HasValue || originvalValue.Value != maxWidth.Value) { - var originvalValue = maxWidth; - - maxWidth = Math.Min(config.MaxWidth, maxWidth ?? config.MaxWidth); - if (!originvalValue.HasValue || originvalValue.Value != maxWidth.Value) - { - maxHeight = null; - } - - break; + maxHeight = null; } } @@ -58,6 +56,19 @@ namespace MediaBrowser.Model.Dlna }; } + private static ResolutionConfiguration GetResolutionConfiguration(int outputBitrate) + { + foreach (var config in Configurations) + { + if (outputBitrate <= config.MaxBitrate) + { + return config; + } + } + + return null; + } + private static double GetVideoBitrateScaleFactor(string codec) { if (StringHelper.EqualsIgnoreCase(codec, "h265") || diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.cs index 131583024..d0655d90b 100644 --- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs +++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs @@ -29,6 +29,8 @@ namespace MediaBrowser.Model.Dto public string ETag { get; set; } public long? RunTimeTicks { get; set; } public bool ReadAtNativeFramerate { get; set; } + public bool IgnoreDts { get; set; } + public bool IgnoreIndex { get; set; } public bool SupportsTranscoding { get; set; } public bool SupportsDirectStream { get; set; } public bool SupportsDirectPlay { get; set; } diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 20681b317..c86e9a71c 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.698 + 3.0.699 Emby.Common Emby Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 7b5f348c8..f68cf4e41 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.698 + 3.0.699 Emby.Server.Core Emby Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Emby Server. Copyright © Emby 2013 - +