jellyfin / jellyfin-plugin-dlna

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

[Issue]: DLNA server chooses not to transcode even though AudioCodecNotSupported #23

Open gerbik opened 2 years ago

gerbik commented 2 years ago

Please describe your bug

When playing (DLNA) unsupported audio formats (ones not specified in the active profile), Jellyfin successfully identiefies the audio as not being supported but chooses not to transcode it anyway. Always seeing "PlayMethod=DirectStream, TranscodeReason=AudioCodecNotSupported" Tested with multiple MKV files with both FLAC and DTS audio (neither of which is specified in the profile)

Custom Profile /etc/jellyfin/dlna/user/Panasonic GX800.xml

<DirectPlayProfile container="mkv" audioCodec="aac,ac3,dca,mp3,mp2,pcm" videoCodec="h264,h265,hevc,mpeg2video" type="Video" />

Jellyfin Version

Other

if other:

10.8.1-1

Environment

- OS: Ubuntu 20.04.4 LTS
- Virtualization:
- Clients: Panasonic TX-50GX820e (DLNA)
- Browser:
- FFmpeg Version:
- Playback Method: 
- Hardware Acceleration: none
- Plugins:
- Reverse Proxy:
- Base URL:
- Networking:
- Storage:

Jellyfin logs

[2022-07-26 18:11:50.505 +02:00] [INF] StreamBuilder.BuildVideoItem( Profile="Panasonic GX800", Path="/red/test/Serial.(Bad).Weddings.2014.1080p.BluRay.DTS.x264-Narkyy.mkv", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=DirectStream, TranscodeReason=AudioCodecNotSupported ) "media:/videos/585bbc9b-a229-b119-6c68-42d648434ed3/stream.mkv?MediaSourceId=585bbc9ba229b1196c6842d648434ed3&Static=true&VideoCodec=h264,hevc,mpeg2video,h264&AudioCodec=aac,ac3,dca,mp3,mp2,pcm&AudioStreamIndex=1&SubtitleStreamIndex=2&VideoBitrate=138464000&AudioBitrate=1536000&MaxFramerate=24&MaxWidth=1920&MaxHeight=1080&api_key=<token>&SubtitleMethod=Embed&Tag=7dfebe25a7ca6030751859f1ae410862&h264-level=41&h264-videobitdepth=8&h264-profile=high&hevc-videobitdepth=8&mpeg2video-videobitdepth=8"

FFmpeg logs

No response

Please attach any browser or client logs here

No response

Please attach any screenshots here

No response

Code of Conduct

gerbik commented 2 years ago

This issue is only present for DLNA clients. Previous changes seem to have fixed this issue for web-client users. Here are a few examples of conditions under which the behavior happens. Seems to me like ffmpeg is only called on VideoCodecNotSupported and in all other cases, the media will always be DirectPlayed. Even remuxing will not happen if the container is the only thing that doesn't match, in that case PlayMethod will be set to DirectStream but the media will still be DirectPlayed regardless.

input: MKV h264 flac allowed: MKV * ac3 output: MKV h264 flac => no audio transcoding performed

[DBG] Profile: "Panasonic", Path: "/red/test/[Doki] Nichijou - 01 (1920x1080 Hi10P BD FLAC) [178745F7].mkv", isEligibleForDirectPlay: True, isEligibleForDirectStream: True
[DBG] Transcode Result for Profile: "Panasonic", Path: "/red/test/[Doki] Nichijou - 01 (1920x1080 Hi10P BD FLAC) [178745F7].mkv", PlayMethod: DirectStream, AudioStreamIndex: 2, SubtitleStreamIndex: 0, Reasons: 0
[DBG] DirectPlay Result for Profile: "Panasonic", Path: "/red/test/[Doki] Nichijou - 01 (1920x1080 Hi10P BD FLAC) [178745F7].mkv", PlayMethod: DirectStream, AudioStreamIndex: 2, SubtitleStreamIndex: 0, Reasons: AudioCodecNotSupported
[INF] StreamBuilder.BuildVideoItem( Profile="Panasonic", Path="/red/test/[Doki] Nichijou - 01 (1920x1080 Hi10P BD FLAC) [178745F7].mkv", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=DirectStream, TranscodeReason=AudioCodecNotSupported ) "media:/videos/63b629ed-e6c0-07c6-64b1-e8348220f51c/stream.mkv?MediaSourceId=63b629ede6c007c664b1e8348220f51c&Static=true&VideoCodec=h264&AudioCodec=ac3&AudioStreamIndex=2&SubtitleStreamIndex=0&VideoBitrate=139040000&AudioBitrate=960000&MaxFramerate=23.976025&api_key=<token>&SubtitleMethod=Embed&Tag=651aa6a2c39a0f6dc59f0665c036974f&h264-level=51&h264-videobitdepth=10&h264-profile=high10"

input: MKV h264 flac allowed: MP4 output: MKV h264 flac => no remux to MP4 performed

[DBG] Profile: "Panasonic", Path: "/red/test/[Doki] Nichijou - 01 (1920x1080 Hi10P BD FLAC) [178745F7].mkv", isEligibleForDirectPlay: True, isEligibleForDirectStream: True
[DBG] Transcode Result for Profile: "Panasonic", Path: "/red/test/[Doki] Nichijou - 01 (1920x1080 Hi10P BD FLAC) [178745F7].mkv", PlayMethod: DirectStream, AudioStreamIndex: 2, SubtitleStreamIndex: 0, Reasons: 0
[DBG] DirectPlay Result for Profile: "Panasonic", Path: "/red/test/[Doki] Nichijou - 01 (1920x1080 Hi10P BD FLAC) [178745F7].mkv", PlayMethod: DirectStream, AudioStreamIndex: 2, SubtitleStreamIndex: 0, Reasons: ContainerNotSupported
[INF] StreamBuilder.BuildVideoItem( Profile="Panasonic", Path="/red/test/[Doki] Nichijou - 01 (1920x1080 Hi10P BD FLAC) [178745F7].mkv", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=DirectStream, TranscodeReason=ContainerNotSupported ) "media:/videos/63b629ed-e6c0-07c6-64b1-e8348220f51c/stream.mkv?MediaSourceId=63b629ede6c007c664b1e8348220f51c&Static=true&VideoCodec=h264&AudioCodec=flac&AudioStreamIndex=2&SubtitleStreamIndex=0&VideoBitrate=139040000&AudioBitrate=960000&AudioSampleRate=48000&MaxFramerate=23.976025&api_key=<token>&SubtitleMethod=Embed&Tag=651aa6a2c39a0f6dc59f0665c036974f&h264-level=51&h264-videobitdepth=10&h264-profile=high10&h264-audiochannels=2"
fenirani commented 1 year ago

Having the same problem on PS4 DLNA. "PlayMethod=DirectStream, TranscodeReason=AudioCodecNotSupported "

The ps4 web browser works as intended and transcodes but the DLNA Media Player does not, even with the PS4 DLNA profile.

The Audio codec is the E-AC-3.

smue83 commented 1 year ago

Exactly the same problem on Samsung NU7099 and Samsung RU7099.

Audio codec is dts.

Any ETA if this will be fixed? Just switched to jellyfin and i am loving it... except on the Samsung TVs xD

Edit: While using the Samsung browser it works :(

alnmy commented 1 year ago

Same issue on PS4 DLNA.

seemebreakthis commented 1 year ago

Same issue for my old Bravia TV under the "Sony Bravia (2014)" DLNA Profile. I have actually made changes to remove the eac3 codec which isn't compatible with my TV, but the log says it still tried to DirectStream:

[2023-04-01 18:43:11.740 +08:00] [INF] [45] Emby.Dlna.ContentDirectory.ContentDirectoryService: StreamBuilder.BuildVideoItem( Profile="Sony Bravia (2014)", Path="/sonarr/video.mkv", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=DirectStream, TranscodeReason=ContainerNotSupported, AudioCodecNotSupported )

My workaround for now is to remove the entire container record in the Direct Playback section of the profile to force Jellyfin to transcode even the compatible videos. There are a number of obvious drawbacks with this approach, so if this issue can be fixed eventually, it would be super nice.

jellyfin-bot commented 1 year ago

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.

If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.

This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

kieferlam commented 1 year ago

I am still getting this issue. Logs looks the same as OP's where video codec is supported and only audio codec not supported (dts in my case). However it will choose to stream via direct play instead of transcoding audio only

pavelpykhtin commented 12 months ago

Same issue with Samsung Q70b and jellyfin v10.8.10.

[12:10:56] [INF] [20] Emby.Dlna.ContentDirectory.ContentDirectoryService: StreamBuilder.BuildVideoItem( Profile=Samsung Smart TV, Path=/test.mkv, AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=DirectStream, TranscodeReason=AudioCodecNotSupported ) media:/videos/b143d709-53be-3443-0689-c5426addbabc/stream.mkv?MediaSourceId=b143d70953be34430689c5426addbabc&Static=true&VideoCodec=h264,mpeg4,mjpeg4,h264&AudioCodec=mp3,ac3,dca,aac&AudioStreamIndex=1&SubtitleStreamIndex=3&VideoBitrate=37500000&AudioBitrate=768000&MaxFramerate=23.976025&MaxWidth=1920&MaxHeight=1080&api_key=&SubtitleMethod=Embed&Tag=a0f01544a1beb9ca937a11b7ee7c2125&h264-level=41&h264-videobitdepth=8&h264-profile=high

Fire-GitH commented 11 months ago

Having the same issue with playing over DLNA on a Panasonic VIERA E6 Series television. DirectPlay of unsupported OPUS audio codec. With this audio codec being popular I guess more people will bump into this issue.

KevinSalmon commented 6 months ago

Same problem on Sony Bravia 2013 KDL-42W650A

bousqi commented 3 months ago

Same issue as mentionned with a 2023 Tv, Samsung S95B 😢 and Jellyfin 10.9.2 Tv does not support DTS, and when profile is updated to transcode, no transcoding performed at the end.

[2024-05-23 21:55:40.437 +00:00] [DBG] [42] Jellyfin.Plugin.Dlna.ContentDirectory.ContentDirectoryService: Profile: "Samsung Smart TV", Path: "/media/usb/Video/Films/TestVIDEO.Bluray-1080p.DTS-HD MA.mkv", isEligibleForDirectPlay: True, isEligibleForDirectStream: True
[2024-05-23 21:55:40.438 +00:00] [DBG] [42] Jellyfin.Plugin.Dlna.ContentDirectory.ContentDirectoryService: Transcode Result for Profile: "Samsung Smart TV", Path: "/media/usb/Video/Films/TestVIDEO.Bluray-1080p.DTS-HD MA.mkv", PlayMethod: DirectStream, AudioStreamIndex: 1, SubtitleStreamIndex: null, Reasons: 0
[2024-05-23 21:55:40.440 +00:00] [DBG] [42] Jellyfin.Plugin.Dlna.ContentDirectory.ContentDirectoryService: DirectPlay Result for Profile: "Samsung Smart TV", Path: "/media/usb/Video/Films/TestVIDEO.Bluray-1080p.DTS-HD MA.mkv", PlayMethod: DirectStream, AudioStreamIndex: 1, SubtitleStreamIndex: null, Reasons: ContainerNotSupported, AudioCodecNotSupported
[2024-05-23 21:55:40.442 +00:00] [DBG] [42] Jellyfin.Plugin.Dlna.ContentDirectory.ContentDirectoryService: StreamBuilder.BuildVideoItem( Profile="Samsung Smart TV", Path="/media/usb/Video/Films/TestVIDEO.Bluray-1080p.DTS-HD MA.mkv", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=DirectStream, TranscodeReason=ContainerNotSupported, AudioCodecNotSupported ) "media:/videos/61517814-755b-892f-7c93-0503c56b84ab/stream.mkv?MediaSourceId=61517814755b892f7c930503c56b84ab&Static=true&VideoCodec=h264,mpeg4,mjpeg,h264&AudioCodec=mp3,ac3,wmav2,wmapro,wmavoice&AudioStreamIndex=1&VideoBitrate=135474855&AudioBitrate=4525145&MaxFramerate=23.976025&api_key=<token>&Tag=82f9e7ad7b19945771356a72fbc61215&h264-level=41&h264-videobitdepth=8&h264-profile=high"