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

Improve HEVC codec handling in transcoding profiles #895

Merged
merged 4 commits into from
Aug 10, 2024

Conversation

peterlodri92
Copy link

This PR refines the logic for handling HEVC codec preferences in transcoding profiles, ensuring more consistent and codec selection.
Fixes #893

Changes

  • Restructured the codec selection process for transcoding video
  • Ensured HEVC is only added once to the codec list
  • Implemented logic to prioritize HEVC when it's the preferred codec
  • Tests for the get_transcoding methods

Details

The codec list is now handled as follows:

  1. Initially populated with ["h264", "mpeg4", "mpeg2video", "vc1"]
  2. If settings("transcode_h265.bool") is False, "hevc" is added to the list
  3. If settings("videoPreferredCodec") is "H265/HEVC":
    • Checks if "hevc" is in the list
    • Removes it if present
    • Inserts it at the beginning of the list

This ensures that:

  • HEVC is only added once to the codec list
  • HEVC is prioritized when it's the preferred codec

Additional Notes

  • Added tests to verify the new codec selection logic

Fixes #893

add test scenario for the jellyfin#893
@peterlodri92 peterlodri92 force-pushed the fix-duplicate-hvec-trancoding branch from 6bd2129 to ca49333 Compare July 24, 2024 16:23
Copy link

codecov bot commented Jul 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 21.86%. Comparing base (62a1de7) to head (9eb9cd1).
Report is 30 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #895      +/-   ##
==========================================
+ Coverage   21.50%   21.86%   +0.36%     
==========================================
  Files          63       63              
  Lines        8632     8630       -2     
  Branches     1585     1585              
==========================================
+ Hits         1856     1887      +31     
+ Misses       6755     6724      -31     
+ Partials       21       19       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@oddstr13 oddstr13 left a comment

Choose a reason for hiding this comment

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

Please refer to my earlier comments around the tests.

@oddstr13 oddstr13 added the blocked This item is blocked by another label Aug 9, 2024
Copy link

sonarcloud bot commented Aug 10, 2024

@oddstr13 oddstr13 added bugfix tests and removed blocked This item is blocked by another labels Aug 10, 2024
@oddstr13 oddstr13 merged commit efe059a into jellyfin:master Aug 10, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transcoding fails due to duplicate hevc in VideoCodec
4 participants