Using Unraid and Quick Sync to transcode in Plex

Intro

Using Plex to stream videos to different devices is very convenient and easy to use. In the background however, there is a lot going on. Different devices require different formats, and the video file you already got might be in a format that specific device can’t play, or maybe the bandwidth is too low and it need to be converted into a lower resolution. Doing this can take a lot of cpu time, but luckily it is easy to offload the video transcoding onto a graphics card.

If you got a processor with built in graphics, you might even be able to use that, and that is exactly what this guide will be doing.

Hardware

This guide is based on

CPU: Intel i7 4790K

Mainboard: Asus Z97-Pro GAMER

Different processors can also be used, but some might not be able to. Use Intel ARK to see your processor’s specifications.

Pre checks

If Intel ARK show your processor to have built in graphics, but you can’t find it during this guide, you might need to attach a hdmi dummy or a monitor to the hdmi port on the IO shield. Without anything attached the built in graphics might not be enabled. Attaching something to the hdmi port might also require a complete power down before getting enabled.

To check if the build in graphics is ready log into unraid, open the terminal, and put this in.

cd /dev/dri
ls

If you are getting an error try putting this in

modprobe i915

Then go back and try again.

If you are still getting an error you probably need to put a dummy or monitor into the hdmi port.

If there is no error, you should be able to find card0 and renderD128 in the list.

After this we need to change the permissions so the docker container can access it, do this in the terminal with this command.

chmod -R 777 /dev/dri

Plex container setup

Having confirmed we got access to the built in graphics, we now need to also give the plex docker container access to it.

First go to the docker tab, find your plex container, and select to edit it.

In the bottom of that page you need to press “Add another Path, Port, Variable, Label or Device”.

From the dropdown select “Device”, and in name insert “/dev/dri” and in value also “/dev/dri”.

Press “Add” followed by “Apply”.

Plex setup

We have now given the plex docker container access to the build in graphics, but we haven’t set it to use it yet. To do that head over to your plex server and go into settings.

Scroll down to “Transcoder” in the menu, and in that menu you need to enable “Use hardware acceleration where available”, if you can’t see that option you probably need to press the “Show advanced” button.

After enabling hardware acceleration, save your settings and head back to your media library.

Let’s test!

Select a video file you want to test with and head into the play settings. On a pc it will most likely use direct play, so set the quality to convert automatically.

Minimize the video by pressing the arrow down in the top left corner of the picture, and head over and press the activity icon.

In the list you should be able to see yourself playing a video, press the show details icon.

Under next to video it should be saying it is transcoding, with a (hw) behind it. And that’s it. The build in graphics in the processor will now handle the video transcoding, and the processor only need to handle transcoding the audio if needed.

Final settings

After having confirmed everything works, we just need to set up so everything will be enabled automatically on startup. For this I like to use the User Scripts plugin.

Create a new script with this content

#!/bin/bash
modprobe i915
chmod -R 777 /dev/dri

Save it, and set the schedule to “At startup of array”.

Add a Comment

Your email address will not be published. Required fields are marked *