From af02f9d692a74749921815ab356c1180fcae6f08 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 23 Aug 2017 14:44:40 -0400 Subject: [PATCH] add mpdecimate option --- .../LiveTv/TunerHosts/M3UTunerHost.cs | 1 + .../MediaEncoding/EncodingHelper.cs | 10 ++++++++++ .../MediaEncoding/EncodingJobInfo.cs | 5 +++++ MediaBrowser.Model/Dto/MediaSourceInfo.cs | 1 + MediaBrowser.Model/LiveTv/LiveTvOptions.cs | 1 + 5 files changed, 18 insertions(+) diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs index 1bc334f06..eac845579 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs @@ -165,6 +165,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts RequiresOpening = true, RequiresClosing = true, RequiresLooping = info.EnableStreamLooping, + EnableMpDecimate = info.EnableMpDecimate, ReadAtNativeFramerate = false, diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index d99103852..736f1b32f 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -778,6 +778,11 @@ namespace MediaBrowser.Controller.MediaEncoding return false; } + if (state.EnableMpDecimate) + { + return false; + } + if (videoStream.IsInterlaced) { if (request.DeInterlace) @@ -1449,6 +1454,11 @@ namespace MediaBrowser.Controller.MediaEncoding } } + if (state.EnableMpDecimate) + { + filters.Add("mpdecimate,setpts=N/FRAME_RATE/TB"); + } + if (filters.Count > 0) { output += string.Format(" -vf \"{0}\"", string.Join(",", filters.ToArray())); diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs index c2ce96979..e76217fda 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs @@ -127,6 +127,11 @@ namespace MediaBrowser.Controller.MediaEncoding } } + public bool EnableMpDecimate + { + get { return MediaSource.EnableMpDecimate; } + } + public string AlbumCoverPath { get; set; } public string InputAudioSync { get; set; } diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.cs index 488b1e7a8..8f3f0648d 100644 --- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs +++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs @@ -41,6 +41,7 @@ namespace MediaBrowser.Model.Dto public string OpenToken { get; set; } public bool RequiresClosing { get; set; } public bool SupportsProbing { get; set; } + public bool EnableMpDecimate { get; set; } public string LiveStreamId { get; set; } public int? BufferMs { get; set; } diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs index 15f60d831..2c2f22e86 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs @@ -47,6 +47,7 @@ namespace MediaBrowser.Model.LiveTv public bool ImportFavoritesOnly { get; set; } public bool AllowHWTranscoding { get; set; } public bool EnableStreamLooping { get; set; } + public bool EnableMpDecimate { get; set; } public bool EnableNewHdhrChannelIds { get; set; } public string Source { get; set; }