Closed Kalroth closed 6 years ago
Do you have a log for the second issue? As far as I understand, the 6 channel limit isn't applied in plexplayer.py 330-344, as the function that checks the compatibility simply returns True.
Uh, it does!
In case of dca
it does exactly that: "add-limitation(scope=videoAudioCodec&scopeName=dca&type=upperBound&name=audio.channels&value=6&isRequired=false)"
I've uploaded XML info of the media file that gave me issues: https://pastebin.com/eSU8RaXE Note that there is only 1 video stream, so I can't confirm the commit about disabling direct play.
I will revert my own changes and generate a full log when I get home today, apologies for not doing so in the first place.
I have a question about the audio stream fix.
When I was trying to play the media, I had selected TrueHD as my audio stream, yet I got a log error about 8 channels being more than the maximum of 6 channels.
Could this be because self.choice.audioStream.channels
isn't working for TrueHD streams? As the integer default of 6 channels should only go into effect if self.choice.audioStream.channels
is null?
Hmm. I'm wondering why it even got into the buildTranscodeMkv
code path in the first place.
Logs would definitely help.
Edit: Do you have HEVC support enabled in P4K's settings?
I do have both 4K
and HEVC (h265)
support enabled, I have other 4k movies that plays directly from P4K without any issues.
I've made a very verbose log available here: https://files.knas.io/plex/Plex%20Media%20Server.log.txt Note: This is the current public version of P4K, I have not updated to the develop branch.
The following log lines might be of interest: (My selections in P4K were English TrueHD audio and English PGS subtitles.)
Jul 17, 2018 17:38:32.543 [3716] DEBUG - Jumanji: Welcome to the Jungle - audio.channels limitation applies: 8 > 6
Jul 17, 2018 17:38:32.543 [3716] DEBUG - MDE: Cannot direct stream audio stream due to profile or setting limitations
Jul 17, 2018 17:38:32.543 [3716] DEBUG - MDE: Jumanji: Welcome to the Jungle (2017): selected media 0 / 2
Jul 17, 2018 17:38:32.543 [3716] DEBUG - Streaming Resource: Calculated bandwidth of 221619kbps exceeds bandwidth limit. Changing decision parameters provided by client to fit bandwidth limit of 200000kbps
Jul 17, 2018 17:38:32.543 [3716] DEBUG - Streaming Resource: Determining preferred transcode encoders through transcode only decision.
Jul 17, 2018 17:38:32.543 [3716] DEBUG - Scaled up video bitrate to 210807Kbps based on 4.500000x fudge factor.
I'm not sure right now, I'm leaning towards this being a server-side decision, not a client-side one to not directplay this file as I can't find any references in the code regarding this. I just now realized this was a PMS log.
Do you have the P4K log for that?
@Kalroth can you try this branch please? I'm thinking the 200mbit bitrate limit might be the culprit here.
Be sure to disable auto-update for the P4K plugin before doing so.
I've uploaded the kodi log here: https://files.knas.io/plex/kodi.log.txt (hopefully it's fairly anonymized ..)
I tried installing the branch you linked, but the add-on did not work at all. All I saw was gray snow on the TV and it worked again when I copied the original version back.
EDIT: I can try adding the patches one at a time tomorrow, it looks like the following code in mediadecisionengine.py
is the culprit for my troubles:
# elif numVideoStreams > 1:
# util.LOG("MDE: Multiple video streams, won't try to direct play")
Did you unpack the zip into a subfolder inside your kodi addons folder and call it script.plex?
Yes, it had the same folder structure as the original version of the addon. I saw it open the addon main window, but where I would normally see the Plex logo and gradient background, there was only white TV noise.
I'll try installing it again tonight. I got home late last night, so it's not impossible that I did fudge something up.
I installed your branch again and I'm happy to report that it works great now! What I saw yesterday must have been an error from my side.
I tried a few different 4k movies (other than the one in question) and I got direct 4k TrueHD HDR enabled playback on all of them.
Thanks for your help!
Description:
I'm using a fairly capable player and Kodi plays everything, so I was a little puzzled when Plex for Kodi decided to transcode a lot of my media.
Issues
1) The highest setting for
transcodeVideoBitrates
is hard-coded to 200000. I've encountered media that reported higher values than that, which seems to lead to an incorrectly forced transcode. See:~\.kodi\addons\script.plex\lib\_included_packages\plexnet\plexapp.py
line 162 and~\.kodi\addons\script.plex\lib\plex.py
line 98.2) There's a hard-coded 6 channel limit for ac3, eac3 and dca audio streams. This limit gets applied globally if one of these streams are available in the file (even though the stream isn't selected) which in turn causes an error stating that the 8 channels in the selected Dolby Atmos stream is too much. See:
~\.kodi\addons\script.plex\lib\_included_packages\plexnet\plexplayer.py
line 330 to 344.I tried to work around it, but with no luck. I ended up disabling video transcoding entirely, which fixed the issues I was experiencing. I've included how to modify the files to disable video transcoding, in case someone else also prefers direct streaming everything.
Hacky fix: disable video transcoding entirely
Edit:
~/.kodi/addons/script.plex/lib/_included_packages/plexnet/plexserver.py
line 255 Edit the line that says:self.supportsVideoTranscoding = data.attrib.get('transcoderVideo') == '1' or data.attrib.get('transcoderVideoQualities')
and change it toself.supportsVideoTranscoding = False
Details:
Checklist