Merge pull request #2604 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2017-04-30 16:08:25 -04:00 committed by GitHub
commit f7302f3663
8 changed files with 57 additions and 23 deletions

View File

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

View File

@ -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<string>();
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))

View File

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

View File

@ -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,20 +37,16 @@ namespace MediaBrowser.Model.Dlna
}
}
foreach (var config in Configurations)
{
if (outputBitrate <= config.MaxBitrate)
var resolutionConfig = GetResolutionConfiguration(outputBitrate);
if (resolutionConfig != null)
{
var originvalValue = maxWidth;
maxWidth = Math.Min(config.MaxWidth, maxWidth ?? config.MaxWidth);
maxWidth = Math.Min(resolutionConfig.MaxWidth, maxWidth ?? resolutionConfig.MaxWidth);
if (!originvalValue.HasValue || originvalValue.Value != maxWidth.Value)
{
maxHeight = null;
}
break;
}
}
return new ResolutionOptions
@ -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") ||

View File

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

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
<version>3.0.698</version>
<version>3.0.699</version>
<title>Emby.Common</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Server.Core</id>
<version>3.0.698</version>
<version>3.0.699</version>
<title>Emby.Server.Core</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Emby Server.</description>
<copyright>Copyright © Emby 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.696" />
<dependency id="MediaBrowser.Common" version="3.0.699" />
</dependencies>
</metadata>
<files>

View File

@ -1,3 +1,3 @@
using System.Reflection;
[assembly: AssemblyVersion("3.2.13.8")]
[assembly: AssemblyVersion("3.2.13.9")]