From ec91142c855571f44c06b7ce6ef753ee9b69a1d5 Mon Sep 17 00:00:00 2001 From: Qstick Date: Mon, 15 Jan 2024 21:11:45 -0600 Subject: [PATCH] Fixed: Only use frames for Primary video stream for analysis (cherry picked from commit 581828b0dcfcd4aa1ae581b899f812071457c9ca) --- src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs | 4 ++-- src/NzbDrone.Core/Organizer/FileNameBuilder.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs index 296c7632e..58674b44d 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo private readonly List _pixelFormats; public const int MINIMUM_MEDIA_INFO_SCHEMA_REVISION = 8; - public const int CURRENT_MEDIA_INFO_SCHEMA_REVISION = 9; + public const int CURRENT_MEDIA_INFO_SCHEMA_REVISION = 10; private static readonly string[] ValidHdrColourPrimaries = { "bt2020" }; private static readonly string[] HlgTransferFunctions = { "bt2020-10", "arib-std-b67" }; @@ -117,7 +117,7 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo // if it looks like PQ10 or similar HDR, do a frame analysis to figure out which type it is if (PqTransferFunctions.Contains(mediaInfoModel.VideoTransferCharacteristics)) { - var frameOutput = FFProbe.GetFrameJson(filename, ffOptions: new () { ExtraArguments = "-read_intervals \"%+#1\" -select_streams v" }); + var frameOutput = FFProbe.GetFrameJson(filename, ffOptions: new () { ExtraArguments = $"-read_intervals \"%+#1\" -select_streams v:{primaryVideoStream?.Index ?? 0}" }); mediaInfoModel.RawFrameData = frameOutput; frames = FFProbe.AnalyseFrameJson(frameOutput); diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs index 1560150f0..791469fd6 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs @@ -686,7 +686,7 @@ namespace NzbDrone.Core.Organizer new Dictionary(FileNameBuilderTokenEqualityComparer.Instance) { { MediaInfoVideoDynamicRangeToken, 5 }, - { MediaInfoVideoDynamicRangeTypeToken, 9 } + { MediaInfoVideoDynamicRangeTypeToken, 10 } }; private void AddMediaInfoTokens(Dictionary> tokenHandlers, EpisodeFile episodeFile)