Guide: NVDEC Hardware Acceleration Patch for Plex Media Server on Linux

Nice work on making this an easy to install script!

If there are people who want to make this script even better, maybe consider making some install options.

For example, in my usecase. I have plenty of CPU horses to do all h264 transcodes on my cpu (and have better quality output compared to HW transcoding). But I want to run my HEVC content off of my GPU. Since I have a handful of 4K HEVC 10bit movies/tv-shows. I don’t want all transcodes to slow down, when someone fires this 4K movie up with hardware that needs transcoded output. So I’m now testing the script as follows:

#!/bin/bash
marap=$(cut -c 10-14 <<<"$@")
if [ $marap == "hevc" ]; then
     exec /usr/lib/plexmediaserver/Plex\ Transcoder2 -hwaccel nvdec "$@"
else
     exec /usr/lib/plexmediaserver/Plex\ Transcoder2 "$@"
fi

As also discussed in original thread. This way all cpu intensive transcodes are handles by my Nvidia GPU and all normal H264 content is handles by my CPU with better quality and saving VRAM for other HEVC transcodes :slight_smile:

You could for example use a --hevc-only parameter on the install script for if people want to use it for hevc only content.

I’m just a beginning engineer and don’t really trust myself into making these commits myself. I do like to help by submitting ideas

EDIT:
script above obviously only works for the decoder, in other words, everything HEVC will be decoded by the CPU and encoded by the GPU. Still not optimal, anyone a clue how I could get bash script for Plex to only use HW accelerated encode for HEVC streams?

1 Like