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

Disambiguate vpx to vp8 or vp9 #6456

Merged
merged 1 commit into from Sep 4, 2021
Merged

Conversation

GodTamIt
Copy link
Contributor

@GodTamIt GodTamIt commented Aug 20, 2021

Changes
Currently, vpx is being sent by clients to refer to the VP8/VP9 codecs ambiguously when indicating transcoding jobs. This change disambiguates between them in the server while providing backwards compatibility with codecs set as vpx, defaulting to VP8 as the codec. Additionally, as a part of this change, proper encoding support for VP9 is implemented leveraging libvpx-vp9.

Issues

Progress on #6455

MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs Outdated Show resolved Hide resolved
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs Outdated Show resolved Hide resolved
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs Outdated Show resolved Hide resolved
int defaultVp9Crf = 31;
if (h265Crf >= 0 && h265Crf <= 51)
{
var vp9Crf = Convert.ToInt32(h265Crf * 1.12);
Copy link
Member

Choose a reason for hiding this comment

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

Where does 1.12 come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a comment in the code, but I'll reproduce it here for posterity.

This conversion factor is chosen to match the default CRF for H.265 to the recommended 1080p CRF from Google. The factor also maps the logarithmic CRF scales of x265 [0, 51] to that of VP9 [0, 63] relatively

Resources:

if (threads <= 0)
{
return 0;
// Automatically set thread count
return mustSetThreadCount ? Math.Max(Environment.ProcessorCount - 1, 1) : 0;
}
else if (threads >= Environment.ProcessorCount)
Copy link
Member

Choose a reason for hiding this comment

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

This is higher than the recommended value for vpx, is it not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This does not change the behavior from before, but no, vpx with -row-mt enabled should be able to exploit row-based parallelism during encoding (in addition to any tile-based parallelism).

@GodTamIt GodTamIt requested a review from cvium August 25, 2021 11:31
@jellyfin-bot jellyfin-bot added the merge conflict Merge conflicts should be resolved before a merge label Aug 30, 2021
@jellyfin-bot jellyfin-bot removed the merge conflict Merge conflicts should be resolved before a merge label Sep 3, 2021
@GodTamIt
Copy link
Contributor Author

GodTamIt commented Sep 4, 2021

Squashed intermediate change commits so feel free to merge whenever :)

@Bond-009 Bond-009 merged commit ff83fab into jellyfin:master Sep 4, 2021
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

5 participants