fix: set max resolution for common video codecs #4470
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Instead of relying on the max resolution for the H264 codec decoder as a
global setting when computing device capabilities, set the max supported
resolution for the most common video codecs by querying the decoder.
Video codecs that support this are: AVC (H264), HEVC (H265), AV1.
This change avoids unnecessary transcodings because, on some devices,
the AVC decoder might support a lower maximum resolution compared to
other decoders that the device supports. For example, if the AVC decoder
supports up to 2K resolution decoding, and the HEVC supports up to 4K
resolution decoding, Jellyfin would have transcoded a 4K HEVC media
stream.
I tested this on my setup, and, after this change, 4K HEVC media files all direct play instead of transcoding.
Issues
Fix #4466