HW accelerated video for Sandy Bridge

Issues related to hardware problems
BeyondEvil
Posts: 1
Joined: 2018/04/03 16:56:24

HW accelerated video for Sandy Bridge

Postby BeyondEvil » 2018/04/03 18:22:51

First of all, I think this belongs under the Hardware section. If anyone disagrees, please feel free to move it to the appropriate section. Please and thank you.

I'm running Plex Media Server on a Mac Mini (2011) with a Sandy Bridge CPU (i5-2415m) and Intel® HD Graphics 3000 GPU, and I have an issue where transcoding using HW acc is really bad and results in horrible artifacts.

Here's what it looks like w/o HW acc:
Image

and with:
Image

I need the HW acc because w/o my CPU goes haywire with +300% load barely handling one stream.

I'm trying to make sense of kernels, vaapi, libva, intel etc. and was hoping someone could guide me to solving this issue.

Here's my thread over at Plex Forums.

Result of getinfo

bonedome
Posts: 30
Joined: 2017/04/22 08:11:04

Re: HW accelerated video for Sandy Bridge

Postby bonedome » 2018/04/13 15:04:28

Hello
when you say transcoding do you mean changing the video/audio to a different format i.e changing vp8 to x264 or do you mean playing the video or streaming from one device to another i.e stream from a laptop to a playstation 4 to watch on a tv.
My laptop has a 2nd generation i5 with built in graphics, I use libvdpau and libvdpau-va-gl driver to play videos, this uses opengl as a sort of vdpau emulator but I must say using opengl directly actually uses less cpu, 23% vs 28% X uses slightly less cpu with vdpau.
From what I've read hw accel in GNU/Linux is not the finished article and has problems.
I don't use the plex media server so don't know the set up but I do use kodi to stream to my ps4 which allows you to choose hw acc or not and it looks fine with or without, maybe it's plex that struggles.
If you run

Code: Select all

mplayer -vo help
it will list available video output drivers, I just tried each one in turn with top running in another terminal.
I found

Code: Select all

mplayer -vo gl_tiled /path/to/vid
to yield least cpu usage and best picture quality.
BTW HW accel only works with h264 encoded video (on my cpu)
Also if you use the libvdpau-va-gl driver, a recent update broke it, you need to create a symbolic link to get it to work again

Code: Select all

ln -s /usr/lib64/vdpau/ibvdpau_va_gl.so.1 /usr/lib64/vdpau/libvdpau_i965.so.1

bonedome
Posts: 30
Joined: 2017/04/22 08:11:04

Re: HW accelerated video for Sandy Bridge

Postby bonedome » 2018/04/14 09:34:19

Hello
just did a bit more research, this arch wiki page might explain the problem https://wiki.archlinux.org/index.php/Intel_graphics#Hardware_accelerated_H.264_decoding_on_GMA_4500 it says
Hardware accelerated H.264 decoding on GMA 4500
The H.264 decoding support is maintained in a separated g45-h264 branch, which can be used by installing libva-intel-driver-g45-h264 package. Note however that this support is experimental and its development has been abandoned.
Tests using mplayer showed that using vaapi to play back an H.264 encoded 1080p video halved the CPU load (compared to the XV overlay) but resulted in very choppy playback
It also suggests increasing video ram in bios, although that would reduce available ram, might be worth experimenting with higher vram, see if there's any improvement.