mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Always use ffmpeg codec for bluray
This commit is contained in:
parent
4f0f364ac9
commit
c603cd2e4e
@ -324,20 +324,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use BD Info if it has multiple m2ts. Otherwise, treat it like a video file and rely more on ffprobe output
|
var ffmpegVideoStream = mediaStreams.FirstOrDefault(s => s.Type == MediaStreamType.Video);
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fill video properties from the BDInfo result
|
// Fill video properties from the BDInfo result
|
||||||
mediaStreams.Clear();
|
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
|
// 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;
|
// Always use ffmpeg's detected codec since that is what the rest of the codebase expects.
|
||||||
videoStream.Width = videoStream.Width.GetValueOrDefault() == 0 ? currentWidth : videoStream.Width;
|
blurayVideoStream.Codec = ffmpegVideoStream.Codec;
|
||||||
videoStream.Height = videoStream.Height.GetValueOrDefault() == 0 ? currentHeight : videoStream.Height;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user