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 the bitrate scale factor for h264-to-hevc transcoding #9485

Merged
merged 1 commit into from
Mar 14, 2023

Conversation

nyanmisaka
Copy link
Member

Changes

  • Fix the bitrate scale factor for h264-to-hevc transcoding.
    Don't scale the real bitrate lower than the requested bitrate.

Issues

@nyanmisaka nyanmisaka added the stable backport Backport into the next stable release label Mar 14, 2023
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
@crobibero crobibero merged commit 173a963 into jellyfin:release-10.8.z Mar 14, 2023
crobibero pushed a commit that referenced this pull request Mar 14, 2023
Fix the bitrate scale factor for h264-to-hevc transcoding

Original-merge: 173a963

Merged-by: Nyanmisaka <nst799610810@gmail.com>

Backported-by: crobibero <cody@robibe.ro>
@crobibero crobibero removed the stable backport Backport into the next stable release label Mar 14, 2023
@nyanmisaka nyanmisaka deleted the fix-bitrate-scale branch March 14, 2023 22:43
nyanmisaka added a commit to nyanmisaka/jellyfin that referenced this pull request Apr 14, 2023
var scaleFactor = outputScaleFactor / inputScaleFactor;

// Don't scale the real bitrate lower than the requested bitrate
var scaleFactor = Math.Min(outputScaleFactor / inputScaleFactor, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for bringing up this old PR again, I have a quick question:

Don't scale the real bitrate lower than the requested bitrate.

This means scaleFactor >= 1, correct? Shouldn't it be Math.Max to get that?

Copy link
Member Author

Choose a reason for hiding this comment

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

heck.. I got input and output inverted at that time. You are right.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we only ever increase the bitrate via this scaling (and later clamp it to any limit) this should also effectively obsolete an issue I opened #8344 🎉

Copy link
Contributor

Choose a reason for hiding this comment

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

This means scaleFactor >= 1, correct? Shouldn't it be Math.Max to get that?

I have noticed that the picture quality of "standard"-transcodes from hevc to h264 (for the web player) has degraded massively in version 10.8.10 and I just wanted to file an issue for this. But I think this change might be the reason, as scaleFactor is now tied to 1. (I wonder why no one else has complained about the loss of transcoding quality yet...)

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.

None yet

6 participants