jellyfin / jellyfin-plugin-dlna

GNU General Public License v3.0
23 stars 13 forks source link

Unnecessary transcoding of HEVC when streaming to Samsung Q80AA TV #90

Open bubblec0re opened 3 weeks ago

bubblec0re commented 3 weeks ago

Issue Summary: Unnecessary transcoding occurs when streaming HEVC/AAC MP4 files to Samsung Q80AA TV via Jellyfin DLNA plugin. Modifying DLNA profile allows direct playback without transcoding. The fix is to add HEVC to the mp4 DirectPlayProfile.

Description: When streaming MP4 files encoded with HEVC and AAC codecs to my Samsung Q80AA 55" Smart TV (QE55Q80AAUXRU) via the DLNA plugin in Jellyfin, they are unnecessarily transcoded. However, these same files play perfectly fine when streamed from a simpler DLNA server in my router box or just from a thumb drive.

To prevent this unnecessary transcoding , I've experimented with modifying the DLNA profile by adding 'hevc' to the list of supported video formats in DirectPlayProfile section in the file plugins/DLNA_4.0.0.0/profiles/Samsung Smart TV.xml. Here's the diff:

--- samsung-smart-tv.xml.bak    2024-11-01 00:16:18.134196919 +0300
+++ samsung-smart-tv.xml        2024-11-01 00:16:50.545732480 +0300
@@ -40,7 +40,7 @@
     <DirectPlayProfile container="asf" audioCodec="mp3,ac3,wmav2,wmapro,wmavoice" videoCodec="h264,mpeg4,mjpeg" type="Video" />
     <DirectPlayProfile container="avi" audioCodec="mp3,ac3,dca,dts" videoCodec="h264,mpeg4,mjpeg" type="Video" />
     <DirectPlayProfile container="mkv" audioCodec="mp3,ac3,dca,aac,dts" videoCodec="h264,mpeg4,mjpeg4" type="Video" />
-    <DirectPlayProfile container="mp4,m4v" audioCodec="mp3,aac" videoCodec="h264,mpeg4" type="Video" />
+    <DirectPlayProfile container="mp4,m4v" audioCodec="mp3,aac" videoCodec="h264,mpeg4,hevc" type="Video" />
     <DirectPlayProfile container="3gp" audioCodec="aac,he-aac" videoCodec="h264,mpeg4" type="Video" />
     <DirectPlayProfile container="mpg,mpeg" audioCodec="ac3,mp2,mp3,aac" videoCodec="mpeg1video,mpeg2video,h264" type="Video" />
     <DirectPlayProfile container="vro,vob" audioCodec="ac3,mp2,mp3" videoCodec="mpeg1video,mpeg2video" type="Video" />

Observed behavior in DLNA debug logs:

Since I'm not sure if this change works for all Samsung Smart TVs, I thought it'd be best to create an issue for it first. If you think it's a good idea, I can create a pull request with my modification.

disgustipated commented 2 weeks ago

Might be worth a dive into the Samsung documentation to see what they have listed as supported. If its new codec support they added it might not be in all of their models.

bubblec0re commented 1 week ago

Might be worth a dive into the Samsung documentation to see what they have listed as supported. If its new codec support they added it might not be in all of their models.

Apparently, containers, codecs and resolutions are listed here: developer.samsung.com, but without specific model numbers, only years. Not sure how helpful this is.

I'll try monitoring the DLNA logs to see if Samsung specification name apeears in it when connecting the TV.