Skip to content

Commit

Permalink
Add AV1 as a preferred codec
Browse files Browse the repository at this point in the history
  • Loading branch information
Insprill committed Jul 22, 2024
1 parent 40ee9cf commit 900cb00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion jellyfin_kodi/helper/playutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def get_directplay_video_codec(self):
return ",".join(codecs)

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

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")
Expand All @@ -399,6 +399,12 @@ def get_transcoding_video_codec(self):
if settings("transcode_vc1.bool"):
codecs.remove("vc1")

if settings("transcode_av1.bool"):
codecs.remove("av1")

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

View check run for this annotation

Codecov / codecov/patch

jellyfin_kodi/helper/playutils.py#L403

Added line #L403 was not covered by tests
else:
if settings("videoPreferredCodec") == "AV1":
codecs.insert(0, codecs.pop(codecs.index("av1")))

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

View check run for this annotation

Codecov / codecov/patch

jellyfin_kodi/helper/playutils.py#L406

Added line #L406 was not covered by tests

return ",".join(codecs)

def get_transcoding_audio_codec(self):
Expand Down
2 changes: 1 addition & 1 deletion resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<setting label="30524" id="transcode_vc1" type="bool" default="false" visible="true" />
<setting label="30525" id="transcode_vp9" type="bool" default="false" visible="true" />
<setting label="30526" id="transcode_av1" type="bool" default="false" visible="true" />
<setting label="30161" id="videoPreferredCodec" type="select" values="H264/AVC|H265/HEVC" visible="eq(-2,false)" default="H264/AVC" />
<setting label="30161" id="videoPreferredCodec" type="select" values="H264/AVC|H265/HEVC|AV1" visible="eq(-2,false)" default="H264/AVC" />
<setting label="30162" id="audioPreferredCodec" type="select" values="AAC|AC3|MP3|Opus|FLAC|Vorbis" visible="true" default="AAC" />
<setting label="30163" id="audioBitrate" type="enum" values="96|128|160|192|256|320|384" visible="true" default="4" />
<setting label="30164" id="audioMaxChannels" type="slider" range="2,1,6" option="int" visible="true" default="6" />
Expand Down

0 comments on commit 900cb00

Please sign in to comment.