From 812300ad333a8ee844ba1c5e7facbe35c98f983c Mon Sep 17 00:00:00 2001 From: Orry Verducci Date: Sun, 22 Nov 2020 16:54:41 +0000 Subject: Revert "Fix frame rate probing for interlaced MKV files" This reverts commit 84fd5a09532bd1e854ec3745609f845aa7098da2. --- MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs') diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index cdeefbbbd..22537a4d9 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -666,16 +666,6 @@ namespace MediaBrowser.MediaEncoding.Probing stream.AverageFrameRate = GetFrameRate(streamInfo.AverageFrameRate); stream.RealFrameRate = GetFrameRate(streamInfo.RFrameRate); - // Interlaced video streams in Matroska containers return the field rate instead of the frame rate - // as both the average and real frame rate, so we half the returned frame rates to get the correct values - // - // https://gitlab.com/mbunkus/mkvtoolnix/-/wikis/Wrong-frame-rate-displayed - if (stream.IsInterlaced && formatInfo.FormatName.Contains("matroska", StringComparison.OrdinalIgnoreCase)) - { - stream.AverageFrameRate /= 2; - stream.RealFrameRate /= 2; - } - if (isAudio || string.Equals(stream.Codec, "gif", StringComparison.OrdinalIgnoreCase) || string.Equals(stream.Codec, "png", StringComparison.OrdinalIgnoreCase)) { -- cgit v1.2.3 From 92118c2129ec8175665e65dcd78c1400fbe60c80 Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Sun, 29 Nov 2020 22:46:26 +0800 Subject: allow to extract music bitrate info from formatInfo --- MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs') diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 97d61441c..27bd693e3 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -778,7 +778,11 @@ namespace MediaBrowser.MediaEncoding.Probing } } - if (bitrate == 0 && formatInfo != null && !string.IsNullOrEmpty(formatInfo.BitRate) && stream.Type == MediaStreamType.Video) + // The bitrate info of FLAC musics and some videos is included in formatInfo. + if (bitrate == 0 + && formatInfo != null + && !string.IsNullOrEmpty(formatInfo.BitRate) + && (stream.Type == MediaStreamType.Video || stream.Type == MediaStreamType.Audio)) { // If the stream info doesn't have a bitrate get the value from the media format info if (int.TryParse(formatInfo.BitRate, NumberStyles.Any, _usCulture, out var value)) -- cgit v1.2.3 From 6536c81226d5348f587119aa46635b32cc7a807e Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Tue, 1 Dec 2020 10:53:56 +0800 Subject: do not extract audio stream bitrate info for videos from formatInfo --- MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs') diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 27bd693e3..bd026bce1 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -782,7 +782,7 @@ namespace MediaBrowser.MediaEncoding.Probing if (bitrate == 0 && formatInfo != null && !string.IsNullOrEmpty(formatInfo.BitRate) - && (stream.Type == MediaStreamType.Video || stream.Type == MediaStreamType.Audio)) + && (stream.Type == MediaStreamType.Video || (isAudio && stream.Type == MediaStreamType.Audio))) { // If the stream info doesn't have a bitrate get the value from the media format info if (int.TryParse(formatInfo.BitRate, NumberStyles.Any, _usCulture, out var value)) -- cgit v1.2.3