4K HDR Hardware Transcode

Server Version#: 1.25.2.5319
Player: web.plex (chrome)

I’m running my PMS in a i5-11600k (UHD 750) PC, with Ubuntu Server 20.04.3 LTS (GNU/Linux 5.11.0-43-generic x86_64) (bare metal)

HW transcoding works perfectly EXCEPT, for movies with HDR. If I enable the tone mapping, PMS just switch to software.

I have installed this >> Releases · intel/compute-runtime · GitHub

Subtitles OFF.

This is the log from PMS Install:

Preparing to unpack plexmediaserver_1.25.2.5319-c43dc0277_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.25.2.5319-c43dc0277) over (1.25.2.5319-c43dc0277) ...
Setting up plexmediaserver (1.25.2.5319-c43dc0277) ...
PlexMediaServer install: PlexMediaServer-1.25.2.5319-c43dc0277 - Installation starting.
PlexMediaServer install: 
PlexMediaServer install: Now installing based on:
PlexMediaServer install:   Installation Type:   Update
PlexMediaServer install:   Process Control:     systemd
PlexMediaServer install:   Plex User:           plex
PlexMediaServer install:   Plex Group:          plex
PlexMediaServer install:   Video Group:         render
PlexMediaServer install:   Metadata Dir:        /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install:   Temp Directory:      /dev/shm  (set in Preferences.xml)
PlexMediaServer install:   Lang Encoding:       en_US.UTF-8
PlexMediaServer install:   Intel i915 Hardware: Found
PlexMediaServer install:   Nvidia GPU card:     Not Found
PlexMediaServer install:  
PlexMediaServer install:   OpenCL:              Installed
PlexMediaServer install:   Intel Gmmlib:        Installed
PlexMediaServer install:   Intel IGC Core:      Installed
PlexMediaServer install:   Intel IGC OpenCL:    Installed
PlexMediaServer install:   Intel OpenCL:        Installed
PlexMediaServer install:  
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: Starting Plex Media Server.
PlexMediaServer install: PlexMediaServer-1.25.2.5319-c43dc0277 - Installation successful.  Errors: 0, Warnings: 0
Processing triggers for mime-support (3.64ubuntu1) ...

The Log is showing:

Dec 22, 2021 15:13:39.708 [0x7f214081db38] ERROR - [Transcoder] [AVHWDeviceContext @ 0x7f29e3bb5600] No matching devices found.

plexinstaller log:

  GNU nano 4.8                                                           /tmp/plexinstaller.log                                                                     
# Plex Media Server installation configuration info:  Wed 22 Dec 2021 02:57:27 PM -03
Init=0
Systemd=1
Custom=0
LinuxContainer=0
NewInstall=0
HaveOverride=0
OverrideFile=""
PlexUser="plex"
PlexGroup="plex"
VideoGroup="render"
AppSuppDir="/var/lib/plexmediaserver/Library/Application Support"
PlexTempDir="/dev/shm"
LangEncoding="en_US.UTF-8"
ExistingVersion=12502
HaveHardware=1
HaveTranscoderPref=1
NeedUser=0
NeedGroup=0
NeedVideo=0
Verbose=1
Running=1
Errors=0
Warnings=0
HaveIntel=1
HaveIntelCore=1
HaveIntelXeon=0
Havei915=1
HaveNvidia=0
Processor=11th Gen Intel(R) Core(TM) i5-11600K @ 3.90GHz
CPUSKU=11600
NeedOpenCL=1
NeedBeignet=0
NeedIntelCompute=1
HaveIntelGmmlib=1
HaveIntelIGCCore=1
HaveIntelIGCOpenCL=1
HaveIntelOpenCL=1
HaveIntelCompute=1
HaveBeignet=1
HaveOpenCL=1
Platform="B560M DS3H"
Processor="11th Gen Intel(R) Core(TM) i5-11600K @ 3.90GHz"
Distro="Ubuntu 20.04.3 LTS"
Kernel="Linux furflix 5.11.0-43-generic #47~20.04.2-Ubuntu SMP Mon Dec 13 11:06:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux"
Memory="15834 437 14260"

Any help will be much appreciated.

1 Like

Hi @ChuckPa! Is this a known issue and Plex doesn’t support UDH750 GPU yet, or it’s happening just to me? Merry xmas!

-10xxx and -11xxx are supported.
have seen reports of isolated cases
will look when i get back

Thanks Chuck! Have a happy holidays!

I have the same issue. PMS is running in Ubuntu Server 20.04.3 on an Intel 10600K. Beignet and OpenCL dependencies are installed.

Here’s the install log:

Preparing to unpack plexmediaserver_1.25.2.5319-c43dc0277_amd64.deb …
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.25.2.5319-c43dc0277) over (1.22.0.4163-d8c4875dd) …
Setting up plexmediaserver (1.25.2.5319-c43dc0277) …
PlexMediaServer install: PlexMediaServer-1.25.2.5319-c43dc0277 - Installation starting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install: Installation Type: Update
PlexMediaServer install: Process Control: systemd
PlexMediaServer install: Plex User: plex
PlexMediaServer install: Plex Group: plex
PlexMediaServer install: Video Group: render
PlexMediaServer install: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install: Temp Directory: /dev/shm (set in Preferences.xml)
PlexMediaServer install: Lang Encoding: en_US.UTF-8
PlexMediaServer install: Intel i915 Hardware: Found
PlexMediaServer install: Nvidia GPU card: Not Found
PlexMediaServer install:
PlexMediaServer install: OpenCL: Installed
PlexMediaServer install: Intel Gmmlib: Installed
PlexMediaServer install: Intel IGC Core: Installed
PlexMediaServer install: Intel IGC OpenCL: Installed
PlexMediaServer install: Intel OpenCL: Installed
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: PlexMediaServer-1.25.2.5319-c43dc0277 - Installation successful. Errors: 0, Warnings: 0
Processing triggers for libc-bin (2.31-0ubuntu9.2) …
Processing triggers for mime-support (3.64ubuntu1) …

I have uploaded the logs.
Plex Media Server Logs_2021-12-23_15-36-24.zip (1.7 MB)

@KyleD324

What’s the issue with HW transcoding?

Logs show it’s engaging as it should.

Dec 23, 2021 14:46:28.431 [0x7f37f7992b38] DEBUG - [Transcode] [FFMPEG] - Format 0x33434d49 -> unknown.
Dec 23, 2021 14:46:28.431 [0x7f37f7992b38] DEBUG - [Transcode] [FFMPEG] - Format 0x30313050 -> p010le.
Dec 23, 2021 14:46:28.431 [0x7f37f7992b38] DEBUG - [Transcode] [FFMPEG] - Created surface 0.
Dec 23, 2021 14:46:28.431 [0x7f37f7992b38] DEBUG - [Transcode] [FFMPEG] - Direct mapping possible.
Dec 23, 2021 14:46:28.436 [0x7f37f7992b38] DEBUG - [Transcode] TPU: hardware transcoding: final decoder: vaapi, final encoder: vaapi
Dec 23, 2021 14:46:28.436 [0x7f37f7992b38] DEBUG - [Transcode/JobRunner] Job running: EnableExtendedVaFormats='1' FFMPEG_EXTERNAL_LIBS='/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Codecs/fb9eae3-4185-linux-x86_64/' LIBVA_DRIVERS_PATH='/usr/lib/plexmediaserver/lib/dri' NEOReadDebugKeys='1' X_PLEX_TOKEN='xxxxxxxxxxxxxxxxxxxx' '/usr/lib/plexmediaserver/Plex Transcoder' '-codec:0' 'hevc' '-hwaccel:0' 'vaapi' '-hwaccel_fallback_threshold:0' '10' '-hwaccel_output_format:0' 'vaapi' '-hwaccel_device:0' 'vaapi' '-codec:1' 'dca' '-ss' '962' '-analyzeduration' '20000000' '-probesize' '20000000' '-i' '/HOVITOS/Media/Movies/Scream (1996)/Scream (1996).mkv' '-filter_complex' '[0:0]hwupload[0];[0]scale_vaapi=w=720:h=404:format=p010[1];[1]hwmap=derive_device=opencl[2];[2]tonemap_opencl=tonemap=mobius:format=nv12:m=bt709:p=bt709:r=tv[3];[3]hwmap=derive_device=vaapi:reverse=1[4];[4]hwupload[5]' '-map' '[5]' '-metadata:s:0' 'language=eng' '-codec:0' 'h264_vaapi' '-b:0' '1293k' '-maxrate:0' '1724k' '-bufsize:0' '3448k' '-r:0' '23.975999999999999' '-filter_complex' '[0:1] aresample=async=1:ocl='\''stereo'\'':rematrix_maxval=0.000000dB:osr=48000[6]' '-map' '[6]' '-metadata:s:1' 'language=eng' '-codec:1' 'libopus' '-b:1' '162k' '-f' 'segment' '-segment_format' 'matroska' '-segment_format_options' 'live=1' '-segment_time' '1' '-segment_header_filename' 'header' '-segment_start_number' '0' '-segment_list' 'http://127.0.0.1:32400/video/:/transcode/session/79loq6j08s5bfyws8z7frlv9/80c1d779-6846-4cb0-bc82-11aef9c9afc2/manifest?X-Plex-Http-Pipeline=infinite' '-segment_list_type' 'csv' '-segment_list_unfinished' '1' '-segment_list_size' '5' '-segment_list_separate_stream_times' '1' '-avoid_negative_ts' 'disabled' '-map_metadata:g' '-1' '-map_metadata:c' '-1' '-map_chapters' '-1' 'chunk-%05d' '-start_at_zero' '-copyts' '-init_hw_device' 'vaapi=vaapi:' '-filter_hw_device' 'vaapi' '-y' '-nostats' '-loglevel' 'quiet' '-loglevel_plex' 'error' '-progressurl' 'http://127.0.0.1:32400/video/:/transcode/session/79loq6j08s5bfyws8z7frlv9/80c1d779-6846-4cb0-bc82-11aef9c9afc2/progress'
Dec 23, 2021 14:46:28.436 [0x7f37f7992b38] DEBUG - [Transcode/JobRunner] Jobs: Starting child process with pid 48087

The file to look at is /tmp/plexinstaller.log. It contains host inventory results.

NOTE:

The client (player) is set for 2Mbps limit. Might want to check that.

Dec 23, 2021 14:46:28.817 [0x7f37f847db38] DEBUG - MDE: Scream (1996): Direct Play is disabled
Dec 23, 2021 14:46:28.817 [0x7f37f847db38] DEBUG - MDE: Scream (1996): no direct play video profile exists for http/mkv/hevc
Dec 23, 2021 14:46:28.817 [0x7f37f847db38] DEBUG - MDE: Scream (1996): no direct play video profile exists for http/mkv/hevc/dca
Dec 23, 2021 14:46:28.817 [0x7f37f847db38] DEBUG - MDE: Scream (1996): no direct play video profile exists for http/mkv/hevc/dca
Dec 23, 2021 14:46:28.817 [0x7f37f847db38] DEBUG - MDE: Scream (1996): no direct play video profile exists for http/mkv/hevc/ac3
Dec 23, 2021 14:46:28.817 [0x7f37f847db38] DEBUG - MDE: Scream (1996): selected media 0 / 20571
Dec 23, 2021 14:46:28.817 [0x7f37f847db38] DEBUG - Streaming Resource: Calculated bandwidth of 85000kbps exceeds bandwidth limit. Changing decision parameters provided by client to fit bandwidth limit of 2000kbps
Dec 23, 2021 14:46:28.817 [0x7f37f847db38] DEBUG - Streaming Resource: Determining preferred transcode encoders through transcode only decision.
Dec 23, 2021 14:46:28.818 [0x7f37f847db38] DEBUG - Scaled up video bitrate to 273681Kbps based on 4.500000x fudge factor.
Dec 23, 2021 14:46:28.818 [0x7f37f847db38] DEBUG - Scaled up video bitrate to 273681Kbps based on 4.500000x fudge factor.
1 Like

The issue is hardware transcoding. It works correctly when tone mapping is disabled, but enabling tone mapping switches everything to software transcoding. This happens at every client bitrate, except native streaming.

EDIT: Everything worked properly earlier this year. A 4K HDR stream could be transcoded with less than 10% CPU usage. Since updating to 1.25.2.5319, HW transcoding does not work, and a single 4K HDR stream utilizes 60-80% of the CPU. I’ve tried downgrading to previous versions, and HW transcoding still does not work with tone mapping.

Here is the contents of /tmp/plexinstaller.log

GNU nano 4.8 plexinstaller.log # Plex Media Server installation configuration info: Thu 23 Dec 2021 02:42:28 >
Init=0
Systemd=1
Custom=0
LinuxContainer=0
NewInstall=0
HaveOverride=0
OverrideFile=“”
PlexUser=“plex”
PlexGroup=“plex”
VideoGroup=“render”
AppSuppDir=“/var/lib/plexmediaserver/Library/Application Support”
PlexTempDir=“/dev/shm”
LangEncoding=“en_US.UTF-8”
ExistingVersion=12200
HaveHardware=1
HaveTranscoderPref=1
NeedUser=0
NeedGroup=0
NeedVideo=0
Verbose=1
Running=0
Errors=0
Warnings=0
HaveIntel=1
HaveIntelCore=1
HaveIntelXeon=0
Havei915=1
HaveNvidia=0
Processor=Intel(R) Core™ i5-10600K CPU @ 4.10GHz
CPUSKU=10600
NeedOpenCL=1
NeedBeignet=0
NeedIntelCompute=1
HaveIntelGmmlib=1
HaveIntelIGCCore=1
HaveIntelIGCOpenCL=1
HaveIntelOpenCL=1
HaveIntelCompute=1
HaveBeignet=1
HaveOpenCL=1
Platform=“System Product Name”
Processor=“Intel(R) Core™ i5-10600K CPU @ 4.10GHz”
Distro=“Ubuntu 20.04.3 LTS”
Kernel="Linux hovitosserver 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28>
Memory=“31955 7682 21195”

Plex Media Server Logs_2021-12-23_20-33-34.zip (3.4 MB)

Chuck, here’s my full log where it’s showing:

Dec 23, 2021 20:23:53.405 [0x7fd86cea0b38] DEBUG - [Now] Adding 1 sessions.
Dec 23, 2021 20:23:53.406 [0x7fd8715e3b38] DEBUG - Completed: [192.168.0.100:48810] 200 GET /status/sessions (17 live) TLS GZIP 0ms 3588 bytes (pipelined: 1)
Dec 23, 2021 20:23:53.496 [0x7fd86c6dab38] ERROR - [Transcoder] [AVHWDeviceContext @ 0x7f628328c600] No matching devices found.
Dec 23, 2021 20:23:53.637 [0x7fd872d62b38] DEBUG - Jobs: '/usr/lib/plexmediaserver/Plex Transcoder' exit code for process 5500 is -11 (signal: Segmentation fault)
Dec 23, 2021 20:23:53.637 [0x7fd86ca62b38] DEBUG - Streaming Resource: Changing client to use software decoding

That’s a known problem Ridley is working on.

I recommend pinging her after the holidays to check status.

Dec 23, 2021 20:23:53.496 [0x7fd86c6dab38] ERROR - [Transcoder] [AVHWDeviceContext @ 0x7f628328c600] No matching devices found.

1 Like

Here are logs showing the issue with a 12mbps transcode, 4K HDR → 1080p SDR with tone mapping enabled. I have hardware accelerated transcoding enabled, but the transcoding is still being done in software and it is using 60% of my CPU

Plex Media Server Logs_2021-12-24_11-29-29.zip (3.5 MB)

it’s invoking it right and seeing the HW.

Dec 24, 2021 11:12:55.923 [0x7f9b0f2fcb38] DEBUG - [Transcode] [FFMPEG] - Direct mapping possible.
Dec 24, 2021 11:12:55.926 [0x7f9b0f2fcb38] DEBUG - [Transcode] TPU: hardware transcoding: final decoder: vaapi, final encoder: vaapi
Dec 24, 2021 11:12:55.926 [0x7f9b0f2fcb38] DEBUG - [Transcode/JobRunner] Job running: EAE_ROOT='/tmp/pms-fc0afe33-612c-4bbd-921d-9e1ad4a1dfc7/EasyAudioEncoder' EnableExtendedVaFormats='1' FFMPEG_EXTERNAL_LIBS='/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Codecs/fb9eae3-4185-linux-x86_64/' LIBVA_DRIVERS_PATH='/usr/lib/plexmediaserver/lib/dri' NEOReadDebugKeys='1' X_PLEX_TOKEN='xxxxxxxxxxxxxxxxxxxx' '/usr/lib/plexmediaserver/Plex Transcoder' '-codec:0' 'hevc' '-hwaccel:0' 'vaapi' '-hwaccel_fallback_threshold:0' '10' '-hwaccel_output_format:0' 'vaapi' '-hwaccel_device:0' 'vaapi' '-codec:1' 'truehd_eae' '-eae_prefix:1' 'bbe8a32c-0142-4f19-b58d-7774914b553d-363_' '-ss' '2560' '-analyzeduration' '20000000' '-probesize' '20000000' '-i' '/HOVITOS/Media/Movies/Matrix Reloaded, The (2003)/Matrix Reloaded, The (2003).mkv' '-filter_complex' '[0:0]hwupload[0];[0]scale_vaapi=w=1280:h=720:format=p010[1];[1]hwmap=derive_device=opencl[2];[2]tonemap_opencl=tonemap=mobius:format=nv12:m=bt709:p=bt709:r=tv[3];[3]hwmap=derive_device=vaapi:reverse=1[4];[4]hwupload[5]' '-map' '[5]' '-metadata:s:0' 'language=eng' '-codec:0' 'h264_vaapi' '-b:0' '2513k' '-maxrate:0' '3351k' '-bufsize:0' '6702k' '-r:0' '23.975999999999999' '-filter_complex' '[0:1] aresample=async=1:ocl='\''7.1'\'':rematrix_maxval=0.000000dB:osr=48000[6]' '-map' '[6]' '-metadata:s:1' 'language=eng' '-codec:1' 'eac3_eae' '-eae_prefix:1' 'bbe8a32c-0142-4f19-b58d-7774914b553d-363_' '-b:1' '444k' '-f' 'segment' '-segment_format' 'matroska' '-segment_format_options' 'live=1' '-segment_time' '1' '-segment_header_filename' 'header' '-segment_start_number' '0' '-segment_list' 'http://127.0.0.1:32400/video/:/transcode/session/bbe8a32c-0142-4f19-b58d-7774914b553d-363/2f25b93b-7e73-45c1-abfd-98f520e403de/manifest?X-Plex-Http-Pipeline=infinite' '-segment_list_type' 'csv' '-segment_list_unfinished' '1' '-segment_list_size' '5' '-segment_list_separate_stream_times' '1' '-avoid_negative_ts' 'disabled' '-map_metadata' '-1' '-map_chapters' '-1' 'chunk-%05d' '-start_at_zero' '-copyts' '-init_hw_device' 'vaapi=vaapi:' '-filter_hw_device' 'vaapi' '-y' '-nostats' '-loglevel' 'quiet' '-loglevel_plex' 'error' '-progressurl' 'http://127.0.0.1:32400/video/:/transcode/session/bbe8a32c-0142-4f19-b58d-7774914b553d-363/2f25b93b-7e73-45c1-abfd-98f520e403de/progress'
Dec 24, 2021 11:12:55.926 [0x7f9b0f2fcb38] DEBUG - [Transcode/JobRunner] Jobs: Starting child process with pid 1012251

Tonemapping in hardware
Transcoding in hardware
CPU converting audio

Looks like subtitle conversion. ASS subtitles?

No ASS subtitles. The .MKV files retain all the PGS subtitles from the disc rip, but no subtitle tracks were enabled by the client’s stream. Again, everything worked correctly earlier this year with the same .MKV files.

Then it’s still subtitles

ASS converts,
PGS burns into the image.

60% CPU for a subtitle burn and audio conversion, on an i5 – a bit higher than I’d expect but not unreasonable.

If you weren’t using the subtitles but the video / audio tracks are “UNK” (unknown) from the rip, the transcoder will start as software and be ready to engage the subtitles

Thanks for the explanation. I appreciate it, especially over the holiday. Is that a change in the Plex coding? Is it something new with the Intel dependencies? Is it specific to tone mapping?

I was able to use HW acceleration with tone mapping on all of my 4K .mkv rips earlier this year on version 1.24, and all of my rips have PGS subs. Unfortunately, rolling back to 1.24 now doesn’t fix the issue. HW acceleration also still works on these files as long as tone mapping isn’t enabled. I’d really prefer not to remux all of my mkvs.

It’s always been this way.

What Plex is doing, which it always has.

  1. (Using the account default desired language)
  2. If the requested playback language is available as an audio track – select it
  3. If not, play the first track (which is almost always a UNK track) and play it
  4. ALSO find a subtitle track (if available) and prepare to use it.
  5. It’s ready to engage (display) the subtitles the instant you turn them on

IF the desired audio matched the default track audio – and you want subtitles-- then it would pause and start burning (a noticable delay) as it refills the buffers to the play

This really does come down to ‘media curation’ and making certain the language you’re going to use the most often is either the only language or the default language track AND you don’t drag around any subtitle tracks you don’t need (A VERY common problem I see in countless log files)

I just checked the files in MKVToolNix, and none of the tracks are flagged “UNK”. They all have proper language flags: “en”, “fr”, “de”, “it”, etc. See attached.

Screenshot 2021-12-24 162144

Respectfully, this doesn’t sound like a media curation issue. This sounds like a software issue. Plex shouldn’t be preparing to use the subtitles unless they’re enabled by the user. I would much prefer HW accelerated tone mapping over instant subtitle availability. At least, it’s something that should be an option for the user.

Do you need all those subtitles?

Conduct the experiment please

  1. Copy the original to a safe place
  2. Now remove all tracks except those you need
    – (Keep: Video, English audio, chapter marks, but no subtitles)
  3. Replace the one PMS currently sees.
  4. Force “Analyze” it again so PMS updates
  5. Now play the file.

I may not be saying it correctly but it does matter.

I tried the experiment. I removed all of the subtitle tracks and left only one English audio track. Hardware accelerated tone mapping still is not working. So, it’s not a subtitle issue. Logs attached.

Screenshot 2021-12-24 191125
Screenshot 2021-12-24 190939

Plex Media Server Logs_2021-12-24_19-09-56.zip (4.1 MB)

Have you considered / tried updating to the latest Intel Compute Runtime drivers provided by Intel at

I did not do any of the development work for this. All I can suggest is making sure the drivers (ICR) are up to date because I don’t see the ‘failed to find device’ error which is known.

It’s going to take Engineering to see what’s really wrong if more than just ICR updating.