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
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions jellyfin_kodi/helper/playutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,15 @@
return ",".join(codecs)

def get_transcoding_video_codec(self):
codecs = ["h264", "hevc", "h265", "mpeg4", "mpeg2video", "vc1"]
codecs = ["h264", "mpeg4", "mpeg2video", "vc1"]

Check warning on line 387 in jellyfin_kodi/helper/playutils.py

View check run for this annotation

Codecov / codecov/patch

jellyfin_kodi/helper/playutils.py#L387

Added line #L387 was not covered by tests

if settings("transcode_h265.bool"):
codecs.remove("hevc")
codecs.remove("h265")
else:
if settings("videoPreferredCodec") == "H265/HEVC":
codecs.insert(2, codecs.pop(codecs.index("h264")))
if not settings("transcode_h265.bool"):
codecs.append("hevc") # Add HEVC if transcoding is not forced

Check warning on line 390 in jellyfin_kodi/helper/playutils.py

View check run for this annotation

Codecov / codecov/patch

jellyfin_kodi/helper/playutils.py#L390

Added line #L390 was not covered by tests

if settings("videoPreferredCodec") == "H265/HEVC":
if "hevc" in codecs:
codecs.remove("hevc")
codecs.insert(0, "hevc") # Add HEVC at the beginning if preferred

Check warning on line 395 in jellyfin_kodi/helper/playutils.py

View check run for this annotation

Codecov / codecov/patch

jellyfin_kodi/helper/playutils.py#L394-L395

Added lines #L394 - L395 were not covered by tests

if settings("transcode_mpeg2.bool"):
codecs.remove("mpeg2video")
Expand Down
Loading