Plex HW Transcoding using AMD VCE and VA-API?

server-linux

#1

Hi there,

I've recently upgraded my HP Microserver Gen8 server with a Xeon E3-1265L V2 CPU.
This one features an Intel® HD Graphics 2500 GPU with QuickSync capabilities.
But unfortunately the bios of the Microserver Gen8 won't allow the integrated GPU to be activated.
And since HP bios images a signed.. there's also no possibility to mod it.

So then I came up with the idea to install a dedicated GPU for transcoding.
I can only fit a low-profile PCI-E card, so I can go for nvidia and use nvenc (which is officially supported), but the consumer cards are limited to 2 streaming sessions only...
This sucks big time as the third and fourth transcode will still hit the CPU..

So then I was looking into AMD cards with VCE capabilities as they now also feature VA-API support trough the mesa drivers.
According to the FFMpeg wiki it's only interlacing which is currently broken while encoding.
See: https://trac.ffmpeg.org/wiki/Hardware/VAAPI (AMD / Mesa)

Has anyone tried it?
I suppose if the drivers are correctly installed, it should run automatically, since the FFMPeg command for encoding with VA-API would be the same as for Intel QuickSync.


#2

External GPU card support is only if you enable it yourself. It is not supported by Plex at this time nor is AMD’s equivalent of QSV.

In order for PMS to use any means other than QSV, the device node /dev/dri/renderD128 must exist.


#3

Thank you ChuckPA.

Yes, when using a recent kernel, the amdgpu driver should provide a “/dev/dri/renderD128” node for use with va-api.

Only downside is that polaris doesn’t support B-frames and vega isn’t supported yet.
But the R9 series should encode h264 up to 4k resolutions with B-frame support, so the ffmpeg command-line should be the same as for QSV.


#4

@“JohnnyBr@v0”

That is exactly how I understand it will be too. When vega support comes , it should all be good.


#5

I have a rx480 and this is the commands I use. you will need ffmpeg built with libfdk_aac support or use aac that is built in.
This is my specs I’m not sure how new of a ffmpeg and mesa you need for h265 to work. I’m using mesa-git and ffmpeg-git
OpenGL renderer string: AMD Radeon (TM) RX 480 Graphics (POLARIS10, DRM 3.26.0, 4.17.0-1-git+, LLVM 7.0.0) OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.2.0-devel (git-135e4d434f)

mp4 h264 -vaapi_device /dev/dri/renderD128 -filter:v 'format=nv12,hwupload' -c:a libfdk_aac -bf 0 -qp 29 -quality 8 -c:v h264_vaapi -profile:v constrained_baseline -level:v 4.1

mkv h264 with ac3 -vaapi_device /dev/dri/renderD128 -filter:v 'format=nv12,hwupload' -c:a copy -bf 0 -qp 29 -quality 8 -c:v h264_vaapi -profile:v constrained_baseline -level:v 4.1

mp4 h265 aac -vaapi_device /dev/dri/renderD128 -filter:v 'format=nv12,hwupload' -c:a aac -bf 0 -qp 30 -quality 8 -c:v hevc_vaapi -profile:v 1 -level:v 4.1

mkv h265 ac3 -vaapi_device /dev/dri/renderD128 -filter:v 'format=nv12,hwupload' -c:a copy -bf 0 -qp 30 -quality 8 -c:v hevc_vaapi -profile:v 1 -level:v 4.1