Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 4k HEVC downscaling on 1080p devices #3419

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MichaelRUSF
Copy link
Contributor

Changes
Add DeviceUtils.has4kVideoSupport conditional tests directly to the deviceHevcCodecProfile in the ProfileHelper.

Issues
Fixes #3388 #2516

ProfileConditionValue.VideoProfile,
"none"
),
ProfileCondition(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do these conditions add? The max1080pProfileConditions are already included in a CodecProfile to limit the resolution. Including them here too should be pointless noise.

See:

// Limit video resolution support for older devices
if (!DeviceUtils.has4kVideoSupport()) {
add(CodecProfile().apply {
type = CodecType.Video
conditions = max1080pProfileConditions
})
}

The way the Jellyfin server works is that all codec profiles that match the type, codec, container and applyConditions of a media file need all their conditions to be true in order for compatibility to be agreed. Therefore the width and height are already being checked for when DeviceUtils.has4kVideoSupport() is false due to the above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory, that statement should work, but it doesn't. Why not? Go figure. Luckily, I was able to dig up some old 1080p devices to test this out. I tried several different ways of rewriting this, but this is the version that actually worked.

I can tell you some findings with the original code. A 4k video would transcode initially for unsupported resolution as it should. Play another video then come back and the same file would no longer transcode and would just get remuxed causing the player to crash, along with any other video played after that. 🤷‍♂️

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the profile is correct the bug should be fixed server-side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4k hevc content fails to play on 1080p devices
3 participants