fix: correct anamorphic video detection (#14640) (#14648)

This commit is contained in:
Gene 2025-08-15 20:52:43 -04:00 committed by GitHub
parent 9eaca73888
commit 28b8d3ee29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 5 deletions

View File

@ -202,6 +202,7 @@
- [Shoham Peller](https://github.com/spellr) - [Shoham Peller](https://github.com/spellr)
- [theshoeshiner](https://github.com/theshoeshiner) - [theshoeshiner](https://github.com/theshoeshiner)
- [TokerX](https://github.com/TokerX) - [TokerX](https://github.com/TokerX)
- [GeneMarks](https://github.com/GeneMarks)
# Emby Contributors # Emby Contributors

View File

@ -850,12 +850,36 @@ namespace MediaBrowser.MediaEncoding.Probing
} }
} }
// stream.IsAnamorphic = string.Equals(streamInfo.sample_aspect_ratio, "0:1", StringComparison.OrdinalIgnoreCase) ||
// string.Equals(stream.AspectRatio, "2.35:1", StringComparison.OrdinalIgnoreCase) ||
// string.Equals(stream.AspectRatio, "2.40:1", StringComparison.OrdinalIgnoreCase);
// http://stackoverflow.com/questions/17353387/how-to-detect-anamorphic-video-with-ffprobe // http://stackoverflow.com/questions/17353387/how-to-detect-anamorphic-video-with-ffprobe
stream.IsAnamorphic = string.Equals(streamInfo.SampleAspectRatio, "0:1", StringComparison.OrdinalIgnoreCase); if (string.Equals(streamInfo.SampleAspectRatio, "1:1", StringComparison.OrdinalIgnoreCase))
{
stream.IsAnamorphic = false;
}
else if (!string.Equals(streamInfo.SampleAspectRatio, "0:1", StringComparison.OrdinalIgnoreCase))
{
stream.IsAnamorphic = true;
}
else if (string.Equals(streamInfo.DisplayAspectRatio, "0:1", StringComparison.OrdinalIgnoreCase))
{
stream.IsAnamorphic = false;
}
else if (!string.Equals(
streamInfo.DisplayAspectRatio,
// Force GetAspectRatio() to derive ratio from Width/Height directly by using null DAR
GetAspectRatio(new MediaStreamInfo
{
Width = streamInfo.Width,
Height = streamInfo.Height,
DisplayAspectRatio = null
}),
StringComparison.OrdinalIgnoreCase))
{
stream.IsAnamorphic = true;
}
else
{
stream.IsAnamorphic = false;
}
if (streamInfo.Refs > 0) if (streamInfo.Refs > 0)
{ {