HEVC/H265 Hardware decode to CPU encode on Linux?

Hello All,

I am starting to have issues streaming to clients with h265 video. It just takes up way too much CPU. Encoding h264 works great and I can support many, many clients this way. I have 24 broadwell xeon cores and gigabit upload. h264 was never a problem for me.

Most of my clients can’t do h265. So when they launch an h265 video, it gets converted to h264. The problem is that decoding h265 on my CPU is really eating up a TON of compute power.

If I installed a video card on my Linux PMS server. Can I do hardware decoding on the video card and use the CPU to do the h264 encoding? Currently the documentation from Plex indicates that this is not possible. But I’m not sure when it was tested.

Thanks!

What are the processor specifics? This determines everything.
With respect to “Broadwell” , if this is the CPU https://ark.intel.com/products/93790/Intel-Xeon-Processor-E7-8890-v4-60M-Cache-2_20-GHz then you have no hardware accelerated transcoding because the CPU does not have Intel Quick Sync Video (QSV) capability.

If you are willing to take on the task of installing the appropriate codecs and libraries for your installation (libva and libvaapi 2.0), such that it presents the GPU(s) to the OS as /dev/dri/renderD128, PMS will be able to see and utilize it.

Hi ChuckPA,

I am also interested in the functionality requested by adambahe.

My PMS (on linux) has more than enough power to manage software encoding in H264 for all my users, but the H265 decoding only using the CPU is a much bigger challenge.

I can activate hardware transcoding, no worries, but it is at the cost of a loss of quality in the transcoded stream for some of my users (my mother, not to name it: p). Its internet connection is quite miserable, and at low bitrate the hardware transcoding does not give a good enough result…

Is there a way to only enable hardware decoding, while letting the CPU do the H264 encoding ?

Thanks by advance !

What you’re asking is: Enable HW transcoding for H.264 only?
If so, then no, that’s not possible

A broadwell CPU, because of it’s generation, will have considerably lower HW transcode quality than its younger sibling (KabyLake / CoffeeLake). Each generation of silicon is, obviously, getting better.

I was doing a tour on the forum to see if there was something new, and I only see your answer now @ChuckPa!

No, I wanted to say activate the hardware decoding, leaving the hardware encoding off.
I want to benefit from the quality of the software encoding, while relieving the CPU on the decoding, especially when playing H265 movies.

Unfortunately we don’t have that level of control.

I appreciate the finer fidelity that comes with software encoding but in the newer generation chips (-7xxx series in particular), I can’t tell on my tablet or phone. The number of physical size makes it impossible to see (to me) any difference between the two.

When sending to the TV, I DirectPlay or DirectStream (audio convert only). The video is untouched.

then really you should not even be bothering with 265. you are causing your own pain by doing so.

Thanks for your reply @ChuckPa.

As explained, it is not only a question of quality, but a question of quality vs size: My mother has a very weak internet connection.

I will keep the HW transcoding off until the fiber arrives at home!

Thank you for the most worthless response I have ever had the pleasure to laugh at in my years on the internet.

Thankfully, Plex has resolved the issue and now supports GPU encoding/decoding on Linux.

Well glad I could at least give you a good laugh. You are welcome.

Plex currently supports NVIDIA and INTEL gpu ENCODING on linux and has for a while.

INTEL gpu linux DECODING has also been working for awhile and is currently the only official supported plex linux decoder.

Plex is in the process of supporting NVIDIA gpu DECODING on linux, but has not released or announced anything official about it.

Which you may apparently be aware of, some folks, including myself, have used a workaround to get it working in advance of release.

Once released it will be great for many people. However keep in mind that there is still no HDR to SDR conversion, so converting 4k/hdr to any sdr is still going to be rather pointless.

edit: forgot to specify NVIDIA vs INTEL support

If I may augment what Plex currently does support,

On Linux

  1. On-CPU Intel QSV hardware decoding and encoding has been a feature since PMS 1.6.0 - H.264 encoding only.
  2. PMS does not transcode to HEVC targets (H.265) at this time; H.264 encoding only.
  3. External GPU encoding has been available for some time when manually configured - H.264 encoding only.
  4. External GPU encoding for nVidia GPUs on capable QNAP products (PMS 1.15.0) - H.264 only.
  5. External GPU decoding work is in progress and will be complete with the next major transcoder update.
1 Like