diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-10-25 21:26:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-25 21:26:04 +0100 |
| commit | 655a4f8600067046b3a689c84a9e7a0cc42b5939 (patch) | |
| tree | 2b6e6fe50f1eb3b55aac390ca6fba31808b4ff3d | |
| parent | a69397d7141a6f8fde840cb53516244785243de8 (diff) | |
| parent | 84fd5a09532bd1e854ec3745609f845aa7098da2 (diff) | |
Merge pull request #4369 from orryverducci/mkv-interlaced-fix
Fix frame rate probing for interlaced MKV files
| -rw-r--r-- | MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 22537a4d9..cdeefbbbd 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -666,6 +666,16 @@ 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)) { |
