Add a small tolerance value to remux fps check (#12947)

This commit is contained in:
gnattu 2024-11-04 22:59:23 +08:00 committed by GitHub
parent f6f4cdf9e7
commit 954950dc14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2196,7 +2196,10 @@ namespace MediaBrowser.Controller.MediaEncoding
{ {
var videoFrameRate = videoStream.ReferenceFrameRate; var videoFrameRate = videoStream.ReferenceFrameRate;
if (!videoFrameRate.HasValue || videoFrameRate.Value > requestedFramerate.Value) // Add a little tolerance to the framerate check because some videos might record a framerate
// that is slightly higher than the intended framerate, but the device can still play it correctly.
// 0.05 fps tolerance should be safe enough.
if (!videoFrameRate.HasValue || videoFrameRate.Value > requestedFramerate.Value + 0.05f)
{ {
return false; return false;
} }