[BUG] Hardware acceleration not working after update

PMS running on CentOS 7 on a Mac mini (2011).

After I did a yum update, I noticed the video quality was ■■■■ (AppleTV wired to the same GbE-switch as the server).

Found this in the logs:

Mar 18 22:02:04 pms sh: Failed to wrapper hybrid_drv_video.so
Mar 18 22:02:04 pms sh: libva info: va_openDriver() returns 0
Mar 18 22:02:04 pms sh: libva info: VA-API version 1.0.0
Mar 18 22:02:04 pms sh: libva info: va_getDriverName() returns 0
Mar 18 22:02:04 pms sh: libva info: Trying to open /usr/lib/plexmediaserver/dri/i965_drv_video.so
Mar 18 22:02:04 pms sh: libva info: Found init function __vaDriverInit_1_0
Mar 18 22:02:04 pms sh: failed to open /data/jenkins/pms-deps-universal-v2/BUILD_TAG/linux-ubuntu-x86_64/output/pms-depends-linux-ubuntu-x86_64-release-b2a8479/lib/dri/hybrid_drv_video.so

Turned off Hardware acceleration and the issue (log) disappeared. Quality was good again, with the “small” problem of Plex punishing the CPU (300+%) when transcoding.

@BeyondEvil said:
PMS running on CentOS 7 on a Mac mini (2011).

After I did a yum update, I noticed the video quality was **** (AppleTV wired to the same GbE-switch as the server).
Turned off Hardware acceleration and the issue (log) disappeared. Quality was good again, with the “small” problem of Plex punishing the CPU (300+%) when transcoding.

Did you check or change the quality settings in the Apple TV Plex app? Please re-enable hardware transcoding and take a look at the quality setting.

Found this in the logs:

That’s OK. Ignore it for now.

@uglymagoo said:

@BeyondEvil said:
PMS running on CentOS 7 on a Mac mini (2011).

After I did a yum update, I noticed the video quality was **** (AppleTV wired to the same GbE-switch as the server).
Turned off Hardware acceleration and the issue (log) disappeared. Quality was good again, with the “small” problem of Plex punishing the CPU (300+%) when transcoding.

Did you check or change the quality settings in the Apple TV Plex app? Please re-enable hardware transcoding and take a look at the quality setting.

I didn’t change them, but I didn’t do a before and after check either. Did that now.
Before HW ACC:

Auto Adjust Quality: OFF
Home Streaming: Maximum
Internet Streaming: 2 Mbps, 270p HD
Play Smaller Videos…: On

After HW ACC:

same as before.

But it’s obvious to the naked eye the quality goes to ■■■■, it gets all pixelated. :frowning:

Found this in the logs:

That’s OK. Ignore it for now.

Ok, ignoring.

@BeyondEvil said:

Auto Adjust Quality: OFF
Home Streaming: Maximum
Internet Streaming: 2 Mbps, 270p HD
Play Smaller Videos…: On

Just to make sure this is a regression: you are transcoding to 270p 2 Mbps, correct? This is a very low setting and it’s very common, that the hardware transcoding result is much worse than software transcoding at this very low setting. Has hardware transcoding resulted in much better quality in previous releases?

Another important question to answer is: why are you even transcoding the video for the AppleTV? Your Mac server and the AppleTV are part of the same local network, correct? Is there a problem, where your AppleTV Plex client thinks your server is “remote”? Do higher “internet streaming” settings result in an improved quality on your AppleTV?

Please export the media xml of the file [1], that’s resulting in the low quality and post the server logs [2], so we can examine which transcoding settings are used for the playback of this file. It would also be great, if you could start the playback and then post the complete plex transcoder command that’s being used (e.g. ps aux | grep -i transcoder on the server).

[1] https://support.plex.tv/articles/201998867-investigate-media-information-and-formats/
[2] https://support.plex.tv/articles/200250417-plex-media-server-log-files/

@uglymagoo said:

@BeyondEvil said:

Auto Adjust Quality: OFF
Home Streaming: Maximum
Internet Streaming: 2 Mbps, 270p HD
Play Smaller Videos…: On

Just to make sure this is a regression: you are transcoding to 270p 2 Mbps, correct? This is a very low setting and it’s very common, that the hardware transcoding result is much worse than software transcoding at this very low setting. Has hardware transcoding resulted in much better quality in previous releases?

Another important question to answer is: why are you even transcoding the video for the AppleTV? Your Mac server and the AppleTV are part of the same local network, correct? Is there a problem, where your AppleTV Plex client thinks your server is “remote”? Do higher “internet streaming” settings result in an improved quality on your AppleTV?

Maybe if I answer the questions in the second paragraph, that will answer the questions in the first.

It all started with a subtitles issue. I have several clients:

Wired:
AppleTV (ATV and PMS server are connected to the same Netgear GS105 GbE switch).

Wireless:
2 iPhones
Samsung Tablet
2 Macbook Pros
iPad

Subtitles on the wireless clients work as expected. But on the ATV they’re always out-of-sync.

The solution to that was to set “Burn Subtitles” to “Always”.

If I’m not mistaken, that causes transcoding.

This caused a new issue, CPU pain.

So I searched a little and went through the server settings, which led me to activating HW acc. And it worked, CPU got alot better. And I didn’t notice any issues with quality.

Then I updated. Go to watch an episode of Parks and Rec. Notice quality is bad. Figure it’s just a bad rip. Next episode, same thing. Go watch a movie I’ve already seen, that I know has great quality. Same thing.

Venture into the logs - see the issue. Turn off HW acc. Quality is back to great.

According to the ATV client the server is “Nearby”.

I haven’t tried increasing the “Internet Quality”, but I’ll try that for completeness.

I hope that answers the questions?

Please export the media xml of the file [1], that’s resulting in the low quality and post the server logs [2], so we can examine which transcoding settings are used for the playback of this file. It would also be great, if you could start the playback and then post the complete plex transcoder command that’s being used (e.g. ps aux | grep -i transcoder on the server).

[1] https://support.plex.tv/articles/201998867-investigate-media-information-and-formats/
[2] https://support.plex.tv/articles/200250417-plex-media-server-log-files/

I’ll gather all this and get back to you.

Thanks, I appreciate your help!

@uglymagoo said:
Please export the media xml of the file [1], that’s resulting in the low quality and post the server logs [2], so we can examine which transcoding settings are used for the playback of this file. It would also be great, if you could start the playback and then post the complete plex transcoder command that’s being used (e.g. ps aux | grep -i transcoder on the server).

[1] https://support.plex.tv/articles/201998867-investigate-media-information-and-formats/
[2] https://support.plex.tv/articles/200250417-plex-media-server-log-files/

Files included.

Result of ps aux | grep -i transcoder : transcoder · GitHub

@BeyondEvil said:
Files included.

Thanks for the additional information. In theory, everything looks good so far, so I suppose it’s really a regression in the hardware transcoder. I will get in contact with the developers. Just one last question: do you remember which Plex version was the last one that did not suffer from this severe quality degradation using the hardware transcoder?

@uglymagoo said:

@BeyondEvil said:
Files included.

Thanks for the additional information. In theory, everything looks good so far, so I suppose it’s really a regression in the hardware transcoder. I will get in contact with the developers. Just one last question: do you remember which Plex version was the last one that did not suffer from this severe quality degradation using the hardware transcoder?

This was the previous version: Feb 24 01:10:25 Updated: plexmediaserver-1.11.3.4803-c40bba82e.x86_64

Here are all the packages that got updated at the same time as plex: yum.log · GitHub

@BeyondEvil said:
This was the previous version: Feb 24 01:10:25 Updated: plexmediaserver-1.11.3.4803-c40bba82e.x86_64

Perfect, thank you. If you got 5 minutes please try the transcoder preview build. It includes many ffmpeg and codec updates and it might fix your quality problems. If it does not work well, just reinstall 1.12.0 again. There won’t be any problems switching between these two builds.

https://forums.plex.tv/discussion/310828/plex-media-server-transcoder-preview-1-12-1

@uglymagoo said:

@BeyondEvil said:
This was the previous version: Feb 24 01:10:25 Updated: plexmediaserver-1.11.3.4803-c40bba82e.x86_64

Perfect, thank you. If you got 5 minutes please try the transcoder preview build. It includes many ffmpeg and codec updates and it might fix your quality problems. If it does not work well, just reinstall 1.12.0 again. There won’t be any problems switching between these two builds.

https://forums.plex.tv/discussion/310828/plex-media-server-transcoder-preview-1-12-1

I’m home sick at the moment, so I have all the time in the world… :-/

Would you mind elaborating a little on how to install that version? And switching?

This is what my plex.repo contains:

[user@pms /]$ sudo cat /etc/yum.repos.d/plex.repo
[PlexRepo]
name=PlexRepo
baseurl=https://downloads.plex.tv/repo/rpm/$basearch/
enabled=1
gpgkey=https://downloads.plex.tv/plex-keys/PlexSign.key
gpgcheck=1

@BeyondEvil said:
Would you mind elaborating a little on how to install that version? And switching?

Don’t use the repository, it’s not available there. Just download the appropriate rpm package to your server and than install it manually with yum, e.g.:

cd /tmp
wget https://downloads.plex.tv/plex-media-server/1.12.1.4843-ed2a49865/plexmediaserver-1.12.1.4843-ed2a49865.x86_64.rpm
sudo yum localinstall plexmediaserver-1.12.1.4843-ed2a49865.x86_64.rpm

You can switch back to 1.12.0 the same way later, if this preview build does not fix the issue for you.

If I may augment here?

  1. At this point with GPU transcoding silicon development (in the Intel world), Hardware transcoding will always have less quality than software.
  2. In a few CPU generations, as the silicon matures, it will eventually be indistinguishable from software but for now it is
  3. Some, but not all, of that can be mitigated. Try it. YMMV (Hardware transcoding enabled, all the quality settings to maximum (make it hurt) )

An often misunderstood point: hardware will lose a certain percentage of quality. when the source file quality is low to start with, it does not take much to fall into unacceptable image quality level. The only resolution here is to rip it again and keep all the bits, don’t HandBrake it down to 700 MB and expect perfection because it won’t happen. :slight_smile:

@ChuckPA said:
If I may augment here?

Of course, your insights are always welcome. :slight_smile:

  1. At this point with GPU transcoding silicon development (in the Intel world), Hardware transcoding will always have less quality than software.

Absolutely!

But in this case, it wasn’t like it went from 1080p to 480p. It went from 1080p to pixelated garbage with visible artifacts. :joy:

I’ll see if I’ll be able to take a picture/screenshot what it looks like. :smiley:

  1. In a few CPU generations, as the silicon matures, it will eventually be indistinguishable from software but for now it is
  2. Some, but not all, of that can be mitigated. Try it. YMMV (Hardware transcoding enabled, all the quality settings to maximum (make it hurt) )

I’ll play around a little with the settings and see if anything makes a difference. I’ll try a couple of my other clients as well. As well as compare local and remote.

An often misunderstood point: hardware will lose a certain percentage of quality. when the source file quality is low to start with, it does not take much to fall into unacceptable image quality level. The only resolution here is to rip it again and keep all the bits, don’t HandBrake it down to 700 MB and expect perfection because it won’t happen. :slight_smile:

I’m guessing you’re speaking generally here? I don’t think the Kingsman rip (WEBDL-1080@5GB) was bad or sub par. But I’m no expert. :slight_smile:

It won’t change the resolution. It WILL change the quality of that previously, marginally watchable, 1080p image to the pixelated garbage you’re seeing.

You have two choices:

  1. Rip it from the disc
  2. Go find a better site to gank it from >:)

Remember the adage “Garbage in, Garbage out” :slight_smile:

I missed commenting on this. Brace yourself :dizzy:

I’m guessing you’re speaking generally here? I don’t think the Kingsman rip (WEBDL-1080@5GB) was bad or sub par. But I’m no expert. :slight_smile:

That movie is full of CGI and ‘sharp edges’ where live action and CGI meet.

Hardware transcode this and you’ll never see it.

Input #0, matroska,webm, from 'Kingsman The Golden Circle (2017).mkv':
  Metadata:
    encoder         : libebml v1.3.5 + libmatroska v1.4.8
    creation_time   : 2017-12-06T15:29:00.000000Z
  Duration: 02:21:02.25, start: 0.000000, bitrate: 28565 kb/s
    Chapter #0:0: start 0.000000, end 291.958000

@ChuckPa
@drmagoo

Screenshots from client on iPhone 7. All other things/settings being equal.

Without HW acc:

With HW acc:

The way I “force” transcoding is by always burning in subtitles.

Edit:
Changing Transcoder quality from automatic to make my CPU hurt made no difference.

Here’s 4K → 2K transcoding. Tell me which is which?

@ChuckPA

Top is 2K
Bottom is 4K

Not sure what the take-away is supposed to be tho. :blush:

@BeyondEvil Did you try the transcoder preview?

@uglymagoo said:
@BeyondEvil Did you try the transcoder preview?

Not yet, had to prepare dinner for the family etc. Will do it later this evening when the kids are sleeping.