diff options
| author | Cody Robibero <cody@robibe.ro> | 2024-02-28 14:10:44 -0700 |
|---|---|---|
| committer | Cody Robibero <cody@robibe.ro> | 2024-02-28 14:10:44 -0700 |
| commit | c603cd2e4ef7fac0b458734e9555421a2f2c2a95 (patch) | |
| tree | caf1c3eaf25cf3a9bf42eaa5e0c63533ffc26c1a | |
| parent | 4f0f364ac941dc4a856512c9bf0e6b93fdf7b3ab (diff) | |
Always use ffmpeg codec for bluray
| -rw-r--r-- | MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs index 35ea04d21..5d0fccbe1 100644 --- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs +++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs @@ -324,20 +324,7 @@ namespace MediaBrowser.Providers.MediaInfo return; } - // Use BD Info if it has multiple m2ts. Otherwise, treat it like a video file and rely more on ffprobe output - int? currentHeight = null; - int? currentWidth = null; - int? currentBitRate = null; - - var videoStream = mediaStreams.FirstOrDefault(s => s.Type == MediaStreamType.Video); - - // Grab the values that ffprobe recorded - if (videoStream is not null) - { - currentBitRate = videoStream.BitRate; - currentWidth = videoStream.Width; - currentHeight = videoStream.Height; - } + var ffmpegVideoStream = mediaStreams.FirstOrDefault(s => s.Type == MediaStreamType.Video); // Fill video properties from the BDInfo result mediaStreams.Clear(); @@ -361,14 +348,16 @@ namespace MediaBrowser.Providers.MediaInfo } } - videoStream = mediaStreams.FirstOrDefault(s => s.Type == MediaStreamType.Video); + var blurayVideoStream = mediaStreams.FirstOrDefault(s => s.Type == MediaStreamType.Video); // Use the ffprobe values if these are empty - if (videoStream is not null) + if (blurayVideoStream is not null && ffmpegVideoStream is not null) { - videoStream.BitRate = videoStream.BitRate.GetValueOrDefault() == 0 ? currentBitRate : videoStream.BitRate; - videoStream.Width = videoStream.Width.GetValueOrDefault() == 0 ? currentWidth : videoStream.Width; - videoStream.Height = videoStream.Height.GetValueOrDefault() == 0 ? currentHeight : videoStream.Height; + // Always use ffmpeg's detected codec since that is what the rest of the codebase expects. + blurayVideoStream.Codec = ffmpegVideoStream.Codec; + blurayVideoStream.BitRate = blurayVideoStream.BitRate.GetValueOrDefault() == 0 ? ffmpegVideoStream.BitRate : blurayVideoStream.BitRate; + blurayVideoStream.Width = blurayVideoStream.Width.GetValueOrDefault() == 0 ? ffmpegVideoStream.Width : blurayVideoStream.Width; + blurayVideoStream.Height = blurayVideoStream.Height.GetValueOrDefault() == 0 ? ffmpegVideoStream.Width : blurayVideoStream.Height; } } |
