Add MediaStream.ReferenceFrameRate for problematic video files (#12603)

Co-authored-by: Nyanmisaka <nst799610810@gmail.com>
This commit is contained in:
gnattu
2024-09-08 01:16:23 +08:00
committed by GitHub
parent 57452d65ef
commit 5a8a19e07b
7 changed files with 30 additions and 13 deletions

View File

@@ -525,6 +525,23 @@ namespace MediaBrowser.Model.Entities
/// <value>The real frame rate.</value>
public float? RealFrameRate { get; set; }
/// <summary>
/// Gets the framerate used as reference.
/// Prefer AverageFrameRate, if that is null or an unrealistic value
/// then fallback to RealFrameRate.
/// </summary>
/// <value>The reference frame rate.</value>
public float? ReferenceFrameRate
{
get
{
// In some cases AverageFrameRate for videos will be read as 1000fps even if it is not.
// This is probably due to a library compatability issue.
// See https://github.com/jellyfin/jellyfin/pull/12603#discussion_r1748044018 for more info.
return AverageFrameRate < 1000 ? AverageFrameRate : RealFrameRate;
}
}
/// <summary>
/// Gets or sets the profile.
/// </summary>