[PMS Bug] Hardware accelerated HDR tone mapping broken again. OpenCL is broken in Plex but not in system

Hi, Hardware HDR tone mapping seems to be broken in Plex. Hardware accelerated HDR tone mapping was working for me without any issues in the past. It has been a while that I haven’t watched HDR movies on a SDR screen, but today I did with the result that the whole transcoding process is falling back to Software rather than being done in Hardware.

The error causing the Software transcode seems to be this one (From the Plex logs):
Failed to get number of OpenCL platforms: -1001.

This error makes the whole transcoding pipeline fall back to software.

Running “clinfo -l” works fine and shows the following results:
Platform #0: Intel Gen OCL Driver
`-- Device #0: Intel(R) UHD Graphics Coffee Lake Mobile GT2

So it seems that the OpenCL library loaded by Plex is broken or something.

Without HDR tone mapping enabled, hardware transcoding works fine.

Any ideas what could be going on there or how to fix this issue!? Has there been some faulty updates in Plex lately?

Server Version: 1.23.6.4881
OS: Debian 10.10
Client: Tested with Android and Web

Edit:

Install output:

Setting up plexmediaserver (1.23.6.4881-e2e58f321) …
PlexMediaServer install: PlexMediaServer-1.23.6.4881-e2e58f321 - 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: video
PlexMediaServer install: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install: Temp Directory: /tmp
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: Beignet: Installed
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: Starting Plex Media Server.
PlexMediaServer install: PlexMediaServer-1.23.6.4881-e2e58f321 - Installation successful. Errors: 0, Warnings: 0

For what it’s worth, I just set up hardware transcoding today for Plex. I spent the afternoon getting the Beignet driver complied and installed and OpenCL happy on CentOS 7. Hardware transcoding works fine for everything but HDR → SDR tone mapping and it will revert to software. We’re on different distros, but encountering the same behavior.

I 've verified OpenCL is working with Intel’s tests you can run when you compile the driver from source to verify it complied correctly. Plex’s logging reports it can do the mapping and everything is good, sends the job off, but it will just throw the errors below and fall back to software after a short bit.

Plex Log Excerpt

Aug 13, 2021 22:58:57.485 [0x7fb856b4fb38] Error — [Transcoder] [AVHWDeviceContext @ 0x7f1dce4d5ac0] Failed to get number of OpenCL platforms: -1001.
Aug 13, 2021 22:58:57.485 [0x7fb856cedb38] Error — [Transcoder] [AVHWDeviceContext @ 0x7f1dce4d5ac0] Failed to get number of OpenCL platforms: -1001.
Aug 13, 2021 22:58:57.486 [0x7fb8592cbb38] Error — [Transcoder] [Parsed_hwmap_2 @ 0x7f1dcad568c0] Failed to created derived device context: -19.
Aug 13, 2021 22:58:57.486 [0x7fb856ccab38] Error — [Transcoder] [Parsed_hwmap_2 @ 0x7f1dcad568c0] Failed to configure output pad on Parsed_hwmap_2
Aug 13, 2021 22:58:57.489 [0x7fb856b4fb38] Error — [Transcoder] Error reinitializing filters!
Aug 13, 2021 22:58:57.489 [0x7fb856cedb38] Error — [Transcoder] Failed to inject frame into filter network: No such device
Aug 13, 2021 22:58:57.489 [0x7fb8592cbb38] Error — [Transcoder] Error while processing the decoded data for stream #0:0
Aug 13, 2021 22:51:47.904 [0x7fb858269b38] VERBOSE - Didn't receive a request from 127.0.0.1:41290: End of file
Aug 13, 2021 22:51:47.905 [0x7fb859b15b38] VERBOSE - JobManager: child process with handle 5386 exited
Aug 13, 2021 22:51:47.905 [0x7fb859b15b38] DEBUG - Jobs: '/usr/lib/plexmediaserver/Plex Transcoder' exit code for process 5386 is 1 (failure)
Aug 13, 2021 22:51:47.905 [0x7fb856b4db38] DEBUG - Streaming Resource: Changing client to use software decoding

clinfo -l

Platform #0: Intel Gen OCL Driver
 `-- Device #0: Intel(R) HD Graphics Kabylake Workstation GT2
1 Like

Yes, this seems to be an issue with newer versions of Plex (> 1.22.0)

I was very excited when Plex released support for hardware transcoding of HDR content. I made sure to install the necessary OpenCL bits on my Plex server (running Fedora 34) and confirmed that transcoding HEVC HDR content to H264 SDR was assisted by hardware - as evidenced by Tautulli and significantly reduced CPU usage on my server.

If I downgrade to plexmediaserver-1.22.0.4163-d8c4875dd (found here: https://github.com/axlecrusher/plex_download_urls), transcoding is done in hardware. Example:

STREAM
Transcode (Speed: 3.4)
CONTAINER
Converting (MKV  MP4)
VIDEO
Transcode (HEVC (HW) 1080p HDR  H264 (HW) 1080p SDR)
AUDIO
Transcode (AAC 7.1  AAC Stereo)
SUBTITLE
None

I tried a number of newer Plex builds, and everything after 1.22.0.4163-d8c4875dd, starting with 1.22.1.4228-724c56e62 goes back to software transcoding. The latest build, plexmediaserver-1.24.2.4973-2b1b51db9, is included. Example:

STREAM
Transcode (Speed: 0.7)
CONTAINER
Converting (MKV  MP4)
VIDEO
Transcode (HEVC 1080p HDR  H264 1080p SDR)
AUDIO
Transcode (AAC 7.1  AAC Stereo)
SUBTITLE
None

Some info from my server in case it helps:

uname -a
Linux x.x.x.x 5.13.13-200.fc34.x86_64 #1 SMP Thu Aug 26 17:06:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
rpm -qa | grep opencl
opencl-headers-3.0-7.20210216gitd1b936b.fc34.noarch
intel-igc-opencl-1.0.8517-1.fc34.x86_64
intel-opencl-21.35.20826-1.fc34.x86_64
clinfo -l
Platform #0: Intel(R) OpenCL HD Graphics
 `-- Device #0: Intel(R) UHD Graphics 630 [0x3e91]
cat /proc/cpuinfo

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz
stepping : 11
microcode : 0xea
cpu MHz : 2288.021
cache size : 6144 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
vmx flags : vnmi preemption_timer invvpid ept_x_only ept_ad ept_1gb flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest ple pml ept_mode_based_exec
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds
bogomips : 7200.00
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:

...
1 Like

Unable to replicate on i7-8809g CPU.

DEBUG (not VERBOSE) logs which capture the first 30 seconds of playback are needed to investigate further.

  1. /proc/cpuinfo
processor	: 7
vendor_id	: GenuineIntel
cpu family	: 6
model		: 158
model name	: Intel(R) Core(TM) i7-8809G CPU @ 3.10GHz
stepping	: 9
microcode	: 0xea
cpu MHz		: 3100.000
cache size	: 8192 KB
  1. Distro & version
[chuck@lizum Downloads.1663]$ cat /etc/os-release && uname -a
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
Linux lizum 5.11.0-34-generic #36~20.04.1-Ubuntu SMP Fri Aug 27 08:06:32 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[chuck@lizum Downloads.1664]$ 
  1. Installation
[chuck@lizum Downloads.1659]$ sudo dpkg -i plexmediaserver_1.24.2.4973-2b1b51db9_amd64.deb
Selecting previously unselected package plexmediaserver.
(Reading database ... 351124 files and directories currently installed.)
Preparing to unpack plexmediaserver_1.24.2.4973-2b1b51db9_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.24.2.4973-2b1b51db9) ...
Setting up plexmediaserver (1.24.2.4973-2b1b51db9) ...
PlexMediaServer install: PlexMediaServer-1.24.2.4973-2b1b51db9 - Installation starting.
PlexMediaServer install: 
PlexMediaServer install: Now installing based on:
PlexMediaServer install:   Installation Type:   New
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:      /tmp 
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:   Beignet:             Not Installed
PlexMediaServer install: 
PlexMediaServer install: WARNING: The Beignet-OpenCL library, required for hardware transcoding of HDR content, is missing.
PlexMediaServer install:          Please install package:  'beignet-opencl-icd'
PlexMediaServer install:  
PlexMediaServer install: INFO:    dpkg will install package 'beignet-opencl-icd' automatically
PlexMediaServer install:          if available for your host upon successful installation of Plex Media Server.
PlexMediaServer install:  
PlexMediaServer install: Completing final configuration.
Created symlink /etc/systemd/system/multi-user.target.wants/plexmediaserver.service → /lib/systemd/system/plexmediaserver.service.
PlexMediaServer install: PlexMediaServer-1.24.2.4973-2b1b51db9 - Installation successful.  Errors: 0, Warnings: 1
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
[chuck@lizum Downloads.1660]$ sudo apt-get install beignet-opencl-icd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  beignet-opencl-icd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 16.0 MB of archives.
After this operation, 66.0 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 beignet-opencl-icd amd64 1.3.2-7build1 [16.0 MB]
Fetched 16.0 MB in 1s (16.4 MB/s)           
Selecting previously unselected package beignet-opencl-icd:amd64.
(Reading database ... 353632 files and directories currently installed.)
Preparing to unpack .../beignet-opencl-icd_1.3.2-7build1_amd64.deb ...
Unpacking beignet-opencl-icd:amd64 (1.3.2-7build1) ...
Setting up beignet-opencl-icd:amd64 (1.3.2-7build1) ...
[chuck@lizum Downloads.1661]$ sudo dpkg -i plexmediaserver_1.24.2.4973-2b1b51db9_amd64.deb
(Reading database ... 353678 files and directories currently installed.)
Preparing to unpack plexmediaserver_1.24.2.4973-2b1b51db9_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.24.2.4973-2b1b51db9) over (1.24.2.4973-2b1b51db9) ...
Setting up plexmediaserver (1.24.2.4973-2b1b51db9) ...
PlexMediaServer install: PlexMediaServer-1.24.2.4973-2b1b51db9 - 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:      /tmp 
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:   Beignet:             Installed
PlexMediaServer install:  
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: Starting Plex Media Server.
PlexMediaServer install: PlexMediaServer-1.24.2.4973-2b1b51db9 - Installation successful.  Errors: 0, Warnings: 0
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
[chuck@lizum Downloads.1662]$ date
Fri 10 Sep 2021 07:39:44 PM EDT
[chuck@lizum Downloads.1663]$ 
  1. Actual playback and transcode status

Thanks for attempting to reproduce! I’ve captured some DEBUG logs from both versions

and notice the following in the plexmediaserver-1.25.0.5220-de6e61df7.x86_64 logs (this is the latest version which doesn’t do hardware accelerated tone mapping on my machine):

Nov 12, 2021 16:37:11.065 [0x7f4bf1392b38] Debug — [Transcode/6scgjkgaazf8tkepou3b61x8] Asked for segment 0 from session.
Nov 12, 2021 16:37:11.103 [0x7f4bf0902b38] Error — [Transcoder] [AVHWDeviceContext @ 0x7f698813eac0] Failed to get number of OpenCL platforms: -1001.
Nov 12, 2021 16:37:11.103 [0x7f4bf0902b38] Error — [Transcoder] [AVHWDeviceContext @ 0x7f698813eac0] Failed to get number of OpenCL platforms: -1001.
Nov 12, 2021 16:37:11.103 [0x7f4bf0902b38] Error — [Transcoder] [Parsed_hwmap_2 @ 0x7f698820b040] Failed to created derived device context: -19.
Nov 12, 2021 16:37:11.103 [0x7f4bf0902b38] Error — [Transcoder] [Parsed_hwmap_2 @ 0x7f698820b040] Failed to configure output pad on Parsed_hwmap_2
Nov 12, 2021 16:37:11.105 [0x7f4bf0902b38] Error — [Transcoder] Error reinitializing filters!
Nov 12, 2021 16:37:11.105 [0x7f4bf0902b38] Error — [Transcoder] Failed to inject frame into filter network: No such device
Nov 12, 2021 16:37:11.105 [0x7f4bf0902b38] Error — [Transcoder] Error while processing the decoded data for stream #0:0
Nov 12, 2021 16:37:11.140 [0x7f4bf2162b38] Debug — Jobs: '/usr/lib/plexmediaserver/Plex Transcoder' exit code for process 1387144 is 1 (failure)
Nov 12, 2021 16:37:11.140 [0x7f4bf0327b38] Debug — Streaming Resource: Changing client to use software decoding

and then

Nov 12, 2021 16:37:12.371 [0x7f4bf0902b38] Debug — [Transcode] Transcoder: session 6scgjkgaazf8tkepou3b61x8 indicated fallback to software decoding

the logs from plexmediaserver-1.22.0.4163-d8c4875dd.x86_64 don’t show this issue and hardware tone mapping works beautifully.

Seems that others have experienced the same with other CPUs: 4K HDR HEVC HW transcoding is broken on i5-11600K (Rocket Lake) - #5 by emb531

I’m happy to provide the full logs but I’m a bit worried that they might contain sensitive info. Is it possible to send those directly to you instead of making them publicly available?

It’s not that it’s “broken again” – It doesn’t yet support RocketLake.

HOWEVER —

Have you seen the new release?

There are reports it’s transcoding a “F****ton” on the new GPUs

Got it, perhaps I crossed the streams while linking to that other thread.

I have a i3-8100 processor, definitely not Rocket Lake, but have the same experience where plexmediaserver-1.22.0.4163-d8c4875dd.x86_64 works beautifully with hardware accelerated tone mapping, and later builds don’t.

This version seems to be mentioned all over the Plex forums, lots of examples here: 4K HDR HEVC HW transcoding is broken on 1.22.1.4200 - #32 by ChuckPa

Is this still considered a regression that Plex engineering is working on? Are there any known fixes for the issue or should I just stay on the older version?

@swindmill

I need your DEBUG (not VERBOSE) logs ZIP which capture this.
Also please state whether in a VM/container and the distro+version in use

I’m running an i7-8809 (same QSV ASIC as you) without issue.

I also have this same issue on a 9900k on the latest PMS version plexmediaserver_1.25.2.5319-c43dc0277_amd64 but reverting to plexmediaserver_1.22.0.4163-d8c4875dd_amd64 allows for correct (hw) transcoding of 4k HDR → SDR.

Preparing to unpack plexmediaserver_1.22.0.4163-d8c4875dd_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.22.0.4163-d8c4875dd) over (1.25.2.5319-c43dc0277) ...
Setting up plexmediaserver (1.22.0.4163-d8c4875dd) ...
PlexMediaServer install: PlexMediaServer-1.22.0.4163-d8c4875dd - 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 QSV Hardware:  Found
PlexMediaServer install:   Nvidia GPU card:     Not Found
PlexMediaServer install:
PlexMediaServer install:   OpenCL library:      Installed
PlexMediaServer install:   Beignet package:     Installed
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: Starting Plex Media Server.
PlexMediaServer install: PlexMediaServer-1.22.0.4163-d8c4875dd - Installation successful.  Errors: 0, Warnings: 0
Processing triggers for libc-bin (2.34-0ubuntu3) ...
Processing triggers for mailcap (3.69ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...

This seems to show the old version seeing “Intel QSV Hardware” correctly and that does work, while the newer install shows this:

sudo dpkg -i plexmediaserver_1.25.2.5319-c43dc0277_amd64.deb
(Reading database ... 222672 files and directories currently installed.)
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: Starting Plex Media Server.
PlexMediaServer install: PlexMediaServer-1.25.2.5319-c43dc0277 - Installation successful.  Errors: 0, Warnings: 0
Processing triggers for libc-bin (2.34-0ubuntu3) ...
Processing triggers for mailcap (3.69ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...

Also seemingly seeing all of the right hardware and opencl dependencies. Despite this, the newer version does not correctly use HW to transcode HD to SDR, at least for 4k content. I reinstalled the newest version to check (again) and it is still broken. reverted again, and it works.

Thanks for any clues on getting it working better on the newer version!

@athines

In those versions, you’re showing the old transcoder versus the recently updated transcoder (which switched to Intel Compute Runtime for the -9xxx and above CPUs).

Might I also have the server DEBUG log files which capture the playback attempt failure?

I will send you the debug log file zip! I could not figure out how to DM so I am uploading it here. -redacted-

To me, this looks like the issue area:

Dec 20, 2021 23:57:09.351 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] Starting a transcode session nu7k53w24oio4ag21e2gpug6 at offset 102.0 (state=3)
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] TPU: hardware transcoding: enabled, but no hardware decode accelerator found
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [Universal] Using local file path instead of URL: /Vault_3/Media/Movies/The Lord of the Rings - The Fellowship of the Ring (2001) (Extended Edition)/The Lord of the Rings The Fellowship of the Ring (2001) [Extended Edition] - Part1.mkv
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] Codecs: hardware transcoding: testing API vaapi
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x41524742 -> bgra.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x42475241 -> argb.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x41424752 -> rgba.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x52474241 -> abgr.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x58524742 -> bgr0.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x42475258 -> 0rgb.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x58424752 -> rgb0.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x52474258 -> 0bgr.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x30335241 -> unknown.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x30334241 -> unknown.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x30335258 -> x2rgb10le.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x30334258 -> unknown.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x36314752 -> unknown.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x50424752 -> unknown.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x50524742 -> unknown.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x56555941 -> unknown.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x30303859 -> gray.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x3231564e -> nv12.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x3132564e -> unknown.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x32595559 -> yuyv422.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x59565955 -> uyvy422.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x32315659 -> yuv420p.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x30323449 -> yuv420p.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x50313134 -> yuv411p.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x48323234 -> yuv422p.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x56323234 -> yuv440p.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x50343434 -> yuv444p.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x33434d49 -> unknown.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x30313050 -> p010le.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Created surface 0.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Direct mapping possible.
Dec 20, 2021 23:57:09.352 [0x7f9013ac2b38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] TPU: hardware transcoding: final decoder: , final encoder: 

In particular, this: “TPU: hardware transcoding: enabled, but no hardware decode accelerator found”
seems odd but perhaps it is fine.

@athines

This is weird but not uncommon with Ubuntu 21. I have no explanation either at this point. I don’t see it happen on Ubuntu 20.04.x LTS

I am not seeing subtitles involved.

Do you have a subtitle stream in the file which fails but not in the first ?

It works –

/Vault_3/Media/Movies/The Lord of the Rings - The Fellowship of the Ring (2001) (Extended Edition)/The Lord of the Rings The Fellowship of the Ring (2001) [Extended Edition] - Part1.mkv'
Dec 20, 2021 23:57:05.958 [0x7f9013b0eb38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x48323234 -> yuv422p.
Dec 20, 2021 23:57:05.958 [0x7f9013b0eb38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x56323234 -> yuv440p.
Dec 20, 2021 23:57:05.958 [0x7f9013b0eb38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x50343434 -> yuv444p.
Dec 20, 2021 23:57:05.958 [0x7f9013b0eb38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x33434d49 -> unknown.
Dec 20, 2021 23:57:05.958 [0x7f9013b0eb38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Format 0x30313050 -> p010le.
Dec 20, 2021 23:57:05.958 [0x7f9013b0eb38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Created surface 0.
Dec 20, 2021 23:57:05.958 [0x7f9013b0eb38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] [FFMPEG] - Direct mapping possible.
Dec 20, 2021 23:57:05.958 [0x7f9013b0eb38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6] TPU: hardware transcoding: final decoder: vaapi, final encoder: vaapi
Dec 20, 2021 23:57:05.958 [0x7f9013b0eb38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6/JobRunner] Job running: EAE_ROOT='/tmp/pms-21374217-1a6e-474b-9da7-8c59f111f950/EasyAu'/Vault_3/Media/Movies/The Lord of the Rings - The Fellowship of the Ring (2001) (Extended Edition)/The Lord of the Rings The Fellowship of the Ring (2001) [Extended Edition] - Part1.mkv'dioEncoder' 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' 'nu7k53w24oio4ag21e2gpug6_' '-analyzeduration' '20000000' '-probesize' '20000000' '-i' '/Vault_3/Media/Movies/The Lord of the Rings - The Fellowship of the Ring (2001) (Extended Edition)/The Lord of the Rings The Fellowship of the Ring (2001) [Extended Edition] - Part1.mkv' '-filter_complex' '[0:0]hwupload[0];[0]scale_vaapi=w=2276:h=1280: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' '88875k' '-maxrate:0' '118501k' '-bufsize:0' '237002k' '-r:0' '23.975999999999999' '-force_key_frames:0' 'expr:gte(t,n_forced*1)' '-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' 'libmp3lame' '-q:1' '0' '-segment_format' 'mpegts' '-f' 'ssegment' '-individual_header_trailer' '0' '-segment_time' '1' '-segment_start_number' '0' '-segment_copyts' '1' '-segment_time_delta' '0.0625' '-segment_list' 'http://127.0.0.1:32400/video/:/transcode/session/nu7k53w24oio4ag21e2gpug6/4dce8950-4082-4c17-a068-471c1f928651/manifest?X-Plex-Http-Pipeline=infinite' '-segment_list_type' 'csv' '-segment_list_size' '5' '-segment_list_separate_stream_times' '1' '-segment_list_unfinished' '1' '-max_delay' '5000000' '-avoid_negative_ts' 'disabled' '-map_metadata' '-1' '-map_chapters' '-1' 'media-%05d.ts' '-start_at_zero' '-copyts' '-vsync' 'cfr' '-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/nu7k53w24oio4ag21e2gpug6/4dce8950-4082-4c17-a068-471c1f928651/progress'
Dec 20, 2021 23:57:05.958 [0x7f9013b0eb38] DEBUG - [Transcode/nu7k53w24oio4ag21e2gpug6/JobRunner] Jobs: Starting child process with pid 168097
Dec 20, 2021 23:57:05.960 [0x7f9013ac2b38] DEBUG - Request: [127.0.0.1:51300 (Loopback)] PUT /video/:/transcode/session/nu7k53w24oio4ag21e2gpug6/4dce8950-4082-4c17-a068-471c1f928651/progress?status=startup (13 live) Signed-in Token (athines) (range: bytes=0-) 
Dec 20, 2021 23:57:05.960 [0x7f9014925b38] DEBUG - Completed: [127.0.0.1:51300] 204 PUT /video/:/transcode/session/nu7k53w24oio4ag21e2gpug6/4dce8950-4082-4c17-a068-471c1f928651/progress?status=startup (13 live) 0ms 203 bytes (pipelined: 1) (range: bytes=0-) 
Dec 20, 2021 23:57:05.962 [0x7f9013a9fb38] DEBUG - Request: [127.0.0.1:51300 (Loopback)] PUT /video/:/transcode/session/nu7k53w24oio4ag21e2gpug6/4dce8950-4082-4c17-a068-471c1f928651/progress?status=startup (13 live) Signed-in Token (athines) (range: bytes=0-) 

It fails –

'/Vault_3/Media/Movies/The Lord of the Rings - The Fellowship of the Ring (2001) (Extended Edition)/The Lord of the Rings The Fellowship of the Ring (2001) [Extended Edition] - Part1.mkv'
Dec 20, 2021 23:57:06.264 [0x7f9013a5eb38] DEBUG - [FFMPEG] - Format 0x32315659 -> yuv420p.
Dec 20, 2021 23:57:06.264 [0x7f9013a5eb38] DEBUG - [FFMPEG] - Format 0x30323449 -> yuv420p.
Dec 20, 2021 23:57:06.264 [0x7f9013a5eb38] DEBUG - [FFMPEG] - Format 0x50313134 -> yuv411p.
Dec 20, 2021 23:57:06.264 [0x7f9013a5eb38] DEBUG - [FFMPEG] - Format 0x48323234 -> yuv422p.
Dec 20, 2021 23:57:06.264 [0x7f9013a5eb38] DEBUG - [FFMPEG] - Format 0x56323234 -> yuv440p.
Dec 20, 2021 23:57:06.264 [0x7f9013a5eb38] DEBUG - [FFMPEG] - Format 0x50343434 -> yuv444p.
Dec 20, 2021 23:57:06.264 [0x7f9013a5eb38] DEBUG - [FFMPEG] - Format 0x33434d49 -> unknown.
Dec 20, 2021 23:57:06.264 [0x7f9013a5eb38] DEBUG - [FFMPEG] - Format 0x30313050 -> p010le.
Dec 20, 2021 23:57:06.264 [0x7f9013a5eb38] DEBUG - [FFMPEG] - Created surface 0.
Dec 20, 2021 23:57:06.264 [0x7f9013a5eb38] DEBUG - [FFMPEG] - Direct mapping possible.
Dec 20, 2021 23:57:06.265 [0x7f9013a5eb38] DEBUG - TPU: hardware transcoding: final decoder: , final encoder: 
Dec 20, 2021 23:57:06.265 [0x7f9013a5eb38] DEBUG - [JobRunner] Job running: EAE_ROOT='/tmp/pms-21374217-1a6e-474b-9da7-8c59f111f950/EasyAudioEncoder' 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' X_PLEX_TOKEN='xxxxxxxxxxxxxxxxxxxx' '/usr/lib/plexmediaserver/Plex Transcoder' '-codec:0' 'hevc' '-codec:1' 'truehd_eae' '-eae_prefix:1' 'nu7k53w24oio4ag21e2gpug6_' '-analyzeduration' '20000000' '-probesize' '20000000' '-i' '/Vault_3/Media/Movies/The Lord of the Rings - The Fellowship of the Ring (2001) (Extended Edition)/The Lord of the Rings The Fellowship of the Ring (2001) [Extended Edition] - Part1.mkv' '-filter_complex' '[0:0]scale=w=2276:h=1280:force_divisible_by=4[0];[0]format=p010,tonemap=mobius[1];[1]format=pix_fmts=yuv420p|nv12[2]' '-map' '[2]' '-metadata:s:0' 'language=eng' '-codec:0' 'libx264' '-crf:0' '16' '-maxrate:0' '118501k' '-bufsize:0' '237002k' '-r:0' '23.975999999999999' '-preset:0' 'veryfast' '-x264opts:0' 'subme=2:me_range=4:rc_lookahead=10:me=hex:8x8dct=1' '-force_key_frames:0' 'expr:gte(t,n_forced*1)' '-filter_complex' '[0:1] aresample=async=1:ocl='\''stereo'\'':rematrix_maxval=0.000000dB:osr=48000[3]' '-map' '[3]' '-metadata:s:1' 'language=eng' '-codec:1' 'libmp3lame' '-q:1' '0' '-segment_format' 'mpegts' '-f' 'ssegment' '-individual_header_trailer' '0' '-segment_time' '1' '-segment_start_number' '0' '-segment_copyts' '1' '-segment_time_delta' '0.0625' '-segment_list' 'http://127.0.0.1:32400/video/:/transcode/session/nu7k53w24oio4ag21e2gpug6/4dce8950-4082-4c17-a068-471c1f928651/manifest?X-Plex-Http-Pipeline=infinite' '-segment_list_type' 'csv' '-segment_list_size' '5' '-segment_list_separate_stream_times' '1' '-segment_list_unfinished' '1' '-max_delay' '5000000' '-avoid_negative_ts' 'disabled' '-map_metadata' '-1' '-map_chapters' '-1' 'media-%05d.ts' '-start_at_zero' '-copyts' '-vsync' 'cfr' '-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/nu7k53w24oio4ag21e2gpug6/4dce8950-4082-4c17-a068-471c1f928651/progress'
Dec 20, 2021 23:57:06.265 [0x7f9013a5eb38] DEBUG - [JobRunner] Jobs: Starting child process with pid 168138
Dec 20, 2021 23:57:06.265 [0x7f9013a5eb38] DEBUG - Started session successfully: nu7k53w24oio4ag21e2gpug6
Dec 20, 2021 23:57:06.266 [0x7f9013b0eb38] DEBUG - Request: [127.0.0.1:51302 (Loopback)] PUT /video/:/transcode/session/nu7k53w24oio4ag21e2gpug6/4dce8950-40

I’m not certain I understand - I am not enabling subtitles certainly, and while there are subtitles (24 languages, PGS) that could be selected, they’re not on- it is on “None” in the player UI. Is the presence of subtitles as an option causing this?

What I’ve found is that subtitles in the file cause problems (because they get enabled) when

  1. The default track is tagged ‘un’ (unknown) language
  2. The requested language doesn’t match the default language track
  3. There exists a subtitle in the file which satisfies the language requirement.

To me, this falls into “curating the media”.

I don’t carry around all those languages. Why would it make sense to?
English is the spoken language in this household.

Therefore, when I rip media from the discs,

  1. I select the English language track
  2. If there are “Forced English subtitles” , I select them as well.
  3. I select the chapter markers the studio placed in there.

Everything else is extra and unwanted content to me.

My playback experience is very clean.

If you want to try this, I recommend the tool “mkvtoolnix-gui”
(sudo apt install mkvtoolnix mkvtoolnix-gui).

The GUI lets you uncheck the boxes you don’t want. it’s that simple.

You do configure an output directory (where you want the modified file to go.

What it does is “filter” through the streams. It copies those tracks you selected to the output file leaving the others behind.

In the end, I have exactly what I want with no baggage to interfere

That makes sense, though this still seems odd - on this file the audio language is already set to english, and no subtitles are enabled so they souldn’t be knocking it out of hw transcoding. If I roll back to the earlier version (so, using the older transcoder) it seems to not hit this same speedbump, but on the new one it looks like it starts playing then .3 seconds later it restarts playing with sw transcoding instead of hw. This behavior is consistent across every 4k hdr file I attempt. Any suggestions on getting the hw transcoding working as intended on ubuntu 21 without having to revert to the older PMS version? I can look into stripping out the subtitle files but that seems like an odd reason for this to happen and still unintended behavior.

how about running some controlled test cases?

These controlled test case have predictable behavior and are well known.

They remove all the subitles / audio track / other things which can go wrong.

http://jell.yfish.us.

I would grab H.264 and H.265 , up to 80 Mbps.

Create a folder to put them all in.
Create a “Other Videos” type library section.
You don’t need thumbnails – turn that all off

Now you can check pure hardware transcoding from 80 → whatever and confirm it’s working consistently.

Sure will do! I am also testing stripping the subtitles from a movie - if that works it will be interesting, though not an ideal solution as some movies I in fact do want subtitles on (though I guess they’d be software transcoded as a result anyway)

Edit - I did remove the subtitles from a movie and it still demonstrates the same behavior as before.

after you removed the subtitles … and replaced the file… did you Analyze it so Plex would know the subtitles are gone?

It did show “none” in the subtitles options with no other options, but I will analyze and re-test. The jellyfish videos played back just fine but as they do not appear to be HDR originally they do not demonstrate the curious behavior. I tested up to the 400mbps main 10 version and it played back but transcoded via cpu (not hardware) but was able to keep up as there was no tone mapping apparently.

Edit- I just re tested after analyzing the movie file again and it still does the same thing - HDR to SDR transcoding without (hw)

The JellyFish HEVC files are HDR

Please observe.

Screenshot from 2021-12-21 01-30-36