Hardware transcoding is not working properly - Please help!

Server Version#: 1.25.7.5604
Player Version#: Android TV 8.31.0.31215 (6f5d4f5e)

I am running Plex Media Server in Docker on my QNAP TS653D. I understand this shoud lsupport hardware transcoding. I am trying to transcode all my 4k stuff to 108p as optimised versions to deal with an issue where they won’t play on a certain device.

Now, it is takig ages to transcode each film (running at 0.3x speed) and using a lot of CPU power (so much it overheats and then the QNAP throttles the processor!). Also, if I watch a 1080p video and transcode to 720p, then under Playback info it says, e.g., Transcode (H264 - H264) but it does not show (hw) anywhere, which I understnad it should indicate if hardware transcoding is working OK.

Is there a surefire way I can confirm/check if it is working?

PS - on the server dashboard is no sign that hardware tanscoding is being used either

The compatibility spreadsheet says “H.264 Output” from HEVC 2160p content, with a comment "Supports decoding 4K HEVC (H.265) & 4K H.264 SDR (8-bit)

Encoding is limited to 1080p output".

This is exactly what I want to do but it doesn’t appears to be using hardware to do it.

Oh - and I have

/dev/dri:/dev/dri

set up on my docker-compose file under devices. If I navigate to /dev/dri I see two items:

crw-------  1 admin administrators 226,   0 2022-03-01 16:42 card0
crw-------  1 admin administrators 226, 128 2022-03-01 16:42 renderD128

Portainer shows the following:

Devices
   0
      CgroupPermissions rwm
      PathInContainer /dev/dri
      PathOnHost /dev/dri

I have checked on the QNAP web interface and Plex transcoder is taking up 70%+ of CPU resources transcoding 1080p HEVC to 720p. H264.

fopr some time (as recommended when the NAS first came out) I had VaapiDriver="i965" manually included in my Preferences.xml. It still didn’t work (in eithe QPKG or Docker) so I have removed this manual change and it is not in my Preferences.xml used by docker. I did try it - but no luck.

Finally - I was having exactly the same issue under Plex as a built in QNAP server, which is why I switched to docker to try and solve it - but the symptoms are the same!

Very happy to provide logs to try and get to the bottom of this issue.

Thank you @FordGuy61 for switching the tag where I had used the wrong one. However, I also had the exact same issue using the QPKG version of PMS so it kind of applies to both!

Another note - I do not see the (hw) show up under transcoding when using my nVidia Shield as the plex server either, and when using different Plex Clients. copudl this be some sort of account issue? I do have a (lifetime) Plex pass.

Here’s something interesting from my Plex logs, however, it doesn’t really help with me fix the issue, it may just help someone diagnose it:

Mar 04, 2022 11:33:13.049 [0x7f7c50f5cb38] DEBUG - [Transcode] Codecs: testing h264_vaapi (encoder)
Mar 04, 2022 11:33:13.049 [0x7f7c50f5cb38] DEBUG - [Transcode] Codecs: hardware transcoding: testing API vaapi
Mar 04, 2022 11:33:13.049 [0x7f7c50f5cb38] DEBUG - [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Generic error in an external library
Mar 04, 2022 11:33:13.049 [0x7f7c50f5cb38] DEBUG - [Transcode] Could not create hardware context for h264_vaapi
Mar 04, 2022 11:33:13.049 [0x7f7c50f5cb38] DEBUG - [Transcode] Codecs: testing h264_nvenc (encoder)
Mar 04, 2022 11:33:13.049 [0x7f7c50f5cb38] DEBUG - [Transcode] Codecs: hardware transcoding: testing API nvenc
Mar 04, 2022 11:33:13.049 [0x7f7c50f5cb38] ERROR - [Transcode] [FFMPEG] - Cannot load libcuda.so.1
Mar 04, 2022 11:33:13.049 [0x7f7c50f5cb38] ERROR - [Transcode] [FFMPEG] - Could not dynamically load CUDA
Mar 04, 2022 11:33:13.049 [0x7f7c50f5cb38] DEBUG - [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Unknown error occurred
Mar 04, 2022 11:33:13.049 [0x7f7c50f5cb38] DEBUG - [Transcode] Could not create hardware context for h264_nvenc
Mar 04, 2022 11:33:13.049 [0x7f7c50f5cb38] DEBUG - [Transcode] Codecs: testing hevc (decoder) with hwdevice vaapi
Mar 04, 2022 11:33:13.050 [0x7f7c50f5cb38] DEBUG - [Transcode] Codecs: hardware transcoding: testing API vaapi
Mar 04, 2022 11:33:13.050 [0x7f7c50f5cb38] DEBUG - [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Generic error in an external library
Mar 04, 2022 11:33:13.050 [0x7f7c50f5cb38] DEBUG - [Transcode] Could not create hardware context for hevc
Mar 04, 2022 11:33:13.050 [0x7f7c50f5cb38] DEBUG - [Transcode] Codecs: testing hevc (decoder) with hwdevice nvdec
Mar 04, 2022 11:33:13.050 [0x7f7c50f5cb38] DEBUG - [Transcode] Codecs: hardware transcoding: testing API nvdec

This assists to be some strange permissions issue because once I’d:

sudo chmod 666 /dev/dri/*

I was then able to hardware transcode. I’m unsure why the permissions for these devices aren’t available to my docker user from the start (I am running docker as an administrator, and even tried changing to run docker as the “admin” user and it still didn’t work until I did the chmod.

Is this a bug, or a setting that needs to be different to enable hardware transcoding?

Hardware accelerated transcoding is not currently working in Plex Media Server on the Shield. Based on some threads in the server-nvidia-shield section, Plex is working on the problem, but there is no mention of when a fix will be available.

Hardware transcoding issues with PMS 1.24.x and 1.25.x? Any details on what the HW transcoding issues are and is a fix in progress?


Someone else will have to assist with QNAP & Docker. I run Plex on a Synology and not in docker, so can’t help with any QNAP specifics.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.