Ok. no go with Windows.
Reverted back to linux, latest nvidia drivers, latest plex to do some more debugging.
The problem is the encoder as I was saying, the decoder works fine even though it’s still not officially suported (ironic).
I can more precisely say now what’s going on though.
I was first under the impression that this happens only on 4k files but it happens on any source, h264 or h265, 4k or 1080p. The only difference is that on 1080p source files, the one core that is maxed out is not at 96+ % but 70ish so it kinda works ok.
So this is what happens for example with a 4k source file:
Player is Chrome and the server will automatically transcode by default to 4k h264. which works but with one core on the server maxed out and the others idling mostly.
If I choose a different quality, for example 1080p 12Mbit, or 720… any quality, the transcoding stops entirely with this error in the log:
Mar 14, 2019 21:08:35.521 [0x7f2344ff9700] DEBUG - MDE: Selected protocol dash; container: mp4
Mar 14, 2019 21:08:35.521 [0x7f2344ff9700] DEBUG - MDE: analyzing media item 10
Mar 14, 2019 21:08:35.522 [0x7f2344ff9700] DEBUG - MDE: Life of Pi (2012): Direct Play is disabled
Mar 14, 2019 21:08:35.522 [0x7f2344ff9700] DEBUG - MDE: Life of Pi (2012): media must be transcoded in order to use the dash protocol
Mar 14, 2019 21:08:35.522 [0x7f2344ff9700] DEBUG - MDE: Life of Pi (2012): no direct play video profile exists for http/mkv/hevc
Mar 14, 2019 21:08:35.522 [0x7f2344ff9700] DEBUG - MDE: Life of Pi (2012): no direct play video profile exists for http/mkv/hevc/dca
Mar 14, 2019 21:08:35.522 [0x7f2344ff9700] DEBUG - Life of Pi - video.bitDepth limitation applies: 10 > 8
Mar 14, 2019 21:08:35.522 [0x7f2344ff9700] DEBUG - Life of Pi - audio.channels limitation applies: 6 > 2
Mar 14, 2019 21:08:35.522 [0x7f2344ff9700] DEBUG - MDE: Life of Pi (2012): no remuxable profile found, so video stream will be transcoded
Mar 14, 2019 21:08:35.522 [0x7f2344ff9700] DEBUG - Codecs: testing h264_nvenc (encoder)
Mar 14, 2019 21:08:35.628 [0x7f2308ea5700] DEBUG - [TranscodeOutputStream] Input processing thread exited after writing 692 bytes, m_closed=1, m_endOfFileReached=0, session->isStopped()=1
Mar 14, 2019 21:08:35.628 [0x7f23467fc700] DEBUG - Cleaning directory for session htcw0w1e2mq01gdd3g0oqrx3 (/ramdisk/Transcode/Sessions/plex-transcode-htcw0w1e2mq01gdd3g0oqrx3-bc3edaa9-3661-4dce-97c0-67952bd9ee64)
Mar 14, 2019 21:08:35.628 [0x7f23b0ad4700] DEBUG - Completed: [10.10.0.194:64315] -2 GET /video/:/transcode/universal/subtitles?hasMDE=1&path=%2Flibrary%2Fmetadata%2F10&mediaIndex=0&partIndex=0&protocol=dash&fastSeek=1&directPlay=0&directStream=1&subtitleSize=100&audioBoost=100&location=lan&addDebugOverlay=0&autoAdjustQuality=0&directStreamAudio=1&mediaBufferSize=102400&session=htcw0w1e2mq01gdd3g0oqrx3&subtitles=auto&Accept-Language=ro (17 live) GZIP 64249ms 704 bytes (pipelined: 16)
Mar 14, 2019 21:08:36.117 [0x7f2344ff9700] DEBUG - MDE: Cannot direct stream video stream due to profile or setting limitations
Mar 14, 2019 21:08:36.117 [0x7f2344ff9700] DEBUG - Codecs: hardware transcoding: testing API vaapi
Mar 14, 2019 21:08:36.117 [0x7f2344ff9700] ERROR - [FFMPEG] - libva: va_getDriverName() failed with unknown libva error,driver_name=(null)
Mar 14, 2019 21:08:36.117 [0x7f2344ff9700] ERROR - [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Mar 14, 2019 21:08:36.117 [0x7f2344ff9700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
Mar 14, 2019 21:08:36.118 [0x7f2344ff9700] DEBUG - Scaled up video bitrate to 273802Kbps based on 4.500000x fudge factor.
Mar 14, 2019 21:08:36.118 [0x7f2344ff9700] DEBUG - Scaled maximum bitrate for resolution reduction to 96168Kbps.
Mar 14, 2019 21:08:36.118 [0x7f2344ff9700] DEBUG - Life of Pi - audio.channels limitation applies: 6 > 2
Mar 14, 2019 21:08:36.118 [0x7f2344ff9700] DEBUG - MDE: Cannot direct stream audio stream due to profile or setting limitations
Mar 14, 2019 21:08:36.118 [0x7f2344ff9700] DEBUG - MDE: Life of Pi (2012): selected media 0 / 10
Mar 14, 2019 21:08:36.118 [0x7f2344ff9700] DEBUG - Streaming Resource: Reached Decision id=10 codes=(General=1001,Direct play not available; Conversion OK. Direct Play=3000,App cannot direct play this item. Direct play is disabled. Transcode=1001,Direct play not available; Conversion OK.) media=(id=10 part=(id=10 decision=transcode container=mp4 protocol=dash streams=(Video=(id=493 decision=transcode bitrate=9357 encoder=h264_nvenc width=2276 height=1280) Audio=(id=494 decision=transcode bitrate=101 encoder=aac channels=2 rate=48000) Subtitle=(id=497 decision=transcode bitrate=2147483647 encoder=ass languageCode=rum location=sidecar))))
Mar 14, 2019 21:08:36.118 [0x7f23ab7fe700] DEBUG - Killing job.
Mar 14, 2019 21:08:36.118 [0x7f23ab7fe700] DEBUG - Signalling job ID 1857 with 9
Mar 14, 2019 21:08:36.119 [0x7f23ab7fe700] DEBUG - Job was already killed, not killing again.
If I disable the hardware accel in ui and leave the hack in place everything works as it should on any source any resolution, but when using hevc 4k files it’s eating up about 8-10 cores fully on only ONE stream (which is expected for software decoding of 4k h265).